Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3
¢báW•: ã @ sä d Z ddlmZ ddlZddlZddlZddlZddlZddl Zddl
ZddlZddlm
Z
mZmZ dZefdd„ZdZefd d
„ZedƒZdd
„ Zdd„ ZG dd„ deƒZG dd„ deƒZi ZdZdd„ Zddd„Zddd„ZdS )aæ DNS rdata.
@var _rdata_modules: A dictionary mapping a (rdclass, rdtype) tuple to
the module which implements that type.
@type _rdata_modules: dict
@var _module_prefix: The prefix to use when forming modules names. The
default is 'dns.rdtypes'. Changing this value will break the library.
@type _module_prefix: string
@var _hex_chunk: At most this many octets that will be represented in each
chunk of hexstring that _hexify() produces before whitespace occurs.
@type _hex_chunk: inté )ÚBytesIONé )ÚxrangeÚstring_typesÚ text_typeé c s4 t j| ƒ‰dj‡ ‡fdd„tdtˆƒˆ ƒD ƒƒjƒ S )a Convert a binary string into its hex encoding, broken up into chunks
of I{chunksize} characters separated by a space.
@param data: the binary string
@type data: string
@param chunksize: the chunk size. Default is L{dns.rdata._hex_chunksize}
@rtype: string
ó c s g | ]}ˆ||ˆ … ‘qS © r )Ú.0Úi)Ú chunksizeÚliner ú/usr/lib/python3.6/rdata.pyú
6 s z_hexify..r )ÚbinasciiZhexlifyÚjoinÚrangeÚlenÚdecode)Údatar r )r r
r Ú_hexify+ s
r c s4 t j| ƒ‰dj‡ ‡fdd„tdtˆƒˆ ƒD ƒƒjƒ S )a$ Convert a binary string into its base64 encoding, broken up into chunks
of I{chunksize} characters separated by a space.
@param data: the binary string
@type data: string
@param chunksize: the chunk size. Default is
L{dns.rdata._base64_chunksize}
@rtype: string
r c s g | ]}ˆ||ˆ … ‘qS r r )r
r )r r
r r r I s z_base64ify..r )Úbase64Z b64encoder r r r )r r r )r r
r Ú
_base64ify= s
r s "\c C s~ t | tƒr| jƒ } t | tƒs$t| ƒ} d}xP| D ]H}|tkrL|dt|ƒ 7 }q.|dkrj|dk rj|t|ƒ7 }q.|d| 7 }q.W |S )zªEscape the characters in a quoted string which need it.
@param qstring: the string
@type qstring: string
@returns: the escaped string
@rtype: string
Ú ú\r é z\%03d)Ú
isinstancer ÚencodeÚ bytearrayÚ __escapedÚchr)ZqstringÚtextÚcr r r Ú _escapifyO s
r# c C sF x8t t| ƒd ddƒD ] }| | dkr| d|d … S qW | dd… S )zñDetermine the index of greatest byte that isn't all zeros, and
return the bitmap that contains all the bytes less than that index.
@param what: a string of octets representing a bitmap.
@type what: string
@rtype: string
r r éÿÿÿÿr$ )r r )Zwhatr r r r Ú_truncate_bitmaph s r% c @ sÌ e Zd ZdZddgZdd„ Zdd„ Zdd „ Zd.dd
„Zd/dd„Z d0dd„Z
dd„ Zdd„ Zdd„ Z
dd„ Zdd„ Zdd„ Zdd„ Zd d!„ Zd"d#„ Zd$d%„ Zd&d'„ Zed1d(d)„ƒZed2d*d+„ƒZd3d,d-„Zd
S )4ÚRdataz(Base class for all DNS rdata types.
ÚrdclassÚrdtypec C s || _ || _dS )z Initialize an rdata.
@param rdclass: The rdata class
@type rdclass: int
@param rdtype: The rdata type
@type rdtype: int
N)r' r( )Úselfr' r( r r r Ú__init__~ s zRdata.__init__c C s t jjS )a_ DNS SIG/RRSIG rdatas apply to a specific type; this type is
returned by the covers() function. If the rdata type is not
SIG or RRSIG, dns.rdatatype.NONE is returned. This is useful when
creating rdatasets, allowing the rdataset to contain only RRSIGs
of a particular type, e.g. RRSIG(NS).
@rtype: int
)ÚdnsÚ rdatatypeÚNONE)r) r r r Úcovers‰ s zRdata.coversc C s | j ƒ d> | jB S )zÉReturn a 32-bit type value, the least significant 16 bits of
which are the ordinary DNS type, and the upper 16 bits of which are
the "covered" type, if any.
@rtype: int
é )r. r( )r) r r r Úextended_rdatatype” s zRdata.extended_rdatatypeNTc K s t ‚dS )z@Convert an rdata to text format.
@rtype: string
N)ÚNotImplementedError)r) ÚoriginÚ
relativizeÚkwr r r Úto_text� s z
Rdata.to_textc C s t ‚dS )z@Convert an rdata to wire format.
@rtype: string
N)r1 )r) ÚfileÚcompressr2 r r r Úto_wire£ s z
Rdata.to_wirec C s t ƒ }| j|d|ƒ |jƒ S )zlConvert rdata to a format suitable for digesting in hashes. This
is also the DNSSEC canonical form.N)r r8 Úgetvalue)r) r2 Úfr r r Ú
to_digestableª s zRdata.to_digestablec C s t jj| j| j| jƒ ƒ dS )zÜCheck that the current contents of the rdata's fields are
valid. If you change an rdata by assigning to its fields,
it is a good idea to call validate() when you are done making
changes.
N)r+ ÚrdataÚ from_textr' r( r5 )r) r r r Úvalidate± s zRdata.validatec C sf | j ƒ }|tjjkrd}ndtjj|ƒ d }dtjj| jƒ d tjj| jƒ | d t| ƒ d S )Nr ú(ú)z) r. r+ r, r- r5 Ú
rdataclassr' r( Ústr)r) r. Zctextr r r Ú__repr__¹ s
zRdata.__repr__c C s | j ƒ S )N)r5 )r) r r r Ú__str__Ã s z
Rdata.__str__c C s8 | j tjjƒ}|j tjjƒ}||kr(dS ||kr4dS dS )z½Compare an rdata with another rdata of the same rdtype and
rdclass. Return < 0 if self < other in the DNSSEC ordering,
0 if self == other, and > 0 if self > other.
r r r$ )r; r+ ÚnameÚroot)r) ÚotherZourZtheirr r r Ú_cmpÆ s z
Rdata._cmpc C s8 t |tƒsdS | j|jks&| j|jkr*dS | j|ƒdkS )NFr )r r&