§
    þÊíjà#  ã                   óØ  — d Z ddlmZmZmZmZmZmZ ddlZ	ddl
Z	ddlZ	ddlZ	 G d„ de	j        j        ¦  «        Z	 	 	 	 ddee	j        j        ef         ded	ee	j        j        ef         d
ee	j        j        ef         dee         dee	j        j                 dee	j        j                 dedee	j        j                 defd„Zdee	j        j        ef         ded	ee	j        j        ef         d
ee	j        j        ef         dedefd„Z	 ddee	j        j        ef         dedee	j        j                 dee	j        j                 def
d„Zdee	j        j        ef         dededefd„ZdS )z)DNS RRsets (an RRset is a named rdataset)é    )ÚAnyÚcastÚ
CollectionÚDictÚOptionalÚUnionNc                   ó‚  ‡ — e Zd ZdZddgZej        j        dfdej        j	        dej
        j        dej        j        dej        j        deej
        j                 f
ˆ fd„Zˆ fd	„Zd
„ Zd„ Zˆ fd„Zdededefˆ fd„Z	 ddej        j	        dej
        j        dej        j        dej        j        deej
        j                 defˆ fd„Z	 	 ddeej        j	                 dedeeef         defˆ fd„Z	 	 ddedeej        j                 deej        j	                 deeef         def
ˆ fd„Zdej        j        fd„Zˆ xZ S )ÚRRseta6  A DNS RRset (named rdataset).

    RRset inherits from Rdataset, and RRsets can be treated as
    Rdatasets in most cases.  There are, however, a few notable
    exceptions.  RRsets have different to_wire() and to_text() method
    arguments, reflecting the fact that RRsets always have an owner
    name.
    ÚnameÚdeletingNÚrdclassÚrdtypeÚcoversc                 ój   •— t          ¦   «                              |||¦  «         || _        || _        dS )zCreate a new RRset.N)ÚsuperÚ__init__r   r   ©Úselfr   r   r   r   r   Ú	__class__s         €ú+/usr/lib/python3/dist-packages/dns/rrset.pyr   zRRset.__init__)   s3   ø€ õ 	‰Œ×Ò˜ &¨&Ñ1Ô1Ð1ØˆŒ	Ø ˆŒˆˆó    c                 óx   •— t          ¦   «                              ¦   «         }| j        |_        | j        |_        |S ©N)r   Ú_cloner   r   )r   Úobjr   s     €r   r   zRRset._clone7   s-   ø€ Ý‰gŒg�nŠnÑÔˆØ”9ˆŒØ”}ˆŒØˆ
r   c                 óä  — | j         dk    rd}n*dt          j                             | j         ¦  «        z   dz   }| j        �(dt          j                             | j        ¦  «        z   }nd}dt          | j        ¦  «        z   dz   t          j                             | j        ¦  «        z   dz   t          j                             | j	        ¦  «        z   |z   |z   dz   |  
                    ¦   «         z   d	z   S )
Nr   Ú ú(ú)z delete=z<DNS ú z RRset: ú>)r   ÚdnsÚ	rdatatypeÚto_textr   Ú
rdataclassÚstrr   r   r   Ú_rdata_repr)r   ÚctextÚdtexts      r   Ú__repr__zRRset.__repr__=   s  € ØŒ;˜!ÒÐØˆEˆEà�#œ-×/Ò/°´Ñ<Ô<Ñ<¸sÑBˆEØŒ=Ð$Ø¥¤×!7Ò!7¸¼Ñ!FÔ!FÑFˆEˆEàˆEàÝ�$”)‰nŒnñàñõ Œn×$Ò$ T¤\Ñ2Ô2ñ3ð ñ	õ
 Œm×#Ò# D¤KÑ0Ô0ñ1ð ñð ñð ñð ×ÒÑ Ô ñ	!ð ñ
