Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips
System : Linux server1.richineiserver.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : fdshops ( 1003)
PHP Version : 8.2.21
Disable Function : NONE
Directory :  /lib/python2.7/site-packages/dns/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python2.7/site-packages/dns/name.pyo
�
m!|Uc@s/dZddlZddlZddlZddlZejdkrTddlZnddlZ	ddl
Z	dZdZdZ
dZdZd	e	jjfd
��YZde	jjfd��YZd
e	jjfd��YZde	jjfd��YZde	jjfd��YZde	jjfd��YZde	jjfd��YZde	jjfd��YZde	jjfd��YZied6ed6ed6ed6ed6ed 6ed!6ed"6Zed#�Z d$�Z!d%e"fd&��YZ#e#d'g�Z$e#g�Z%e$d(�Z&e$d)�Z'd*�Z(dS(+s�DNS Names.

@var root: The DNS root name.
@type root: dns.name.Name object
@var empty: The empty DNS name.
@type empty: dns.name.Name object
i����Niiiiiit
EmptyLabelcBseZdZRS(sA DNS label is empty.(t__name__t
__module__t__doc__(((s,/usr/lib/python2.7/site-packages/dns/name.pyR)st	BadEscapecBseZdZRS(s8An escaped code in a text format of DNS name is invalid.(RRR(((s,/usr/lib/python2.7/site-packages/dns/name.pyR,st
BadPointercBseZdZRS(s=A DNS compression pointer points forward instead of backward.(RRR(((s,/usr/lib/python2.7/site-packages/dns/name.pyR/stBadLabelTypecBseZdZRS(s2The label type in DNS name wire format is unknown.(RRR(((s,/usr/lib/python2.7/site-packages/dns/name.pyR2stNeedAbsoluteNameOrOrigincBseZdZRS(svAn attempt was made to convert a non-absolute name to
    wire when there was also a non-absolute (or missing) origin.(RRR(((s,/usr/lib/python2.7/site-packages/dns/name.pyR5stNameTooLongcBseZdZRS(s A DNS name is > 255 octets long.(RRR(((s,/usr/lib/python2.7/site-packages/dns/name.pyR9stLabelTooLongcBseZdZRS(s A DNS label is > 63 octets long.(RRR(((s,/usr/lib/python2.7/site-packages/dns/name.pyR	<stAbsoluteConcatenationcBseZdZRS(s]An attempt was made to append anything other than the
    empty name to an absolute DNS name.(RRR(((s,/usr/lib/python2.7/site-packages/dns/name.pyR
?stNoParentcBseZdZRS(sMAn attempt was made to get the parent of the root name
    or the empty name.(RRR(((s,/usr/lib/python2.7/site-packages/dns/name.pyRCst"t(t)t.t;s\t@t$cCs�d}x�|D]�}|tkr0|d|7}q
t|�dkrat|�dkra||7}q
|r�t|�dkr�||7}q
|dt|�7}q
W|S(s�Escape the characters in label which need it.
    @param unicode_mode: escapify only special and whitespace (<= 0x20)
    characters
    @returns: the escaped string
    @rtype: stringts\i is\%03d(t_escapedtord(tlabeltunicode_modettexttc((s,/usr/lib/python2.7/site-packages/dns/name.pyt	_escapifyRs
$

cCs�t|�}d}d}d}xh|D]`}t|�}||d7}|dkrZt�n|dkr{|dkr{|}n|d7}q%W|dkr�t�n|dkr�||dkr�t�ndS(siCheck for empty labels in the middle of a label sequence,
    labels that are too long, and for too many labels.
    @raises NameTooLong: the name as a whole is too long
    @raises LabelTooLong: an individual label is too long
    @raises EmptyLabel: a label is empty (i.e. the root label) and appears
    in a position other than the end of the label sequenceii����ii?Ri�N(tlenR	RR(tlabelstlttotaltitjRtll((s,/usr/lib/python2.7/site-packages/dns/name.pyt_validate_labelses 
			tNamecBsseZdZdgZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zed�Zed�Zd&d�Zd&d&d&d�Zd�Zd�Z d�Z!d�Z"d�Z#d �Z$d!�Z%d"�Z&d#�Z'd&e(d$�Z)d%�Z*RS('s�A DNS name.

    The dns.name.Name class represents a DNS name as a tuple of labels.
    Instances of the class are immutable.

    @ivar labels: The tuple of labels in the name. Each label is a string of
    up to 63 octets.RcCs0tt|�jdt|��t|j�dS(s�Initialize a domain name from a list of labels.
        @param labels: the labels
        @type labels: any iterable whose values are strings
        RN(tsuperR#t__setattr__ttupleR"R(tselfR((s,/usr/lib/python2.7/site-packages/dns/name.pyt__init__�scCstd��dS(Ns+object doesn't support attribute assignment(t	TypeError(R'tnametvalue((s,/usr/lib/python2.7/site-packages/dns/name.pyR%�scCs
t|j�S(N(R#R(R'((s,/usr/lib/python2.7/site-packages/dns/name.pyt__copy__�scCsttj|j|��S(N(R#tcopytdeepcopyR(R'tmemo((s,/usr/lib/python2.7/site-packages/dns/name.pyt__deepcopy__�scCsi|jd6S(NR(R(R'((s,/usr/lib/python2.7/site-packages/dns/name.pyt__getstate__�scCs.tt|�jd|d�t|j�dS(NR(R$R#R%R"R(R'tstate((s,/usr/lib/python2.7/site-packages/dns/name.pyt__setstate__�scCs&t|j�dko%|jddkS(sXIs the most significant label of this name the root label?
        @rtype: bool
        ii����R(RR(R'((s,/usr/lib/python2.7/site-packages/dns/name.pytis_absolute�scCs&t|j�dko%|jddkS(s\Is this name wild?  (I.e. Is the least significant label '*'?)
        @rtype: bool
        it*(RR(R'((s,/usr/lib/python2.7/site-packages/dns/name.pytis_wild�scCsZd}x@|jD]5}x,|D]$}||d>t|j��7}qWqWt|tj�S(sHReturn a case-insensitive hash of the name.
        @rtype: int
        li(RRtlowertinttsystmaxint(R'thRR((s,/usr/lib/python2.7/site-packages/dns/name.pyt__hash__�s

&c
Cs�|j�}|j�}||krG|r7tddfStddfSnt|j�}t|j�}||}|dkr�|}n|}d}d}	t}
x�|dkrd|d8}|d8}|d8}|j|j�}|j|j�}||kr#d}|	dkrt}
n|
||	fS||krWd}|	dkrJt}
n|
||	fS|	d7}	q�W|}|dkr�t}
n|dkr�t}
nt}
|
||	fS(s�Compare two names, returning a 3-tuple (relation, order, nlabels).

        I{relation} describes the relation ship beween the names,
        and is one of: dns.name.NAMERELN_NONE,
        dns.name.NAMERELN_SUPERDOMAIN, dns.name.NAMERELN_SUBDOMAIN,
        dns.name.NAMERELN_EQUAL, or dns.name.NAMERELN_COMMONANCESTOR

        I{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.

        I{nlabels} is the number of significant labels that the two names
        have in common.
        iii����(	R4t
NAMERELN_NONERRR7tNAMERELN_COMMONANCESTORtNAMERELN_SUPERDOMAINtNAMERELN_SUBDOMAINtNAMERELN_EQUAL(
R'tothertsabstoabstl1tl2tldiffRtordertnlabelstnamerelntlabel1tlabel2((s,/usr/lib/python2.7/site-packages/dns/name.pytfullcompare�sN

	


	
	
		cCs8|j|�\}}}|tks0|tkr4tStS(soIs self a subdomain of other?

        The notion of subdomain includes equality.
        @rtype: bool
        (RMR@RAtTruetFalse(R'RBtnrtotnl((s,/usr/lib/python2.7/site-packages/dns/name.pytis_subdomain�scCs8|j|�\}}}|tks0|tkr4tStS(sqIs self a superdomain of other?

        The notion of subdomain includes equality.
        @rtype: bool
        (RMR?RARNRO(R'RBRPRQRR((s,/usr/lib/python2.7/site-packages/dns/name.pytis_superdomainscCs&tg|jD]}|j�^q
�S(s�Return a name which is equal to the current name, but is in
        DNSSEC canonical form.
        @rtype: dns.name.Name object
        (R#RR7(R'tx((s,/usr/lib/python2.7/site-packages/dns/name.pytcanonicalizescCs.t|t�r&|j|�ddkStSdS(Nii(t
isinstanceR#RMRO(R'RB((s,/usr/lib/python2.7/site-packages/dns/name.pyt__eq__scCs.t|t�r&|j|�ddkStSdS(Nii(RWR#RMRN(R'RB((s,/usr/lib/python2.7/site-packages/dns/name.pyt__ne__scCs.t|t�r&|j|�ddkStSdS(Nii(RWR#RMtNotImplemented(R'RB((s,/usr/lib/python2.7/site-packages/dns/name.pyt__lt__$scCs.t|t�r&|j|�ddkStSdS(Nii(RWR#RMRZ(R'RB((s,/usr/lib/python2.7/site-packages/dns/name.pyt__le__*scCs.t|t�r&|j|�ddkStSdS(Nii(RWR#RMRZ(R'RB((s,/usr/lib/python2.7/site-packages/dns/name.pyt__ge__0scCs.t|t�r&|j|�ddkStSdS(Nii(RWR#RMRZ(R'RB((s,/usr/lib/python2.7/site-packages/dns/name.pyt__gt__6scCsd|j�dS(Ns
<DNS name t>(t__str__(R'((s,/usr/lib/python2.7/site-packages/dns/name.pyt__repr__<scCs
|jt�S(N(tto_textRO(R'((s,/usr/lib/python2.7/site-packages/dns/name.pyR`?scCs�t|j�dkrdSt|j�dkrE|jddkrEdS|rg|j�rg|jd }n	|j}djtt|��}|S(s�Convert name to text format.
        @param omit_final_dot: If True, don't emit the final dot (denoting the
        root label) for absolute names.  The default is False.
        @rtype: string
        iRiRRi����(RRR4tjointmapR(R'tomit_final_dotRts((s,/usr/lib/python2.7/site-packages/dns/name.pyRbBs(	cCs�t|j�dkrdSt|j�dkrE|jddkrEdS|rg|j�rg|jd }n	|j}djg|D]!}ttjj|�t�^q}�}|S(sConvert name to Unicode text format.

        IDN ACE lables are converted to Unicode.

        @param omit_final_dot: If True, don't emit the final dot (denoting the
        root label) for absolute names.  The default is False.
        @rtype: string
        iu@iRu.i����(	RRR4RcRt	encodingstidnat	ToUnicodeRN(R'ReRRURf((s,/usr/lib/python2.7/site-packages/dns/name.pyt
to_unicodeTs
(	7cCs�|j�sV|dks%|j�r.t�nt|j�}|jt|j��n	|j}g|D](}dtt|��|j�f^qf}dj	|�S(sConvert name to a format suitable for digesting in hashes.

        The name is canonicalized and converted to uncompressed wire format.

        @param origin: If the name is relative and origin is not None, then
        origin will be appended to it.
        @type origin: dns.name.Name object
        @raises NeedAbsoluteNameOrOrigin: All names in wire format are
        absolute.  If self is a relative name, then an origin must be supplied;
        if it is missing, then this exception is raised
        @rtype: string
        s%s%sRN(
R4tNoneRtlistRtextendtchrRR7Rc(R'toriginRRUtdlabels((s,/usr/lib/python2.7/site-packages/dns/name.pyt
to_digestableis		5c
Cs�|dkr!tj�}t}nt}|j�s}|dksL|j�rUt�nt|j�}|j	t|j��n	|j}d}x|D]�}t
||�}|d7}|dk	r�|j|�}	nd}	|	dk	rd|	}
tj
d|
�}|j|�Pq�|dk	rVt|�dkrV|j�}	|	dkrV|	||<qVnt|�}|jt|��|dkr�|j|�q�q�W|r�|j�SdS(s�Convert name to wire format, possibly compressing it.

        @param file: the file where the name is emitted (typically
        a cStringIO file).  If None, a string containing the wire name
        will be returned.
        @type file: file or None
        @param compress: The compression table.  If None (the default) names
        will not be compressed.
        @type compress: dict
        @param origin: If the name is relative and origin is not None, then
        origin will be appended to it.
        @type origin: dns.name.Name object
        @raises NeedAbsoluteNameOrOrigin: All names in wire format are
        absolute.  If self is a relative name, then an origin must be supplied;
        if it is missing, then this exception is raised
        iii�s!Hi�?N(Rkt	cStringIOtStringIORNROR4RRlRRmR#tgettstructtpacktwriteRttellRntgetvalue(
R'tfiletcompressRotwant_returnRRRtntposR+RfR((s,/usr/lib/python2.7/site-packages/dns/name.pytto_wire�s@			



cCs
t|j�S(s@The length of the name (in labels).
        @rtype: int
        (RR(R'((s,/usr/lib/python2.7/site-packages/dns/name.pyt__len__�scCs|j|S(N(R(R'tindex((s,/usr/lib/python2.7/site-packages/dns/name.pyt__getitem__�scCs|j||!S(N(R(R'tstarttstop((s,/usr/lib/python2.7/site-packages/dns/name.pyt__getslice__�scCs
|j|�S(N(tconcatenate(R'RB((s,/usr/lib/python2.7/site-packages/dns/name.pyt__add__�scCs
|j|�S(N(t
relativize(R'RB((s,/usr/lib/python2.7/site-packages/dns/name.pyt__sub__�scCs�t|j�}|dkr+|tjjfS||krGtjj|fS|dks_||krntd��nt|| �t||�fS(s(Split a name into a prefix and suffix at depth.

        @param depth: the number of labels in the suffix
        @type depth: int
        @raises ValueError: the depth was not >= 0 and <= the length of the
        name.
        @returns: the tuple (prefix, suffix)
        @rtype: tuple
        is0depth must be >= 0 and <= the length of the name(RRtdnsR*temptyt
ValueErrorR#(R'tdepthR((s,/usr/lib/python2.7/site-packages/dns/name.pytsplit�scCsV|j�r't|�dkr't�nt|j�}|jt|j��t|�S(s�Return a new name which is the concatenation of self and other.
        @rtype: dns.name.Name object
        @raises AbsoluteConcatenation: self is absolute and other is
        not the empty name
        i(R4RR
RlRRmR#(R'RBR((s,/usr/lib/python2.7/site-packages/dns/name.pyR��s
	cCs8|dk	r0|j|�r0t|t|� �S|SdS(s�If self is a subdomain of origin, return a new name which is self
        relative to origin.  Otherwise return self.
        @rtype: dns.name.Name object
        N(RkRSR#R(R'Ro((s,/usr/lib/python2.7/site-packages/dns/name.pyR��scCs!|j�s|j|�S|SdS(s�If self is a relative name, return a new name which is the
        concatenation of self and origin.  Otherwise return self.
        @rtype: dns.name.Name object
        N(R4R�(R'Ro((s,/usr/lib/python2.7/site-packages/dns/name.pytderelativize�s
cCs1|r)|r|j|�S|j|�Sn|SdS(sReturn a name with the relativity desired by the caller.  If
        origin is None, then self is returned.  Otherwise, if
        relativize is true the name is relativized, and if relativize is
        false the name is derelativized.
        @rtype: dns.name.Name object
        N(R�R�(R'RoR�((s,/usr/lib/python2.7/site-packages/dns/name.pytchoose_relativitys

cCs2|tks|tkr!t�nt|jd�S(s�Return the parent of the name.
        @rtype: dns.name.Name object
        @raises NoParent: the name is either the root name or the empty name,
        and thus has no parent.
        i(trootR�RR#R(R'((s,/usr/lib/python2.7/site-packages/dns/name.pytparents	N(+RRRt	__slots__R(R%R,R0R1R3R4R6R<RMRSRTRVRXRYR[R\R]R^RaR`RORbRjRkRqRR�R�R�R�R�R�R�R�R�RNR�R�(((s,/usr/lib/python2.7/site-packages/dns/name.pyR#~sL												=											8							
		RcCs�t|t�std��n|dkp6t|t�sHtd��ng}d}t}d}d}|dkr{d}n|rq|dkr�tdg�Sxl|D]d}|rR|dkr�|j�r�t|�}|d7}qO||7}t}q|j�st�n|d	9}|t|�7}|d7}|d
krt}|t	|�7}qq�|dks�|dks�|dks�|d
kr�t
|�dkr�t�nt
|�dkr�t�n|j
tjj|��d}q�|dkr�t}d}d}q�||7}q�W|rt�nt
|�dkr3t�nt
|�dkra|j
tjj|��qq|j
d�nt
|�dks�|ddkr�|dk	r�|jt|j��nt|�S(sxConvert unicode text into a Name object.

    Lables are encoded in IDN ACE form.

    @rtype: dns.name.Name object
    s0input to from_unicode() must be a unicode stringsorigin must be a Name or Noneuiu@u.Rii
iu。u.u。i?u\i����N(RWtunicodeR�RkR#ROtisdigitR8RRnRRR	tappendRgRhtToASCIIRNRmRlR(RRoRRtescapingtedigitsRR((s,/usr/lib/python2.7/site-packages/dns/name.pytfrom_unicode sj	



		

						.cCs{t|t�sIt|t�r:tjdkr:t||�Std��n|d
kpat|t�sstd��ng}d}t	}d}d}|dkr�d}n|r*|dkr�tdg�Sx!|D]}|r}|dkr|j
�r	t|�}|d7}qz||7}t	}q�|j
�s1t�n|d	9}|t|�7}|d7}|d
kr�t	}|t
|�7}q�q�|dkr�t|�dkr�t�n|j|�d}q�|dkr�t}d}d}q�||7}q�W|r�t�nt|�dkr|j|�q*|jd�nt|�dksL|ddkrq|d
k	rq|jt|j��nt|�S(sFConvert text into a Name object.
    @rtype: dns.name.Name object
    is%input to from_text() must be a stringsorigin must be a Name or NoneRiRRii
is\i����N(RWtstrR�R9t
hexversionR�R�RkR#ROR�R8RRnRRR�RNRmRlR(RRoRRR�R�RR((s,/usr/lib/python2.7/site-packages/dns/name.pyt	from_textdsd
	



		

	
			.cCs�t|t�std��ntjj|�}g}|}d}t||�}|d7}d}x|dkrf|dkr�|j||||!j��||7}|dkr0||7}q0no|dkr*|d@dt||�}|dkr|d7}n||krt	�n|}|d7}nt
