File: //usr/lib/python3/dist-packages/twisted/names/__pycache__/dns.cpython-38.pyc
U
��W[�d � \ @ sB d Z ddlmZmZ ddddddd d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^g\Zdd_lZdd_lZdd_lZdd_lZdd`l m
Z
ddalmZ ej
Z
ddblmZmZmZ ddclmZmZ dddlmZ ddelmZmZ ddflmZ ddglmZ ddhlmZmZm Z m!Z!m"Z" e�r�didj� Z#dkdl� Z$dmdn� Z%ne&Z#e' Z$Z%dodp� Z(dqZ)e*drds�\Z+Z,Z-Z.Z/Z0Z1Z2Z3Z4Z5Z6Z7Z8Z9Z:Z;Z<dtZ=duZ>dvZ?dwZ@dxZAdyZBdzZCe+de,de-de.de/d e0de1de2de3de4de5de6de7de8de9de:de;de<de=de>de?de@deAd
eBdeCdiZDe*d{d|�\ZEZFZGZHZIeEd'eFd&eGd
eHdeId%iZJeKd}d~� e
eD�L� eJ�L� �D ��ZMe*drd�\ZNZOZPZQd�ZReNd$eOd"ePd!eQd#eRd iZSeKd�d~� eS�L� D ��ZTe*d��\ZUZVZWd�ZXdZYe*d��\ZZZ[Z\Z]Z^Z_d�Z`G d�d� de�Zadd�lbmcZcmdZd dd�lbmeZe d�d�� Zfd�d�� Zgd�d�� Zhd�d�� ZiG d�d� de�Zjeej�G d�dL� dLek��Zleej�G d�dN� dN��Zme eej�G d�dO� dO���Zneej�G d�d�� d�ejoejpek��Zqeej�G d�d�� d�ejoejpek��Zreej�G d�dP� dPejp��Zseejea�G d�dQ� dQejoejp��ZtG d�d=� d=et�ZuG d�d6� d6et�ZvG d�d7� d7et�ZwG d�d2� d2et�ZxG d�d5� d5et�ZyG d�d8� d8et�ZzG d�d:� d:et�Z{G d�d?� d?et�Z|G d�d3� d3et�Z}eejea�G d�d.� d.ejp��Z~eejea�G d�dA� dAejpejo��Zeejea�G d�d>� d>ejoejp��Z�eejea�G d�dE� dEejpejo��Z�eejea�G d�d0� d0ejpejo��Z�eejea�G d�d/� d/ejoejp��Z�eejea�G d�dC� dCejpejo��Z�eejea�G d�d<� d<ejpejo��Z�eejea�G d�d1� d1ejoejp��Z�eejea�G d�d@� d@ejpejo��Z�eejea�G d�d4� d4ejoejp��Z�eejea�G d�d9� d9ejpejo��Z�eejea�G d�d;� d;ejoejp��Z�eejea�G d�dD� dDejpejo��Z�eejea�G d�dF� dFejpejoek��Z�G d�dB� dBe��Z�d�d�� Z�d�d�� Z�d�d�d��Z�G d�dM� dMejp�Z�G d�d�� d�ejpek�Z�G d�dS� dSek�Z�G d�dR� dRe�ej��Z�G d�dT� dTe�ej��Z�d_S )�zU
DNS protocol implementation.
Future Plans:
- Get rid of some toplevels, maybe.
� )�division�absolute_import�
IEncodable�IRecord�A�A6�AAAA�AFSDB�CNAME�DNAME�HINFO�MAILA�MAILB�MB�MD�MF�MG�MINFO�MR�MX�NAPTR�NS�NULL�OPT�PTR�RP�SOA�SPF�SRV�TXT�WKS�ANY�CH�CS�HS�IN�ALL_RECORDS�AXFR�IXFR�EFORMAT�ENAME�ENOTIMP�EREFUSED�ESERVER�EBADVERSION�Record_A� Record_A6�Record_AAAA�Record_AFSDB�Record_CNAME�Record_DNAME�Record_HINFO� Record_MB� Record_MD� Record_MF� Record_MG�Record_MINFO� Record_MR� Record_MX�Record_NAPTR� Record_NS�Record_NULL�
Record_PTR� Record_RP�
Record_SOA�
Record_SPF�
Record_SRV�
Record_TXT�
Record_WKS�
UnknownRecord�
QUERY_CLASSES�QUERY_TYPES�REV_CLASSES� REV_TYPES�EXT_QUERIES�Charstr�Message�Name�Query�RRHeader�SimpleRecord�DNSDatagramProtocol�DNSMixin�DNSProtocol�OK�
OP_INVERSE� OP_NOTIFY�OP_QUERY� OP_STATUS� OP_UPDATE�PORT�AuthoritativeDomainError�DNSQueryTimeoutError�DomainErrorN)�chain)�BytesIO)�implementer� Interface� Attribute)�protocol�defer)�CannotListenError)�log�failure)�util)� randbytes)�_PY3�unicode�
comparable�cmp�nativeStringc C s
t | g�S )z�
Construct a bytes object representing a single byte with the given
ordinal value.
@type ordinal: L{int}
@rtype: L{bytes}
��bytes)Zordinal� rs �3/usr/lib/python3/dist-packages/twisted/names/dns.py�
_ord2bytesC s ru c C s t | �dd� S )z�
Represent a mostly textful bytes object in a way suitable for presentation
to an end user.
@param bytes: The bytes to represent.
@rtype: L{str}
� N)�reprrq rs rs rt �
_nicebytesN s rx c C s dd� dd� | D ��f S )z�
Represent a list of mostly textful bytes objects in a way suitable for
presentation to an end user.
@param list: The list of bytes to represent.
@rtype: L{str}
z[%s]z, c S s g | ]}t |��qS rs )rx )�.0�brs rs rt �
<listcomp>b s z"_nicebyteslist.<locals>.<listcomp>)�join)�listrs rs rt �_nicebyteslistY s �r~ c C s t �dtjddd��d S )zm
Wrapper around L{twisted.python.randbytes.RandomFactory.secureRandom} to return
2 random chars.
�H� T)Zfallbackr )�struct�unpackrk ZsecureRandomrs rs rs rt �randomSourcei s r� �5 rv � � �! �# �&