a Z^"@sdZddlZdZdZGdddeZGdddeZd d Zd7}|d|j krqqdS)Nz1first and last must be IP addresses, not networks%%s and %s are not of the same versionz*last IP address must be greater than firstrzunknown IP versionr)) isinstance _BaseAddress TypeErrorversionrrr_max_prefixlenr,r3r6r4 _ALL_ONES)r/r0r1Zip_bitsZ first_intZlast_intZnbitsnetr r r summarize_address_ranges6      r@ccst|}i}|rV|}|}||}|dur<|||<q ||kr ||=||q d}t|D]$}|dur|j|jkrqf|V|}qfdSN)listpopsupernetgetappendsortedvaluesbroadcast_address)r-Zto_mergesubnetsr?rDexistingr0r r r _collapse_addresses_internals$    rLc Cs.g}g}g}|D]}t|trR|rF|dj|jkrFtd||df||q|j|jkr|r|dj|jkrtd||dfz||jWqty||j Yq0q|r|dj|jkrtd||df||qt t |}|r"t |D]\}}| t||qt||S)Nr7)r9r:_versionr;rF _prefixlenr=r1AttributeErrornetwork_addressrGsetr2extendr@rL)r-ZaddrsZipsZnetsr1r/r0r r r collapse_addresses2s:      rTcCs(t|tr|St|tr$|StSrA)r9 _BaseNetwork_get_networks_keyr:_get_address_keyNotImplemented)objr r r get_mixed_type_keyhs   rZc@seZdZdZeddZeddZeddZedd Zd d Z d d Z e ddZ e ddZ e ddZe ddZe ddZe ddZddZdS)_IPAddressBaser cCs|SrA)_explode_shorthand_ip_stringselfr r r explodedsz_IPAddressBase.explodedcCst|SrAr#r]r r r compressedsz_IPAddressBase.compressedcCs|SrA)_reverse_pointerr]r r r reverse_pointers z_IPAddressBase.reverse_pointercCsdt|f}t|dS)Nz%200s has no version specifiedtypeNotImplementedErrorr^msgr r r r<sz_IPAddressBase.versioncCsF|dkrd}t|||jf||jkrBd}t|||j|jfdS)Nrz-%d (< 0) is not permitted as an IPv%d addressz2%d (>= 2**%d) is not permitted as an IPv%d address)rrNr>r=)r^rrhr r r _check_int_addresss  z!_IPAddressBase._check_int_addresscCs.t|}||kr*d}t|||||jfdS)Nz6%r (len %d != %d) is not permitted as an IPv%d address)r%rrN)r^rZ expected_lenZ address_lenrhr r r _check_packed_addresss z$_IPAddressBase._check_packed_addresscCs|j|j|?ASrA)r>)cls prefixlenr r r _ip_int_from_prefixs z"_IPAddressBase._ip_int_from_prefixc Cs\t||j}|j|}||?}d|>d}||krX|jd}||d}d}t|||S)Nr)rz&Netmask pattern %r mixes zeroes & ones)r6r=rr) rkip_intZtrailing_zeroesrlZ leading_onesZall_onesZbyteslenZdetailsrhr r r _prefix_from_ip_ints      z"_IPAddressBase._prefix_from_ip_intcCsd|}t|ddS)Nz%r is not a valid netmask)r )rkZ netmask_strrhr r r _report_invalid_netmasksz&_IPAddressBase._report_invalid_netmaskcCsj|r|s||z t|}WntyB||Yn0d|krZ|jksfn|||SNr)isasciiisdigitrqintrr=)rkZ prefixlen_strrlr r r _prefix_from_prefix_strings    z)_IPAddressBase._prefix_from_prefix_stringcCsz||}Wnty*||Yn0z ||WStyJYn0||jN}z ||WSty~||Yn0dSrA)_ip_int_from_stringrrqrprr>)rkip_strror r r _prefix_from_ip_strings      z%_IPAddressBase._prefix_from_ip_stringcCsHt|ttfr||jfSt|ts*t|}t|dkr:|S|d|jfS)Nr)r)r9bytesrur=tupler'r%)rkrr r r _split_addr_prefixs    z!_IPAddressBase._split_addr_prefixcCs|jt|ffSrA) __class__r#r]r r r __reduce__/sz_IPAddressBase.__reduce__N)rrr __slots__propertyr_rarcr<rirj classmethodrmrprqrvryr|r~r r r r r[s0          ! r[cspeZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ ddZ fddZZS)r:r cCs|jSrAr,r]r r r __int__@sz_BaseAddress.__int__cCs6z|j|jko|j|jkWSty0tYS0dSrA)r,rNrPrXr^otherr r r __eq__Cs    z_BaseAddress.__eq__cCsFt|tstS|j|jkr*td||f|j|jkrB|j|jkSdSNr7F)r9r:rXrNr;r,rr r r __lt__Js    z_BaseAddress.__lt__cCs t|tstS|t||SrAr9rurXr}rr r r __add__Vs z_BaseAddress.__add__cCs t|tstS|t||SrArrr r r __sub__[s z_BaseAddress.__sub__cCsd|jjt|fSNz%s(%r)r}rr#r]r r r __repr__`sz_BaseAddress.__repr__cCst||jSrA)r#_string_from_ip_intr,r]r r r __str__csz_BaseAddress.__str__cCsttt|jSrA)hashhexrur,r]r r r __hash__fsz_BaseAddress.__hash__cCs |j|fSrArNr]r r r rWisz_BaseAddress._get_address_keycCs|j|jffSrA)r}r,r]r r r r~lsz_BaseAddress.__reduce__cs|r|ddkrtt||Stdur8ddl}|dat|}|sRt|S|\}}}|dkr||j dkrxd}nd}|dkr|j }n |j d}|r||dd 7}|r|d 7}tt ||d |||S) NrMsrz(#?)(_?)([xbnX])nrbxr)r"0) formatr#_address_fmt_rerecompile fullmatchsuper __format__groupsrNr=ru)r^fmtrmZ alternategroupingZfmt_baseZpadlenr}r r ros*     z_BaseAddress.__format__)rrrrrrrrrrrrrWr~r __classcell__r r rr r:5s  r:c@s\eZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ e jddZe jddZeddZeddZeddZedd Zed!d"Zed#d$Zd%d&Zd'd(Zd)d*ZdEd-d.ZdFd/d0Zed1d2Zed3d4Zd5d6Z d7d8Z!ed9d:Z"ed;d<Z#ed=d>Z$ed?d@Z%edAdBZ&edCdDZ'd,S)GrUcCsd|jjt|fSrrr]r r r rsz_BaseNetwork.__repr__cCsd|j|jfSN%s/%d)rQrlr]r r r rsz_BaseNetwork.__str__ccs8t|j}t|j}t|d|D]}||Vq"dSr(rurQrIrange_address_classr^network broadcastrr r r hostss  z_BaseNetwork.hostsccs8t|j}t|j}t||dD]}||Vq"dSr(rrr r r __iter__s  z_BaseNetwork.__iter__cCslt|j}t|j}|dkr>|||kr0td|||S|d7}|||krZtd|||SdS)Nrzaddress out of ranger))rurQrI IndexErrorr)r^rrrr r r __getitem__s    z_BaseNetwork.__getitem__cCs^t|tstS|j|jkr*td||f|j|jkrB|j|jkS|j|jkrZ|j|jkSdSr)r9rUrXrNr;rQnetmaskrr r r rs      z_BaseNetwork.__lt__cCsJz.|j|jko,|j|jko,t|jt|jkWStyDtYS0dSrA)rNrQrurrPrXrr r r rs   z_BaseNetwork.__eq__cCstt|jt|jASrA)rrurQrr]r r r rsz_BaseNetwork.__hash__cCs8|j|jkrdSt|trdS|j|jj@|jjkSdSNF)rNr9rUr,rrQrr r r __contains__s   z_BaseNetwork.__contains__cCs(|j|vp&|j|vp&|j|vp&|j|vSrA)rQrIrr r r overlapss    z_BaseNetwork.overlapscCs|t|jt|jBSrA)rrurQhostmaskr]r r r rIs z_BaseNetwork.broadcast_addresscCs|t|j|jASrA)rrurr>r]r r r rsz_BaseNetwork.hostmaskcCsd|j|jfSr)rQrOr]r r r with_prefixlensz_BaseNetwork.with_prefixlencCsd|j|jfSN%s/%s)rQrr]r r r with_netmasksz_BaseNetwork.with_netmaskcCsd|j|jfSr)rQrr]r r r with_hostmask sz_BaseNetwork.with_hostmaskcCst|jt|jdSr()rurIrQr]r r r num_addresses sz_BaseNetwork.num_addressescCsdt|f}t|dS)Nz%%200s has no associated address classrdrgr r r rsz_BaseNetwork._address_classcCs|jSrA)rOr]r r r rlsz_BaseNetwork.prefixlenccs|j|jkstd||ft|ts2td|||sLtd||f||krXdS|d|j|jf}| \}}||kr||kr||r|V| \}}qz||r|V| \}}qzt d|||fqz||kr|Vn"||kr|Vnt d|||fdS)Nr7z%s is not a network objectz%s not contained in %srz3Error performing exclusion: s1: %s s2: %s other: %s) rNr;r9rU subnet_ofrr}rQrlrJAssertionError)r^rs1s2r r r address_excludes>$        z_BaseNetwork.address_excludecCs`|j|jkrtd||f|j|jkr,dS|j|jkr 0z0prefix length diff %d is invalid for netblock %s) rOr=rrurQrIrrr}) r^prefixlen_diff new_prefix new_prefixlenstartendstepZnew_addrcurrentr r r rJs0      z_BaseNetwork.subnetscCs|jdkr|S|durB||jkr(td|dkr8td|j|}|j|}|dkrftd|j|f|t|jt|j|>@|fS)Nrznew prefix must be shorterr)rz;current prefixlen is %d, cannot have a prefixlen_diff of %d)rOrrlr}rurQr)r^rrrr r r rDs&    z_BaseNetwork.supernetcCs|jjo|jjSrA)rQ is_multicastrIr]r r r rs z_BaseNetwork.is_multicastcCsfz:|j|jkr"t|d|d|j|jko8|j|jkWSty`td|d|Yn0dS)Nz and z are not of the same versionz*Unable to test subnet containment between )rNr;rQrIrP)arr r r _is_subnet_of s    z_BaseNetwork._is_subnet_ofcCs |||SrArrr r r rsz_BaseNetwork.subnet_ofcCs |||SrArrr r r supernet_ofsz_BaseNetwork.supernet_ofcCs|jjo|jjSrA)rQ is_reservedrIr]r r r r!s z_BaseNetwork.is_reservedcCs|jjo|jjSrA)rQ is_link_localrIr]r r r r-sz_BaseNetwork.is_link_localcCs|jjo|jjSrA)rQ is_privaterIr]r r r r8s z_BaseNetwork.is_privatecCs|j SrArr]r r r is_globalDs z_BaseNetwork.is_globalcCs|jjo|jjSrA)rQis_unspecifiedrIr]r r r rOs z_BaseNetwork.is_unspecifiedcCs|jjo|jjSrA)rQ is_loopbackrIr]r r r r[s z_BaseNetwork.is_loopback)r)N)r)N)(rrrrrrrrrrrrr functoolscached_propertyrIrrrrrrrrlrrrVrJrDr staticmethodrrrrrrrrrr r r r rUsb            K0 5 )       rUc@seZdZdZdZdedZeZiZddZ e ddZ e d d Z e d d Z e d dZddZeddZeddZdS)_BaseV4r rr"r)cCst|SrAr`r]r r r r\zsz$_BaseV4._explode_shorthand_ip_stringcCs||jvrt|tr<|}d|kr.|jkshn||n,z||}Wntyf||}Yn0t| |}||f|j|<|j|Srr) _netmask_cacher9rur=rqrvr ryr rmrkargrlrr r r _make_netmask}s    z_BaseV4._make_netmaskc Cs|s td|d}t|dkr.td|ztt|j|dWStyz}ztd||fdWYd}~n d}~00dS)NAddress cannot be empty.rzExpected 4 octets in %rr%s in %r)rr$r%ru from_bytesmap _parse_octetr)rkrxZoctetsexcr r r rws   z_BaseV4._ip_int_from_stringcCsj|s td|r|s,d}t||t|dkrHd}t||t|d}|dkrftd||S)NzEmpty octet not permittedz#Only decimal digits permitted in %rz$At most 3 characters permitted in %r zOctet %d (> 255) not permitted)rrsrtr%ru)rkZ octet_strrhZ octet_intr r r rs     z_BaseV4._parse_octetcCsdtt|ddS)Nrrr)joinrr#r)rkror r r rs z_BaseV4._string_from_ip_intcCs&t|dddd}d|dS)NrrMz .in-addr.arpa)r#r$r)r^Zreverse_octetsr r r rbsz_BaseV4._reverse_pointercCs|jSrAr=r]r r r max_prefixlensz_BaseV4.max_prefixlencCs|jSrArr]r r r r<sz_BaseV4.versionN)rrrrrN IPV4LENGTHr>r=rr\rrrwrrrbrrr<r r r r rgs&        rc@seZdZdZddZeddZeddZee dd Z ee d d Z ed d Z eddZ eddZeddZdS)r )r, __weakref__cCsrt|tr||||_dSt|trF||dt|d|_dSt|}d|vrbtd|| ||_dS)Nrrr!Unexpected '/' in %r) r9rurir,rzrjrr#rrwr^rZaddr_strr r r __init__s     zIPv4Address.__init__cCs t|jSrA)rr,r]r r r packedszIPv4Address.packedcCs ||jjvSrA) _constants_reserved_networkr]r r r rs zIPv4Address.is_reservedcstfddjjDS)Nc3s|]}|vVqdSrAr .0r?r]r r 2z)IPv4Address.is_private..anyr_private_networksr]r r]r r(s zIPv4Address.is_privatecCs||jjvo|j SrA)r_public_networkrr]r r r r4szIPv4Address.is_globalcCs ||jjvSrAr_multicast_networkr]r r r r9s zIPv4Address.is_multicastcCs ||jjkSrA)r_unspecified_addressr]r r r rDs zIPv4Address.is_unspecifiedcCs ||jjvSrA)r_loopback_networkr]r r r rOszIPv4Address.is_loopbackcCs ||jjvSrAr_linklocal_networkr]r r r rYszIPv4Address.is_link_localN)rrrrrrrrr lru_cacherrrrrrr r r r r s(#       r c@sxeZdZddZejddZddZddZd d Z d d Z e j Z e d dZe ddZe ddZe ddZdS)rcCsD||\}}t||t||fdd|_|jj|_|jj|_dSNF)r)r|r rrrrrOr^rr&maskr r r rfs   zIPv4Interface.__init__cCs|jjSrArrr]r r r rnszIPv4Interface.hostmaskcCsd||j|jfSrrr,rOr]r r r rrs zIPv4Interface.__str__cCsDt||}|tus|s|Sz|j|jkWSty>YdS0dSr)r rrXrrPr^rZ address_equalr r r rvs   zIPv4Interface.__eq__cCsPt||}|turtSz|j|jkp4|j|jko4|WStyJYdS0dSr)r rrXrrPr^rZ address_lessr r r rs   zIPv4Interface.__lt__cCs|j|jAt|jjASrAr,rOrurrQr]r r r rszIPv4Interface.__hash__cCs t|jSrA)r r,r]r r r r1szIPv4Interface.ipcCsd||j|jfSrrr]r r r rs zIPv4Interface.with_prefixlencCsd||j|jfSrrr,rr]r r r rs zIPv4Interface.with_netmaskcCsd||j|jfSrrr,rr]r r r rs zIPv4Interface.with_hostmaskN)rrrrrrrrrrrr[r~rr1rrrr r r r rds       rc@s.eZdZeZdddZeeddZ dS)rTcs||\}t|_||\|_|_t|j}|t|j@|krl|rXtd|nt|t|j@|_|j|jdkr|j |_ n|j|jkrfdd|_ dS)N%s has host bits setr)cs tgSrA)r r r&r r rz&IPv4Network.__init__..) r|r rQrrrOrurr=rrr^rrrrr rr rs#    zIPv4Network.__init__cCs&|jtdvo|jtdv o$|j S)N 100.64.0.0/10)rQrrIrr]r r r rs  zIPv4Network.is_globalN)T) rrrr rrrrrrr r r r rs   4rc@seZdZedZedZedZedZededededededed ed ed ed ed edededgZedZ e dZ dS)_IPv4Constantsz169.254.0.0/16z 127.0.0.0/8z 224.0.0.0/4rz 0.0.0.0/8z 10.0.0.0/8z 172.16.0.0/12z 192.0.0.0/29z192.0.0.170/31z 192.0.2.0/24z192.168.0.0/16z 198.18.0.0/15z198.51.100.0/24z203.0.113.0/24z 240.0.0.0/4z255.255.255.255/32z0.0.0.0N) rrrrrrrrrrr rr r r r rs*rc@seZdZdZdZdedZdZedZ eZ iZ e ddZ e d d Ze d d Ze d dZe dddZddZddZeddZeddZeddZdS)_BaseV6r r8r"r)rn0123456789ABCDEFabcdefcCsl||jvrbt|tr<|}d|kr.|jksFn||n ||}t||}||f|j|<|j|Srr)rr9rur=rqrvr rmrr r r r/s    z_BaseV6._make_netmaskc Cs|s td|d}d}t||kr:d||f}t|d|dvrzt|j}Wn6ty}ztd||fdWYd}~n d}~00|d|d ?d @|d|d @|jd }t||krd |d |f}t|d}td t|d D]*} || s|dur"d |}t|| }q|dur|} t||d } |dsn| d 8} | rnd}t|||ds| d 8} | rd}t|||j| | } | d kr4d}t||jd |fnjt||jkrd}t||j|f|ds d}t|||ds$d}t||t|} d} d} znd} t| D] } | d K} | | || O} qB| d | K} t| dD] } | d K} | | || O} q|| WSt y}ztd||fdWYd}~n d}~00dS)Nr:rz At least %d parts expected in %rrrMr%xrr)z!At most %d colons permitted in %rz At most one '::' permitted in %rrz0Leading ':' only permitted as part of '::' in %rz1Trailing ':' only permitted as part of '::' in %rz/Expected at most %d other parts with '::' in %rz,Exactly %d parts expected without '::' in %r) rr$r%r rCr,rF _HEXTET_COUNTr _parse_hextetr)rkrxpartsZ _min_partsrhZipv4_intrZ _max_partsZ skip_indexiZparts_hiZparts_loZ parts_skippedror r r rwCs    (               z_BaseV6._ip_int_from_stringcCs>|j|std|t|dkr4d}t||t|dS)NzOnly hex digits permitted in %rrz$At most 4 characters permitted in %rr) _HEX_DIGITS issupersetrr%ru)rkZ hextet_strrhr r r rs     z_BaseV6._parse_hextetc Csd}d}d}d}t|D]>\}}|dkrN|d7}|dkr<|}||krV|}|}qd}d}q|dkr||}|t|kr~|dg7}dg|||<|dkrdg|}|S)NrMrrr)) enumerater%) rkhextetsZbest_doublecolon_startZbest_doublecolon_lenZdoublecolon_startZdoublecolon_lenindexZhextetZbest_doublecolon_endr r r _compress_hextetss0   z_BaseV6._compress_hextetsNcsZ|durt|j}||jkr$tdd|fddtdddD}||}d|S) NzIPv6 address is too large%032xcs&g|]}dt||ddqS)rrr)rurrZhex_strr r rz/_BaseV6._string_from_ip_int..rrrr)rur,r>rrr#r)rkror!r r&r rs   z_BaseV6._string_from_ip_intcst|trt|j}nt|tr,t|j}nt|}||}d|fddtdddD}t|ttfrdd ||j fSd |S) Nr$csg|]}||dqS)rr r%r&r r r'"rz8_BaseV6._explode_shorthand_ip_string..rrrrr) r9rr#rQrr1rwrrUrrO)r^rxrorr r&r r\s     z$_BaseV6._explode_shorthand_ip_stringcCs&|jddddd}d|dS)NrMrrrz .ip6.arpa)r_replacer)r^Z reverse_charsr r r rb'sz_BaseV6._reverse_pointercCs:|d\}}}|sd}n|r&d|vr2td|||fS)N%zInvalid IPv6 address: "%r") partitionr)rxr&sepscope_idr r r _split_scope_id0s   z_BaseV6._split_scope_idcCs|jSrArr]r r r rDsz_BaseV6.max_prefixlencCs|jSrArr]r r r r<Hsz_BaseV6.version)N)rrrrrN IPV6LENGTHr>r frozensetrr=rrrrwrr#rr\rbrr-rrr<r r r r rs2    g  /    rcseZdZdZddZfddZddZfdd Zed d Z ed d Z eddZ eddZ eddZ eddZeeddZeddZeddZeddZeddZed d!Zed"d#ZZS)$r )r, _scope_idrcCst|tr$||||_d|_dSt|trR||dt|d|_d|_dSt|}d|vrnt d|| |\}|_| ||_dS)Nrrr!r) r9rurir,r0rzrjrr#rr-rwrr r r rSs     zIPv6Address.__init__cs"t}|jr|d|jS|S)Nr))rrr0)r^rxrr r r{s zIPv6Address.__str__cCst|j|jfSrA)rr,r0r]r r r rszIPv6Address.__hash__cs2t|}|turtS|s dS|jt|ddkS)NFr0)rrrXr0getattrr rr r rs  zIPv6Address.__eq__cCs|jSrA)r0r]r r r r,s zIPv6Address.scope_idcCs t|jSrA)r r,r]r r r rszIPv6Address.packedcCs ||jjvSrArr]r r r rs zIPv6Address.is_multicastcstfddjjDS)Nc3s|]}|vVqdSrAr r%r]r r rrz*IPv6Address.is_reserved..)rr_reserved_networksr]r r]r rs zIPv6Address.is_reservedcCs ||jjvSrArr]r r r rszIPv6Address.is_link_localcCs ||jjvSrA)r_sitelocal_networkr]r r r is_site_locals zIPv6Address.is_site_localcstfddjjDS)Nc3s|]}|vVqdSrAr rr]r r rrz)IPv6Address.is_private..rr]r r]r rs zIPv6Address.is_privatecCs|j SrArr]r r r rs zIPv6Address.is_globalcCs |jdkSrrrr]r r r rs zIPv6Address.is_unspecifiedcCs |jdkSr(rr]r r r rs zIPv6Address.is_loopbackcCs |jd?dkrdSt|jd@S)Nrrr,r r]r r r ipv4_mappeds zIPv6Address.ipv4_mappedcCs4|jd?dkrdSt|jd?d@t|jd@fS)N`i @r5r6r]r r r teredos zIPv6Address.teredocCs$|jd?dkrdSt|jd?d@S)Npi Pr5r6r]r r r sixtofours zIPv6Address.sixtofour)rrrrrrrrrr,rrrrr4rrrrrrr7r:r=rr r rr r Ms@(              r cseZdZddZejddZfddZddZd d Z d d Z e j Z e d dZe ddZe ddZe ddZe ddZe ddZZS)rcCsD||\}}t||t||fdd|_|jj|_|jj|_dSr)r|r rrrrrOrr r r r"s   zIPv6Interface.__init__cCs|jjSrArr]r r r r*szIPv6Interface.hostmaskcsdt|jfSr)rrrOr]rr r r.s zIPv6Interface.__str__cCsDt||}|tus|s|Sz|j|jkWSty>YdS0dSr)r rrXrrPr r r r r2s   zIPv6Interface.__eq__cCsPt||}|tur|Sz|j|jkp4|j|jko4|WStyJYdS0dSr)r rrXrrPr r r r r>s   zIPv6Interface.__lt__cCs|j|jAt|jjASrAr r]r r r rJszIPv6Interface.__hash__cCs t|jSrA)r r,r]r r r r1OszIPv6Interface.ipcCsd||j|jfSrrr]r r r rSs zIPv6Interface.with_prefixlencCsd||j|jfSrr r]r r r rXs zIPv6Interface.with_netmaskcCsd||j|jfSrr r]r r r r]s zIPv6Interface.with_hostmaskcCs|jdko|jjSrr)r,rrr]r r r rbszIPv6Interface.is_unspecifiedcCs|jdko|jjSr()r,rrr]r r r rfszIPv6Interface.is_loopback)rrrrrrrrrrrr[r~rr1rrrrrrr r rr r s(         rc@s.eZdZeZd ddZddZeddZdS) rTcs||\}t|_||\|_|_t|j}|t|j@|krl|rXtd|nt|t|j@|_|j|jdkr|j |_ n|j|jkrfdd|_ dS)Nrr)cs tgSrA)r r rr r rrz&IPv6Network.__init__..) r|r rQrrrOrurr=rrrr rr r{s    zIPv6Network.__init__ccs<t|j}t|j}t|d|dD]}||Vq&dSr(rrr r r rs  zIPv6Network.hostscCs|jjo|jjSrA)rQr4rIr]r r r r4s zIPv6Network.is_site_localN)T) rrrr rrrrr4r r r r rks  0 rc@seZdZedZedZededededededed ed ed edg Zed ed edededededededededededededgZedZdS)_IPv6Constantsz fe80::/10zff00::/8z::1/128z::/128z ::ffff:0:0/96z100::/64z 2001::/23z 2001:2::/48z 2001:db8::/32z 2001:10::/28zfc00::/7z::/8z100::/8z200::/7z400::/6z800::/5z1000::/4z4000::/3z6000::/3z8000::/3zA000::/3zC000::/3zE000::/4zF000::/5zF800::/6zFE00::/9z fec0::/10N) rrrrrrrr2r3r r r r r>s.        r>)T)# __version__rrr.rrr rrrrr r'r2r6r@rLrTrZr[rtotal_orderingr:rUrr rrrrrr rrr>r r r r  sV #7163kH uCR4TK\!