GhostManSec
Server: Apache
System: Linux s323.xrea.com 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64
User: moonarc (17751)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //lib/python2.7/site-packages/dns/ipv6.pyc
�
�b�Wc@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|�}xe||kr�|||d!}tj|�}|dk	r�|jd�}n|j|�|d7}qKWd}d}d}	t	}
xvt
d�D]h}||dkr(|
r=|}||	}||kr|	}|}nt	}
q=q�|
s�|}	t}
q�q�W|
rud}||	}||kru|	}|}qun|dkr|dkr�|d	ks�|d
kr�|d
dkr�|d	kr�d}
nd
}
|
tj
j|d�}q+dj|| �ddj|||�}ndj|�}t|�S(s�Convert a network format IPv6 address into text.

    @param address: the binary address
    @type address: string
    @rtype: string
    @raises ValueError: the address isn't 16 bytes long
    is IPv6 addresses are 16 bytes longiiii����it0iitffffs::s::ffff:it:N(tlent
ValueErrortbinasciithexlifyt
_leading_zerotmatchtNonetgrouptappendtFalseRtTruetdnstipv4t	inet_ntoatjoinR(taddressthextchunkstitltchunktmt
best_starttbest_lentstartt
last_was_zerotendtcurrent_lentprefix((s,/usr/lib/python2.7/site-packages/dns/ipv6.pyRs^	

	

	s(.*):(\d+\.\d+\.\d+\.\d+)$s::.*s.*::$c
Cspt|t�s|j�}n|dkr3d}ntj|�}|dk	r�ttjj	|j
d���}d|j
d�j�|d|d|d|dfj�}ntj|�}|dk	r�|d}n(t
j|�}|dk	r|d }n|jd	�}t|�}|d
kr6tjj�nt}g}x�|D]�}|dkr�|rptjj�nt}x�tdd
|d�D]}|jd�q�WqIt|�}	|	d
kr�tjj�n|	d
kr�dd
|	|}n|j|�qIW|d
kr#|r#tjj�ndj|�}ytj|�SWn&tjtfk
rktjj�nXdS(s�Convert a text format IPv6 address into network format.

    @param text: the textual address
    @type text: string
    @rtype: string
    @raises dns.exception.SyntaxError: the text was not properly formatted
    s::s0::iu%s:%02x%02x:%02x%02xiiii����Ritt0000iRN(t
isinstanceRtencodet
_v4_endingRRt	bytearrayRRt	inet_atonR
tdecodet_colon_colon_startt_colon_colon_endtsplitRt	exceptiontSyntaxErrorRRRRRRt	unhexlifytErrort	TypeError(
ttextRtbRRt
seen_emptyt	canonicaltcRtlc((s,/usr/lib/python2.7/site-packages/dns/ipv6.pyR)bsR	!#


si
s��cCs
|jt�S(N(t
startswitht_mapped_prefix(R((s,/usr/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,/usr/lib/python2.7/site-packages/dns/ipv6.pyt<module>s	C	G