ð	
r   c                 ó*   — |                       ¦   «         S r   )r$   ©r   s    r   Ú__str__zRRset.__str__T   s   € Ø�|Š|‰~Œ~Ðr   c                 óØ   •— t          |t          ¦  «        r| j        |j        k    rdS n!t          |t          j        j        ¦  «        sdS t          ¦   «                              |¦  «        S )NF)Ú
isinstancer
   r   r"   ÚrdatasetÚRdatasetr   Ú__eq__)r   Úotherr   s     €r   r2   zRRset.__eq__W   s`   ø€ Ý�e�UÑ#Ô#ð 	ØŒy˜EœJÒ&Ð&Ø�uð 'å˜E¥3¤<Ô#8Ñ9Ô9ð 	Ø�5Ý‰wŒw�~Š~˜eÑ$Ô$Ð$r   ÚargsÚkwargsÚreturnc                 óš   •— t          |d         t          j        j        ¦  «        r | j        |i |¤ŽS  t          ¦   «         j        |i |¤ŽS )aÐ  Does this rrset match the specified attributes?

        Behaves as :py:func:`full_match()` if the first argument is a
        ``dns.name.Name``, and as :py:func:`dns.rdataset.Rdataset.match()`
        otherwise.

        (This behavior fixes a design mistake where the signature of this
        method became incompatible with that of its superclass.  The fix
        makes RRsets matchable as Rdatasets while preserving backwards
        compatibility.)
        r   )r/   r"   r   ÚNameÚ
full_matchr   Úmatch)r   r4   r5   r   s      €r   r:   zRRset.match_   sQ   ø€ õ �d˜1”g�sœxœ}Ñ-Ô-ð 	2Ø"�4”? DÐ3¨FÐ3Ð3Ð3à •5‘7”7”= $Ð1¨&Ð1Ð1Ð1r   c                 ó‚   •— t          ¦   «                              |||¦  «        sdS | j        |k    s| j        |k    rdS dS )ztReturns ``True`` if this rrset matches the specified name, class,
        type, covers, and deletion state.
        FT)r   r:   r   r   r   s         €r   r9   zRRset.full_matchp   sI   ø€ õ ‰wŒw�}Š}˜W f¨fÑ5Ô5ð 	Ø�5ØŒ9˜ÒÐ ¤°Ò 9Ð 9Ø�5Øˆtr   TÚoriginÚ
relativizeÚkwc                 óR   •—  t          ¦   «         j        | j        ||| j        fi |¤ŽS )aï  Convert the RRset into DNS zone file format.

        See ``dns.name.Name.choose_relativity`` for more information
        on how *origin* and *relativize* determine the way names
        are emitted.

        Any additional keyword arguments are passed on to the rdata
        ``to_text()`` method.

        *origin*, a ``dns.name.Name`` or ``None``, the origin for relative
        names.

        *relativize*, a ``bool``.  If ``True``, names will be relativized
        to *origin*.
        )r   r$   r   r   )r   r<   r=   r>   r   s       €r   r$   zRRset.to_textƒ   s9   ø€ ð, �u‰wŒwŒØŒI�v˜z¨4¬=ð
ð 
Ø<>ð
ð 
ð 	
r   ÚfileÚcompressc                 óT   •—  t          ¦   «         j        | j        |||| j        fi |¤ŽS )zÖConvert the RRset to wire format.

        All keyword arguments are passed to ``dns.rdataset.to_wire()``; see
        that function for details.

        Returns an ``int``, the number of records emitted.
        )r   Úto_wirer   r   )r   r@   rA   r<   r>   r   s        €r   rC   zRRset.to_wire�   s;   ø€ ð �u‰wŒwŒØŒI�t˜X v¨t¬}ð
