+
    4Ssi("  ã                   ó´   € ^ RI t ^ RI HtHtHt ^RIHt  ! R R]4      t ! R R]4      t ! R R	]4      t	 ! R
 R]4      t
 ! R R]4      tR tR tR tR tR# )é    N)ÚFLAG_MOD_ADDÚFLAG_MOD_REPLACEÚLdbError)ÚSiteNotFoundExceptionc                   ó   € ] tR t^tRtRtR# )ÚSubnetExceptionzBase element for Subnet errors© N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__static_attributes__r	   ó    Ú//usr/lib/python3/dist-packages/samba/subnets.pyr   r      s   † Ù(Ûr   r   c                   ó   € ] tR t^!tRtRtR# )ÚSubnetNotFoundz$The subnet requested does not exist.r	   Nr
   r	   r   r   r   r   !   s   † Ù.Ûr   r   c                   ó   € ] tR t^&tRtRtR# )ÚSubnetAlreadyExistsz&The subnet being added already exists.r	   Nr
   r	   r   r   r   r   &   s   † Ù0Ûr   r   c                   ó   € ] tR t^+tRtRtR# )ÚSubnetInvalidzThe subnet CIDR is invalid.r	   Nr
   r	   r   r   r   r   +   s   † Ù%Ûr   r   c                   ó   € ] tR t^0tRtRtR# )ÚSiteNotFoundz2The site to be used for the subnet does not exist.r	   Nr
   r	   r   r   r   r   0   s   † Ù<Ûr   r   c                óB  € V P                  V\        P                  R\        P                  ! V4      ,          R7      p\	        V4      ^8w  d   \        RV,          4      hV^ ,          P                  p\        V\        4      '       g   \        RV,          4      h\        P                  ! V R4      p VP                  V4        TP                  R4       TP                  ^ R	T4        \        P                   ! 4       pYgn        \        P"                  ! R
\$        R4      TR&   \        P"                  ! \        T4      \$        R4      TR&   T P'                  T4       R#   \        P                   d    \        R4      hi ; i  \        P                   d    \        R4      hi ; i  \        P                   dc   pTP(                  w  ršT	\        P*                  8X  d   \        T: RT
: 24      hT	\        P,                  8X  d   \/        RT,          4      hh Rp?ii ; i)aN  Create a subnet and associate it with a site.

