OwlCyberSecurity - MANAGER
Edit File: name.cpython-312.pyc
� ����\��g���������������� ��������J����d�Z�ddlZddlZddlZddlZddlmZmZm Z m Z mZmZm Z �ddlZddlZddlZddlZddlZej(������������������j+������������������d�������rddlZdZndZe def���Z�G�d��d ej4������������������j6�������������������������Zej:������������������Zej>������������������Z ejB������������������Z"ejF������������������Z$ejJ������������������Z&�G�d ��dejN������������������jP�������������������������Z)�G�d��d ejN������������������jP�������������������������Z*�G�d��dejN������������������jV�������������������������Z,�G�d��dejN������������������jV�������������������������Z-�G�d��dejN������������������j\�������������������������Z/�G�d��dejN������������������jV�������������������������Z0�G�d��dejN������������������jP�������������������������Z1�G�d��dejN������������������j\�������������������������Z2�G�d��dejN������������������j\�������������������������Z3�G�d��dejN������������������j\�������������������������Z4�G�d��dejN������������������j\�������������������������Z5�G�d ��d!ejN������������������j\�������������������������Z6d"Z7d#Z8d$e e9e:f���d%e:fd&�Z;�G�d'��d(�������Z<�G�d)��d*e<�������Z=�G�d+��d,e<�������Z>�e=d�������Z?�e=d�������Z@e?ZA�e>dddd�������ZB�e>dddd�������ZC�e>dddd�������ZD�e>dddd�������ZEeBZFd-ee9d.f���d%dfd/�ZGd$e e9e:f���d%e9fd0�ZHej�������������������j��������������������G�d1��d���������������ZJ�eJd2g�������ZK�eJg��������ZLeKdfd3e:d4eeJ���d5ee<���d%eJfd6�ZMd3e:d%eNfd7�ZOeKdfd3e e9e:f���d4eeJ���d5ee<���d%eJfd8�ZPd9d:d%eJfd;�ZQd<e9d=ed%eeJef���fd>�ZRd?ZS�eTeS�������ZU�eJeSg�������ZVd@ZW�eTeW�������ZX�eTdA�������ZY�eTdB�������ZZdC��Z[dD��Z\dE��Z]dFeJd4eJdGeNd%eJfdH�Z^dFeJd4eJdGeNd%eJfdI�Z_dJeeJeJeNgeJf���dFeJd4eJdGeNd%eJf dK�Z`y)LzDNS Names. �����N)�Any�Callable�Dict�Iterable�Optional�Tuple�Union�idnaTF�Namec��������������������D�����e�Zd�ZdZdZdZdZdZdZe d����������Z e d����������Zy ) �NameRelationz(Name relation result from fullcompare().r�������������������c�����������������������|�j�������������������S��N)�COMMONANCESTOR��clss��� �7/opt/hc_python/lib/python3.12/site-packages/dns/name.py�_maximumzNameRelation._maximum<���s�������!�!�!�����c�����������������������|�j�������������������S�r���)�__name__r���s��� r����_short_namezNameRelation._short_name@���s�������|�|�r���N)r���� __module__�__qualname__�__doc__�NONE�SUPERDOMAIN� SUBDOMAIN�EQUALr����classmethodr���r�����r���r���r ���r ���+���sF������2�� �D��K��I� �E��N��"���"������r���r ���c�������������������������e�Zd�ZdZy)� EmptyLabelzA DNS label is empty.N�r���r���r���r���r%���r���r���r'���r'���M���s������r���r'���c�������������������������e�Zd�ZdZy)� BadEscapez8An escaped code in a text format of DNS name is invalid.Nr(���r%���r���r���r*���r*���Q���s������Br���r*���c�������������������������e�Zd�ZdZy)� BadPointerz=A DNS compression pointer points forward instead of backward.Nr(���r%���r���r���r,���r,���U���s������Gr���r,���c�������������������������e�Zd�ZdZy)�BadLabelTypez2The label type in DNS name wire format is unknown.Nr(���r%���r���r���r.���r.���Y���s������<r���r.���c�������������������������e�Zd�ZdZy)�NeedAbsoluteNameOrOriginzvAn attempt was made to convert a non-absolute name to wire when there was also a non-absolute (or missing) origin.Nr(���r%���r���r���r0���r0���]���s������Dr���r0���c�������������������������e�Zd�ZdZy)�NameTooLongz A DNS name is > 255 octets long.Nr(���r%���r���r���r2���r2���b����������*r���r2���c�������������������������e�Zd�ZdZy)�LabelTooLongz A DNS label is > 63 octets long.Nr(���r%���r���r���r5���r5���f���r3���r���r5���c�������������������������e�Zd�ZdZy)�AbsoluteConcatenationz]An attempt was made to append anything other than the empty name to an absolute DNS name.Nr(���r%���r���r���r7���r7���j���s������+r���r7���c�������������������������e�Zd�ZdZy)�NoParentzMAn attempt was made to get the parent of the root name or the empty name.Nr(���r%���r���r���r9���r9���o���s������r���r9���c�������������������������e�Zd�ZdZy)� NoIDNA2008zLIDNA 2008 processing was requested but the idna module is not available.Nr(���r%���r���r���r;���r;���t���s������r���r;���c��������������������,�������e�Zd�ZdZdhZdZ��fd�Z��xZS�)� IDNAExceptionz$IDNA processing raised an exception.�idna_exceptionz+IDNA processing exception: {idna_exception}c������������������$������t���������|����|i�|���y�r���)�super�__init__)�self�args�kwargs� __class__s��� �r���rA���zIDNAException.__init__����s������� ���$�)�&�)r���)r���r���r���r����supp_kwargs�fmtrA���� __classcell__�rE���s���@r���r=���r=���y���s�������.�#�$�K� 7�C�*��*r���r=���c�������������������������e�Zd�ZdZy)�NeedSubdomainOfOriginzNAn absolute name was provided that is not a subdomain of the specified origin.Nr(���r%���r���r���rK���rK�������s������Xr���rK���s���"().;\@$z"().;\@$�label�returnc����������������������t��������|�t���������������rFd}|�D�]=��}|t��������v�r|dt��������|�������z���z ��}�|dkD��r|dk��r|t��������|�������z ��}�6|d|z��z ��}�?�|S�d}|�D�]/��}|t��������v�r |d|z���z ��}�|dk��r|dt��������|�������z��z ��}�+||z ��}�1�|S�)zaEscape the characters in label which need it. @returns: the escaped string @rtype: string���\� �������z\%03d� )� isinstance�bytes�_escaped�chr� _escaped_text�ord)rL����text�c�ucs��� r���� _escapifyr]�������s���������%�������A��H�}���s�1�v� �%���T��a�$�h���A������1��$�� �������D��� ����D�2�I��D� �6�\��H�s�2�w�&�&�D��B�J�D� ����Kr���c��������������������F�����e�Zd�ZdZd��Zdedefd�Zdedefd�Z dedefd�Z y) � IDNACodecz.Abstract base class for IDNA encoder/decoders.c������������������������y�r���r%����rB���s��� r���rA���zIDNACodec.__init__����s������r���rL���rM���c������������������@�����|j��������������������������j������������������d�������S�)Ns���xn--)�lower� startswith�rB���rL���s��� r����is_idnazIDNACodec.is_idna����s�������{�{�}�'�'��0�0r���c�����������������������t����������r���)�NotImplementedErrorre���s��� r����encodezIDNACodec.encode����s������!�!r���c�����������������������|�j������������������|�������r �|dd��j������������������d�������}t��������|�������S�t��������|�������S�#�t��������$�r}t ��������|���������d�}~ww�xY�w)Nr����punycode�r>���)rf����decoder]���� Exceptionr=���)rB���rL����slabel�es��� r���rm���zIDNACodec.decode����s^�������<�<��� 6��q�r��)�)�*�5�� ��(�(���U�#�#����� 6�#�1�5�5�� 6�s����=�� A�A�AN)r���r���r���r���rA���rU����boolrf����strri���rm���r%���r���r���r_���r_�������sC������8� �1�U��1�t��1�"�C��"�E��"� $�E�� $�c�� $r���r_���c��������������������N�������e�Zd�ZdZddef��fd� Zdedefd�Zdedef��fd�Z ��xZ S�) � IDNA2003CodeczIDNA 2003 encoder/decoder.� strict_decodec������������������0������t����������|�������������||�_��������y)z�Initialize the IDNA 2003 encoder/decoder. *strict_decode* is a ``bool``. If `True`, then IDNA2003 checking is done when decoding. This can cause failures if the name was encoded with IDNA2008. The default is `False`. N)r@���rA���ru���)rB���ru���rE���s��� �r���rA���zIDNA2003Codec.__init__����s�������� ����*��r���rL���rM���c������������������t�����|dk(��ry �t���������j������������������j������������������|�������S�#�t��������$�r�t���������w�xY�w)zEncode *label*.rO���r���)� encodingsr ����ToASCII�UnicodeErrorr5���re���s��� r���ri���zIDNA2003Codec.encode����s=��������B�;�� ��>�>�)�)�%�0�0���� ��� �s����'��7c�������������������������|�j�������������������st���������|�� ��|�������S�|dk(��ry �t��������t��������j ������������������j ������������������|��������������S�#�t��������$�r}t��������|���������d}~ww�xY�w)zDecode *label*.r���rO���rl���N) ru���r@���rm���r]���rx���r ���� ToUnicodern���r=���)rB���rL���rp���rE���s��� �r���rm���zIDNA2003Codec.decode����s_��������!�!��7�>�%�(�(��C�<�� 2��Y�^�^�5�5�e�<�=�=���� 2��q�1�1�� 2�s����'A�� A&�A!�!A&�F�r���r���r���r���rq���rA���rr���rU���ri���rm���rH���rI���s���@r���rt���rt�������s=�������$� +�d�� +��C���E��� 2�E�� 2�c�� 2�� 2r���rt���c������������ ��������b�������e�Zd�ZdZ � � � �ddedededef��fd� Zdedefd �Zdedef��fd �Z ��xZ S�)� IDNA2008CodeczIDNA 2008 encoder/decoder.�uts_46�transitional�allow_pure_asciiru���c������������������Z������t����������|�������������||�_��������||�_��������||�_��������||�_��������y)a��Initialize the IDNA 2008 encoder/decoder. *uts_46* is a ``bool``. If True, apply Unicode IDNA compatibility processing as described in Unicode Technical Standard #46 (https://unicode.org/reports/tr46/). If False, do not apply the mapping. The default is False. *transitional* is a ``bool``: If True, use the "transitional" mode described in Unicode Technical Standard #46. The default is False. *allow_pure_ascii* is a ``bool``. If True, then a label which consists of only ASCII characters is allowed. This is less strict than regular IDNA 2008, but is also necessary for mixed names, e.g. a name with starting with "_sip._tcp." and ending in an IDN suffix which would otherwise be disallowed. The default is False. *strict_decode* is a ``bool``: If True, then IDNA2008 checking is done when decoding. This can cause failures if the name was encoded with IDNA2003. The default is False. N)r@���rA���r����r����r����ru���)rB���r����r����r����ru���rE���s��� �r���rA���zIDNA2008Codec.__init__����s/�������:� �������(��� 0���*��r���rL���rM���c����������������������|dk(��ry|�j�������������������r2t��������|�������r'|j������������������d�������}t��������|�������dkD��rt���������|S�t ��������st��������� �|�j������������������r!t��������j������������������|d|�j�������������������������}t��������j������������������|�������S�#�t��������j������������������$�r)}|j������������������d���dk(��rt���������t��������|���������d�}~ww�xY�w) NrO���r����ascii�?���Fr���zLabel too longrl���)r�����is_all_asciiri����lenr5����have_idna_2008r;���r����r ����uts46_remapr�����alabel� IDNAErrorrC���r=���)rB���rL����encodedrp���s��� r���ri���zIDNA2008Codec.encode��s��������B�;��� � �\�%�%8��l�l�7�+�G��7�|�b� �"�"��N���� 6��{�{��(�(���t�7H�7H�I���;�;�u�%�%���~�~�� 6��v�v�a�y�,�,�"�"�#�1�5�5�� 6�s����AB��C�'$C�Cc������������������T�����|�j�������������������st���������|�� ��|�������S�|dk(��ryt��������st��������� �t��������j������������������|�������}|�j������������������r!t��������j������������������|d|�j�������������������������}t��������|�������S�#�t ��������j������������������t��������f$�r}t��������|���������d�}~ww�xY�w)Nr���rO���Frl���)ru���r@���rm���r����r;���r ����ulabelr����r����r����r]���r����rz���r=���)rB���rL���r����rp���rE���s��� �r���rm���zIDNA2008Codec.decode!��s���������!�!��7�>�%�(�(��C�<����� 2��[�[��'�F��{�{��)�)�&�%��9J�9J�K���V�$�$������-�� 2��q�1�1�� 2�s����AA=��=B'�B"�"B')FFFFr~���rI���s���@r���r����r��������sk�������$���"�!&�#�!+��!+���!+��� !+� ��!+�F6�C��6�E��6�* 2�E�� 2�c�� 2�� 2r���r�����labels.c������������������������t��������|��������}d}d}d}|�D�]1��}t��������|�������}||dz���z ��}|dkD��rt���������|dk��r|dk(��r|}|dz ��}�3�|dkD��rt���������|dk\��r||dz ��k7��rt���������yy)aX��Check for empty labels in the middle of a label sequence, labels that are too long, and for too many labels. Raises ``dns.name.NameTooLong`` if the name as a whole is too long. Raises ``dns.name.EmptyLabel`` if a label is empty (i.e. the root label) and appears in a position other than the end of the label sequence r������r���r����r�������N)r����r5���r2���r'���)r�����l�total�i�jrL����lls��� r����_validate_labelsr����;��s�������� �F��A� �E� �A� �A��� ��Z�� ��a���� ��7����q�5�U�c�\��A� �Q������ �s�{����A�v�!�q�1�u�*�����vr���c������������������r�����t��������|�t���������������r|�S�t��������|�t���������������r|�j��������������������������S�t���������)zcIf label is ``str``, convert it to ``bytes``. If it is already ``bytes`` just return it. )rT���rU���rr���ri���� ValueError)rL���s��� r����_maybe_convert_to_binaryr����Y��s/��������%������%����|�|�~�� �r���c��������������������������e�Zd�ZdZdgZdeeeef������fd�Z d��Z d��Zd��Z��fd�Z defd �Zdefd �Zdefd�Zdd�deeeef���fd �Zdd�defd�Zdd�defd�Zd3d�Zd��Zd��Zd��Zd��Zd��Zd��Zd��Zd��Z d4dedefd�Z! �d5dede"e#���defd�Z$d6de"d����defd�Z% � � � �d7de"e&���d e"e'���de"d����d!ede"e���f d"�Z(defd#�Z)d$��Z*d%��Z+d&��Z,d'eded(���fd)�Z-d8d*�Z.d9d+�Z/d9d,�Z0 �d:de"d����d-edd�fd.�Z1d3d/�Z2d;dd�d0edd�fd1�Z3d;dd�d0edd�fd2�Z4��xZ5S�)<r���z�A DNS name. The dns.name.Name class represents a DNS name as a tuple of labels. Each label is a ``bytes`` in DNS wire format. Instances of the class are immutable. r����c�����������������������|D��cg�c] ��}t��������|����������}}t��������|�������|�_��������t��������|�j��������������������������yc�c}w�)z?*labels* is any iterable whose values are ``str`` or ``bytes``.N)r�����tupler����r����)rB���r�����x�blabelss��� r���rA���z Name.__init__q��s;�������9?�?��1�+�A�.���?��G�n�������%���@s����?c������������������,�����t��������|�j�������������������������S�r���)r���r����ra���s��� r����__copy__z Name.__copy__x��s�������D�K�K� � r���c������������������T�����t��������t��������j������������������|�j������������������|��������������S�r���)r����copy�deepcopyr����)rB����memos��� r����__deepcopy__zName.__deepcopy__{��s�������D�M�M�$�+�+�t�4�5�5r���c�����������������������d|�j�������������������iS��Nr�����r����ra���s��� r����__getstate__zName.__getstate__~��s�������$�+�+�&�&r���c������������������V������t����������|����d|d�����������t��������|�j��������������������������y�r����)r@����__setattr__r����r����)rB����staterE���s��� �r����__setstate__zName.__setstate__���s"������� ���H�e�H�o�6�����%r���rM���c������������������Z�����t��������|�j�������������������������dkD��xr�|�j������������������d���dk(��S�)z`Is the most significant label of this name the root label? Returns a ``bool``. r���r����r����r����r����ra���s��� r����is_absolutezName.is_absolute���s*��������4�;�;��!�#�>����B��3�(>�>r���c������������������Z�����t��������|�j�������������������������dkD��xr�|�j������������������d���dk(��S�)zdIs this name wild? (I.e. Is the least significant label '*'?) Returns a ``bool``. r�������*r����ra���s��� r����is_wildzName.is_wild���s*��������4�;�;��!�#�>����A��$�(>�>r���c������������������l�����d}|�j�������������������D�]"��}|j��������������������������D�] ��}||dz��|z���z ��}���$�|S�)zQReturn a case-insensitive hash of the name. Returns an ``int``. r���r���)r����rc���)rB����hrL���r[���s��� r����__hash__z Name.__hash__���s@������� ���[�[�E��[�[�]���a�1�f��\�!���#��!���r����otherc�����������������������|�j��������������������������}|j��������������������������}||k7��r(|rt��������j������������������ddfS�t��������j������������������ddfS�t��������|�j�������������������������}t��������|j�������������������������}||z ��}|dk��r|}n|}d}d} t��������j������������������} |dkD��r�|dz��}|dz��}|dz��}|�j������������������|���j��������������������������}|j������������������|���j��������������������������}||k��rd}| dkD��rt��������j������������������} | || fS�||kD��rd}| dkD��rt��������j������������������} | || fS�| dz ��} |dkD��r��|}|dk��rt��������j������������������} n&|dkD��rt��������j������������������} nt��������j������������������} | || fS�)a���Compare two names, returning a 3-tuple ``(relation, order, nlabels)``. *relation* describes the relation ship between the names, and is one of: ``dns.name.NameRelation.NONE``, ``dns.name.NameRelation.SUPERDOMAIN``, ``dns.name.NameRelation.SUBDOMAIN``, ``dns.name.NameRelation.EQUAL``, or ``dns.name.NameRelation.COMMONANCESTOR``. *order* is < 0 if *self* < *other*, > 0 if *self* > *other*, and == 0 if *self* == *other*. A relative name is always less than an absolute name. If both names have the same relativity, then the DNSSEC order relation is used to order them. *nlabels* is the number of significant labels that the two names have in common. Here are some examples. Names ending in "." are absolute names, those not ending in "." are relative names. ============= ============= =========== ===== ======= self other relation order nlabels ============= ============= =========== ===== ======= www.example. www.example. equal 0 3 www.example. example. subdomain > 0 2 example. www.example. superdomain < 0 2 example1.com. example2.com. common anc. < 0 2 example1 example2. none < 0 0 example1. example2 none > 0 0 ============= ============= =========== ===== ======= r���r���r����) r����r ���r ���r����r����rc���r���r!���r"���r#���) rB���r�����sabs�oabs�l1�l2�ldiffr�����order�nlabels�namereln�label1�label2s ��� r����fullcomparezName.fullcompare���s������@����!��� � �"���4�<��$�)�)�1�a�0�0�$�)�)�2�q�1�1� ���� �� ���� ���R����1�9��A��A������$�$���!�e� ��F�A��!�G�B��!�G�B��[�[��_�*�*�,�F��\�\�"�%�+�+�-�F�������Q�;�+�:�:�H� �%��1�1��&�����Q�;�+�:�:�H� �%��1�1��q�L�G�!��!�e�"����1�9�#�/�/�H� �Q�Y�#�-�-�H�#�)�)�H��%��)�)r���c������������������|�����|�j������������������|�������\��}}}|t��������j������������������k(��s|t��������j������������������k(��ryy)z�Is self a subdomain of other? Note that the notion of subdomain includes equality, e.g. "dnspython.org" is a subdomain of itself. Returns a ``bool``. TF)r����r ���r"���r#����rB���r�����nr�_s��� r����is_subdomainzName.is_subdomain���s;��������%�%�e�,� ��Q�� ��'�'�'�2��1C�1C�+C��r���c������������������|�����|�j������������������|�������\��}}}|t��������j������������������k(��s|t��������j������������������k(��ryy)z�Is self a superdomain of other? Note that the notion of superdomain includes equality, e.g. "dnspython.org" is a superdomain of itself. Returns a ``bool``. TF)r����r ���r!���r#���r����s��� r����is_superdomainzName.is_superdomain���s;��������%�%�e�,� ��Q�� ��)�)�)�R�<�3E�3E�-E��r���c������������������n�����t��������|�j������������������D��cg�c]��}|j�����������������������������c}�������S�c�c}w�)zcReturn a name which is equal to the current name, but is in DNSSEC canonical form. )r���r����rc���)rB���r����s��� r����canonicalizezName.canonicalize ��s+������ �����4��1�Q�W�W�Y��4�5�5��4s����2c������������������R�����t��������|t���������������r|�j������������������|�������d���dk(��S�y)Nr���r���F�rT���r���r�����rB���r����s��� r����__eq__zName.__eq__��s*�������e�T�"��#�#�E�*�1�-��2�2�r���c������������������R�����t��������|t���������������r|�j������������������|�������d���dk7��S�y)Nr���r���Tr����r����s��� r����__ne__zName.__ne__��s*�������e�T�"��#�#�E�*�1�-��2�2�r���c������������������\�����t��������|t���������������r|�j������������������|�������d���dk��S�t��������S��Nr���r����rT���r���r�����NotImplementedr����s��� r����__lt__zName.__lt__���-�������e�T�"��#�#�E�*�1�-��1�1�!�!r���c������������������\�����t��������|t���������������r|�j������������������|�������d���dk��S�t��������S�r����r����r����s��� r����__le__zName.__le__#���-�������e�T�"��#�#�E�*�1�-��2�2�!�!r���c������������������\�����t��������|t���������������r|�j������������������|�������d���dk\��S�t��������S�r����r����r����s��� r����__ge__zName.__ge__)��r����r���c������������������\�����t��������|t���������������r|�j������������������|�������d���dkD��S�t��������S�r����r����r����s��� r����__gt__zName.__gt__/��r����r���c������������������.�����d|�j��������������������������z���dz���S�)Nz <DNS name �>)�__str__ra���s��� r����__repr__z Name.__repr__5��s�������d�l�l�n�,�s�2�2r���c������������������$�����|�j������������������d�������S�)NF)�to_textra���s��� r���r����zName.__str__8��s�������|�|�E�"�"r����omit_final_dotc������������������(����t��������|�j�������������������������dk(��ryt��������|�j�������������������������dk(��r|�j������������������d���dk(��ry|r |�j��������������������������r|�j������������������dd�}n|�j������������������}dj������������������t ��������t ��������|��������������}|S�)z�Convert name to DNS text format. *omit_final_dot* is a ``bool``. If True, don't emit the final dot (denoting the root label) for absolute names. The default is False. Returns a ``str``. r����@r���r����.Nr����)r����r����r�����join�mapr]���)rB���r����r�����ss��� r���r����zName.to_text;��s|��������t�{�{��q� ���t�{�{��q� �T�[�[��^�s�%:���d�.�.�0����C�R� �A����A��H�H�S��A�&�'���r���� idna_codecc������������������\����t��������|�j�������������������������dk(��ryt��������|�j�������������������������dk(��r|�j������������������d���dk(��ry|r |�j��������������������������r|�j������������������dd�}n|�j������������������}|�t��������}dj ������������������|D��cg�c]��}|j������������������|����������c}�������S�c�c}w�)at��Convert name to Unicode text format. IDN ACE labels are converted to Unicode. *omit_final_dot* is a ``bool``. If True, don't emit the final dot (denoting the root label) for absolute names. The default is False. *idna_codec* specifies the IDNA encoder/decoder. If None, the dns.name.IDNA_2003_Practical encoder/decoder is used. The IDNA_2003_Practical decoder does not impose any policy, it just decodes punycode, so if you don't want checking for compliance, you can use this decoder for IDNA2008 as well. Returns a ``str``. r���r����r���r���r����Nr����)r����r����r�����IDNA_2003_Practicalr����rm���)rB���r����r����r����r����s��� r���� to_unicodezName.to_unicodeP��s�������(��t�{�{��q� ���t�{�{��q� �T�[�[��^�s�%:���d�.�.�0����C�R� �A����A���,�J��x�x�q�9�q�!��*�*�1�-�q�9�:�:��9s���� B)�originc������������������4�����|�j������������������|d��������}|�J��|S�)a@��Convert name to a format suitable for digesting in hashes. The name is canonicalized and converted to uncompressed wire format. All names in wire format are absolute. If the name is a relative name, then an origin must be supplied. *origin* is a ``dns.name.Name`` or ``None``. If the name is relative and origin is not ``None``, then origin will be appended to the name. Raises ``dns.name.NeedAbsoluteNameOrOrigin`` if the name is relative and no origin was provided. Returns a ``bytes``. T)r����r����)�to_wire)rB���r�����digests��� r���� to_digestablezName.to_digestablep��s'������"����V�$��?���!�!�!�� r����file�compressr����c������������������`����|��t����������������}|�j������������������D�]7��}|j������������������t��������|���������������|r||j ��������������������������z ��}�3||z ��}�9�|�j��������������������������s^|�|j��������������������������st���������|j������������������D�]7��}|j������������������t��������|���������������|r||j ��������������������������z ��}�3||z ��}�9�t��������|�������S�|�j��������������������������sR|�|j��������������������������st���������t��������|�j�������������������������}|j������������������t��������|j���������������������������������n|�j������������������}d}|D�]���}t��������||d��������} |dz ��}|�|j������������������| �������} nd} | �.d| z���}t��������j������������������d|�������}|j������������������|���������y|�(t��������| �������dkD��r|j��������������������������} | dk��r| || <���t��������|�������} |j������������������t��������j������������������d| ���������������| dkD��s��|r |j������������������|j ������������������������������������|j������������������|�����������y)a��Convert name to wire format, possibly compressing it. *file* is the file where the name is emitted (typically an io.BytesIO file). If ``None`` (the default), a ``bytes`` containing the wire name will be returned. *compress*, a ``dict``, is the compression table to use. If ``None`` (the default), names will not be compressed. Note that the compression code assumes that compression offset 0 is the start of *file*, and thus compression will not be correct if this is not the case. *origin* is a ``dns.name.Name`` or ``None``. If the name is relative and origin is not ``None``, then *origin* will be appended to it. *canonicalize*, a ``bool``, indicates whether the name should be canonicalized; that is, converted to a format suitable for digesting in hashes. Raises ``dns.name.NeedAbsoluteNameOrOrigin`` if the name is relative and no origin was provided. Returns a ``bytes`` or ``None``. Nr���r���i����z!Hi�?���!B)� bytearrayr�����appendr����rc���r����r0���rU����list�extendr����get�struct�pack�write�tell)rB���r����r����r����r�����outrL���r����r�����n�pos�valuer����r����s��� r���r����zName.to_wire���s������B��<��+�C������ � �3�u�:�&���5�;�;�=�(�C��5�L�C��%���#�#�%��>��);�);�)=�2�2�#�]�]�E��J�J�s�5�z�*�#��u�{�{�}�,���u����+����:������!��~�V�%7�%7�%9�.�.��$�+�+�&�F��M�M�$�v�}�}�-�.��[�[�F� ���E��V�A�B�Z� �A� ��F�A��#��l�l�1�o�����������K�K��e�,��� � �1� ������'�C��F�Q�J��)�)�+�C��f�}�&)������J��� � �6�;�;�t�Q�/�0��q�5�#�� � �5�;�;�=�1�� � �5�)�/��0�r���c������������������,�����t��������|�j�������������������������S�)zIThe length of the name (in labels). Returns an ``int``. r����ra���s��� r����__len__zName.__len__���s��������4�;�;��r���c������������������ �����|�j�������������������|���S�r���r����)rB����indexs��� r����__getitem__zName.__getitem__���s�������{�{�5�!�!r���c������������������$�����|�j������������������|�������S�r���)�concatenater����s��� r����__add__zName.__add__���s����������&�&r���c������������������$�����|�j������������������|�������S�r���)� relativizer����s��� r����__sub__zName.__sub__���s���������u�%�%r����depth)r���r���c����������������������t��������|�j�������������������������}|dk(��r|�t��������j������������������j������������������fS�||k(��rt��������j������������������j������������������|�fS�|dk��s||kD��rt��������d��������t ��������|�d|���������t ��������|�|�d��������fS�)a(��Split a name into a prefix and suffix names at the specified depth. *depth* is an ``int`` specifying the number of labels in the suffix Raises ``ValueError`` if *depth* was not >= 0 and <= the length of the name. Returns the tuple ``(prefix, suffix)``. r���z0depth must be >= 0 and <= the length of the nameN)r����r�����dns�name�emptyr����r���)rB���r��r����s��� r����splitz Name.split���s�������� �������A�:��#�(�(�.�.�)�)� �a�Z��H�H�N�N�D�)�)� �Q�Y�%�!�)��O�P�P��T�'�E�6�]�#�T�$��v�w�-�%8�9�9r���c������������������������|�j��������������������������rt��������|�������dkD��rt���������t��������|�j�������������������������}|j������������������t��������|j���������������������������������t ��������|�������S�)z�Return a new name which is the concatenation of self and other. Raises ``dns.name.AbsoluteConcatenation`` if the name is absolute and *other* is not the empty name. Returns a ``dns.name.Name``. r���)r����r����r7���r���r����r��r���)rB���r����r����s��� r���r��zName.concatenate��sM�����������#�e�*�q�.�'�'��d�k�k�"��� � �d�5�<�<�(�)��F�|�r���c������������������\�����|�)|�j������������������|�������rt��������|�dt��������|����������������S�|�S�)a���If the name is a subdomain of *origin*, return a new name which is the name relative to origin. Otherwise return the name. For example, relativizing ``www.dnspython.org.`` to origin ``dnspython.org.`` returns the name ``www``. Relativizing ``example.`` to origin ``dnspython.org.`` returns ``example.``. Returns a ``dns.name.Name``. N)r����r���r�����rB���r����s��� r���r��zName.relativize��s4���������$�"3�"3�F�";���^��F��|�,�-�-��Kr���c������������������H�����|�j��������������������������s|�j������������������|�������S�|�S�)a���If the name is a relative name, return a new name which is the concatenation of the name and origin. Otherwise return the name. For example, derelativizing ``www`` to origin ``dnspython.org.`` returns the name ``www.dnspython.org.``. Derelativizing ``example.`` to origin ``dnspython.org.`` returns ``example.``. Returns a ``dns.name.Name``. )r����r��r��s��� r����derelativizezName.derelativize ��s&����������!��#�#�F�+�+��Kr���r��c������������������R�����|r$|r|�j������������������|�������S�|�j������������������|�������S�|�S�)a8��Return a name with the relativity desired by the caller. If *origin* is ``None``, then the name is returned. Otherwise, if *relativize* is ``True`` the name is relativized, and if *relativize* is ``False`` the name is derelativized. Returns a ``dns.name.Name``. )r��r ��)rB���r����r��s��� r����choose_relativityzName.choose_relativity0��s/������������v�.�.��(�(��0�0��Kr���c������������������b�����|�t���������k(��s |�t��������k(��rt���������t��������|�j������������������dd��������S�)a��Return the parent of the name. For example, the parent of ``www.dnspython.org.`` is ``dnspython.org``. Raises ``dns.name.NoParent`` if the name is either the root name or the empty name, and thus has no parent. Returns a ``dns.name.Name``. r���N)�rootr��r9���r���r����ra���s��� r����parentzName.parentE��s+��������4�<�4�5�=��N��D�K�K���O�$�$r���� prefix_okc������������������&�����t��������t��������|�||�������S�)a���Return the maximal predecessor of *name* in the DNSSEC ordering in the zone whose origin is *origin*, or return the longest name under *origin* if the name is origin (i.e. wrap around to the longest name, which may still be *origin* due to length considerations. The relativity of the name is preserved, so if this name is relative then the method will return a relative name, and likewise if this name is absolute then the predecessor will be absolute. *prefix_ok* indicates if prefixing labels is allowed, and defaults to ``True``. Normally it is good to allow this, but if computing a maximal predecessor at a zone cut point then ``False`` must be specified. )�_handle_relativity_and_call�_absolute_predecessor�rB���r����r&��s��� r����predecessorzName.predecessorT��s�������+�!�4��� �� r���c������������������&�����t��������t��������|�||�������S�)a;��Return the minimal successor of *name* in the DNSSEC ordering in the zone whose origin is *origin*, or return *origin* if the successor cannot be computed due to name length limitations. Note that *origin* is returned in the "too long" cases because wrapping around to the origin is how NSEC records express "end of the zone". The relativity of the name is preserved, so if this name is relative then the method will return a relative name, and likewise if this name is absolute then the successor will be absolute. *prefix_ok* indicates if prefixing a new minimal label is allowed, and defaults to ``True``. Normally it is good to allow this, but if computing a minimal successor at a zone cut point then ``False`` must be specified. )r(���_absolute_successorr*��s��� r���� successorzName.successorf��s������ �+�+>��f�i�X�Xr���)rM���r���r}���)FNr���)NNNF)r����r���rM���r���)r����r���rM���r���)NT)T)6r���r���r���r���� __slots__r���r ���rU���rr���rA���r����r����r����r����rq���r����r�����intr����r���r ���r����r����r����r����r����r����r����r����r����r����r����r����r����r���r_���r����r����r����CompressTyper����r��r��r��r��r��r��r��r ��r"��r%��r+��r.��rH���rI���s���@r���r���r���f��s2��������� �I�&�x��e�S�j�(9�:��&�!�6�'�&�?�T��?�?���?� �#�� �J*���J*�E�,��S�2H�,I��J*�X�&���T����F���t���6���"�"�"�"�3�#��d���s���,�OS�;�"�;�8@��8K�;� �;�@�H�V�$4������.�#�+/�#'�"�U��s�m�U���<�(�U���� � U� ��U�� �%�� U�n ��� �"�'�&�:�3��:�5��#8��:�( �� �"�CG���v�&��;?�� ��* %� �&�� �T�� �V�� �$Y���Y�4��Y�6��Yr���r���rZ���r����r����c������������������x����t��������|�t���������������st��������d��������|�t��������|t���������������st��������d��������g�}d}d}d}d}|�t��������}|�dk(��rd}�|��r |�dv�rt��������dg�������S�|�D�]���}|rs|dk(��r)|j��������������������������rt ��������|�������}|d z ��}�+||z ��}d}�3|j��������������������������st���������|d z��}|t ��������|�������z ��}|d z ��}|dk(��s�gd}|t��������|�������z ��}�x|dv�r7t��������|�������dk(��rt���������|j������������������|j������������������|���������������d}��|dk(��rd }d}d}��||z ��}���|rt���������t��������|�������dkD��r!|j������������������|j������������������|���������������n|j������������������d��������t��������|�������dk(��s|d���dk7��r&|�$|j������������������t��������|j���������������������������������t��������|�������S�)a���Convert unicode text into a Name object. Labels are encoded in IDN ACE form according to rules specified by the IDNA codec. *text*, a ``str``, is the text to convert into a name. *origin*, a ``dns.name.Name``, specifies the origin to append to non-absolute names. The default is the root name. *idna_codec*, a ``dns.name.IDNACodec``, specifies the IDNA encoder/decoder. If ``None``, the default IDNA 2003 encoder/decoder is used. Returns a ``dns.name.Name``. z0input to from_unicode() must be a unicode string�origin must be a Name or NonerO���Fr���r����)r����u���。u���.u���。r���r���� ���r���rP���Tr����)rT���rr���r����r���� IDNA_2003�isdigitr0��r*���rW���r����r'���r����ri���r��r���r����) rZ���r����r����r����rL����escaping�edigitsr����r[���s ��� r����from_unicoder9�����s������(��d�C� ��K�L�L��N�j���6��8�9�9� �F��E��H��G� �E���� ��s�{�����6�6����;���A���a�<��y�y�{� #�A����1����� ��#(���9�9�;�'���R�K�E��S��V�O�E��q�L�G��!�|�#(����U��+���9�9��u�:��?�$�$�� � �j�/�/��6�7����d���������� ��9��:���O��u�:��>��M�M�*�+�+�E�2�3��M�M�#���F��q��F�2�J�#�-�6�3E�� � �d�6�=�=�)�*���<�r���c������������������2�����|�D�]��}t��������|�������dkD��s��y�y)NrR���FT)rY���)rZ���r[���s��� r���r����r�������s������ ���q�6�D�=�����r���c�����������������������t��������|�t���������������r)t��������|��������s t��������|�||�������S�|�j ������������������d�������}�t��������|�t ���������������st ��������d��������|�t��������|t���������������st ��������d��������g�}d}d}d}d}|�dk(��rd}�|��r%|�dk(��rt��������dg�������S�|�D�]���}t��������j������������������d |�������} |r~|dk(��r)| j��������������������������rt��������| �������}|d z ��}�A|| z ��}d}�I| j��������������������������st���������|dz��}|t��������| �������z ��}|d z ��}|dk(��s�}d}|t��������j������������������d |�������z ��}��| dk(��r(t��������|�������dk(��rt���������|j������������������|��������d}��| d k(��rd}d}d}��|| z ��}���|rt���������t��������|�������dkD��r|j������������������|��������n|j������������������d��������t��������|�������dk(��s|d���dk7��r&|�$|j!������������������t#��������|j$���������������������������������t��������|�������S�)a���Convert text into a Name object. *text*, a ``bytes`` or ``str``, is the text to convert into a name. *origin*, a ``dns.name.Name``, specifies the origin to append to non-absolute names. The default is the root name. *idna_codec*, a ``dns.name.IDNACodec``, specifies the IDNA encoder/decoder. If ``None``, the default IDNA 2003 encoder/decoder is used. Returns a ``dns.name.Name``. r����z%input to from_text() must be a stringr3��r���Fr�������@����.r����r���r4��r�������\Tr����)rT���rr���r����r9��ri���rU���r����r���r��r��r6��r0��r*���r����r'���r����r��r���r����) rZ���r����r����r����rL���r7��r8��r����r[����byte_s ��� r���� from_textr@�����s������&��$����D�!���f�j�9�9���{�{�7�#���d�E�"��@�A�A��N�j���6��8�9�9� �F��E��H��G� �E��t�|�����4�<����;���A��K�K��a�(�E���a�<��}�}�� #�E� ���1�������#(�� �=�=�?�'���R�K�E��S��Z�'�E��q�L�G��!�|�#(������T�5�!9�9���$���u�:��?�$�$�� � �e�$����%������������;��<���O��u�:��>��M�M�%� ��M�M�#���F��q��F�2�J�#�-�6�3E�� � �d�6�=�=�)�*���<�r����parserzdns.wire.Parserc�����������������������g�}|�j�������������������}|�j��������������������������5��|�j��������������������������}|dk7��r|dk��r!|j������������������|�j ������������������|���������������nC|dk\��r8|dz��dz��|�j��������������������������z���}||k\��rt ���������|}|�j ������������������|��������nt���������|�j��������������������������}|dk7��r�|j������������������d��������ddd��������t��������|�������S�#�1�sw�Y���t��������|�������S�xY�w)a7��Convert possibly compressed wire format into a Name. *parser* is a dns.wire.Parser. Raises ``dns.name.BadPointer`` if a compression pointer did not point backwards in the message. Raises ``dns.name.BadLabelType`` if an invalid label type was encountered. Returns a ``dns.name.Name`` r����@�������r��������r���N) �current�restore_furthest� get_uint8r����� get_bytesr,����seekr.���r���)rA��r�����biggest_pointer�countrF��s��� r����from_wire_parserrM��.��s���������F��n�n�O� � � � "�� � �"���q�j��r�z�� � �f�.�.�u�5�6��#�� �4�<�3�.��1A�1A�1C�C���o�-�$�$�")�����G�$�"�"��$�$�&�E���q�j�� � � �c��� #����<��� #����<��s����BC�4C�C+�messagerF��c�����������������������t��������|�t���������������st��������d��������t��������j������������������j������������������|�|�������}t ��������|�������}||j������������������|z ��fS�)a^��Convert possibly compressed wire format into a Name. *message* is a ``bytes`` containing an entire DNS message in DNS wire form. *current*, an ``int``, is the offset of the beginning of the name from the start of the message Raises ``dns.name.BadPointer`` if a compression pointer did not point backwards in the message. Raises ``dns.name.BadLabelType`` if an invalid label type was encountered. Returns a ``(dns.name.Name, int)`` tuple consisting of the name that was read and the number of bytes of the wire format message which were consumed reading it. z*input to from_wire() must be a byte string)rT���rU���r����r���wire�ParserrM��rF��)rN��rF��rA��r��s��� r���� from_wirerR��O��sL������&��g�u�%��E�F�F� �X�X�_�_�W�g� .�F��F�#�D��&�.�.�7�*�+�+r�������������r�����[c������������������2�����t��������j������������������d��|�d�������S�)Nc������������������$�����|�t��������|�������z���dz���S�)Nr���)r����)�vr����s��� r����<lambda>z_wire_length.<locals>.<lambda>u��s�������S��V��a�r���r���)� functools�reducer����s��� r����_wire_lengthr\��t��s���������7���C�Cr���c������������������:����dt��������|�j�������������������������z ��}g�}|dkD��r#|j������������������t��������dz����������|dz��}|dkD��r�#|dk\��r|j������������������t��������|dz ��z����������t ��������t��������|��������������}|j ������������������|�j��������������������������t��������|�������S�)Nr����rC��r����r���r���)r\��r����r�����_MAXIMAL_OCTETr����reversedr��r���)r���needed� new_labelss��� r����_pad_to_max_namerb��x��s������� �<����,� ,�F��J� �2�+����.�2�-�.��"�����2�+����{����.�F�Q�J�7�8���h�z�*�+�J����d�k�k�"�� ��r���c�����������������������t��������|��������}dt��������|�������z ��|z ��dz ��}|dk��r|�S�t��������d|z ��|�������}|�t��������|z��z���S�)Nr����r���r���r����)r����r\���minr^��)rL���� suffix_labels�length� remainingr`��s��� r����_pad_to_max_labelrh�����sP������ ��Z�F��l�=�1�1�F�:�Q�>�I��A�~��� ��f��i� (�F��>�F�*�*�*r���r��r&��c����������������������|�|k(��rt��������|��������S�|�d���}|t��������k(��r|�j��������������������������S�|d���}|�j������������������dd��}|t��������k(��r|d�d�g}nBt��������|�������}|d���}|t��������k(��rt��������}n|dz��}||d<���t��������|�������}t��������||�������g}|j������������������|��������t��������|�������}�|rt��������|��������S�|�S�)Nr���r����r���)rb���_MINIMAL_OCTETr%��r�����_MINIMAL_OCTET_VALUEr�����_LEFT_SQUARE_BRACKET_VALUE�_AT_SIGN_VALUErU���rh��r��r���) r��r����r&���least_significant_label�least_octetre��ra���octets�octets ��� r���r)��r)�����s���������v�~���%�%�"�1�g���.�0��{�{�}��)�"�-�K��K�K���O�M��*�*�-�c�r�2�3� ��2�3���r� ���.�.�"�E��Q�J�E���r� �"'��-��'�(?��O�P� ����m�$�� ��D����%�%��r���c����������������������|r �t���������j������������������|��������S�|�|k7��r�|�d���}t��������|�������dk��rH|t��������z���g}|j������������������|�j������������������dd���������� �t��������j������������������j������������������|�������S�t��������|�������}t��������t��������|�������dz ��dd�������D�]g��}||���}|t��������k(��r�|t��������k(��rt��������}n|dz ��}|||<���t��������|d�|dz�����������g}|j������������������|�j������������������dd����������t��������|�������c�S��|�j!��������������������������}�|�|k7��r��|S�#�t��������$�r�Y���w�xY�w#�t��������j������������������j������������������$�r�Y���w�xY�w)Nr���r����r���r����)�_SUCCESSOR_PREFIXr��r2���r����rj��r��r����r��r��r���r�����range�_MAXIMAL_OCTET_VALUErm��rl��rU���r%��)r��r����r&��rn��ra��rp��r����rq��s��� r���r-��r-�����sj������� �$�0�0��6�6���&�.�"&�q�'���&�'�"�,��2�N�B�C�J����d�k�k�!�"�o�.� ��x�x�}�}�Z�0�0� ��2�3����s�6�{�Q���B�/�A��1�I�E��,�,�����&�2���� ���F�1�I���w��Q���0�1�J����d�k�k�!�"�o�.��� �#�#�+�0�0��{�{�}��W��&�.�^��M��c��� �� ����8�8�'�'�� �� �s#����D��D/�� D,�+D,�/E�E�functionc������������������������|j��������������������������st���������|j���������������������������}|r|j������������������|�������}n|j������������������|�������st����������|�|||�������}|r|j������������������|�������}|S�r���)r����r0���r ��r����rK���r��)rv��r��r����r&���relative�result_names��� r���r(��r(�����su�����������&�&��#�#�%�%�H��� � ��(�� � � �v� &�#�#��4���3�K��!�,�,�V�4���r���)ar���r�����encodings.idnarx���rZ��r���typingr���r���r���r���r���r���r ���� dns._featuresr���dns.enum� dns.exception� dns.immutable�dns.wire� _features�haver ���r����r0��r1���enum�IntEnumr ���r ���� NAMERELN_NONEr!����NAMERELN_SUPERDOMAINr"����NAMERELN_SUBDOMAINr#����NAMERELN_EQUALr����NAMERELN_COMMONANCESTOR� exception�SyntaxErrorr'���r*���� FormErrorr,���r.����DNSExceptionr0���r2���r5���r7���r9���r;���r=���rK���rV���rX���rU���rr���r]���r_���rt���r����r�����IDNA_2003_Strictr5���IDNA_2008_Practical�IDNA_2008_UTS_46�IDNA_2008_Strict�IDNA_2008_Transitional� IDNA_2008r����r����� immutabler���r$��r��r9��rq���r����r@��rM��rR��rj��rY���rk��rs��r^��ru��rm��rl��r\��rb��rh��r)��r-��r(��r%���r���r����<module>r������s�����$�������� ��H��H��H������������=�=���f����N��N��F�C�K� ���3�8�8�#�#���6��!�!� �#�/�/���!�+�+����#�#��&�5�5��� ����*�*�� �C�� � �)�)��C�H����(�(��H�=�3�=�=�*�*��=�D�s�}�}�9�9��D� +�#�-�-�)�)��+�+�3�=�=�,�,��+�+�C�M�M�6�6��+� �s�}�}�)�)��� ����+�+��� *�C�M�M�.�.�� *�Y�C�M�M�6�6��Y����� ��U�5�#�:�&���3���:$��$�0!2�I��!2�HH2�I��H2�V�$�E�*��� ��&���� �#�D�%��u�=��� ��u�e�U�;��� ���u�d�;���&�t�T�5�%�@���� ��U�5�#�:�.���4���< �E�%��*�$5�� �%�� �������OY��OY���OY�f��S�E�{��� �R����)-�PT�J� �J���~�J�:B�9�:M�J� �J�Z�s���t����"�&*�T� ��s� � �T��T�N�T����#�T�� � T�t�.���4���B,�u��,�s��,�u�T�3�Y�/?��,�8����>�*����.�)�*������>�*����S��� ��X���D� � +�����d���t������B;�d��;�D��;�T��;�d��;�|���d�D�)�4�/�0�� ��� ���� � � �r���