ð 
Ø@Bð
ð 
ð 	
r   c                 óf   — t           j                             | j        t	          | ¦  «        ¦  «        S )zYConvert an RRset into an Rdataset.

        Returns a ``dns.rdataset.Rdataset``.
        )r"   r0   Úfrom_rdata_listÚttlÚlistr,   s    r   Úto_rdatasetzRRset.to_rdataset²   s$   € õ
 Œ|×+Ò+¨D¬Hµd¸4±j´jÑAÔAÐAr   r   )NT)NN)!Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r"   r#   ÚNONEr   r8   r%   Ú
RdataClassÚ	RdataTyper   r   r   r*   r-   r2   r   Úboolr:   r9   r   r&   r$   ÚCompressTypeÚintrC   r0   r1   rH   Ú__classcell__)r   s   @r   r
   r
      sµ  ø€ € € € € ðð ð ˜Ð$€Ið +.¬-Ô*<Ø8<ð!ð !àŒhŒmð!ð ”Ô*ð!ð ”Ô'ð	!ð
 ”Ô'ð!ð ˜3œ>Ô4Ô5ð!ð !ð !ð !ð !ð !ðð ð ð ð ð
ð 
ð 
ð.ð ð ð%ð %ð %ð %ð %ð2˜3ð 2¨#ð 2°$ð 2ð 2ð 2ð 2ð 2ð 2ð. 9=ðð àŒhŒmðð ”Ô*ðð ”Ô'ð	ð
 ”Ô'ðð ˜3œ>Ô4Ô5ðð 
ðð ð ð ð ð ð* +/Øð
ð 
à˜œœÔ'ð
ð ð
ð �3˜�8Œnð	
ð
 
ð
ð 
ð 
ð 
ð 
ð 
ð: 59Ø*.ð	
ð 
àð
ð ˜3œ8Ô0Ô1ð
ð ˜œœÔ'ð	
ð
 �3˜�8Œnð
ð 
ð
ð 
ð 
ð 
ð 
ð 
ð*B˜Sœ\Ô2ð Bð Bð Bð Bð Bð Bð Bð Br   r
   Tr   rF   r   r   Útext_rdatasÚ
idna_codecr<   r=   Úrelativize_tor6   c	           
      óâ  — t          | t          ¦  «        r"t          j                             | d|¬¦  «        } t          j        j                             |¦  «        }	t          j        j	                             |¦  «        }
t          | |	|
¦  «        }|                     |¦  «         |D ]F}t          j                             |j        |j        |||||¦  «        }|                     |¦  «         ŒG|S )ay  Create an RRset with the specified name, TTL, class, and type, and with
    the specified list of rdatas in text format.

    *idna_codec*, a ``dns.name.IDNACodec``, specifies the IDNA
    encoder/decoder to use; if ``None``, the default IDNA 2003
    encoder/decoder is used.

    *origin*, a ``dns.name.Name`` (or ``None``), the
    origin to use for relative names.

    *relativize*, a ``bool``.  If true, name will be relativized.

    *relativize_to*, a ``dns.name.Name`` (or ``None``), the origin to use
    when relativizing names.  If not set, the *origin* value will be used.

    Returns a ``dns.rrset.RRset`` object.
    N©rV   )r/   r&   r"   r   Ú	from_textr%   rO   Úmaker#   rP   r
   Ú
