U .Ѫ_Œ ã@sDdZddlZddlmZmZmZmZmZm Z m Z m Z m Z m Z ddlmZmZddlmZmZmZmZmZmZGdd„deƒZGdd „d eƒZGd d „d eƒZdUd d„ZGdd„deeƒZGdd„deeƒZ dd„Z!dd„Z"dd„Z#dd„Z$dd„Z%dd„Z&dVd d!„Z'd"d#„Z(d$d%„Z)d&d'„Z*d(d)„Z+ed*ƒZ,ed+ƒed,ƒed-ƒed.ƒed/ƒed0ƒe d1d2ƒfZ-ed3ƒZ.ed4ƒZ/ed5ƒZ0ed6ƒed7ƒed8ƒed9ƒed:ƒed;ƒe dd?ƒfe,e0fZ1ed@ƒZ2edAƒedBƒfZ3edCƒZ4edDƒZ5edEƒedFƒedGƒedHƒedIƒedJƒedKƒedLƒedMƒedNƒedOƒedPƒedQƒedRƒedSƒedTƒfZ6dS)Wz9Routines for IPv4 and IPv6 addresses, subnets and ranges.éN) ÚAddrFormatErrorÚAddrConversionErrorÚnum_bitsÚ DictDotLookupÚNOHOSTÚNÚ INET_PTONÚPÚZEROFILLÚZ)Úipv4Úipv6)Ú _sys_maxintÚ _iter_nextÚ _iter_rangeÚ_is_strÚ _int_typeÚ _str_typec@sÖeZdZdZdZdd„Zdd„Zedd„ed d �Zd d „Z d d„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zdd„Zdd „Zd!d"„Zd#d$„Zd%d&„Zd'd(„Zd)d*„Zd+d,„Zed-d.„ƒZed/d0„ƒZd1S)2ÚBaseIPzi An abstract base class for common operations shared between various IP related subclasses. )Ú_valueÚ_moduleÚ __weakref__cCsd|_d|_dS)z Constructor.N)rr©Úself©rú:/Users/cjl/code/aws-vpc-ipam/lambda/netaddr/ip/__init__.pyÚ__init__szBaseIP.__init__cCsNt|tƒstdt|ƒƒ‚d|kr2|jjksDntd|jjƒ‚||_dS)Núint argument expected, not %srz&value out of bounds for an %s address!) Ú isinstancerÚ TypeErrorÚtyperÚmax_intrÚ family_namer©rÚvaluerrrÚ _set_value s ÿzBaseIP._set_valuecCs|jS©N©rrrrrÚ(ózBaseIP.z?a positive integer representing the value of IP address/subnet.©ÚdoccCstS©zP :return: a key tuple that uniquely identifies this IP address. ©ÚNotImplementedrrrrÚkey+sz BaseIP.keycCstS)zg :return: A key tuple used to compare and sort this `IPAddress` correctly. r-rrrrÚsort_key1szBaseIP.sort_keycCs t| ¡ƒS)zM :return: A hash value uniquely indentifying this IP object. )Úhashr/rrrrÚ__hash__8szBaseIP.__hash__c Cs4z| ¡| ¡kWSttfk r.tYSXdS)zÇ :param other: an `IPAddress` or `IPNetwork` object. :return: ``True`` if this `IPAddress` or `IPNetwork` object is equivalent to ``other``, ``False`` otherwise. N©r/ÚAttributeErrorrr.©rÚotherrrrÚ__eq__>sz BaseIP.__eq__c Cs4z| ¡| ¡kWSttfk r.tYSXdS)zË :param other: an `IPAddress` or `IPNetwork` object. :return: ``True`` if this `IPAddress` or `IPNetwork` object is not equivalent to ``other``, ``False`` otherwise. Nr3r5rrrÚ__ne__Jsz BaseIP.__ne__c Cs4z| ¡| ¡kWSttfk r.tYSXdS)zà :param other: an `IPAddress` or `IPNetwork` object. :return: ``True`` if this `IPAddress` or `IPNetwork` object is less than ``other``, ``False`` otherwise. N©r0r4rr.r5rrrÚ__lt__Vsz BaseIP.__lt__c Cs4z| ¡| ¡kWSttfk r.tYSXdS)zÏ :param other: an `IPAddress` or `IPNetwork` object. :return: ``True`` if this `IPAddress` or `IPNetwork` object is less than or equal to ``other``, ``False`` otherwise. Nr9r5rrrÚ__le__bsz BaseIP.__le__c Cs4z| ¡| ¡kWSttfk r.tYSXdS)zÆ :param other: an `IPAddress` or `IPNetwork` object. :return: ``True`` if this `IPAddress` or `IPNetwork` object is greater than ``other``, ``False`` otherwise. Nr9r5rrrÚ__gt__nsz BaseIP.__gt__c Cs4z| ¡| ¡kWSttfk r.tYSXdS)zÒ :param other: an `IPAddress` or `IPNetwork` object. :return: ``True`` if this `IPAddress` or `IPNetwork` object is greater than or equal to ``other``, ``False`` otherwise. Nr9r5rrrÚ__ge__zsz BaseIP.__ge__cCs | ¡ S)z<:return: ``True`` if this IP is unicast, ``False`` otherwise)Ú is_multicastrrrrÚ is_unicast†szBaseIP.is_unicastcCs(|jtkr|tkS|jtkr$|tkSdS)z>:return: ``True`` if this IP is multicast, ``False`` otherwiseN)rÚ_ipv4ÚIPV4_MULTICASTÚ_ipv6ÚIPV6_MULTICASTrrrrr>Šs  zBaseIP.is_multicastcCs,|jjdkr|tkS|jjdkr(|tkSdS)z® :return: ``True`` if this IP is loopback address (not for network transmission), ``False`` otherwise. References: RFC 3330 and 4291. ééN)rÚversionÚ IPV4_LOOPBACKÚ IPV6_LOOPBACKrrrrÚ is_loopback‘s  zBaseIP.is_loopbackcCsZ|jjdkr&tD]}||krdSqn$|jjdkrJtD]}||kr6dSq6| ¡rVdSdS)zÀ :return: ``True`` if this IP is for internal/private use only (i.e. non-public), ``False`` otherwise. Reference: RFCs 1918, 3330, 4193, 3879 and 2365. rDTrEF)rrFÚ IPV4_PRIVATEÚ IPV6_PRIVATEÚ is_link_local©rÚcidrrrrÚ is_privateœs   zBaseIP.is_privatecCs,|jjdkr|tkS|jjdkr(|tkSdS)z„ :return: ``True`` if this IP is link-local address ``False`` otherwise. Reference: RFCs 3927 and 4291. rDrEN)rrFÚIPV4_LINK_LOCALÚIPV6_LINK_LOCALrrrrrL°s  zBaseIP.is_link_localcCsN|jjdkr&tD]}||krdSqn$|jjdkrJtD]}||kr6dSq6dS)z‰ :return: ``True`` if this IP is in IANA reserved range, ``False`` otherwise. Reference: RFCs 3330 and 3171. rDTrEF)rrFÚ IPV4_RESERVEDÚ IPV6_RESERVEDrMrrrÚ is_reservedºs   zBaseIP.is_reservedcCs|jjdko|jd?dkS)zp :return: ``True`` if this IP is IPv4-compatible IPv6 address, ``False`` otherwise. rEé iÿÿ©rrFrrrrrÚis_ipv4_mappedÉszBaseIP.is_ipv4_mappedcCs|jjdko|jd?dkS)zl :return: ``True`` if this IP is IPv4-mapped IPv6 address, ``False`` otherwise. rErUrrVrrrrÚis_ipv4_compatÐszBaseIP.is_ipv4_compatcCsddlm}t||ƒƒS)z~ A record dict containing IANA registration details for this IP address if available, None otherwise. r)Úquery)Znetaddr.ip.ianarYr)rrYrrrÚinfo×s z BaseIP.infocCs|jjS)z6the IP protocol version represented by this IP object.)rrFrrrrrFászBaseIP.versionN)Ú__name__Ú __module__Ú __qualname__Ú__doc__Ú __slots__rr%Úpropertyr$r/r0r2r7r8r:r;r<r=r?r>rIrOrLrTrWrXrZrFrrrrrs8 ÿ         rcsTeZdZdZdZdL‡fdd„ Zdd„Zd d „Zd d „Zd d„Z dd„Z dd„Z dd„Z dd„Z e Zdd„Zdd„Zdd„Zdd„Zdd „Zd!d"„Zd#d$„Zd%d&„Zd'd(„Zd)d*„ZdMd+d,„Zed-d.„ƒZed/d0„ƒZed1d2„ƒZed3d4„ƒZd5d6„ZdNd8d9„Z dOd:d;„Z!dd?„Z#d@dA„Z$dBdC„Z%dDdE„Z&dFdG„Z'e'Z(dHdI„Z)dJdK„Z*‡Z+S)PÚ IPAddressz� An individual IPv4 or IPv6 address without a net mask or subnet prefix. To support these and other network based operations, see `IPNetwork`. rNrcs tt|ƒ ¡t|tƒrH|dk r4||jjkr4tdƒ‚|j|_|j|_�nÔ|dk r||dkr`t |_n|dkrpt |_n td|ƒ‚t |ƒrœd|krœtd|j j ƒ‚|jdk�r’t|tƒ�r6zhdt|ƒkrÐt jkrænnt|ƒ|_t |_n4t jt|ƒk�rt jk�rnnt|ƒ|_t |_Wntk �r2YnXnBt t fD]8}z| ||¡|_WnY�q>YnX||_�qx�q>|jdk�rtd |ƒ‚nŠt |ƒ�rÞz|j ||¡|_Wn*tk �rÚtd ||jjfƒ‚YnXn>dt|ƒk�rþ|jjk�rnn t|ƒ|_ntd |fƒ‚dS) a’ Constructor. :param addr: an IPv4 or IPv6 address which may be represented in an accepted string format, as an unsigned integer or as another IPAddress object (copy construction). :param version: (optional) optimizes version detection if specified and distinguishes between IPv4 and IPv6 for addresses with an equivalent integer value. :param flags: (optional) 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 further details. Nz1cannot switch IP versions using copy constructor!rDrEú%r is an invalid IP version!ú/zQ%s() does not support netmasks or subnet prefixes! See documentation for details.rz+failed to detect a valid IP address from %rzbase address %r is not IPv%dzbad address format: %r)ÚsuperrarrrrrFÚ ValueErrorrr@rBrÚ __class__r[rÚintr!Z str_to_intr)rÚaddrrFÚflagsÚmodule©rfrrrðs`   þ   $      ÿ  ÿ$ zIPAddress.__init__cCs|j|jjfS)z1:returns: Pickled state of an `IPAddress` object.)rrrFrrrrÚ __getstate__AszIPAddress.__getstate__cCsB|\}}||_|dkrt|_n |dkr.t|_ntdt|ƒƒ‚dS)zT :param state: data used to unpickle a pickled `IPAddress` object. rDrEz&unpickling failed for object state: %sN)rr@rrBreÚstr)rÚstater$rFrrrÚ __setstate__EsÿzIPAddress.__setstate__cCs†| ¡s|jjS|jdkrdS|j}d}|dkrP|d@dkr>qP|d7}|dL}q(|jj|}d|krt|jjks‚ntd|ƒ‚|S)z¾ @return: If this IP is a valid netmask, the number of non-zero bits are returned, otherwise it returns the width in bits for the IP address version. réz+Unexpected mask length %d for address type!)Ú is_netmaskrÚwidthrre)rZi_valÚnumbitsZ mask_lengthrrrÚ netmask_bitsVs"    ÿzIPAddress.netmask_bitscCs|jd}||d@dkS)zV :return: ``True`` if this IP address host mask, ``False`` otherwise. rprr'©rÚint_valrrrÚ is_hostmaskus zIPAddress.is_hostmaskcCs"|j|jjAd}||d@dkS)zY :return: ``True`` if this IP address network mask, ``False`` otherwise. rpr)rrr!rurrrrq|szIPAddress.is_netmaskcCs@t|j|ƒ}d|kr&|jjkr4nn ||_|Stdƒ‚dS)zæ Increases the numerical value of this IPAddress by num. An IndexError is raised if result exceeds maximum IP address value or is less than zero. :param num: size of IP address increment. rú)result outside valid IP address boundary!N©rgrrr!Ú IndexError©rÚnumÚ new_valuerrrÚ__iadd__ƒs zIPAddress.__iadd__cCs@t|j|ƒ}d|kr&|jjkr4nn ||_|Stdƒ‚dS)zæ Decreases the numerical value of this IPAddress by num. An IndexError is raised if result is less than zero or exceeds maximum IP address value. :param num: size of IP address decrement. rrxNryr{rrrÚ__isub__’s zIPAddress.__isub__cCsFt|j|ƒ}d|kr&|jjkr:nn| ||jj¡Stdƒ‚dS)a Add the numerical value of this IP address to num and provide the result as a new IPAddress object. :param num: size of IP address increase. :return: a new IPAddress object with its numerical value increased by num. rrxN©rgrrr!rfrFrzr{rrrÚ__add__¡s zIPAddress.__add__cCsFt|j|ƒ}d|kr&|jjkr:nn| ||jj¡Stdƒ‚dS)a Subtract the numerical value of this IP address from num providing the result as a new IPAddress object. :param num: size of IP address decrease. :return: a new IPAddress object with its numerical value decreased by num. rrxNr€r{rrrÚ__sub__±s zIPAddress.__sub__cCsFt||jƒ}d|kr&|jjkr:nn| ||jj¡Stdƒ‚dS)a Subtract num (lvalue) from the numerical value of this IP address (rvalue) providing the result as a new IPAddress object. :param num: size of IP address decrease. :return: a new IPAddress object with its numerical value decreased by num. rrxNr€r{rrrÚ__rsub__¿s zIPAddress.__rsub__cCs|jj|jfSr,rVrrrrr/Ísz IPAddress.keycCs|jj|j|jjfS)zI:return: A key tuple used to compare and sort this `IPAddress` correctly.)rrFrrrrrrrr0ÖszIPAddress.sort_keycCs|jS©z<:return: the value of this IP address as an unsigned integerr'rrrrÚ__int__ÚszIPAddress.__int__cCs|jSr„r'rrrrÚ__long__ÞszIPAddress.__long__cCs|jdkrdSd|jS)z;:return: an octal string representation of this IP address.rÚ0z0%or'rrrrÚ__oct__âs zIPAddress.__oct__cCs d|jS)z@:return: a hexadecimal string representation of this IP address.z0x%xr'rrrrÚ__hex__észIPAddress.__hex__cCs|jS)zx :return: return the integer value of this IP address when called by hex(), oct() or bin(). r'rrrrÚ __index__îszIPAddress.__index__cCs|j |jjdd¡S)zt :return: a bytes object equivalent to this IP address. In network byte order, big-endian. éÚbig)rÚto_bytesrrrrrrrÚ __bytes__öszIPAddress.__bytes__cCs|j |j|¡S)zØ :param word_sep: (optional) the separator to insert between words. Default: None - use default separator for address type. :return: the value of this IP address as a binary digit string.)rZ int_to_bitsr)rZword_seprrrÚbitsþszIPAddress.bitscCs|j |j¡S)z7The value of this IP address as a packed binary string.)rZ int_to_packedrrrrrÚpackedszIPAddress.packedcCs|j |j¡S)zx A list of unsigned integer words (octets for IPv4, hextets for IPv6) found in this IP address. )rZ int_to_wordsrrrrrÚwords szIPAddress.wordscCs|j |j¡S)zÛ The value of this IP adddress in standard Python binary representational form (0bxxx). A back port of the format provided by the builtin bin() function found in Python 2.6.x and higher. )rZ int_to_binrrrrrÚbinsz IPAddress.bincCs|j |j¡S)z1The reverse DNS lookup record for this IP address)rZ int_to_arparrrrrÚ reverse_dnsszIPAddress.reverse_dnscCs˜d}|j}|jjdkr$||jdƒ}np|jjdkr”d|jkrHtjkrZnn||jdƒ}n:tj|jkrrdkrˆnn||jddƒ}n td|ƒ‚|S)z¯ Raises an `AddrConversionError` if IPv6 address cannot be converted to IPv4. :return: A numerically equivalent version 4 `IPAddress` object. NrDrErìÿÿÿìüú2IPv6 address %s unsuitable for conversion to IPv4!)rfrrFrr@r!r)rÚipÚklassrrrr !s  ÿzIPAddress.ipv4FcCs„d}|j}|jjdkrT|rFd|jkr0dkrFnn||jddƒ}q€||jdƒ}n,|jjdkr€||jdƒ}|s€|d|jdƒ}|S)a› .. note:: The IPv4-mapped IPv6 address format is now considered deprecated. See RFC 4291 or later for details. :param ipv4_compatible: If ``True`` returns an IPv4-mapped address (::ffff:x.x.x.x), an IPv4-compatible (::x.x.x.x) address otherwise. Default: False (IPv4-mapped). :return: A numerically equivalent version 6 `IPAddress` object. NrEr•r”rD)rfrrFr©rZipv4_compatibler—r˜rrrr 7s  ÿÿ   zIPAddress.ipv6cCs,|dk rt|dƒstdƒ‚|jj|j|d�S)zÇ Only relevant for IPv6 addresses. Has no effect for IPv4. :param dialect: An ipv6_* dialect class. :return: an alternate string representation for this IP address. NZword_fmtz-custom dialects should subclass ipv6_verbose!)Údialect)ÚhasattrrrÚ int_to_strr)rršrrrÚformatTs  ÿzIPAddress.formatcCs| |jt|ƒB|jj¡S)z¾ :param other: An `IPAddress` object (or other int-like object). :return: bitwise OR (x | y) between the integer value of this IP address and ``other``. ©rfrrgrrFr5rrrÚ__or__bszIPAddress.__or__cCs| |jt|ƒ@|jj¡S)z¿ :param other: An `IPAddress` object (or other int-like object). :return: bitwise AND (x & y) between the integer value of this IP address and ``other``. ržr5rrrÚ__and__kszIPAddress.__and__cCs| |jt|ƒA|jj¡S)zÈ :param other: An `IPAddress` object (or other int-like object). :return: bitwise exclusive OR (x ^ y) between the integer value of this IP address and ``other``. ržr5rrrÚ__xor__tszIPAddress.__xor__cCs| |j|>|jj¡S)z² :param numbits: size of bitwise shift. :return: an `IPAddress` object based on this one with its integer value left shifted by ``numbits``. ©rfrrrF©rrsrrrÚ __lshift__}szIPAddress.__lshift__cCs| |j|?|jj¡S)z³ :param numbits: size of bitwise shift. :return: an `IPAddress` object based on this one with its integer value right shifted by ``numbits``. r¢r£rrrÚ __rshift__†szIPAddress.__rshift__cCs t|jƒS)zi:return: ``True`` if the numerical value of this IP address is not zero, ``False`` otherwise.)ÚboolrrrrrÚ __nonzero__�szIPAddress.__nonzero__cCs|j |j¡S)z,:return: IP address in presentational format)rrœrrrrrÚ__str__—szIPAddress.__str__cCsd|jj|fS©ú8:return: Python statement to create an equivalent objectz%s('%s')©rfr[rrrrÚ__repr__›szIPAddress.__repr__)Nr)N)F)N),r[r\r]r^r_rrlrortrwrqr~rr�Ú__radd__r‚rƒr/r0r…r†rˆr‰rŠrŽr�r`r�r‘r’r“r r r�rŸr r¡r¤r¥r§Ú__bool__r¨r¬Ú __classcell__rrrkrraçsVQ             rac@sLeZdZdZdZdd„Zedd„ƒZdd„Zd d „Z d d „Z d d„Z e Z dS)Ú IPListMixinzu A mixin class providing shared list-like functionality to classes representing groups of IP addresses. rcCs*t|j|jjƒ}t|j|jjƒ}t||ƒS)z‘ :return: An iterator providing access to all `IPAddress` objects within range represented by this ranged IP object. )raÚfirstrrFÚlastÚ iter_iprange)rÚstart_ipÚend_iprrrÚ__iter__§szIPListMixin.__iter__cCst|j|jdƒS)zP The total number of IP addresses within this ranged IP object. rp)rgr²r±rrrrÚsize°szIPListMixin.sizecCs|j}|tkrtdtƒ‚|S)zâ :return: the number of IP addresses in this ranged IP object. Raises an `IndexError` if size > system max int (a Python 2.x limitation). Use the .size property for subnets of any size. zVrange contains more than %d (sys.maxint) IP addresses! Use the .size property instead.)r·rrz)rr·rrrÚ__len__·s ÿzIPListMixin.__len__cCsBd}t|dƒrš|jjdkr"tdƒ‚| |j¡\}}}||dksH||kr`tt|j|jjƒgƒ}n8t|j||jjƒ}t|j|||jjƒ}t |||ƒ}n¤z€t |ƒ}|j |kr¼dkrÚnnt|j |d|jjƒ}n>d|krö|jdk�rnnt|j||jjƒ}nt dƒ‚Wn"t k �r<td|ƒ‚YnX|S) zê :return: The IP address(es) in this `IPNetwork` object referenced by index or slice. As slicing can produce large sequences of objects an iterator is returned instead of the more usual `list`. NÚindicesrEzIPv6 slices are not supported!rrpz'index out range for address range size!zunsupported index type %r!)r›rrFrr¹r·Úiterrar±r³rgr²rzre)rÚindexÚitemÚstartÚstopÚstepr´rµrrrÚ __getitem__Ãs(    zIPListMixin.__getitem__cCsdt|tƒrX|jj|jjkrdSt|tƒr@|j|jko>|j|jkS|j|jkoV|j|jkSt|ƒ|kS)ú¯ :param other: an `IPAddress` or ranged IP object. :return: ``True`` if other falls within the boundary of this one, ``False`` otherwise. F)rrrrFrarr±r²r5rrrÚ __contains__ès  zIPListMixin.__contains__cCsdS)z˜ Ranged IP objects always represent a sequence of at least one IP address and are therefore always True in the boolean context. Trrrrrr§úszIPListMixin.__nonzero__N) r[r\r]r^r_r¶r`r·r¸rÀrÂr§r®rrrrr° s   %r°Fc Cst|tƒr|t|ƒdkr$td|jƒ‚|\}}d|krB|jksRntd|jƒ‚d|krh|jksxntd|jƒ‚�npt|tƒ�rÜ|r”t|ƒ}d|kr®|  dd¡\}}n|}d}zt ||j t d�}WnJtk �r|j d k�rt  |¡} t | |j t d�}n td |ƒ‚YnX|j}z t|ƒ}Wn†tk �rN|dk�rJ|j}Ynbtk �r®t ||j t d�} |  ¡�r†|j| j}n$|  ¡�rž|j| j}n td |ƒ‚YnXd|k�rÊ|jk�sìntd |jƒ‚ntd t|ƒƒ‚|t@�r|j|} || @}||fS)Nézinvalid %s tuple!rz#invalid address value for %s tuple!zinvalid prefix for %s tuple!rcrp©rirDzinvalid IPNetwork address %s!z!addr %r is not a valid IPNetwork!zinvalid prefix for %s address!zunexpected type %s for addr arg)rÚtupleÚlenrr"r!rrrÚcidr_abbrev_to_verboseÚsplitrarFrr@Zexpand_partial_addressrrgrrerqZnetmask_to_prefixrwZhostmask_to_prefixr rZprefix_to_netmask) rjrhÚimplicit_prefixrir$Ú prefixlenZval1Zval2r—Z expanded_addrÚmaskÚnetmaskrrrÚparse_ip_networksd  ÿÿ         ÿ ÿ  rÍcsPeZdZdZdZdD‡fdd„ Zdd „Zd d „Zd d „Ze dd„edd�Z e dd„ƒZ e dd„ƒZ e dd„ƒZ e dd„ƒZe dd„ƒZe dd„ƒZejdd„ƒZe dd „ƒZe d!d"„ƒZe d#d$„ƒZe d%d&„ƒZd'd(„Zd)d*„Zd+d,„Zd-d.„Zd/d0„Zd1d2„ZdEd3d4„ZdFd6d7„ZdGd8d9„ZdHd:d;„ZdIdd?„Z!d@dA„Z"dBdC„Z#‡Z$S)JÚ IPNetworkaÏ An IPv4 or IPv6 network or subnet. A combination of an IP address and a network mask. Accepts CIDR and several related variants : a) Standard CIDR:: x.x.x.x/y -> 192.0.2.0/24 x::/y -> fe80::/10 b) Hybrid CIDR format (netmask address instead of prefix), where 'y' address represent a valid netmask:: x.x.x.x/y.y.y.y -> 192.0.2.0/255.255.255.0 x::/y:: -> fe80::/ffc0:: c) ACL hybrid CIDR format (hostmask address instead of prefix like Cisco's ACL bitmasks), where 'y' address represent a valid netmask:: x.x.x.x/y.y.y.y -> 192.0.2.0/0.0.0.255 x::/y:: -> fe80::/3f:ffff:ffff:ffff:ffff:ffff:ffff:ffff d) Abbreviated CIDR format (as of netaddr 0.7.x this requires the optional constructor argument ``implicit_prefix=True``):: x -> 192 x/y -> 10/8 x.x/y -> 192.168/16 x.x.x/y -> 192.168.0/24 which are equivalent to:: x.0.0.0/y -> 192.0.0.0/24 x.0.0.0/y -> 10.0.0.0/8 x.x.0.0/y -> 192.168.0.0/16 x.x.x.0/y -> 192.168.0.0/24 .. warning:: The next release (0.9.0) will contain a backwards incompatible change connected to handling of RFC 6164 IPv6 addresses (/127 and /128 subnets). When iterating ``IPNetwork`` and ``IPNetwork.iter_hosts()`` the first addresses in the networks will no longer be excluded and ``broadcast`` will be ``None``. ©Ú _prefixlenFNrc s>tt|ƒ ¡d\}}}t|dƒr6|j}|j}|j}nòt|dƒrT|j}|j}|j}nÔ|dkrvtt |||d�\}}t }n²|dkr˜tt |||d�\}}t }n�|dk r¬t d|ƒ‚zt }t||||ƒ\}}Wn`t k �r&zt }t||||ƒ\}}Wnt k �rYnX|dk�r"t d |fƒ‚YnX||_||_||_dS) aõ Constructor. :param addr: an IPv4 or IPv6 address with optional CIDR prefix, netmask or hostmask. May be an IP address in presentation (string) format, an tuple containing and integer address and a network prefix, or another IPAddress/IPNetwork object (copy construction). :param implicit_prefix: (optional) if True, the constructor uses classful IPv4 rules to select a default prefix when one is not provided. If False it uses the length of the IP address version. (default: False) :param version: (optional) optimizes version detection if specified and distinguishes between IPv4 and IPv6 for addresses with an equivalent integer value. :param flags: (optional) decides which rules are applied to the interpretation of the addr value. Currently only supports the NOHOST option. See the netaddr.core docs for further details. )NNNrÐrrD)rÉrirENrbzinvalid IPNetwork %s) rdrÎrr›rrrÐrrrÍr@rBrer)rrhrÉrFrir$rÊrjrkrrr{sX   ÿ ÿ  ÿ ÿ  zIPNetwork.__init__cCs|j|j|jjfS)z0:return: Pickled state of an `IPNetwork` object.)rrÐrrFrrrrrl¿szIPNetwork.__getstate__cCst|\}}}||_|dkr t|_n|dkr0t|_ntd|fƒ‚d|krV|jjkrbnn||_ntd|fƒ‚dS)zT :param state: data used to unpickle a pickled `IPNetwork` object. rDrEz%unpickling failed for object state %srN)rr@rrBrerrrÐ)rrnr$rÊrFrrrroÃs ÿÿzIPNetwork.__setstate__cCsNt|tƒstdt|ƒƒ‚d|kr2|jjksDntd|jjƒ‚||_dS)Nrrz!invalid prefix for an %s address!) rrrr rrrrr"rÐr#rrrÚ_set_prefixlenÚs ÿzIPNetwork._set_prefixlencCs|jSr&rÏrrrrr(âr)zIPNetwork.zCsize of the bitmask used to separate the network from the host bitsr*cCst|j|jjƒS)zÈ The IP address of this `IPNetwork` object. This is may or may not be the same as the network IP address which varies according to the value of the CIDR subnet prefix. )rarrrFrrrrr—åsz IPNetwork.ipcCst|j|j@|jjƒS)z/The network address of this `IPNetwork` object.)rarÚ _netmask_intrrFrrrrÚnetworkîszIPNetwork.networkcCs<|jjdkr"|jj|jdkr"dSt|j|jB|jjƒSdS)aFThe broadcast address of this `IPNetwork` object. .. warning:: The next release (0.9.0) will contain a backwards incompatible change connected to handling of RFC 6164 IPv6 addresses (/127 and /128 subnets). ``broadcast`` will be ``None`` when dealing with those networks. rDrpN)rrFrrrÐrarÚ _hostmask_intrrrrÚ broadcastós zIPNetwork.broadcastcCs|j|jj|jA@S)ze The integer value of first IP address found within this `IPNetwork` object. )rrr!rÔrrrrr±szIPNetwork.firstcCs d|jj|j>d}|j|BS)zd The integer value of last IP address found within this `IPNetwork` object. rp)rrrrÐr©rÚhostmaskrrrr² szIPNetwork.lastcCs|jj|jA}t||jjƒS)z+The subnet mask of this `IPNetwork` object.)rr!rÔrarF)rrÌrrrrÌszIPNetwork.netmaskcCsJt|ƒ}|j|jkr$td||fƒ‚| ¡sd}t||jjƒS)z)The host mask of this `IPNetwork` object.rp)rrrrÐrarFrÖrrrr×+szIPNetwork.hostmaskcCsd|jj|j>dS)z,Same as self.hostmask, but in integer formatrp)rrrrÐrrrrrÔ1szIPNetwork._hostmask_intcCst|j|j@|jf|jjd�S)z� The true CIDR address for this `IPNetwork` object which omits any host bits to the right of the CIDR subnet prefix. ©rF)rÎrrÒrÐrrFrrrrrN6sþzIPNetwork.cidrcCsLt|jƒ|j|}||jd|jjkr2tdƒ‚|dkrBtdƒ‚||_|S)aP Increases the value of this `IPNetwork` object by the current size multiplied by ``num``. An `IndexError` is raised if result exceeds maximum IP address value or is less than zero. :param num: (optional) number of `IPNetwork` blocks to increment this IPNetwork's value by. rpz#increment exceeds address boundary!rzincrement is less than zero!)rgrÓr·rr!rzrr{rrrr~@s zIPNetwork.__iadd__cCsLt|jƒ|j|}|dkr$tdƒ‚||jd|jjkrBtdƒ‚||_|S)aP Decreases the value of this `IPNetwork` object by the current size multiplied by ``num``. An `IndexError` is raised if result is less than zero or exceeds maximum IP address value. :param num: (optional) number of `IPNetwork` blocks to decrement this IPNetwork's value by. rzdecrement is less than zero!rpz#decrement exceeds address boundary!)rgrÓr·rzrr!rr{rrrrUs zIPNetwork.__isub__cCsªt|tƒrž|jj|jjkrdS|jj|j}|j|?}t|tƒrd||>|jjkob|d|>|j jkS|j|?}t|t ƒr€||kSt|t ƒrž||koœ|j|jkSt |ƒ|kS)rÁFrp) rrrrFrrrÐrÚIPRangeÚ_startÚ_endrarÎ)rr6Ú shiftwidthZself_netZ other_netrrrrÂjs   ÿ   zIPNetwork.__contains__cCs|jj|j|jfS)zR :return: A key tuple used to uniquely identify this `IPNetwork`. ©rrFr±r²rrrrr/ˆsz IPNetwork.keycCs8|jd}|j|jj|jA@}|j|}|jj|||fS)z[ :return: A key tuple used to compare and sort this `IPNetwork` correctly. rp)rÐrrr!rÔrF)rZ net_size_bitsr±Z host_bitsrrrr0Žs  zIPNetwork.sort_keycCsÌd}|j}|jjdkr,|d|j|jfƒ}nœ|jjdkrÈd|jkrPtjkrxnn$t |j¡}|d||jdfƒ}nPtj|jkr�dkr¼nn(t |jd¡}|d||jdfƒ}n t d |ƒ‚|S) z¶ :return: A numerically equivalent version 4 `IPNetwork` object. Raises an `AddrConversionError` if IPv6 address cannot be converted to IPv4. NrDú%s/%drEré`r”r•r–) rfrrFr—rÊrr@r!rœr)rr—r˜rhrrrr —s   ÿzIPNetwork.ipv4cCs®d}|j}|jjdkrd|rNd|jkr0dkrNnn||jd|jfdd�}qª||j|jfdd�}nF|jjdkrª|rŽ||j|jdfdd�}n|d|j|jdfdd�}|S)a— .. note:: the IPv4-mapped IPv6 address format is now considered deprecated. See RFC 4291 or later for details. :param ipv4_compatible: If ``True`` returns an IPv4-mapped address (::ffff:x.x.x.x), an IPv4-compatible (::x.x.x.x) address otherwise. Default: False (IPv4-mapped). :return: A numerically equivalent version 6 `IPNetwork` object. NrEr•r”rØrDrß)rfrrFrrÐr™rrrr ®s,  ÿÿ ÿ  ÿÿzIPNetwork.ipv6rpcCs(| d|j|jf|jj¡}||8}|S)zê :param step: the number of IP subnets between this `IPNetwork` object and the expected subnet. Default: 1 (the previous IP subnet). :return: The adjacent subnet preceding this `IPNetwork` object. rÞ©rfrÓrÊrrF©rr¿Zip_copyrrrÚpreviousÎs ÿzIPNetwork.previouscCs(| d|j|jf|jj¡}||7}|S)zç :param step: the number of IP subnets between this `IPNetwork` object and the expected subnet. Default: 1 (the next IP subnet). :return: The adjacent subnet succeeding this `IPNetwork` object. rÞràrárrrÚnextÚs ÿzIPNetwork.nextcCsjd|kr|jjks.ntd||jjfƒ‚g}|j}||_|j|jkrf| |j¡|jd7_q>|S)ab Provides a list of supernets for this `IPNetwork` object between the size of the current prefix and (if specified) an endpoint prefix. :param prefixlen: (optional) a CIDR prefix for the maximum supernet. Default: 0 - returns all possible supernets. :return: a tuple of supernet `IPNetwork` objects. rú"CIDR prefix /%d invalid for IPv%d!rp)rrrrerFrNrÐÚappend)rrÊÚ supernetsÚsupernetrrrrçæs  ÿ  zIPNetwork.supernetc csêd|jkr|jjks0ntd||jjfƒ‚|j|ks>dS|jj}d||jd||}|dkrl|}d|kr€|ksŠntdƒ‚|j |j¡}d}||kræ| d||f|jj¡}|j|j |7_||_|d7}|VqœdS)a† A generator that divides up this IPNetwork's subnet into smaller subnets based on a specified CIDR prefix. :param prefixlen: a CIDR prefix indicating size of subnets to be returned. :param count: (optional) number of consecutive IP subnets to be returned. :return: an iterator containing IPNetwork subnet objects. rräNrÃrpz,count outside of current IP subnet boundary!rÞ) rÊrrrrerFrœr±rfr$r·) rrÊÚcountÚfmtrrZ max_subnetsZ base_subnetÚiÚsubnetrrrrëýs,  ÿ ÿzIPNetwork.subnetcCs¢tgƒ}|jjdkrn|jdkrJtt|jd|jjƒt|jd|jjƒƒ}qžtt|j|jjƒt|j|jjƒƒ}n0|jdkržtt|jd|jjƒt|j|jjƒƒ}|S)a] A generator that provides all the IP addresses that can be assigned to hosts within the range of this IP object's subnet. - for IPv4, the network and broadcast addresses are always excluded. for subnets that contains less than 4 IP addresses /31 and /32 report in a manner per RFC 3021 - for IPv6, only the unspecified address '::' or Subnet-Router anycast address (first address in the network) is excluded. .. warning:: The next release (0.9.0) will contain a backwards incompatible change connected to handling of RFC 6164 IPv6 addresses (/127 and /128 subnets). When iterating ``IPNetwork`` and ``IPNetwork.iter_hosts()`` the first addresses in the networks will no longer be excluded. :return: an IPAddress iterator rDrprÃ)rºrrFr·r³rar±r²)rZit_hostsrrrÚ iter_hosts&s"  þþ þzIPNetwork.iter_hostscCs|j |j¡}d||jfS)z&:return: this IPNetwork in CIDR formatú%s/%s)rrœrrÊ)rrhrrrr¨RszIPNetwork.__str__cCsd|jj|fSr©r«rrrrr¬WszIPNetwork.__repr__)FNr)F)rp)rp)r)NN)%r[r\r]r^r_rrlrorÑr`rÊr—rÓrÕr±r²rÌÚsetterrÒr×rÔrNr~rrÂr/r0r r rârãrçrërìr¨r¬r¯rrrkrrÎIsZ/D ÿ              ),rÎc@sveZdZdZdZddd„Zdd„Zdd „Zd d „Ze d d „ƒZ e dd„ƒZ dd„Z dd„Z dd„Zdd„Zdd„ZdS)rÙzÝ An arbitrary IPv4 or IPv6 address range. Formed from a lower and upper bound IP address. The upper bound IP cannot be numerically smaller than the lower bound and the IP version of both must match. ©rÚrÛrcCsLt||d�|_|jj|_t||jj|d�|_t|jƒt|jƒkrHtdƒ‚dS)aë Constructor. :param start: an IPv4 or IPv6 address that forms the lower boundary of this IP range. :param end: an IPv4 or IPv6 address that forms the upper boundary of this IP range. :param flags: (optional) decides which rules are applied to the interpretation of the start and end values. Supported constants are INET_PTON and ZEROFILL. See the netaddr.core docs for further details. rÄz(lower bound IP greater than upper bound!N)rarÚrrFrÛrgr)rr½Úendrirrrrgs  zIPRange.__init__cCs|jj|jj|jjfS)z.:return: Pickled state of an `IPRange` object.)rÚr$rÛrrFrrrrrl}szIPRange.__getstate__cCs0|\}}}t||ƒ|_|jj|_t||ƒ|_dS)zQ :param state: data used to unpickle a pickled `IPRange` object. N)rarÚrrÛ)rrnr½rðrFrrrro�s   zIPRange.__setstate__cCsÄt|tƒr¸|jj|jjkrdSt|tƒrD|jj|jkoB|jj|jkSt|tƒrn|jj|jjkol|jj|jjkSt|t ƒr¸|jj |j }|j|?|>}|d|>}|jj|ko¶|jj|kSt|ƒ|kS)NFrp) rrrrFrarÚrrÛrÙrÎrrrÐ)rr6rÜZ other_startZother_next_startrrrr‹s&   ÿ ÿ    ÿzIPRange.__contains__cCs t|jƒS)z?The integer value of first IP address in this `IPRange` object.)rgrÚrrrrr±¡sz IPRange.firstcCs t|jƒS)z>The integer value of last IP address in this `IPRange` object.)rgrÛrrrrr²¦sz IPRange.lastcCs|jj|j|jfS)zP :return: A key tuple used to uniquely identify this `IPRange`. rÝrrrrr/«sz IPRange.keycCs$|jjt|jƒ}|jj|jj|fS)zY :return: A key tuple used to compare and sort this `IPRange` correctly. )rrrrr·rFrÚr)rZskeyrrrr0±szIPRange.sort_keycCst|j|jƒS)zx The list of CIDR addresses found within the lower and upper bound addresses of this `IPRange`. )Úiprange_to_cidrsrÚrÛrrrrÚcidrs¸sz IPRange.cidrscCsd|j|jfS)z<:return: this `IPRange` in a common representational format.z%s-%srïrrrrr¨¿szIPRange.__str__cCsd|jj|j|jfS)rªz%s('%s', '%s'))rfr[rÚrÛrrrrr¬ÃsÿzIPRange.__repr__N)r)r[r\r]r^r_rrlrorÂr`r±r²r/r0ròr¨r¬rrrrrÙ\s    rÙcgs"t|ƒD]}|D] }|VqqdS)zÊ :param args: A list of IP addresses and subnets passed in as arguments. :return: A generator that flattens out IP subnets, yielding unique individual IP addresses (no duplicates). N)Ú cidr_merge)ÚargsrNr—rrrÚiter_unique_ipsÉs rõc Csldd„}t|ƒr$d|ks |dkr$|Szt|ƒ}d|||ƒfWStk �rJd|kr´| dd¡\}}z,dt|ƒkr‚d ks’ntd |fƒ‚Wq¼tk r°|YYSXn|}d }| d ¡}t|ƒd krÚ|YStd t|ƒƒD]}| d¡qê|d k�r4z||dƒ}Wntk �r2|YYSXdd  |¡|fYStt fk �rf|YSXd S)aË A function that converts abbreviated IPv4 CIDRs to their more verbose equivalent. :param abbrev_cidr: an abbreviated CIDR. Uses the old-style classful IP address rules to decide on a default subnet prefix if one is not explicitly provided. Only supports IPv4 addresses. Examples :: 10 - 10.0.0.0/8 10/16 - 10.0.0.0/16 128 - 128.0.0.0/16 128/8 - 128.0.0.0/8 192.168 - 192.168.0.0/16 :return: A verbose CIDR from an abbreviated CIDR or old-style classful network address. The original value if it was not recognised as a supported abbreviation. cSsžt|ƒ}d|krdks*ntd|ƒ‚d|kr>dkrFnndSd|krZdkrbnndSd |krvd kr~nnd Sd |kr’d kršnndSdS)NréÿzInvalid octet: %r!ér‹é€é¿ééÀéßééàéïrDrU)rgrz)ÚoctetrrrÚclassful_prefixïs z/cidr_abbrev_to_verbose..classful_prefixú:Úz %s.0.0.0/%srcrprrUz.prefixlen in address %r out of range for IPv4!NÚ.rDr‡rí) rrgrerÈrÆÚrangeråÚjoinrrz)Z abbrev_cidrrrêZ part_addrÚprefixÚtokensrrrrÇÕs@ÿ     rÇc Cs‚t|dƒstdƒ‚g}|D]8}t|ttfƒr2|}nt|ƒ}| |j|j|j|f¡q|  ¡t |ƒd}|dkrø||d||ddkrî||dd||ddkrî||d||dt ||dd||dƒf||d<||=|d8}qhg}|D]|}t |ƒdk�rB|d}t|tƒ�r6|  |  ¡¡n | |¡n8|d}t|d|d�} t|d|d�} |  t| | ƒ¡�q|S) a† A function that accepts an iterable sequence of IP addresses and subnets merging them into the smallest possible list of CIDRs. It merges adjacent subnets where possible, those contained within others and also removes any duplicates. :param ip_addrs: an iterable sequence of IP addresses, subnets or ranges. :return: a summarized list of `IPNetwork` objects. r¶z#A sequence or iterator is expected!rprrÃrDérØ)r›rerrÎrÙrårFr²r±ÚsortrÆÚminÚextendròrarñ) Úip_addrsZrangesr—ZnetrêÚmergedZ range_tupleÚoriginalrFZ range_startZ range_stoprrrró)s6  <<   rócCst||ƒ\}}}||S)a Removes an exclude IP address or subnet from target IP subnet. :param target: the target IP address or subnet to be divided up. :param exclude: the IP address or subnet to be removed from target. :return: list of `IPNetwork` objects remaining after exclusion. )Úcidr_partition)ÚtargetÚexcludeÚleftÚ_ÚrightrrrÚ cidr_exclude\s rc Cs"t|ƒ}t|ƒ}|j|jkr*gg|jgfS|j|jkrD|jgggfS|j|jkr\g|ggfSg}g}|jd}|jj}|j}|j}|}|d||} |j|k�r |j| krÈ| t||f|d�¡| } n| t| |f|d�¡|} |d7}||krö�q | }| d||} q–||g|ddd…fS)ac Partitions a target IP subnet on an exclude IP address. :param target: the target IP address or subnet to be divided up. :param exclude: the IP address or subnet to partition on :return: list of `IPNetwork` objects before, the partition and after, sorted. Adding the three lists returns the equivalent of the original subnet. rprÃrØNéÿÿÿÿ) rÎr²r±rNrÊrrrrFrå) rrrrZ new_prefixlenZtarget_module_widthZ target_firstrFZi_lowerZi_upperÚmatchedrrrrjs8        rc Csòt|ƒ}ztt|ƒƒ}tt|ƒƒ}Wntk r@tdƒ‚YnX||krT|}|}n|}|}|D]$}t|ƒ}||krx|}||kr`|}q`|j|jkrštdƒ‚|j}|j} |j } |j j } | dkrà|| krà| d8} |d| | > M}q´t|| f|jd�S)aO Function that accepts a sequence of IP addresses and subnets returning a single `IPNetwork` subnet that is large enough to span the lower and upper bound IP addresses with a possible overlap on either end. :param ip_addrs: sequence of IP addresses and subnets. :return: a single spanning `IPNetwork` subnet. z-IP sequence must contain at least 2 elements!z.IP sequence cannot contain both IPv4 and IPv6!rrprØ) rºrÎrÚ StopIterationrerFrr²rÊr±rrr) r Z ip_addrs_iterZ network_aZ network_bZ min_networkZ max_networkr—rÓZipnumrÊZ lowest_ipnumrrrrrÚ spanning_cidr¦s6   rrpccsžt|ƒ}t|ƒ}|j|jkr$tdƒ‚|j}t|ƒ}|dkrBtdƒ‚t|ƒ}t|ƒ}d}|dkrbd}||}||7}|r‚||ksŒqšn ||ksŒqšt||ƒVqjdS)a‘ A generator that produces IPAddress objects between an arbitrary start and stop IP address with intervals of step between them. Sequences produce are inclusive of boundary IPs. :param start: start IP address. :param end: end IP address. :param step: (optional) size of step between IP addresses. Default: 1 :return: an iterator of one or more `IPAddress` objects. z(start and stop IP versions do not match!rzstep argument cannot be zeroFTN)rarFrrgre)r½rðr¿rFr¾Z negative_stepr»rrrr³Ôs* r³cCs¼g}t|ƒ}t|ƒ}|j|jg}t||gƒ}|jj}|j|dkrrt|dd|f|jd�}t||ƒd}| ¡}|j|dkr®t|dd|f|jd�}|t||ƒd7}n |  |¡|S)a` A function that accepts an arbitrary start and end IP address or subnet and returns a list of CIDR subnets that fit exactly between the boundaries of the two with no overlap. :param start: the start IP address or subnet. :param end: the end IP address or subnet. :return: a list of one or more IP addresses and subnets. rrprØrÃ) rÎr±r²rrrrrFrÚpoprå)r½rðZ cidr_listZiprangeZ cidr_spanrrrrrrrñs    rñcCsdd}t|dƒstd|fƒ‚t|ƒ}tdd„|DƒƒD](}||krH|}q6|dk r6|j|kr6q`q6|S)ab Matches an IP address or subnet against a given sequence of IP addresses and subnets. :param ip: a single IP address or subnet. :param cidrs: a sequence of IP addresses and/or subnets. :return: the smallest (most specific) matching IPAddress or IPNetwork object from the provided sequence, None if there was no match. Nr¶ú,IP address/subnet sequence expected, not %r!cSsg|] }t|ƒ‘qSr©rΩÚ.0rNrrrÚ :sz*smallest_matching_cidr..)r›rraÚsortedrÓ©r—ròÚmatchrNrrrÚsmallest_matching_cidr's  ÿr$cCsPd}t|dƒstd|fƒ‚t|ƒ}tdd„|DƒƒD]}||kr6|}qLq6|S)ab Matches an IP address or subnet against a given sequence of IP addresses and subnets. :param ip: a single IP address or subnet. :param cidrs: a sequence of IP addresses and/or subnets. :return: the largest (least specific) matching IPAddress or IPNetwork object from the provided sequence, None if there was no match. Nr¶rcSsg|] }t|ƒ‘qSrrrrrrr Wsz)largest_matching_cidr..)r›rrar!r"rrrÚlargest_matching_cidrDs  ÿr%cCsjg}t|dƒstd|fƒ‚t|ƒ}tdd„|DƒƒD].}||krN| |¡q6|r6|j|dkr6qfq6|S)aM Matches an IP address or subnet against a given sequence of IP addresses and subnets. :param ip: a single IP address. :param cidrs: a sequence of IP addresses and/or subnets. :return: all matching IPAddress and/or IPNetwork objects from the provided sequence, an empty list if there was no match. r¶rcSsg|] }t|ƒ‘qSrrrrrrr rsz&all_matching_cidrs..r)r›rrar!rårÓ)r—ròZmatchesrNrrrÚall_matching_cidrs_s  ÿ r&z 127.0.0.0/8z 10.0.0.0/8z 100.64.0.0/10z 172.16.0.0/12z 192.0.0.0/24z192.168.0.0/16z 198.18.0.0/15z 239.0.0.0z239.255.255.255z169.254.0.0/16z 224.0.0.0/4z192.88.99.0/24z 0.0.0.0/8z 192.0.2.0/24z 240.0.0.0/4z198.51.100.0/24z203.0.113.0/24z233.252.0.0/24z 234.0.0.0z238.255.255.255z 225.0.0.0z231.255.255.255z::1zfc00::/7z fec0::/10z fe80::/10zff00::/8z ff00::/12z::/8z0100::/8z0200::/7z0400::/6z0800::/5z1000::/4z4000::/3z6000::/3z8000::/3zA000::/3zC000::/3zE000::/4zF000::/5zF800::/6zFE00::/9)Fr)rp)7r^ÚsysÚ_sysÚ netaddr.corerrrrrrrr r r Znetaddr.strategyr r@r rBÚnetaddr.compatrrrrrrÚobjectrrar°rÍrÎrÙrõrÇrórrrr³rñr$r%r&rGrJrPrAZ IPV4_6TO4rRrHrKrQrCrSrrrrÚs–0 U<e Dm T3<. /$ù ö õþø