�t||�}|d7}|dkre|d7}qeqeW|jd�t|�|fS(	s^Convert possibly compressed wire format into a Name.
    @param message: the entire DNS message
    @type message: string
    @param current: the offset of the beginning of the name from the start
    of the message
    @type current: int
    @raises dns.name.BadPointer: a compression pointer did not point backwards
    in the message
    @raises dns.name.BadLabelType: an invalid label type was encountered.
    @returns: a tuple consisting of the name that was read and the number
    of bytes of the wire format message which were consumed reading it
    @rtype: (dns.name.Name object, int) tuple
    s*input to from_wire() must be a byte stringiii@i�i?iR(RWR�R�R�twiredatat
maybe_wrapRR�tunwrapRRR#(tmessagetcurrentRtbiggest_pointerthopstcounttcused((s,/usr/lib/python2.7/site-packages/dns/name.pyt	from_wire�s<


	


()RRrRuR9R-R�tencodings.idnaRgt
dns.exceptionR�tdns.wiredataR=R?R@RAR>t	exceptiontSyntaxErrorRRt	FormErrorRRtDNSExceptionRRR	R
RRNRRORR"tobjectR#R�R�R�R�R�(((s,/usr/lib/python2.7/site-packages/dns/name.pyt<module>sP
	��D=

Spamworldpro Mini