update_ttlÚrdatar   r   Úadd)r   rF   r   r   rU   rV   r<   r=   rW   Úthe_rdclassÚ
the_rdtypeÚrÚtÚrds                 r   Úfrom_text_listrd   º   s×   € õ: �$�ÑÔð EÝŒx×!Ò! $¨¸Ð!ÑDÔDˆÝ”.Ô+×0Ò0°Ñ9Ô9€KÝ”Ô(×-Ò-¨fÑ5Ô5€JÝˆd�K Ñ,Ô,€AØ‡L‚L�ÑÔÐØð ð ˆÝŒY× Ò ØŒI�q”x  F¨J¸Àzñ
ô 
ˆð 	
�Šˆb‰	Œ	ˆ	ˆ	Ø€Hr   c           
      ód   — t          | |||t          t          t                   |¦  «        ¦  «        S )zŸCreate an RRset with the specified name, TTL, class, and type and with
    the specified rdatas in text format.

    Returns a ``dns.rrset.RRset`` object.
    )rd   r   r   r&   )r   rF   r   r   rU   s        r   rZ   rZ   å   s/   € õ Øˆc�7˜F¥D­µC¬¸+Ñ$FÔ$Fñô ð r   Úrdatasc                 ó\  — t          | t          ¦  «        r"t          j                             | d|¬¦  «        } t          |¦  «        dk    rt          d¦  «        ‚d}|D ]I}|€0t          | |j        |j	        ¦  «        }| 
                    |¦  «         |                     |¦  «         ŒJ|€J ‚|S )a/  Create an RRset with the specified name and TTL, and with
    the specified list of rdata objects.

    *idna_codec*, a ``dns.name.IDNACodec``, specifies the IDNA
    encoder/decoder to use; if ``None``, the default IDNA 2003
    encoder/decoder is used.

    Returns a ``dns.rrset.RRset`` object.

    NrY   r   zrdata list must not be empty)r/   r&   r"   r   rZ   ÚlenÚ
ValueErrorr
   r   r   r\   r^   )r   rF   rf   rV   ra   rc   s         r   rE   rE   ÷   s²   € õ" �$�ÑÔð EÝŒx×!Ò! $¨¸Ð!ÑDÔDˆå
ˆ6�{„{�aÒÐÝÐ7Ñ8Ô8Ð8Ø€AØð ð ˆØˆ9Ý�d˜BœJ¨¬	Ñ2Ô2ˆAØ�LŠL˜ÑÔÐØ	�Šˆb‰	Œ	ˆ	ˆ	Øˆ=ˆ=ˆ=Ø€Hr   c                 ót   — t          | |t          t          t          j        j                 |¦  «        ¦  «        S )zŠCreate an RRset with the specified name and TTL, and with
    the specified rdata objects.

    Returns a ``dns.rrset.RRset`` object.
    )rE   r   r   r"   r]   ÚRdata)r   rF   rf   s      r   Ú
from_rdatarl     s)   € õ ˜4 ¥d­:µc´i´oÔ+FÈÑ&OÔ&OÑPÔPÐPr   )NNTNr   ) rL   Útypingr   r   r   r   r   r   Údns.namer"   Údns.rdatasetÚdns.rdataclassÚdns.rendererr0   r1   r
   r   r8   r&   rS   r%   rO   r#   rP   Ú	IDNACodecrQ   rd   rZ   r]   rk   rE   rl   © r   r   ú<module>rt      s¶  ðð$ 0Ð /à ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?à €€€Ø Ð Ð Ð Ø Ð Ð Ð Ø Ð Ð Ð ð[Bð [Bð [Bð [Bð [BˆCŒLÔ!ñ [Bô [Bð [BðH 04Ø&*ØØ-1ð(ð (Ø
�””˜sÐ"Ô
#ð(à	ð(ð �3”>Ô,¨cÐ1Ô2ð(ð �#”-Ô)¨3Ð.Ô/ð	(ð
 ˜C”ð(ð ˜œÔ+Ô,ð(ð �S”X”]Ô#ð(ð ð(ð ˜CœHœMÔ*ð(ð ð(ð (ð (ð (ðVØ
�””˜sÐ"Ô
#ðà	ðð �3”>Ô,¨cÐ1Ô2ðð �#”-Ô)¨3Ð.Ô/ð	ð
 ðð ðð ð ð ð, 04ð	ð Ø
�””˜sÐ"Ô
#ðà	ðð �s”y”Ô'ðð ˜œÔ+Ô,ð	ð
 ðð ð ð ð@Q�U˜3œ8œ=¨#Ð-Ô.ð Q°Sð QÀ3ð QÈ5ð Qð Qð Qð Qð Qð Qr   