Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
ó
®‹EYc@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((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/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((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/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((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/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((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/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%((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/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((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/netaddr/strategy/ipv4.pyt
packed_to_int®scCst|ttƒS(N(t_valid_wordst	word_sizet	num_words(R,((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/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%((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/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,((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/netaddr/strategy/ipv4.pytwords_to_intÍscCst|ttƒS(N(t_valid_bitstwidthtword_sep(tbits((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/netaddr/strategy/ipv4.pyR	ÙscCst|ttƒS(N(t_bits_to_intR8R9(R:((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/netaddr/strategy/ipv4.pyR
ÝscCs/|dkrtƒd}nt|tt|ƒS(NR9(tNonetglobalst_int_to_bitsR3R4(R%R9((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/netaddr/strategy/ipv4.pyRáscCs
t|tƒS(N(t
_valid_binR8(tbin_val((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/netaddr/strategy/ipv4.pyRçscCs
t|tƒS(N(t_int_to_binR8(R%((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/netaddr/strategy/ipv4.pyR
ëscCs
t|tƒS(N(t_bin_to_intR8(R@((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/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((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/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(((sJ/home/tvault/.virtenv/lib/python2.7/site-packages/netaddr/strategy/ipv4.pyt<module>sX4
??;;