:param samdb: A samdb connection
:param configDn: The DN of the configuration partition
:param subnet_name: name of the subnet to create (a CIDR range)
:return: None
:raise SubnetAlreadyExists: if the subnet to be created already exists.
:raise SiteNotFound: if the site does not exist.
z(&(objectclass=Site)(cn=%s))©ÚbaseÚscopeÚ
expressionz&A site with the name %s does not existz'%s is not a valid subnet (not a string)úCN=Subnets,CN=Sitesúdnsubnet.add_base() failedúCN=Xúdnsubnet.add_child() failedÚCNÚsubnetÚobjectclassÚ
siteObjectú is not a valid subnet: ú(A subnet with the CIDR %s already existsN)ÚsearchÚldbÚSCOPE_SUBTREEÚbinary_encodeÚlenr   ÚdnÚ
isinstanceÚstrr   ÚDnÚadd_baser   r   Ú	add_childÚset_componentÚMessageÚMessageElementr   ÚaddÚargsÚERR_INVALID_DN_SYNTAXÚERR_ENTRY_ALREADY_EXISTSr   )ÚsamdbÚconfigDnÚsubnet_nameÚ	site_nameÚretÚdn_siteÚdnsubnetÚmÚeÚenumÚestrs   &&&&       r   Úcreate_subnetrG   5   sÙ  € ð �,‰,˜H¬C×,=Ñ,=Ø"@Ü×(Ò(¨Ó3õ#4ð ó 5€Cô ˆ3ƒx�1„}ÜÐCØ$õ%ó &ð 	&à�!�f�i‰i€Gä�k¤3×'Ò'ÜÐEÈÕSÓTÐTä�vŠv�eÐ2Ó3€Hð<Ø×Ñ˜(Ô#ð=Ø×Ñ˜6Ô"ð ×Ñ˜1˜d KÔ0ðÜ�KŠK‹MˆØŒÜ×-Ò-¨h¼Ø.;ó=ˆˆ-Ñä×,Ò,¬S°«\¼<Ø-9ó;ˆˆ,‰à�	‰	�!Žøô �<‰<ô <ÜÐ:Ó;Ð;ð<ûô �<‰<ô =ÜÐ;Ó<Ð<ð=ûô �<‰<ô Ø—v‘v‰ˆØ”3×,Ñ,Ô,ÜÃ+ÊtÐ TÓUÐUØ”S×1Ñ1Ô1ô &Ð&PØ(3õ'4ó 5ð 5ð ûðús2   Â3E ÃF Ã*A3F' Å!F Æ!F$Æ'HÆ<AHÈHc                óz  € \         P                  ! V R4      p VP                  V4        TP                  R4       TP                  ^ RT4        T P                  T\         P                  RR7      p\        T4      ^8w  d   \        RT,          4      h T P                  T4       R	#   \         P                   d    \	        R4      hi ; i  \         P                   d    \	        R4      hi ; i  \         d@   pTP                  w  rgT\         P                  8X  d   \        RT,          4      h R	p?L R	p?ii ; i)
zìDelete a subnet.

:param samdb: A samdb connection
:param configDn: The DN of the configuration partition
:param subnet_name: Name of the subnet to delete
:return: None
:raise SubnetNotFound: if the subnet to be deleted does not exist.
r    r!   r"   r#   r$   úobjectClass=subnetr   úSubnet %s does not existN)r+   r2   r3   r   r   r4   r5   r*   Ú
SCOPE_BASEr.   r   r9   ÚERR_NO_SUCH_OBJECTÚdelete)r<   r=   r>   rB   r@   Úe1rE   rF   s   &&&     r   Údelete_subnetrO   m   s%  € ô �vŠv�eÐ2Ó3€Hð<Ø×Ñ˜(Ô#ð=Ø×Ñ˜6Ô"ð ×Ñ˜1˜d KÔ0ðKØ�l‰l ´·±Ø&:ð ó <ˆäˆs‹8�qŒ=Ü Ð!;¸kÕ!IÓJÐJð ð 
‡L�L�Öøô% �<‰<ô <ÜÐ:Ó;Ð;ð<ûô �<‰<ô =ÜÐ;Ó<Ð<ð=ûô ô KØ—w‘w‰ˆØ”3×)Ñ)Ô)Ü Ð!;¸kÕ!IÓJÐJô *ûðKús/   ™B( «C ÁAC0 Â(!C	Ã!C-Ã0D:Ã;5D5Ä5D:c                óê  € \         P                  ! V R4      p VP                  V4        TP                  R4       TP                  ^ RT4       \         P                  ! T \        T4      4      pTP                  ^ RT4        T P                  YE4       R	#   \         P                   d    \	        R4      hi ; i  \         P                   d    \	        R4      hi ; i  \         dŠ   pTP                  w  rxT\         P                  8X  d   \        RT,          4      hT\         P                  8X  d   \        RT,          4      hT\         P                  8X  d   \        T: RT: 24      hh R	p?ii ; i)
aV  Rename a subnet.

:param samdb: A samdb connection
:param configDn: The DN of the configuration partition
:param subnet_name: Name of the subnet to rename
:param new_name: New name for the subnet
:return: None
:raise SubnetNotFound: if the subnet to be renamed does not exist.
:raise SubnetExists: if the subnet to be created already exists.
r    r!   r"   r#   r$   rJ   r)   r(   N)r+   r2   r3   r   r   r4   r5   r1   Úrenamer9   rL   r   r;   r   r:   r   )	r<   r=   r>   Únew_namerB   ÚnewdnsubnetÚe2rE   rF   s	   &&&&     r   Úrename_subnetrU   Ž   sU  € ô �vŠv�eÐ2Ó3€Hð<Ø×Ñ˜(Ô#ð=Ø×Ñ˜6Ô"ð ×Ñ˜1˜d KÔ0ä—&’&˜¤ H£Ó.€KØ×Ñ˜a  xÔ0ðØ�‰�XÖ+øô �<‰<ô <ÜÐ:Ó;Ð;ð<ûô �<‰<ô =ÜÐ;Ó<Ð<ð=ûô ô Ø—w‘w‰ˆØ”3×)Ñ)Ô)Ü Ð!;¸hÕ!FÓGÐGØ”S×1Ñ1Ô1Ü%Ð&PØ(0õ'1ó 2ð 2à”S×.Ñ.Ô.ÜÃ(ÚBFð!Hó Ið Ið ûðús/   ™B «B: ÂC Â!B7Â:!CÃE2Ã)BE-Å-E2c                óÌ  € \         P                  ! V R4      p VP                  V4        TP                  R4       TP                  ^ RT4        T P                  T\         P                  RR7      p\        T4      ^8w  d   \        RT,          4      h \         P                  ! T R
4      p	 T	P                  T4        T	P                  R4       T	P                  ^ RT4       \         P                  ! T R4      p
T
P                  T	4        T P                  T	\         P                  RR7      p\        T4      ^8w  d   \        RT,          4      h \        X^ ,          P                  4      p\         P                   ! 4       pYMn        \         P"                  ! T\$        R4      TR&   T P'                  T4       R	#   \         P                   d    \	        R4      hi ; i  \         P                   d    \	        R4      hi ; i  \         dA   pTP                  w  rxT\         P                  8X  d   \        RT,          4      h R	p?EL³R	p?ii ; i  \         P                   d    \	        R4      hi ; i  \         P                   d    \	        R4      hi ; i  \         dA   pTP                  w  rxT\         P                  8X  d   \        RT,          4      h R	p?EL�R	p?ii ; i)ag  Assign a subnet to a site.

This dissociates the subnet from its previous site.

:param samdb: A samdb connection
:param configDn: The DN of the configuration partition
:param subnet_name: Name of the subnet
:param site_name: Name of the site
:return: None
:raise SubnetNotFound: if the subnet does not exist.
:raise SiteNotFound: if the site does not exist.
r    r!   r"   r#   r$   rI   r   rJ   NzCN=Siteszdnsite.add_base() failedzdnsite.add_child() failedz
CN=ServerszobjectClass=sitezSite %s does not existr'   )r+   r2   r3   r   r   r4   r5   r*   rK   r.   r   r9   rL   r   r1   r/   r6   r7   r   Úmodify)r<   r=   r>   r?   rB   r@   Úe3rE   rF   ÚdnsiteÚ	dnserversÚe4ÚsiteDnrC   s   &&&&          r   Úset_subnet_siter]   ¶   s‘  € ô �vŠv�eÐ2Ó3€Hð<Ø×Ñ˜(Ô#ð=Ø×Ñ˜6Ô"ð ×Ñ˜1˜d KÔ0ðKØ�l‰l ´·±Ø&:ð ó <ˆäˆs‹8�qŒ=Ü Ð!;¸kÕ!IÓJÐJð ô �VŠV�E˜:Ó&€Fð:Ø�‰˜Ô!ð;Ø×Ñ˜Ô ð ×Ñ˜˜D )Ô,ä—’�u˜lÓ+€IØ×Ñ�vÔðNØ�l‰l ¬c¯n©nØ&8ð ó :ˆäˆs‹8�qŒ=Ü'Ð(@À9Õ(LÓMÐMð ô ��Q•—‘‹^€Fä�Š‹€AØ„DÜ×(Ò(¨Ô1AØ)5ó7€A€l�Oà	‡L�L�†Oøôa �<‰<ô <ÜÐ:Ó;Ð;ð<ûô �<‰<ô =ÜÐ;Ó<Ð<ð=ûô ô KØ—w‘w‰ˆØ”3×)Ñ)Ô)Ü Ð!;¸kÕ!IÓJÐJõ *ûðKûô �<‰<ô :ÜÐ8Ó9Ð9ð:ûô �<‰<ô ;ÜÐ9Ó:Ð:ð;ûô ô NØ—w‘w‰ˆØ”3×)Ñ)Ô)Ü'Ð(@À9Õ(LÓMÐMõ *ûðNús`   ™F: «G ÁAH Â-I Â?I4 ÄAJ Æ:!GÇ!G?ÈIÈ5IÉIÉ!I1É4!JÊK#Ê#5KËK#)r+   r   r   r   Úsitesr   Ú	Exceptionr   r   r   r   r   rG   rO   rU   r]   r	   r   r   Ú<module>r`      sg   ðó. ß 8Ñ 8Ý )ô	�iô 	ô
	�_ô 	ô
	˜/ô 	ô
	�Oô 	ô
	�?ô 	ò
5òpòB%ôPAr   