ó
    0/¡jS1  ã                   ó²  • S r SSKrSSKrSSKJrJr  SSKrSSKrSSK	rSSK
rSSKrSSKr\R                  R                  1r\R                  R                   \R                  R"                  \R                  R$                  1rS r\R*                   " S S\R,                  5      5       r " S S5      r\R2                  R2                   " S	 S
\5      5       rg)z)DNS nodes.  A node is a set of rdatasets.é    N)ÚAnyÚDictc                 óh   • X;   =(       d(    U[         R                  R                  :H  =(       a    X ;   $ ©N)ÚdnsÚ	rdatatypeÚRRSIG)ÚrdtypesÚrdtypeÚcoverss      Úa/var/www/html/health-monitoring.indevconsultancy.in/venv/lib/python3.13/site-packages/dns/node.pyÚ_matches_type_or_its_signaturer   +   s'   € ØÑ×U ¬3¯=©=×+>Ñ+>Ñ!>×!TÀ6ÑCTÐUó    c                   óØ   • \ rS rSrSrSrSrSr\S\	R                  R                  S\	R                  R                  SS 4S	 j5       r\S
\	R                  R                  SS 4S j5       rSrg)ÚNodeKindé/   zRdatasets in nodesr   é   é   r   r   Úreturnc                 ó¶   • [        [        X5      (       a  [        R                  $ [        [        X5      (       a  [        R
                  $ [        R                  $ r   )r   Ú_cname_typesr   ÚCNAMEÚ_neutral_typesÚNEUTRALÚREGULAR)Úclsr   r   s      r   ÚclassifyÚNodeKind.classify7   s@   € ô *¬,¸×GÑGÜ—>‘>Ð!Ü+¬N¸F×KÑKÜ×#Ñ#Ð#ä×#Ñ#Ð#r   Úrdatasetc                 óN   • U R                  UR                  UR                  5      $ r   )r   r   r   )r   r   s     r   Úclassify_rdatasetÚNodeKind.classify_rdatasetB   s   € à�|‰|˜HŸO™O¨X¯_©_Ó=Ð=r   © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r   Úclassmethodr   r   Ú	RdataTyper   r   ÚRdatasetr!   Ú__static_attributes__r#   r   r   r   r   /   s~   † áà€GØ€GØ€Eàð$Ø—]‘]×,Ñ,ð$Ø69·m±m×6MÑ6Mð$à	ó$ó ð$ð ð>¨¯©×)>Ñ)>ð >À:ó >ó ó>r   r   c                   óˆ  • \ rS rSrSrS/rS rS\R                  R                  S\
\\4   S\4S jrS	 rS
 rS rS rS rS r\R(                  R*                  S4S\R,                  R.                  S\R(                  R0                  S\R(                  R0                  S\S\R4                  R6                  4
S jjr\R(                  R*                  S4S\R,                  R.                  S\R(                  R0                  S\R(                  R0                  S\S\R4                  R6                  S-  4
S jjr\R(                  R*                  4S\R,                  R.                  S\R(                  R0                  S\R(                  R0                  SS4S jjrS\R4                  R6                  SS4S jrS\ 4S jr!S\4S jr"Sr#g)ÚNodeéG   a¦  A Node is a set of rdatasets.

A node is either a CNAME node or an "other data" node.  A CNAME
node contains only CNAME, KEY, NSEC, and NSEC3 rdatasets along with their
covering RRSIG rdatasets.  An "other data" node contains any
rdataset other than a CNAME or RRSIG(CNAME) rdataset.  When
changes are made to a node, the CNAME or "other data" state is
always consistent with the update, i.e. the most recent change
wins.  For example, if you have a node which contains a CNAME
rdataset, and then add an MX rdataset to it, then the CNAME
rdataset will be deleted.  Likewise if you have a node containing
an MX rdataset and add a CNAME rdataset, the MX rdataset will be
deleted.
Ú	rdatasetsc                 ó   • / U l         g r   ©r0   ©Úselfs    r   Ú__init__ÚNode.__init__Y   s	   € àˆ�r   ÚnameÚkwr   c                 ó   • [         R                  " 5       nU R                   HG  n[        U5      S:”  d  M  UR	                  UR
                  " U40 UD65        UR	                  S5        MI     UR                  5       SS $ )zòConvert a node to text format.

Each rdataset at the node is printed.  Any keyword arguments
to this method are passed on to the rdataset's to_text() method.

*name*, a ``dns.name.Name``, the owner name of the
rdatasets.

Returns a ``str``.

r   Ú
Néÿÿÿÿ)ÚioÚStringIOr0   ÚlenÚwriteÚto_textÚgetvalue)r4   r7   r8   ÚsÚrdss        r   r@   ÚNode.to_text]   sb   € ô �KŠK‹MˆØ—>”>ˆCÜ�3‹x˜!�|Ø—‘˜Ÿš DÑ/¨BÑ/Ô0Ø—‘˜–ñ "ð �z‰z‹|˜C˜RÐ Ð r   c                 ó6   • S[        [        U 5      5      -   S-   $ )Nz
<DNS node Ú>)ÚstrÚidr3   s    r   Ú__repr__ÚNode.__repr__q   s   € Øœc¤" T£(›mÑ+¨cÑ1Ð1r   c                 ó”   • U R                    H  nX!R                   ;  d  M    g   UR                    H  nX R                   ;  d  M    g   g)NFTr2   )r4   ÚotherÚrds      r   Ú__eq__ÚNode.__eq__t   sA   € ð —.”.ˆBØŸ™Õ(Ùñ !ð —/”/ˆBØŸ™Õ'Ùñ "ð r   c                 ó.   • U R                  U5      (       + $ r   )rN   )r4   rL   s     r   Ú__ne__ÚNode.__ne__€   s   € Ø—;‘;˜uÓ%Ô%Ð%r   c                 ó,   • [        U R                  5      $ r   )r>   r0   r3   s    r   Ú__len__ÚNode.__len__ƒ   s   € Ü�4—>‘>Ó"Ð"r   c                 ó,   • [        U R                  5      $ r   )Úiterr0   r3   s    r   Ú__iter__ÚNode.__iter__†   s   € Ü�D—N‘NÓ#Ð#r   c                 ó(  • [        U R                  5      S:”  aÔ  [        R                  U5      nU[        R                  :X  aL  U R                   Vs/ s H.  n[        R                  U5      [        R
                  :w  d  M,  UPM0     snU l        O_U[        R
                  :X  aK  U R                   Vs/ s H.  n[        R                  U5      [        R                  :w  d  M,  UPM0     snU l        U R                  R                  U5        gs  snf s  snf )aV  Append rdataset to the node with special handling for CNAME and
other data conditions.

Specifically, if the rdataset being appended has ``NodeKind.CNAME``,
then all rdatasets other than KEY, NSEC, NSEC3, and their covering
RRSIGs are deleted.  If the rdataset being appended has
``NodeKind.REGULAR`` then CNAME and RRSIG(CNAME) are deleted.
r   N)r>   r0   r   r!   r   r   Úappend)r4   r   ÚkindrC   s       r   Ú_append_rdatasetÚNode._append_rdataset‰   sÙ   € ô ˆt�~‰~Ó Ó"Ü×-Ñ-¨hÓ7ˆDØ”x—~‘~Ó%ð  $Ÿ~š~ó"â-˜Ü×1Ñ1°#Ó6¼(×:JÑ:JÑJ÷ Ù-ñ"�•ð
 œ×)Ñ)Ó)ð  $Ÿ~š~ó"â-˜Ü×1Ñ1°#Ó6¼(¿.¹.ÑH÷ Ù-ñ"�”ð 	�‰×Ñ˜hÕ'ùò"ùò"s   Á+D
Â D
Â1+DÃ DFÚrdclassr   r   Úcreatec                 óÞ   • U R                    H  nUR                  XU5      (       d  M  Us  $    U(       d  [        e[        R                  R                  XU5      nU R                  U5        U$ )a¢  Find an rdataset matching the specified properties in the
current node.

*rdclass*, a ``dns.rdataclass.RdataClass``, the class of the rdataset.

*rdtype*, a ``dns.rdatatype.RdataType``, the type of the rdataset.

*covers*, a ``dns.rdatatype.RdataType``, the covered type.
Usually this value is ``dns.rdatatype.NONE``, but if the
rdtype is ``dns.rdatatype.SIG`` or ``dns.rdatatype.RRSIG``,
then the covers value will be the rdata type the SIG/RRSIG
covers.  The library treats the SIG and RRSIG types as if they
were a family of types, e.g. RRSIG(A), RRSIG(NS), RRSIG(SOA).
This makes RRSIGs much easier to work with than if RRSIGs
covering different rdata types were aggregated into a single
RRSIG rdataset.

*create*, a ``bool``.  If True, create the rdataset if it is not found.

Raises ``KeyError`` if an rdataset of the desired type and class does
not exist and *create* is not ``True``.

Returns a ``dns.rdataset.Rdataset``.
)r0   ÚmatchÚKeyErrorr   r   r+   r]   ©r4   r_   r   r   r`   rC   s         r   Úfind_rdatasetÚNode.find_rdataset¥   s\   € ð@ —>”>ˆCØ�y‰y˜¨&×1Ó1Ø’
ñ "ö ÜˆNÜ�l‰l×#Ñ# G°VÓ<ˆØ×Ñ˜cÔ"Øˆ
r   Nc                 óR   •  U R                  XX45      nU$ ! [         a    Sn U$ f = f)ag  Get an rdataset matching the specified properties in the
current node.

None is returned if an rdataset of the specified type and
class does not exist and *create* is not ``True``.

*rdclass*, an ``int``, the class of the rdataset.

*rdtype*, an ``int``, the type of the rdataset.

*covers*, an ``int``, the covered type.  Usually this value is
dns.rdatatype.NONE, but if the rdtype is dns.rdatatype.SIG or
dns.rdatatype.RRSIG, then the covers value will be the rdata
type the SIG/RRSIG covers.  The library treats the SIG and RRSIG
types as if they were a family of
types, e.g. RRSIG(A), RRSIG(NS), RRSIG(SOA).  This makes RRSIGs much
easier to work with than if RRSIGs covering different rdata
types were aggregated into a single RRSIG rdataset.

*create*, a ``bool``.  If True, create the rdataset if it is not found.

Returns a ``dns.rdataset.Rdataset`` or ``None``.
N)re   rc   rd   s         r   Úget_rdatasetÚNode.get_rdatasetÎ   s;   € ð>	Ø×$Ñ$ W°fÓEˆCð ˆ
øô ó 	Ø‰CØˆ
ð	ús   ‚ –&¥&c                 óf   • U R                  XU5      nUb  U R                  R                  U5        gg)a  Delete the rdataset matching the specified properties in the
current node.

If a matching rdataset does not exist, it is not an error.

*rdclass*, an ``int``, the class of the rdataset.

*rdtype*, an ``int``, the type of the rdataset.

*covers*, an ``int``, the covered type.
N)rh   r0   Úremove)r4   r_   r   r   rC   s        r   Údelete_rdatasetÚNode.delete_rdatasetó   s2   € ð$ ×Ñ °Ó8ˆØ‰?Ø�N‰N×!Ñ! #Õ&ð r   Úreplacementc                 ób  • [        U[        R                  R                  5      (       d  [	        S5      e[        U[        R
                  R                  5      (       a  UR                  5       nU R                  UR                  UR                  UR                  5        U R                  U5        g)a…  Replace an rdataset.

It is not an error if there is no rdataset matching *replacement*.

Ownership of the *replacement* object is transferred to the node;
in other words, this method does not store a copy of *replacement*
at the node, it stores *replacement* itself.

*replacement*, a ``dns.rdataset.Rdataset``.

Raises ``ValueError`` if *replacement* is not a
``dns.rdataset.Rdataset``.
zreplacement is not an rdatasetN)Ú
isinstancer   r   r+   Ú
ValueErrorÚrrsetÚRRsetÚto_rdatasetrl   r_   r   r   r]   ©r4   rn   s     r   Úreplace_rdatasetÚNode.replace_rdataset	  sƒ   € ô ˜+¤s§|¡|×'<Ñ'<×=Ñ=ÜÐ=Ó>Ð>Ü�k¤3§9¡9§?¡?×3Ñ3ð &×1Ñ1Ó3ˆKØ×ÑØ×Ñ ×!3Ñ!3°[×5GÑ5Gô	
ð 	×Ñ˜kÕ*r   c                 óÌ   • U R                    HE  n[        R                  UR                  UR                  5      nU[        R
                  :w  d  MC  Us  $    [        R
                  $ )a  Classify a node.

A node which contains a CNAME or RRSIG(CNAME) is a
``NodeKind.CNAME`` node.

A node which contains only "neutral" types, i.e. types allowed to
co-exist with a CNAME, is a ``NodeKind.NEUTRAL`` node.  The neutral
types are NSEC, NSEC3, KEY, and their associated RRSIGS.  An empty node
is also considered neutral.

A node which contains some rdataset which is not a CNAME, RRSIG(CNAME),
or a neutral type is a a ``NodeKind.REGULAR`` node.  Regular nodes are
also commonly referred to as "other data".
)r0   r   r   r   r   r   )r4   r   r\   s      r   r   ÚNode.classify#  sM   € ð ŸœˆHÜ×$Ñ$ X§_¡_°h·o±oÓFˆDØ”x×'Ñ'Õ'Ø’ñ 'ô ×ÑÐr   c                 ó   • g)NFr#   r3   s    r   Úis_immutableÚNode.is_immutable8  s   € Ør   r2   )$r$   r%   r&   r'   r(   Ú	__slots__r5   r   r7   ÚNamer   rG   r   r@   rI   rN   rQ   rT   rX   r]   r   ÚNONEÚ
rdataclassÚ
RdataClassr*   Úboolr   r+   re   rh   rl   rv   r   r   r{   r,   r#   r   r   r.   r.   G   sÐ  † ñð �€Iòð!˜CŸH™HŸM™Mð !°°c¸3°h±ð !ÀCô !ò(2ò
ò&ò#ò$ò(ð@ +.¯-©-×*<Ñ*<Øñ'à—‘×*Ñ*ð'ð —‘×'Ñ'ð'ð —‘×'Ñ'ð	'ð
 ð'ð 
�‰×	Ñ	õ'ðZ +.¯-©-×*<Ñ*<Øñ#à—‘×*Ñ*ð#ð —‘×'Ñ'ð#ð —‘×'Ñ'ð	#ð
 ð#ð 
�‰×	Ñ	 Ñ	%õ#ðR +.¯-©-×*<Ñ*<ñ	'à—‘×*Ñ*ð'ð —‘×'Ñ'ð'ð —‘×'Ñ'ð	'ð
 
õ'ð,+¨C¯L©L×,AÑ,Að +Àdô +ð4 ˜(ô  ð*˜d÷ r   r.   c                   ó  ^ • \ rS rSrU 4S jr\R                  R                  S4S\R                  R                  S\R                  R                  S\R                  R                  S\S\R                  R                  4
U 4S	 jjjr\R                  R                  S4S\R                  R                  S\R                  R                  S\R                  R                  S\S\R                  R                  S
-  4
U 4S jjjr\R                  R                  4S\R                  R                  S\R                  R                  S\R                  R                  SS
4S jjrS\R                  R                  SS
4S jrS\4S jrSrU =r$ )ÚImmutableNodei<  c                 ó¼   >• [         TU ]  5         [        UR                   Vs/ s H"  n[        R
                  R                  U5      PM$     sn5      U l        g s  snf r   )Úsuperr5   Útupler0   r   r   ÚImmutableRdataset)r4   ÚnoderC   Ú	__class__s      €r   r5   ÚImmutableNode.__init__>  sB   ø€ Ü‰ÑÔÜØ<@¿NºNÓKºN°SŒS�\‰\×+Ñ+¨CÖ0¹NÑKó
ˆ�ùÚKs   £)AFr_   r   r   r`   r   c                 óJ   >• U(       a  [        S5      e[        TU ]	  XUS5      $ ©NÚ	immutableF)Ú	TypeErrorr†   re   ©r4   r_   r   r   r`   rŠ   s        €r   re   ÚImmutableNode.find_rdatasetD  s'   ø€ ö Ü˜KÓ(Ð(Ü‰wÑ$ W°f¸eÓDÐDr   Nc                 óJ   >• U(       a  [        S5      e[        TU ]	  XUS5      $ r�   )r�   r†   rh   r�   s        €r   rh   ÚImmutableNode.get_rdatasetO  s'   ø€ ö Ü˜KÓ(Ð(Ü‰wÑ# G°V¸UÓCÐCr   c                 ó   • [        S5      e©NrŽ   ©r�   )r4   r_   r   r   s       r   rl   ÚImmutableNode.delete_rdatasetZ  s   € ô ˜Ó$Ð$r   rn   c                 ó   • [        S5      er•   r–   ru   s     r   rv   ÚImmutableNode.replace_rdatasetb  s   € Ü˜Ó$Ð$r   c                 ó   • g)NTr#   r3   s    r   r{   ÚImmutableNode.is_immutablee  s   € Ør   r2   )r$   r%   r&   r'   r5   r   r   r   r€   r�   r*   r‚   r   r+   re   rh   rl   rv   r{   r,   Ú__classcell__)rŠ   s   @r   r„   r„   <  s‰  ø† õ
ð +.¯-©-×*<Ñ*<Øñ	Eà—‘×*Ñ*ð	Eð —‘×'Ñ'ð	Eð —‘×'Ñ'ð		Eð
 ð	Eð 
�‰×	Ñ	÷	Eð 	Eð +.¯-©-×*<Ñ*<Øñ	Dà—‘×*Ñ*ð	Dð —‘×'Ñ'ð	Dð —‘×'Ñ'ð		Dð
 ð	Dð 
�‰×	Ñ	 Ñ	%÷	Dð 	Dð +.¯-©-×*<Ñ*<ñ	%à—‘×*Ñ*ð%ð —‘×'Ñ'ð%ð —‘×'Ñ'ð	%ð
 
õ%ð%¨C¯L©L×,AÑ,Að %Àdô %ð˜d÷ ò r   r„   )r(   Úenumr<   Útypingr   r   Údns.immutabler   Údns.nameÚdns.rdataclassÚdns.rdatasetÚdns.rdatatypeÚ	dns.rrsetr   r   r   ÚNSECÚNSEC3ÚKEYr   r   ÚuniqueÚEnumr   r.   rŽ   r„   r#   r   r   Ú<module>rª      sÆ   ðñ$ 0ã Û 	ß ã Û Û Û Û Û ð ‡M�M×Ñð€ð ‡M�M×ÑØ‡M�M×ÑØ‡M�M×Ñð€òVð ‡�ô>ˆt�y‰yó >ó ð>÷.rñ rðj ‡�×Ñô)�Dó )ó ñ)r   