OwlCyberSecurity - MANAGER
Edit File: rrset.cpython-36.opt-1.pyc
3 �$�Wk������������������@���sl���d�Z�ddlZddlZddlZddlZddlmZ�G�dd��dejj �Z ddd�Zd d ��Zddd�Z d d��ZdS�)z)DNS RRsets (an RRset is a named rdataset)�����N����)�string_typesc�������������������s����e�Zd�ZdZddgZejjdf��fdd� Z��fdd�Z d d ��Z dd��Z��fd d�Zd��fdd� Z d��fdd� Zd��fdd� Zdd��Z���ZS�)�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�deletingNc����������������s$���t�t|��j|||��||�_||�_dS�)zCreate a new RRset.N)�superr����__init__r���r���)�selfr����rdclass�rdtype�coversr���)� __class__���/usr/lib/python3.6/rrset.pyr���'���s����zRRset.__init__c����������������s"���t�t|��j��}|�j|_|�j|_|S�)N)r���r����_cloner���r���)r ����obj)r ���r���r���r���/���s����zRRset._clonec�������������C���s����|�j�dkrd}ndtjj|�j���d�}|�jd�k rDdtjj|�j��}nd}dt|�j��d�tjj|�j��d�tjj|�j ��|�|�d�S�) Nr������(�)z delete=z<DNS � z RRset>) r����dns� rdatatype�to_textr���� rdataclass�strr���r ���r���)r ���ZctextZdtextr���r���r����__repr__5���s���� zRRset.__repr__c�������������C���s���|�j���S�)N)r���)r ���r���r���r����__str__B���s����z RRset.__str__c����������������s.���t�|t�sdS�|�j|jkrdS�tt|��j|�S�)zcTwo RRsets are equal if they have the same name and the same rdataset @rtype: boolF)� isinstancer���r���r����__eq__)r ����other)r ���r���r���r���E���s ���� zRRset.__eq__c����������������s4���t�t|��j|||�sdS�|�j|ks,|�j|kr0dS�dS�)zaReturns True if this rrset matches the specified class, type, covers, and deletion state.FT)r���r����matchr���r���)r ���r���r ���r���r���r���)r ���r���r���r ���P���s ����zRRset.matchTc����������������s���t�t|��j|�j|||�jf|�S�)a���Convert the RRset into DNS master file format. @see: L{dns.name.Name.choose_relativity} for more information on how I{origin} and I{relativize} determine the way names are emitted. Any additional keyword arguments are passed on to the rdata to_text() method. @param origin: The origin for relative names, or None. @type origin: dns.name.Name object @param relativize: True if names should names be relativized @type relativize: bool)r���r���r���r���r���)r ����originZ relativize�kw)r ���r���r���r���Z���s����z RRset.to_textc����������������s ���t�t|��j|�j||||�jf|�S�)z!Convert the RRset to wire format.)r���r����to_wirer���r���)r ����file�compressr!���r"���)r ���r���r���r#���l���s����z RRset.to_wirec�������������C���s���t�jj|�jt|���S�)zYConvert an RRset into an Rdataset. @rtype: dns.rdataset.Rdataset object )r����rdataset�from_rdata_list�ttl�list)r ���r���r���r����to_rdatasetr���s����zRRset.to_rdataset)N)NT)NN)�__name__� __module__�__qualname__�__doc__� __slots__r���r���ZNONEr���r���r���r���r���r ���r���r#���r*���� __classcell__r���r���)r ���r���r������s��� r���c������� ������C���s����t�|�t�rtjj|�d|d�}�t�|t�r2tjj|�}t�|t�rHtjj|�}t|�||�}|j|��x*|D�]"}tj j|j |j|�}|j|��qdW�|S�)z�Create an RRset with the specified name, TTL, class, and type, and with the specified list of rdatas in text format. @rtype: dns.rrset.RRset object N)� idna_codec) r���r���r���r���� from_textr���r���r���� update_ttlZrdatar ���r����add) r���r(���r ���r����text_rdatasr1����r�t�rdr���r���r����from_text_listz���s���� r9���c�������������G���s���t�|�||||�S�)z�Create an RRset with the specified name, TTL, class, and type and with the specified rdatas in text format. @rtype: dns.rrset.RRset object )r9���)r���r(���r ���r���r5���r���r���r���r2�������s����r2���c�������������C���sr���t�|�t�rtjj|�d|d�}�t|�dkr0td��d}x8|D�]0}|dkr`t|�|j|j �}|j |��|j|��q:W�|S�)z�Create an RRset with the specified name and TTL, and with the specified list of rdata objects. @rtype: dns.rrset.RRset object N)r1���r���zrdata list must not be empty)r���r���r���r���r2����len� ValueErrorr���r ���r���r3���r4���)r���r(����rdatasr1���r6���r8���r���r���r���r'�������s���� r'���c�������������G���s���t�|�||�S�)z�Create an RRset with the specified name and TTL, and with the specified rdata objects. @rtype: dns.rrset.RRset object )r'���)r���r(���r<���r���r���r���� from_rdata����s����r=���)N)N)r.���Zdns.namer���Zdns.rdatasetZdns.rdataclassZdns.rendererZ_compatr���r&���ZRdatasetr���r9���r2���r'���r=���r���r���r���r����<module>���s���a