a qéqe^ ã@s|ddlmZddlmZmZddlmZddlmZddl m Z m Z Gdd „d eƒZ Gd d „d e ƒZ Gd d „d e eƒZdS)é)Ú NamedTupleé)ÚContextÚ Ibpkeyconé)ÚContextWrapper)ÚDiffResultDescriptor)Ú DifferenceÚWrapperc@s*eZdZUdZeed<eed<eed<dS)ÚModifiedIbpkeyconz,Difference details for a modified ibpkeycon.ZruleZ added_contextZremoved_contextN)Ú__name__Ú __module__Ú __qualname__Ú__doc__rÚ__annotations__r©rrú(óz7IbpkeyconsDifference.diff_ibpkeycons..css|]}t|ƒVqdSrrrrrrr)rN)ÚlogÚinfoÚformatZ _set_diffZ left_policyZ ibpkeyconsZ right_policyÚadded_ibpkeyconsÚremoved_ibpkeyconsÚmodified_ibpkeyconsrÚcontextÚappendr )ÚselfZmatched_ibpkeyconsZ left_ibpkeyZ right_ibpkeyrrrrs ÿÿþÿ  ÿz$IbpkeyconsDifference.diff_ibpkeyconscCs"|j d¡d|_d|_d|_dS)z%Reset diff results on policy changes.zResetting ibpkeycon differencesN)rÚdebugr!r"r#©r&rrrÚ _reset_diff7s z IbpkeyconsDifference._reset_diff) r r rrrr!r"r#rr)rrrrrs rc@s<eZdZdZdZeddœdd„Zdd„Zd d „Zd d „Z dS) rz,Wrap ibpkeycon statements for diff purposes.©Ú subnet_prefixÚlowÚhighN)ÚoconrcCs*||_|j|_|j\|_|_t|ƒ|_dSr)Úoriginr+Zpkeysr,r-ÚhashÚkey)r&r.rrrÚ__init__EszIbpkeyconWrapper.__init__cCs|jSr)r1r(rrrÚ__hash__KszIbpkeyconWrapper.__hash__cCs |j|jkSr)r/©r&ÚotherrrrÚ__lt__NszIbpkeyconWrapper.__lt__cCs$|j|jko"|j|jko"|j|jkSrr*r4rrrÚ__eq__Qs   ÿ þzIbpkeyconWrapper.__eq__) r r rrÚ __slots__rr2r3r6r7rrrrr?s rN)ÚtypingrZ policyreprrr$rZ descriptorsrÚ differencer r r rrrrrrÚs    (