PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB`  I]c@sdZdZddlZdZdZdefdYZdefd YZed Z ee d Z d Z d Z dZdZdZdZdZdZeZy%eekredneZWn-eefk r defdYZnXdZdefdYZdefdYZdefdYZdefdYZd eefd!YZ d"eefd#YZ!d$efd%YZ"d&e"efd'YZ#d(e"efd)YZ$dS(*sA fast, lightweight IPv4/IPv6 manipulation library in Python. This library is used to create/poke/manipulate IPv4 and IPv6 addresses and networks. s2.1.11iNi itAddressValueErrorcBseZdZRS(s%A Value Error related to the address.(t__name__t __module__t__doc__(((s*/usr/lib/python2.7/site-packages/ipaddr.pyR stNetmaskValueErrorcBseZdZRS(s%A Value Error related to the netmask.(RRR(((s*/usr/lib/python2.7/site-packages/ipaddr.pyR$scCs|r5|dkrt|S|dkr5t|Snyt|SWnttfk r\nXyt|SWnttfk rnXtd|dS(sTake an IP string/int and return an object of the correct type. Args: address: A string or integer, the IP address. Either IPv4 or IPv6 addresses may be supplied; integers less than 2**32 will be considered to be IPv4 by default. version: An Integer, 4 or 6. If set, don't try to automatically determine what the IP address type is. important for things like IPAddress(1), which could be IPv4, '0.0.0.1', or IPv6, '::1'. Returns: An IPv4Address or IPv6Address object. Raises: ValueError: if the string passed isn't either a v4 or a v6 address. iis0%r does not appear to be an IPv4 or IPv6 addressN(t IPv4Addresst IPv6AddressRRt ValueError(taddresstversion((s*/usr/lib/python2.7/site-packages/ipaddr.pyt IPAddress(s    cCs|r;|dkrt||S|dkr;t||Snyt||SWnttfk renXyt||SWnttfk rnXtd|dS(sTake an IP string/int and return an object of the correct type. Args: address: A string or integer, the IP address. Either IPv4 or IPv6 addresses may be supplied; integers less than 2**32 will be considered to be IPv4 by default. version: An Integer, if set, don't try to automatically determine what the IP address type is. important for things like IPNetwork(1), which could be IPv4, '0.0.0.1/32', or IPv6, '::1/128'. Returns: An IPv4Network or IPv6Network object. Raises: ValueError: if the string passed isn't either a v4 or a v6 address. Or if a strict network was requested and a strict network wasn't given. iis0%r does not appear to be an IPv4 or IPv6 networkN(t IPv4Networkt IPv6NetworkRRR(RR tstrict((s*/usr/lib/python2.7/site-packages/ipaddr.pyt IPNetworkPs   cCs4|tjkrtdnttjd|S(sThe binary representation of this address. Args: address: An integer representation of an IPv4 IP address. Returns: The binary representation of this address. Raises: ValueError: If the integer is too large to be an IPv4 IP address. sAddress too large for IPv4s!I(t_BaseV4t _ALL_ONESRtByteststructtpack(R((s*/usr/lib/python2.7/site-packages/ipaddr.pytv4_int_to_packedys cCs!ttjd|d?|d@S(sThe binary representation of this address. Args: address: An integer representation of an IPv6 IP address. Returns: The binary representation of this address. s!QQi@iill(RRR(R((s*/usr/lib/python2.7/site-packages/ipaddr.pytv6_int_to_packeds cCsM|d}}x2|dD]&}|j|jdkr>|}qPqW||fS(sFind a sequence of addresses. Args: addresses: a list of IPv4 or IPv6 addresses. Returns: A tuple containing the first and last IP addresses in the sequence. ii(t_ip(t addressestfirsttlasttip((s*/usr/lib/python2.7/site-packages/ipaddr.pyt_find_address_ranges  cCs7x0t|D]"}||?||?kr ||Sq WdS(sGet the number of leading bits that are same for two numbers. Args: number1: an integer. number2: another integer. bits: the maximum number of bits to compare. Returns: The number of leading bits that are the same for two numbers. i(trange(tnumber1tnumber2tbitsti((s*/usr/lib/python2.7/site-packages/ipaddr.pyt_get_prefix_lengths  cCs=|dkr|Sx&t|D]}||?dr|SqWdS(sCount the number of zero bits on the right hand side. Args: number: an integer. bits: maximum number of bits to count. Returns: The number of zero bits on the right hand side of the number. iiN(R(tnumberRR ((s*/usr/lib/python2.7/site-packages/ipaddr.pyt_count_righthand_zero_bitss c Cst|tot|ts-tdn|j|jkrdtdt|t|fn||krtdng}|jdkrt}n$|jdkrt}n td|j}|j }|j }x||krt ||}d }xB|dkrDd|d } || }|d 8}||krPqqWt |||} |d t|| f} |j | ||jkrPn|d }t|d |j}qW|S( s/Summarize a network range given the first and last IP addresses. Example: >>> summarize_address_range(IPv4Address('1.1.1.0'), IPv4Address('1.1.1.130')) [IPv4Network('1.1.1.0/25'), IPv4Network('1.1.1.128/31'), IPv4Network('1.1.1.130/32')] Args: first: the first IPv4Address or IPv6Address in the range. last: the last IPv4Address or IPv6Address in the range. Returns: The address range collapsed to a list of IPv4Network's or IPv6Network's. Raise: TypeError: If the first and last objects are not IP addresses. If the first and last objects are not the same version. ValueError: If the last object is not greater than the first. If the version is not 4 or 6. s1first and last must be IP addresses, not networkss%%s and %s are not of the same versions*last IP address must be greater than firstiisunknown IP versioniiis%s/%dR N(t isinstancet_BaseIPt TypeErrorR tstrRR R t_max_prefixlenRR#tNoneR!tappendRR t_version( RRtnetworksRtip_bitst first_inttlast_inttnbitstcurrenttaddendtprefixtnet((s*/usr/lib/python2.7/site-packages/ipaddr.pytsummarize_address_rangesB            cCsg}t}x|D]}|s2|j|qn||dkrKt}q||djjdkr|j|jjt}q|j|qW|rt|S|S(sLoops through the addresses, collapsing concurrent netblocks. Example: ip1 = IPv4Network('1.1.0.0/24') ip2 = IPv4Network('1.1.1.0/24') ip3 = IPv4Network('1.1.2.0/24') ip4 = IPv4Network('1.1.3.0/24') ip5 = IPv4Network('1.1.4.0/24') ip6 = IPv4Network('1.1.0.1/22') _collapse_address_list_recursive([ip1, ip2, ip3, ip4, ip5, ip6]) -> [IPv4Network('1.1.0.0/22'), IPv4Network('1.1.4.0/24')] This shouldn't be called directly; it is called via collapse_address_list([]). Args: addresses: A list of IPv4Network's or IPv6Network's Returns: A list of IPv4Network's or IPv6Network's depending on what we were passed. ii(tFalseR*tTruetsupernettsubnettpopt _collapse_address_list_recursive(Rt ret_arrayt optimizedtcur_addr((s*/usr/lib/python2.7/site-packages/ipaddr.pyR; s      cCsd}g}g}g}x.|D]&}t|tr|ry|dj|jkrytdt|t|dfn|j|q|j|jkr|r|dj|jkrtdt|t|dfn|j|jq|r8|dj|jkr8tdt|t|dfn|j|qWt t |}t t |}xU|t |krt ||\}}|j |d}|jt||qpWtt ||dtjS(sCollapse a list of IP objects. Example: collapse_address_list([IPv4('1.1.0.0/24'), IPv4('1.1.1.0/24')]) -> [IPv4('1.1.0.0/23')] Args: addresses: A list of IPv4Network or IPv6Network objects. Returns: A list of IPv4Network or IPv6Network objects depending on what we were passed. Raises: TypeError: If passed a list of mixed version objects. iis%%s and %s are not of the same versionitkey(R$R%R+R&R'R*t _prefixlenR(RtsortedtsettlenRtindextextendR5R;t_BaseNett_get_networks_key(RR taddrstipstnetsRRR((s*/usr/lib/python2.7/site-packages/ipaddr.pytcollapse_address_list:s6 ###sbytes is not a distinct typeRcBseZdZRS(cCsdtj|S(Ns Bytes(%s)(R't__repr__(tself((s*/usr/lib/python2.7/site-packages/ipaddr.pyRLs(RRRL(((s*/usr/lib/python2.7/site-packages/ipaddr.pyRscCs6t|tr|jSt|tr2|jStS(s+Return a key suitable for sorting between networks and addresses. Address and Network objects are not sortable by default; they're fundamentally different so the expression IPv4Address('1.1.1.1') <= IPv4Network('1.1.1.1/24') doesn't make any sense. There are some times however, where you may wish to have ipaddr sort these for you anyway. If you need to do this, you can use this function as the key= argument to sorted(). Args: obj: either a Network or Address object. Returns: appropriate key. (R$RFRGR%t_get_address_keytNotImplemented(tobj((s*/usr/lib/python2.7/site-packages/ipaddr.pytget_mixed_type_keys   t _IPAddrBasecBsGeZdZdZdZdZedZedZRS(sThe mother class.cCs|jS(N(R(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyt __index__scCs|jS(N(R(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyt__int__scCs t|jS(N(thexR(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyt__hex__scCs |jS(s:Return the longhand version of the IP address as a string.(t_explode_shorthand_ip_string(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pytexplodedscCs t|S(s;Return the shorthand version of the IP address as a string.(R'(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyt compresseds( RRRRSRTRVtpropertyRXRY(((s*/usr/lib/python2.7/site-packages/ipaddr.pyRRs    R%cBseZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zed ZRS(sA generic IP object. This IP class contains the version independent methods which are used by single IP addresses. cCs?y&|j|jko$|j|jkSWntk r:tSXdS(N(RR+tAttributeErrorRO(RMtother((s*/usr/lib/python2.7/site-packages/ipaddr.pyt__eq__s  cCs$|j|}|tkrtS| S(N(R]RO(RMR\teq((s*/usr/lib/python2.7/site-packages/ipaddr.pyt__ne__s cCs$|j|}|tkrtS| S(N(t__gt__RO(RMR\tgt((s*/usr/lib/python2.7/site-packages/ipaddr.pyt__le__s cCs$|j|}|tkrtS| S(N(t__lt__RO(RMR\tlt((s*/usr/lib/python2.7/site-packages/ipaddr.pyt__ge__s cCs|j|jkr7tdt|t|fnt|tsktdt|t|fn|j|jkr|j|jkStS(Ns%%s and %s are not of the same versions"%s and %s are not of the same type(R+R&R'R$R%RR6(RMR\((s*/usr/lib/python2.7/site-packages/ipaddr.pyRcscCs|j|jkr7tdt|t|fnt|tsktdt|t|fn|j|jkr|j|jkStS(Ns%%s and %s are not of the same versions"%s and %s are not of the same type(R+R&R'R$R%RR6(RMR\((s*/usr/lib/python2.7/site-packages/ipaddr.pyR`scCs0t|tstStt||d|jS(NR (R$tintROR R+(RMR\((s*/usr/lib/python2.7/site-packages/ipaddr.pyt__add__scCs0t|tstStt||d|jS(NR (R$RfROR R+(RMR\((s*/usr/lib/python2.7/site-packages/ipaddr.pyt__sub__scCsd|jjt|fS(Ns%s(%r)(t __class__RR'(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyRLscCsd|j|jS(Ns%s(t_string_from_ip_intR(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyt__str__scCsttt|jS(N(thashRUtlongR(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyt__hash__scCs |j|fS(N(R+(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyRNscCstddS(NsBaseIP has no version(tNotImplementedError(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyR s(RRRR]R_RbReRcR`RgRhRLRkRnRNRZR (((s*/usr/lib/python2.7/site-packages/ipaddr.pyR%s          RFcBseZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZedZedZedZedZedZedZedZedZedZdZdZdZdZdZ dZ!dZ"d d%d!Z$d"Z%d d%d#Z&d d%d$Z'e&Z(e'Z)eZ*eZ+eZ,RS(&svA generic IP object. This IP class contains the version independent methods which are used by networks. cCs i|_dS(N(t_cache(RMR((s*/usr/lib/python2.7/site-packages/ipaddr.pyt__init__scCsd|jjt|fS(Ns%s(%r)(RiRR'(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyRLsccs_t|jd}t|jd}x2||krZ|d7}t|dd|jVq)WdS(sGenerate Iterator over usable hosts in a network. This is like __iter__ except it doesn't return the network or broadcast addresses. iR N(Rftnetworkt broadcastR R+(RMtcurtbcast((s*/usr/lib/python2.7/site-packages/ipaddr.pyt iterhostss  ccsWt|j}t|j}x2||krR|d7}t|dd|jVq!WdS(NiR (RfRrRsR R+(RMRtRu((s*/usr/lib/python2.7/site-packages/ipaddr.pyt__iter__)s  cCst|j}t|j}|dkrZ|||krCtnt||d|jS|d7}|||kr}tnt||d|jSdS(NiR i(RfRrRst IndexErrorR R+(RMtnRrRs((s*/usr/lib/python2.7/site-packages/ipaddr.pyt __getitem__0s    cCs|j|jkr7tdt|t|fnt|tsktdt|t|fn|j|jkr|j|jkS|j|jkr|j|jkStS(Ns%%s and %s are not of the same versions"%s and %s are not of the same type(R+R&R'R$RFRrtnetmaskR6(RMR\((s*/usr/lib/python2.7/site-packages/ipaddr.pyRc=scCs|j|jkr7tdt|t|fnt|tsktdt|t|fn|j|jkr|j|jkS|j|jkr|j|jkStS(Ns%%s and %s are not of the same versions"%s and %s are not of the same type(R+R&R'R$RFRrR{R6(RMR\((s*/usr/lib/python2.7/site-packages/ipaddr.pyR`JscCs$|j|}|tkrtS| S(N(R`RO(RMR\Ra((s*/usr/lib/python2.7/site-packages/ipaddr.pyRbWs cCs$|j|}|tkrtS| S(N(RcRO(RMR\Rd((s*/usr/lib/python2.7/site-packages/ipaddr.pyRe]s cCsyD|j|jkoB|j|jkoBt|jt|jkSWnBtk rt|tr|j|jko|j|jkSnXdS(N(R+RrRfR{R[R$R%R(RMR\((s*/usr/lib/python2.7/site-packages/ipaddr.pyR]cs  cCs$|j|}|tkrtS| S(N(R]RO(RMR\R^((s*/usr/lib/python2.7/site-packages/ipaddr.pyR_ms cCs dt|jt|jfS(Ns%s/%s(R'RR@(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyRksscCs tt|jt|jAS(N(RlRfRrR{(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyRnwscCs~|j|jkrtSt|trG|j|jkoF|j|jkSt|jt|jkowt|jkSSdS(N(R+R6R$RFRrRsRfR(RMR\((s*/usr/lib/python2.7/site-packages/ipaddr.pyt __contains__zs cCs:|j|kp9|j|kp9|j|kp9|j|kS(s*Tell if self is partly contained in other.(RrRs(RMR\((s*/usr/lib/python2.7/site-packages/ipaddr.pytoverlapsscCsW|jjd}|dkrSt|jt|j@d|j}||jd other eg: IPv4('1.1.1.0/24') > IPv4('1.1.0.0/24') IPv6('1080::1:200C:417A/112') > IPv6('1080::0:200C:417A/112') If the IP versions of self and other are different, returns: -1 if self._version < other._version eg: IPv4('10.0.0.1/24') < IPv6('::1/128') 1 if self._version > other._version eg: IPv6('::1/128') > IPv4('255.255.255.0/24') iii(R+RrR{(RMR\((s*/usr/lib/python2.7/site-packages/ipaddr.pytcompare_networks s"cCs|j|j|jfS(sNetwork-only key function. Returns an object that identifies this address' network and netmask. This function is a suitable "key" argument for sorted() and list.sort(). (R+RrR{(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyRG?scCs|j|j|?AS(sTurn the prefix length into a bitwise netmask. Args: prefixlen: An integer, the prefix length. Returns: An integer. (R(RMR((s*/usr/lib/python2.7/site-packages/ipaddr.pyt_ip_int_from_prefixIs cCs`|j}x,|r7|d@r Pn|dL}|d8}q W|d|>dkrP|StddS(sReturn prefix length from a bitwise netmask. Args: ip_int: An integer, the netmask in expanded bitwise format. Returns: An integer, the prefix length. Raises: NetmaskValueError: If the input is not a valid netmask. is!Bit pattern does not match /1*0*/N(R(R(RMtip_intR((s*/usr/lib/python2.7/site-packages/ipaddr.pyt_prefix_from_ip_intUs    cCs{yStjj|stnt|}d|koD|jknsRtnWn!tk rvtd|nX|S(s)Turn a prefix length string into an integer. Args: prefixlen_str: A decimal string containing the prefix length. Returns: The prefix length as an integer. Raises: NetmaskValueError: If the input is malformed or out of range. is%s is not a valid prefix length(Rt_DECIMAL_DIGITSt issupersetRRfR(R(RMt prefixlen_strR((s*/usr/lib/python2.7/site-packages/ipaddr.pyt_prefix_from_prefix_stringns     cCsy|j|}Wn!tk r6td|nXy|j|SWntk r[nX||jN}y|j|SWn!tk rtd|nXdS(s.Turn a netmask/hostmask string into a prefix length. Args: ip_str: A netmask or hostmask, formatted as an IP address. Returns: The prefix length as an integer. Raises: NetmaskValueError: If the input is not a netmask or hostmask. s%s is not a valid netmaskN(t_ip_int_from_stringRRRR(RMtip_strR((s*/usr/lib/python2.7/site-packages/ipaddr.pyt_prefix_from_ip_strings    iccs|j|jkr|VdS|dk rp||jkrEtdn|dkr`tdn||j}n|dkrtdn|j|}||jkrtd|t|fntdt|jt|j|fd |j}|V|}xutr}|j }||j kr+dSt t |dd |j}tdt|t|fd |j}|Vq WdS( sThe subnets which join to make the current subnet. In the case that self contains only one IP (self._prefixlen == 32 for IPv4 or self._prefixlen == 128 for IPv6), return a list with just ourself. Args: prefixlen_diff: An integer, the amount the prefix length should be increased by. This should not be set if new_prefix is also set. new_prefix: The desired new prefix length. This must be a larger number (smaller prefix) than the existing prefix. This should not be set if prefixlen_diff is also set. Returns: An iterator of IPv(4|6) objects. Raises: ValueError: The prefixlen_diff is too small or too large. OR prefixlen_diff and new_prefix are both set or new_prefix is a smaller number than the current prefix (smaller number means a larger network) Nsnew prefix must be longeris(cannot set prefixlen_diff and new_prefixisprefix length diff must be > 0s0prefix length diff %d is invalid for netblock %ss%s/%sR ( R@R(R)RR'RRrR+R7RsR Rf(RMtprefixlen_difft new_prefixt new_prefixlenRR1Rstnew_addr((s*/usr/lib/python2.7/site-packages/ipaddr.pyt iter_subnetss:        cCs#td|j|jfd|jS(s8Return the network object with the host bits masked out.s%s/%dR (RRrR@R+(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pytmaskedscCst|j||S(s2Return a list of subnets, rather than an iterator.(tlistR(RMRR((s*/usr/lib/python2.7/site-packages/ipaddr.pyR9scCs|jdkr|S|dk rh||jkr=tdn|dkrXtdn|j|}n|j|dkrtd|j|fntdt|jt|j|fd|jS( sThe supernet containing the current network. Args: prefixlen_diff: An integer, the amount the prefix length of the network should be decreased by. For example, given a /24 network and a prefixlen_diff of 3, a supernet with a /21 netmask is returned. Returns: An IPv4 network object. Raises: ValueError: If self.prefixlen - prefixlen_diff < 0. I.e., you have a negative prefix length. OR If prefixlen_diff and new_prefix are both set or new_prefix is a larger number than the current prefix (larger number means a smaller network) isnew prefix must be shorteris(cannot set prefixlen_diff and new_prefixs;current prefixlen is %d, cannot have a prefixlen_diff of %ds%s/%sR N(R@R)RRRR'RrR+(RMRR((s*/usr/lib/python2.7/site-packages/ipaddr.pyR8s  N(-RRRRqRLRvRwRzRcR`RbReR]R_RkRnR|R}RZRrRsRRRRRR RRRRGRRRRR)RRR9R8tSubnettSupernettAddressExcludetCompareNetworkstContains(((s*/usr/lib/python2.7/site-packages/ipaddr.pyRF sR           N 3   "> )RcBseZdZdedZedZdZdZdZ dZ dZ e d Z e d Ze d Ze d Ze d Ze dZe dZe dZe dZRS(syBase IPv4 object. The following methods are used by IPv4 objects in both single IP addresses and networks. iit 0123456789cCsd|_t|_dS(Ni(R+t IPV4LENGTHR((RMR((s*/usr/lib/python2.7/site-packages/ipaddr.pyRq,s cCs t|S(N(R'(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyRW0scCs|jd}t|dkr0t|nd}xI|D]A}y|d>|j|B}Wq=tk r}t|q=Xq=W|S(sTurn the given IP string into an integer for comparison. Args: ip_str: A string, the IP ip_str. Returns: The IP ip_str as an integer. Raises: AddressValueError: if ip_str isn't a valid IPv4 Address. t.iii(tsplitRCRt _parse_octetR(RMRtoctetst packed_iptoc((s*/usr/lib/python2.7/site-packages/ipaddr.pyR3s   cCse|jj|stnt|d}|dksX|ddkrat|dkratn|S(s Convert a decimal octet into an integer. Args: octet_str: A string, the number to parse. Returns: The octet as an integer. Raises: ValueError: if the octet isn't strictly a decimal from [0..255]. i iit0i(RRRRfRC(RMt octet_strt octet_int((s*/usr/lib/python2.7/site-packages/ipaddr.pyRLs  . cCsNg}x8tdD]*}|jdt|d@|dL}qWdj|S(sTurns a 32-bit integer into dotted decimal notation. Args: ip_int: An integer, the IP address. Returns: The IP address as a string in dotted decimal notation. iiiiR(txrangetinsertR'tjoin(RMRRt_((s*/usr/lib/python2.7/site-packages/ipaddr.pyRjcs cCs|jS(N(R((RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyt max_prefixlensscCs t|jS(s*The binary representation of this address.(RR(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pytpackedwscCs|jS(N(R+(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyR |scCs|tdkS(sTest if the address is otherwise IETF reserved. Returns: A boolean, True if the address is within the reserved IPv4 Network range. s 240.0.0.0/4(R (RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyt is_reserveds cCs4|tdkp3|tdkp3|tdkS(sTest if this address is allocated for private networks. Returns: A boolean, True if the address is reserved per RFC 1918. s 10.0.0.0/8s 172.16.0.0/12s192.168.0.0/16(R (RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyt is_privatescCs|tdkS(sTest if the address is reserved for multicast use. Returns: A boolean, True if the address is multicast. See RFC 3171 for details. s 224.0.0.0/4(R (RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyt is_multicasts cCs|tdkS(sTest if the address is unspecified. Returns: A boolean, True if this is the unspecified address as defined in RFC 5735 3. s0.0.0.0(R (RM((s*/usr/lib/python2.7/site-packages/ipaddr.pytis_unspecifieds cCs|tdkS(sTest if the address is a loopback address. Returns: A boolean, True if the address is a loopback per RFC 3330. s 127.0.0.0/8(R (RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyt is_loopbackscCs|tdkS(sTest if the address is reserved for link-local. Returns: A boolean, True if the address is link-local per RFC 3927. s169.254.0.0/16(R (RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyt is_link_locals(RRRRRt frozensetRRqRWRRRjRZRRR RRRRRR(((s*/usr/lib/python2.7/site-packages/ipaddr.pyRs"           RcBseZdZdZRS(s/Represent and manipulate single IPv4 Addresses.cCstj||t|ttfr\||_|dksI||jkrXt|ndSt|tryt j d|\|_Wn t j k rt|nXdSt |}|j ||_dS(s Args: address: A string or integer representing the IP '192.168.1.1' Additionally, an integer can be passed, so IPv4Address('192.168.1.1') == IPv4Address(3232235777). or, more generally IPv4Address(int(IPv4Address('192.168.1.1'))) == IPv4Address('192.168.1.1') Raises: AddressValueError: If ipaddr isn't a valid IPv4 address. iNs!I(RRqR$RfRmRRRRRtunpackterrorR'R(RMRtaddr_str((s*/usr/lib/python2.7/site-packages/ipaddr.pyRqs  (RRRRq(((s*/usr/lib/python2.7/site-packages/ipaddr.pyRsR cBs>eZdZedZdZdZdZdZRS(s~This class represents and manipulates 32-bit IPv4 networks. Attributes: [examples for IPv4Network('1.2.3.4/27')] ._ip: 16909060 .ip: IPv4Address('1.2.3.4') .network: IPv4Address('1.2.3.0') .hostmask: IPv4Address('0.0.0.31') .broadcast: IPv4Address('1.2.3.31') .netmask: IPv4Address('255.255.255.224') .prefixlen: 27 cCstj||tj||t|tttfrxt||_|jj |_ |j |_ t|j |_ dSt|jd}t|dkrt|n|j|d|_ t|j |_t|dkr/y|j|d|_ Wq;tk r+|j|d|_ q;Xn |j |_ t|j|j |_ |r|j|jkrtd|jqn|j |j dkr|j|_ndS(sInstantiate a new IPv4 network object. Args: address: A string or integer representing the IP [& network]. '192.168.1.1/24' '192.168.1.1/255.255.255.0' '192.168.1.1/0.0.0.255' are all functionally the same in IPv4. Similarly, '192.168.1.1' '192.168.1.1/255.255.255.255' '192.168.1.1/32' are also functionaly equivalent. That is to say, failing to provide a subnetmask will create an object with a mask of /32. If the mask (portion after the / in the argument) is given in dotted quad form, it is treated as a netmask if it starts with a non-zero field (e.g. /255.0.0.0 == /8) and as a hostmask if it starts with a zero field (e.g. 0.255.255.255 == /8), with the single exception of an all-zero mask which is treated as a netmask == /0. If no mask is given, a default of /32 is used. Additionally, an integer can be passed, so IPv4Network('192.168.1.1') == IPv4Network(3232235777). or, more generally IPv4Network(int(IPv4Network('192.168.1.1'))) == IPv4Network('192.168.1.1') strict: A boolean. If true, ensure that we have been passed A true network address, eg, 192.168.1.0/24 and not an IP address on a network, eg, 192.168.1.1/24. Raises: AddressValueError: If ipaddr isn't a valid IPv4 address. NetmaskValueError: If the netmask isn't valid for an IPv4 address. ValueError: If strict was True and a network address was not supplied. Nt/iiis%s has host bits set(RFRqRR$RfRmRRRRR(R@RR{R'RRCRRRRRRRrRRwRv(RMRR taddr((s*/usr/lib/python2.7/site-packages/ipaddr.pyRqs4(   cCs|jS(N(R(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pytOscCs|jS(N(R(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyRPscCs|jS(N(R(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyRQscCs|jS(N(R(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyRRs( RRRR6Rqt IsRFC1918t IsMulticastt IsLoopbackt IsLinkLocal(((s*/usr/lib/python2.7/site-packages/ipaddr.pyR s   R   t_BaseV6cBs*eZdZdedZdZedZdZdZ dZ dZ dd Z d Zed Zed Zed ZedZedZedZedZedZedZedZedZedZedZRS(syBase IPv6 object. The following methods are used by IPv6 objects in both single IP addresses and networks. iiit0123456789ABCDEFabcdefcCsd|_t|_dS(Ni(R+t IPV6LENGTHR((RMR((s*/usr/lib/python2.7/site-packages/ipaddr.pyRqbs c Cs|jd}t|dkr0t|nd|dkrt|jj}|jd|d?d@|jd|d@nt||jdkrt|nyFgtdt|dD]}||s|^qpd g\}Wnt k rt|nX|d k r|}t||d}|d sf|d8}|rft|qfn|ds|d8}|rt|qn|j||}|dkrt|qn<t||jkrt|nt|}d }d }yd } x5t|D]'}| dK} | |j ||O} qW| d|K} x9t| d D]'}| dK} | |j ||O} q]W| SWnt k rt|nXd S( sTurn an IPv6 ip_str into an integer. Args: ip_str: A string, the IPv6 ip_str. Returns: A long, the IPv6 ip_str. Raises: AddressValueError: if ip_str isn't a valid IPv6 Address. t:iRis%xiiiilN( RRCRRR:RR*t _HEXTET_COUNTRR)Rt _parse_hextet( RMRtpartstipv4_intR t skip_indextparts_hitparts_lot parts_skippedR((s*/usr/lib/python2.7/site-packages/ipaddr.pyRfsZ 6           cCs^|jj|stnt|dkr6tnt|d}|dkrZtn|S(sConvert an IPv6 hextet string into an integer. Args: hextet_str: A string, the number to parse. Returns: The hextet as an integer. Raises: ValueError: if the input isn't strictly a hex number from [0..FFFF]. iii(t _HEX_DIGITSRRRCRf(RMt hextet_strt hextet_int((s*/usr/lib/python2.7/site-packages/ipaddr.pyRs    cCsd}d}d}d}xstt|D]_}||dkr~|d7}|dkr`|}n||kr|}|}qq+d}d}q+W|dkr||}|t|kr|dg7}ndg|||+|dkrdg|}qn|S(sCompresses a list of hextets. Compresses a list of strings, replacing the longest continuous sequence of "0" in the list with "" and adding empty strings at the beginning or at the end of the string such that subsequently calling ":".join(hextets) will produce the compressed version of the IPv6 address. Args: hextets: A list of strings, the hextets to compress. Returns: A list of strings. iiRit(RRC(RMthextetstbest_doublecolon_starttbest_doublecolon_lentdoublecolon_starttdoublecolon_lenRDtbest_doublecolon_end((s*/usr/lib/python2.7/site-packages/ipaddr.pyt_compress_hextetss.        c Cs| r%|dkr%t|j}n||jkrCtdnd|}g}x?tdddD]+}|jdt|||d!dqfW|j|}dj|S( s,Turns a 128-bit integer into hexadecimal notation. Args: ip_int: An integer, the IP address. Returns: A string, the hexadecimal representation of the address. Raises: ValueError: The address is bigger than 128 bits of all ones. isIPv6 address is too larges%032xi is%xiR(RfRRRRR*RR(RMRthex_strRR((s*/usr/lib/python2.7/site-packages/ipaddr.pyRjs  )cCst|tr!t|j}n t|}|j|}g}x6t|jD]%}|jd|d@|dL}qRW|jt|trddj ||j fSdj |S(sExpand a shortened IPv6 address. Args: ip_str: A string, the IPv6 address. Returns: A string, the expanded IPv6 address. s%04xiis%s/%dR( R$RFR'RRRRR*treverseRR(RMRRRR ((s*/usr/lib/python2.7/site-packages/ipaddr.pyRWs   cCs|jS(N(R((RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyR/scCs t|jS(s*The binary representation of this address.(RR(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyR3scCs|jS(N(R+(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyR 8scCs|tdkS(sTest if the address is reserved for multicast use. Returns: A boolean, True if the address is a multicast address. See RFC 2373 2.7 for details. sff00::/8(R (RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyR<s cCs |tdkp |tdkp |tdkp |tdkp |tdkp |tdkp |tdkp |tdkp |td kp |td kp |td kp |td kp |td kp |tdkp |tdkS(sTest if the address is otherwise IETF reserved. Returns: A boolean, True if the address is within one of the reserved IPv6 Network ranges. s::/8s100::/8s200::/7s400::/6s800::/5s1000::/4s4000::/3s6000::/3s8000::/3sA000::/3sC000::/3sE000::/4sF000::/5sF800::/6sFE00::/9(R (RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyRGs cCs%|jdko$t|dddkS(sTest if the address is unspecified. Returns: A boolean, True if this is the unspecified address as defined in RFC 2373 2.5.2. iR@i(Rtgetattr(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyR`s cCs%|jdko$t|dddkS(sTest if the address is a loopback address. Returns: A boolean, True if the address is a loopback address as defined in RFC 2373 2.5.3. iR@i(RR(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyRks cCs|tdkS(sTest if the address is reserved for link-local. Returns: A boolean, True if the address is reserved per RFC 4291. s fe80::/10(R (RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyRvscCs|tdkS(s`Test if the address is reserved for site-local. Note that the site-local address space has been deprecated by RFC 3879. Use is_private to test if this address is in the space of unique local addresses as defined by RFC 4193. Returns: A boolean, True if the address is reserved per RFC 3513 2.5.6. s fec0::/10(R (RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyt is_site_locals cCs|tdkS(sTest if this address is allocated for private networks. Returns: A boolean, True if the address is reserved per RFC 4193. sfc00::/7(R (RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyRscCs(|jd?dkrdSt|jd@S(sReturn the IPv4 mapped address. Returns: If the IPv6 address is a v4 mapped address, return the IPv4 mapped address. Return None otherwise. i ilN(RR)R(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyt ipv4_mappeds cCs@|jd?dkrdSt|jd?d@t|jd@fS(sTuple of embedded teredo IPs. Returns: Tuple of the (server, client) IPs or None if the address doesn't appear to be a teredo address (doesn't start with 2001::/32) i`i i@lN(RR)R(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pytteredos cCs,|jd?dkrdSt|jd?d@S(sReturn the IPv4 6to4 embedded address. Returns: The IPv4 6to4-embedded address if present or None if the address doesn't appear to contain a 6to4 embedded address. ipi iPlN(RR)R(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyt sixtofours N(RRRRRRRRRqRRRR)RjRWRZRRR RRRRRRRRRR(((s*/usr/lib/python2.7/site-packages/ipaddr.pyRUs.   O  /        RcBseZdZdZRS(s4Represent and manipulate single IPv6 Addresses. cCstj||t|ttfr\||_|dksI||jkrXt|ndSt|tryt j d|\}}Wn t j k rt|nX|d>|B|_dSt |}|stdn|j ||_dS(sInstantiate a new IPv6 address object. Args: address: A string or integer representing the IP Additionally, an integer can be passed, so IPv6Address('2001:4860::') == IPv6Address(42541956101370907050197289607612071936L). or, more generally IPv6Address(IPv6Address('2001:4860::')._ip) == IPv6Address('2001:4860::') Raises: AddressValueError: If address isn't a valid IPv6 address. iNs!QQi@R(RRqR$RfRmRRRRRRRR'R(RMRthitloR((s*/usr/lib/python2.7/site-packages/ipaddr.pyRqs"  (RRRRq(((s*/usr/lib/python2.7/site-packages/ipaddr.pyRsR cBs)eZdZedZedZRS(sThis class represents and manipulates 128-bit IPv6 networks. Attributes: [examples for IPv6('2001:658:22A:CAFE:200::1/64')] .ip: IPv6Address('2001:658:22a:cafe:200::1') .network: IPv6Address('2001:658:22a:cafe::') .hostmask: IPv6Address('::ffff:ffff:ffff:ffff') .broadcast: IPv6Address('2001:658:22a:cafe:ffff:ffff:ffff:ffff') .netmask: IPv6Address('ffff:ffff:ffff:ffff::') .prefixlen: 64 cCstj||tj||t|tttfrxt||_|jj |_ |j |_ t|j |_ dSt|jd}t|dkrt|n|j|d|_ t|j |_t|dkr|j|d|_ n |j |_ t|j|j |_ |rY|j|jkrYtd|jqYn|j |j dkr~|j|_ndS(sInstantiate a new IPv6 Network object. Args: address: A string or integer representing the IPv6 network or the IP and prefix/netmask. '2001:4860::/128' '2001:4860:0000:0000:0000:0000:0000:0000/128' '2001:4860::' are all functionally the same in IPv6. That is to say, failing to provide a subnetmask will create an object with a mask of /128. Additionally, an integer can be passed, so IPv6Network('2001:4860::') == IPv6Network(42541956101370907050197289607612071936L). or, more generally IPv6Network(IPv6Network('2001:4860::')._ip) == IPv6Network('2001:4860::') strict: A boolean. If true, ensure that we have been passed A true network address, eg, 192.168.1.0/24 and not an IP address on a network, eg, 192.168.1.1/24. Raises: AddressValueError: If address isn't a valid IPv6 address. NetmaskValueError: If the netmask isn't valid for an IPv6 address. ValueError: If strict was True and a network address was not supplied. NRiiis%s has host bits set(RFRqRR$RfRmRRRRR(R@RR{R'RRCRRRRRrRRwRv(RMRR R((s*/usr/lib/python2.7/site-packages/ipaddr.pyRqs.   cCs|jS(N(R(RM((s*/usr/lib/python2.7/site-packages/ipaddr.pyRFs(RRRR6RqRZR(((s*/usr/lib/python2.7/site-packages/ipaddr.pyR s  D(%Rt __version__RRRRRRR)R R6RRRRR!R#R5R;RKtCollapseAddrListtbytesR'R&Rt NameErrorRQtobjectRRR%RFRRR RRR (((s*/usr/lib/python2.7/site-packages/ipaddr.pytsH  ()     @ / 6   U,gn1