QfR2F dZddlZdZdZGddeZGddeZd Zd1d Zd Z d Z d Z dZ dZ dZdZdZdZdZGddZdaej*GddeZej*GddeZGddZee_GddZGdd eeZGd!d"eZGd#d$eeZGd%d&Zee_ee_Gd'd(ZGd)d*eeZ Gd+d,e Z!Gd-d.eeZ"Gd/d0Z#e#e _e#e"_y)2z1.0N c eZdZy)AddressValueErrorN__name__ __module__ __qualname__0/opt/alt/python312/lib64/python3.12/ipaddress.pyrr/r rc eZdZy)NetmaskValueErrorNrr r r rrrr rc t|S#ttf$rYnwxYw t|S#ttf$rYnwxYwt |d)Nz. does not appear to be an IPv4 or IPv6 address) IPv4Addressrr IPv6Address ValueErroraddresss r ip_addressrsl 7## 0 1    7## 0 1    {"PQ RR    /AAc t||S#ttf$rYnwxYw t||S#ttf$rYnwxYwt |d)Nz. does not appear to be an IPv4 or IPv6 network) IPv4Networkrr IPv6Networkr)rstricts r ip_networkr9sp 7F++ 0 1    7F++ 0 1    {"PQ RRs !! 1AAc t|S#ttf$rYnwxYw t|S#ttf$rYnwxYwt |d)Nz0 does not appear to be an IPv4 or IPv6 interface) IPv4Interfacerr IPv6Interfacerrs r ip_interfacer!Vsl( W%% 0 1    W%% 0 1    {"RS TTrcX |jdS#t$r tdwxYw)Nz&Address negative or too large for IPv4to_bytes OverflowErrorrrs r v4_int_to_packedr'xs; C"" CABBC)cX |jdS#t$r tdwxYw)Nz&Address negative or too large for IPv6r$rs r v6_int_to_packedr+s;C## CABBCr(ct t|jd}t|dkDrtd||S)N/zOnly one '/' permitted in )strsplitlenr)raddrs r _split_optional_netmaskr3s<K w<  c "D 4y1}"ip_bits first_intlast_intnbitsnets r summarize_address_rangerUs-2| , l +KLL }} $&' ' t|EFF }}  !  -..""G IxxH x .y'B )A-99;a?A)Wu_-. Q%Z q=BLL (  x s D%D*(D*c#ZK t|}i}|rU|j}|j}|j|}||||<n||k7r||=|j ||rUd}t |j D]$}||j|jk\r||}&ywN)listpopsupernetgetappendsortedvaluesbroadcast_address)r:to_mergesubnetsrTrZexistingr=s r _collapse_addresses_internalrcs0IHG lln<<>;;x(   #GH  _! OOH %  Dgnn&'  %%)>)>> (s A%B+(AB+c g}g}g}|D]}t|trD|r0|dj|jk7rt|d|dd|j |X|j |j k(rO|r0|dj|jk7rt|d|dd |j |j|r0|dj|jk7rt|d|dd|j |tt|}|r.t|D] \}}|jt||"t||zS#t$r|j |jYwxYw)NrGrH)rJrK_versionrLr\ _prefixlenrNr>AttributeErrornetwork_addressr]setr?extendrUrc)r:addrsipsnetsr>r<r=s r collapse_addressesro0sv" E C D b, 's2w''2;;6!#SW!.// JJrN ]]b// /s2w''2;;6!#SW!.// / 255!R))R[[8!#T"X!/00 KKO%* S C .s3KE4 LL0= >4 ( 55!" / 2--. /s.E""$F  F c t|tr|jSt|tr|j St SrW)rJ _BaseNetwork_get_networks_keyrK_get_address_keyNotImplemented)objs r get_mixed_type_keyrvfsA"#|$$$&& C &##%% r ceZdZ dZedZedZedZedZdZ dZ e dZ e d Z e d Ze d Ze d Ze d ZdZy)_IPAddressBaser c$ |jSrW)_explode_shorthand_ip_stringselfs r explodedz_IPAddressBase.explodedsH0022r c t|SrWr/r{s r compressedz_IPAddressBase.compressedsI4yr c$ |jSrW)_reverse_pointerr{s r reverse_pointerz_IPAddressBase.reverse_pointers $$&&r c6dt|fz}t|)Nz%200s has no version specifiedtypeNotImplementedErrorr|msgs r rMz_IPAddressBase.versions.$t*>!#&&r c|dkrd}t|||jfz||jkDr'd}t|||j|jfzy)Nrz-%d (< 0) is not permitted as an IPv%d addressz2%d (>= 2**%d) is not permitted as an IPv%d address)rrfrOrN)r|rrs r _check_int_addressz!_IPAddressBase._check_int_addresssg Q;AC#C7DMM*B$BC C T^^ #FC#C7D4G4G+/==+:%:; ; $r c`t|}||k7rd}t|||||jfzy)Nz6%r (len %d != %d) is not permitted as an IPv%d address)r1rrf)r|r expected_len address_lenrs r _check_packed_addressz$_IPAddressBase._check_packed_addresssG'l , &JC#C7K+7+H%HI I 'r c< |j|j|z z SrW)rO)cls prefixlens r _ip_int_from_prefixz"_IPAddressBase._ip_int_from_prefixs! }}  :;;r c t||j}|j|z }||z }d|zdz }||k7r1|jdz}|j|d}d}t||z|S)Nr6bigz&Netmask pattern %r mixes zeroes & ones)rErNr%r) rip_inttrailing_zeroesr leading_onesall_onesbyteslendetailsrs r _prefix_from_ip_intz"_IPAddressBase._prefix_from_ip_ints 5V585G5GI&&8 0 Na' 8 #))Q.Hooh6G:CS7]+ +r c$d|z}t|d)Nz%r is not a valid netmask)r)r netmask_strrs r _report_invalid_netmaskz&_IPAddressBase._report_invalid_netmasks)K7$$.r c |jr|js|j| t|}dcxkr|j ksn|j||S#t$r|j|YFwxYwNr)isasciiisdigitrintrrN)r prefixlen_strrs r _prefix_from_prefix_stringz)_IPAddressBase._prefix_from_prefix_strings %%'M,A,A,C  ' ' 6 7M*IY4#"4"44  ' ' 6  7  ' ' 6 7s A))BBc, |j|} |jS#t$r|j|Y.wxYw#t$rYnwxYw|j z} |j|S#t$r|j|YywxYwrW)_ip_int_from_stringrrrrrO)rip_strrs r _prefix_from_ip_stringz%_IPAddressBase._prefix_from_ip_strings  0,,V4F **62 2! 0  ' ' / 0    #-- 0**62 2 0  ' ' / 0s2&AAA AA%A66BBc t|ttfr||jfSt|ts t |}t |dkDr|S|d|jfS)Nr6r)rJbytesrrNtupler3r1)rrs r _split_addr_prefixz!_IPAddressBase._split_addr_prefixsf  gs| ,C... .'5).g6G ws xxr c |j|jk(xr|j|jk(S#t$r tcYSwxYwrW)r9rfrhrtr|others r __eq__z_BaseAddress.__eq__AsF "HH )8 7 9 "! ! "s36AAct|tstS|j|jk7rt |d|d|j |j k7r|j |j kSyNrGrHF)rJrKrtrfrLr9rs r __lt__z_BaseAddress.__lt__Hs_%.! ! ==ENN *!5*+ + 88uyy 88eii' 'r cht|tstS|jt||zSrWrJrrtrrs r __add__z_BaseAddress.__add__T*%%! !~~c$i%/00r cht|tstS|jt||z SrWrrs r __sub__z_BaseAddress.__sub__Yrr cL|jjdt|dSN()rrr/r{s r __repr__z_BaseAddress.__repr__^>>22CI>>r cJt|j|jSrW)r/_string_from_ip_intr9r{s r __str__z_BaseAddress.__str__as4++DHH566r cPttt|jSrW)hashhexrr9r{s r __hash__z_BaseAddress.__hash__dsCDHH &''r c|j|fSrWrfr{s r rsz_BaseAddress._get_address_keygs t$$r c4|j|jffSrW)rr9r{s r rz_BaseAddress.__reduce__js~~{**r c |r|ddk(rtt||Stddl}|j datj |}|st ||S|j\}}}|dk(r|jdk(rd}nd}|dk(r |j}n|jdz}|r ||dzd z z }|r|d z }tt||d |||S) Nresrz(#?)(_?)([xbnX])nr#bxr6r.0) formatr/_address_fmt_rerecompile fullmatchsuper __format__groupsrfrNr) r|fmtrm alternategroupingfmt_basepadlenrs r rz_BaseAddress.__format__ms c"gn#d)S) )  "  jj);>r c` t|jt|jz dzSr5)rr_rir{s r num_addressesz_BaseNetwork.num_addresses s+44))*S1E1E-FFJJr c6dt|fz}t|)Nz%%200s has no associated address classrrs r rz_BaseNetwork._address_classs 6d E!#&&r c|jSrW)rgr{s r rz_BaseNetwork.prefixlens r c#K |j|jk(st|d|dt|tstd|z|j |st |d|||k(ry|j |jd|j}|j\}}||k7rv||k7rq|j |r||j\}}n=|j |r||j\}}ntd|d|d|||k7r||k7rq||k(r|y||k(r|ytd|d|d|w) NrGrHz%s is not a network objectz not contained in r-z Error performing exclusion: s1: z s2: z other: ) rfrLrJrq subnet_ofrrrirraAssertionError)r|rs1s2s r address_excludez_BaseNetwork.address_excludesY" F}}.!5*+ +%.85@A At$EF F D= 5+@+@+0??!<=BEkbEkr"B$B%&("e&566EkbEk ;H 5[H!"$b%"12 2s D(E+(Ec* |j|jk7rt|d|d|j|jkry|j|jkDry|j|jkry|j|jkDryy)NrGz are not of the same typerer6r)rfrLrirrs r compare_networksz_BaseNetwork.compare_networksgs @ ==ENN *!5*+ +   %"7"7 7   %"7"7 7 <<%-- ' <<%-- 'r cJ |j|j|jfSrW)rfrirr{s r rrz_BaseNetwork._get_networks_keys$  t33T\\BBr Nc#K |j|jk(r|y|9||jkr td|dk7r td||jz }|dkr td|j|z}||jkDrtd||fzt|j}t|j dz}t|j dz|z }t|||D]}|j||f}|yw)Nznew prefix must be longerr6(cannot set prefixlen_diff and new_prefixrzprefix length diff must be > 0z0prefix length diff %d is invalid for netblock %s) rgrNrrrir_r rr) r|prefixlen_diff new_prefix new_prefixlenstartendstepnew_addrcurrents r raz_BaseNetwork.subnetss! 2 ??d11 1J   !DOO+ !<==" !KLL'$//9N A => >.8 4.. .B!4F))* *D(()$(()A-DMM"Q&>9eS$/Hnnh %>?GM0sD D cv |jdk(r|S|9||jkDr td|dk7r td|j|z }|j|z }|dkrtd|j|fz|jt |j t |j |zz|fS)Nrznew prefix must be shorterr6r#z;current prefixlen is %d, cannot have a prefixlen_diff of %d)rgrrrrrir)r|r$r%r&s r rZz_BaseNetwork.supernets ( ??a K  !DOO+ !=>>" !KLL!__z9N7 1 M012 2~~ $$ %T\\):n)L M  r c` |jjxr|jjSrW)ri is_multicastr_r{s r r.z_BaseNetwork.is_multicasts1 $$114&&33 5r c |j|jk7rt|d|d|j|jkxr|j|jk\S#t$rtd|d|wxYw)NrGrHz*Unable to test subnet containment between )rfrLrir_rh)ars r _is_subnet_ofz_BaseNetwork._is_subnet_of s 4zzQZZ'1#U1#-I JKK%%):)::?''1+>+>> @ 4''(cqc34 4 4s AA A;c( |j||SrWr1rs r rz_BaseNetwork.subnet_ofs?!!$..r c( |j||SrWr3rs r supernet_ofz_BaseNetwork.supernet_ofsA!!%..r c` |jjxr|jjSrW)ri is_reservedr_r{s r r7z_BaseNetwork.is_reserved1 $$003&&22 4r c` |jjxr|jjSrW)ri is_link_localr_r{s r r:z_BaseNetwork.is_link_local+s1 $$225&&44 6r c tfdjjDxr(tfdjjDS)Nc3ZK|]"}j|vxrj|v$ywrWr ).0 priv_networkr|s r z*_BaseNetwork.is_private..?s=J'H|''<7:))\9:'H(+c3ZK|]"}j|vxrj|v$ywrWr )r=rr|s r r?z*_BaseNetwork.is_private..As@R$P((7:**'9:#Or@any _constants_private_networksall_private_networks_exceptionsr{s`r is_privatez_BaseNetwork.is_private6sZ J'+'H'HJJNQR$(??#O#ORO r c |j SrWrHr{s r is_globalz_BaseNetwork.is_globalGs ??""r c` |jjxr|jjSrW)riis_unspecifiedr_r{s r rMz_BaseNetwork.is_unspecifiedRs1 $$336&&55 7r c` |jjxr|jjSrW)ri is_loopbackr_r{s r rOz_BaseNetwork.is_loopback^r8r )r6N)(rr r rrrrrrrrrr  functoolscached_propertyr_r rrrrrrrrr rrrarZr. staticmethodr1rr5r7r:rHrKrMrOr r r rqrqs ?@ )) 6 "C L777GGAA>>??KK''I2V.`C3j'R 5 5 4 4// 4 466 ## 7 7 4 4r rqceZdZgZy)_BaseConstantsN)rr r rEr r r rTrTksr rTceZdZ dZdZdezdz ZeZiZdZ e dZ e dZ e dZ e d Zd Zed Zed Zy )_BaseV4r r#r.r6ct|SrWrr{s r rzz$_BaseV4._explode_shorthand_ip_strings 4yr cn ||jvrxt|tr+|}d|cxkr|jks&n|j |n |j |}t|j|}||f|j|<|j|S#t $r|j|}YVwxYwr) _netmask_cacherJrrNrrrrrrrargrrs r _make_netmaskz_BaseV4._make_netmasks  c(( (#s# Y<#*<*<<// :@ # > >s CI "#"9"9)"DEG&-y&8C  s #!!#&& )@!$ : :3 ?I@s BB43B4c |s td|jd}t|dk7rtd|z tj t |j |dS#t$r}t|d|dd}~wwxYw)NAddress cannot be empty.r#zExpected 4 octets in %rr in )rr0r1r from_bytesmap _parse_octetr)rroctetsexcs r rz_BaseV4._ip_int_from_strings #$=> >c" v;! #$=$FG G J>>#c&6&6"?G G J##v$>?T I Js)A'' B0BBc6 |s td|jr|jsd}t||zt|dkDrd}t||z|dk7r|ddk(rd}t||zt |d}|d kDrtd |z|S) NzEmpty octet not permittedz#Only decimal digits permitted in %rz$At most 3 characters permitted in %rrrz%Leading zeros are not permitted in %r zOctet %d (> 255) not permitted)rrrr1r)r octet_strr octet_ints r rcz_BaseV4._parse_octets 89 9!!# (9(9(;7CS9_- - y>A 8CS9_- -   !  39CS9_- - 2& s?= IJ Jr c b djtt|jddS)Nr_r#r)joinrbr/r%)rrs r rz_BaseV4._string_from_ip_ints* xxCE!:;<.KI'H 'Hc3&K|]}|v ywrWr rs r r?z)IPv4Address.is_private..L\/[DO/[rrBr{s`r rHzIPv4Address.is_private9sE  It'H'HI I ]\t/[/[\\ r cR ||jjvxr |j SrW)rD_public_networkrHr{s r rKzIPv4Address.is_globalOs* 4??:::R4???RRr c4 ||jjvSrWrD_multicast_networkr{s r r.zIPv4Address.is_multicasta t9999r c6 ||jjk(SrW)rD_unspecified_addressr{s r rMzIPv4Address.is_unspecifiedls t;;;;r c4 ||jjvSrW)rD_loopback_networkr{s r rOzIPv4Address.is_loopbackws t8888r c4 ||jjvSrWrD_linklocal_networkr{s r r:zIPv4Address.is_link_local t9999r N)rr r rr}rrr7rP lru_cacherHrKr.rMrOr:r r r rrs9&I!6F**99Y  (YSS ::<<99::r rceZdZdZej dZdZdZdZ dZ e jZ e dZe dZe d Ze d Zy ) rc|j|\}}tj||t||fd|_|jj |_|jj |_yNF)r)rrr}rrrrgr|rr2masks r r}zIPv4Interface.__init__Z,,W5 dT4("D$<> ||++ ,,11r c.|jjSrWrr r{s r r zIPv4Interface.hostmask||$$$r cVd|j|j|jfzSrrr9rgr{s r rzIPv4Interface.__str__s,$22488<//++ +r ctj||}|tus|s|S |j|jk(S#t$rYywxYwr)rrrtrrhr|r address_equals r rzIPv4Interface.__eq__P#**47 N *-  <<5==0 0   = A A ctj||}|turtS |j|jkxs|j|jk(xr|S#t$rYywxYwr)rrrtrrhr|r address_lesss r rzIPv4Interface.__lt__sl"))$6 > )! ! LL5==0CLLEMM1Bl D  s7A A*)A*ct|j|jt|jj fSrWrr9rgrrrir{s r rzIPv4Interface.__hash__+TXXtDLL4P4P0QRSSr c,t|jSrW)rr9r{s r r>zIPv4Interface.ip488$$r cV|j|jd|jSrrr{s r rzIPv4Interface.with_prefixlen%22488<//+ +r cV|j|jd|jSrrr9rr{s r rzIPv4Interface.with_netmask%22488<,,( (r cV|j|jd|jSrrr9r r{s r rzIPv4Interface.with_hostmask%22488<--) )r N)rr r r}rPrQr rrrrrxrrr>rrrr r r rrs2%%+  T **J %%++(())r rcReZdZ eZddZeejdZ y)rc |j|\}t|_|j|\|_|_t |j}|t |jz|k7r6|rtd|zt|t |jz|_|j |jdz k(r|j|_ y|j |jk(r fd|_ yy)N%s has host bits setr6ctgSrW)rr2sr z&IPv4Network.__init__.. +d"3!4r ) rrrir\rrgrrrNrrr|rrrrr2s @r r}zIPv4Network.__init__s! D,,W5 d*40(,(:(:4(@% doT))* C % % / !7$!>??'2636t||3D4E(F$ ??t22Q6 7DJ __!4!4 54DJ6r c |jtdvxr|jtdv xr |j S)N 100.64.0.0/10)rirr_rHr{s r rKzIPv4Network.is_globalsO ))[-IIK**k/.JJL$OO# %r NT) rr r rrr}rrPrrKr r r rrs; !N25hY % %r rcTeZdZedZedZedZedZededededededed ed ed ed ed edededgZededgZ edZ e dZ y)_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/24z192.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/32z 192.0.0.9/32z 192.0.0.10/32z0.0.0.0N) rr r rrrrrrErGrrrr r r rr!s$%56#M2$]3!/2O K L!M"$%O$N#$%N#$%O$%&$%M"() $ N#O$$ $M2&y1r rceZdZ dZdZdezdz ZdZedZ eZ iZ e dZ e dZe d Ze d Ze dd Zd ZdZedZedZedZy )_BaseV6r rIr.r6r0123456789ABCDEFabcdefc, ||jvrwt|tr+|}d|cxkr|jks%n|j |n|j |}t |j|}||f|j|<|j|Sr)rYrJrrNrrrrrZs r r\z_BaseV6._make_netmask_s  c(( (#s# Y<#*<*<<// :::3? !#"9"9)"DEG&-y&8C  s #!!#&&r cH |s td|jd}d}t||krd||fz}t|d|dvrU t|j j }|j d|d z d zz|j d|d zz|jd z}t||kDrd |d z |fz}t|d}td t|d z D]} || r |d |z}t|| }||} t||z d z } |ds| d z} | rd}t||z|ds| d z} | rd}t||z|j| | zz } | d krd}t||jd z |fzt||jk7rd}t||j|fz|dsd}t||z|dsd}t||zt|} d} d} d} t| D]} | d z} | |j|| z} | d | zz} t| dD]} | d z} | |j|| z} | S#t$r}t|d|dd}~wwxYw#t$r}t|d|dd}~wwxYw)Nr^:rgz At least %d parts expected in %rr_rer`%xr*r6z!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) rr0r1rrYr9r\ _HEXTET_COUNTr _parse_hextetr)rrparts _min_partsripv4_intre _max_parts skip_indexiparts_hiparts_lo parts_skippedrs r rz_BaseV6._ip_int_from_stringss4 #$=> > S! u: "4 F7KKC#C( ( %)  N&uyy{377 LL(b.F!:; < LLF!23 4 &&* u: "5Av8NNC#C( ( q#e*q.)A8)?T I Js1 #I :A%J I?)I::I? J! JJ!c |jj|std|zt|dkDrd}t||zt |dS)NzOnly hex digits permitted in %rr#z$At most 4 characters permitted in %rr*) _HEX_DIGITS issupersetrr1r)r hextet_strrs r rz_BaseV6._parse_hextets\ ))*5>KL L z?Q 8CS:-. .:r""r c d}d}d}d}t|D]%\}}|dk(r|dz }|dk(r|}||kDs|}|}"d}d}'|dkDr*||z}|t|k(r|dgz }dg||||dk(rdg|z}|S)Nrerrr6) enumerater1) rhextetsbest_doublecolon_startbest_doublecolon_lendoublecolon_startdoublecolon_lenindexhextetbest_doublecolon_ends r _compress_hextetsz_BaseV6._compress_hextetss "$ &w/ME6}1$$*(-%"%99+:(->*"#$&!0 ! #$:$8%9 $s7|3B4DF4G*+? @%*$.r Nc  |t|j}||jkDr tdd|z}t dddDcgc]}dt|||dzdz}}|j |}dj |Scc}w) NzIPv6 address is too large%032xrrr#rr*r)rr9rOrrrrm)rrhex_strrrs r rz_BaseV6._string_from_ip_int%s  >\F CMM !89 9F";@B?K?a4#ga!nb11?K''0xx  LsBc t|trt|j}n1t|trt|j }n t|}|j |}d|z}tdddDcgc] }|||dz }}t|ttfr ddj||jfzSdj|Scc}w)Nrrrr#rr) rJrr/rir r>rrrqrmrg)r|rrrrrs r rzz$_BaseV6._explode_shorthand_ip_string?s dK (--.F m ,\FYF))&1F").q"a9A1Q39 d\=9 :chhuot?? ?xx:s>Ccp |jdddjdd}dj|dzS)Nrerrr_z .ip6.arpa)r}replacerm)r| reverse_charss r rz_BaseV6._reverse_pointerTs<  dd+33C< xx &44r cn |jd\}}}|sd}||fS|rd|vrtd|z||fS)N%zInvalid IPv6 address: "%r") partitionr)rr2sepscope_ids r _split_scope_idz_BaseV6._split_scope_id]sZ %..s3c8HX~SH_#$@6$IJ JX~r c|jSrWrqr{s r rrz_BaseV6.max_prefixlenqrsr c|jSrWrr{s r rMz_BaseV6.versionurur rW)rr r rrf IPV6LENGTHrOr frozensetrrNrYrr\rrrrrzrrRrrrrrMr r r rrKsIHJ!#IM45KNN''&eJeJN##2--^!!2*5&##r rc8eZdZ dZdZfdZdZfdZdZe dZ e dZ e d Z e d Z e d Ze d Ze ej"d Ze dZe dZe dZe dZe dZe dZxZS)r)r9 _scope_idrxc t|tr |j|||_d|_yt|t r5|j |dtj|d|_d|_yt|}d|vrtd||j|\}|_|j||_y)Nr*rr-rz) rJrrr9rrrrar/rrrr{s r r}zIPv6Address.__init__s " gs #  # #G ,DH!DN  gu %  & &w 3~~gu5DH!DN w< (?#&8 $DE E#'#7#7#A $.++H5r c`t|}|jr|dz|jzS|S)Nr)rrr)r|rrs r rzIPv6Address.__str__s-"04v|dnn,JFJr cDt|j|jfSrW)rr9rr{s r rzIPv6Address.__hash__sTXXt~~.//r cxt||}|turtS|sy|jt |ddk(S)NFr)rrrtrgetattr)r|rrrs r rzIPv6Address.__eq__s=u- N *! !~~ T!BBBr c2|jt|ffSrWrr{s r rzIPv6Address.__reduce__sT --r c |jSrW)rr{s r rzIPv6Address.scope_ids ~~r c. t|jSrW)r+r9r{s r rzIPv6Address.packedrr c4 ||jjvSrWrr{s r r.zIPv6Address.is_multicastrr cV tfdjjDS)Nc3&K|]}|v ywrWr )r=rr|s r r?z*IPv6Address.is_reserved..sI&H419&Hr)rCrD_reserved_networksr{s`r r7zIPv6Address.is_reserveds% Idoo&H&HIIIr c4 ||jjvSrWrr{s r r:zIPv6Address.is_link_localrr c4 ||jjvSrW)rD_sitelocal_networkr{s r is_site_localzIPv6Address.is_site_locals t9999r c j}| |jStfdjjDxr(t fdjj DS)Nc3&K|]}|v ywrWr rs r r?z)IPv6Address.is_private..rrc3&K|]}|v ywrWr rs r r?z)IPv6Address.is_private..rr) ipv4_mappedrHrCrDrErFrGr|rs` r rHzIPv6Address.is_privatesb &&  ")) ) It'H'HI I ]\t/[/[\\ r c |j SrWrJr{s r rKzIPv6Address.is_globals ??""r c" |jdk(Srrr{s r rMzIPv6Address.is_unspecified#s xx1}r cV |j}| |jS|jdk(Sr5)rrOr9rs r rOzIPv6Address.is_loopback.s4 &&  "** *xx1}r cZ |jdz dk7ryt|jdzS)Nrrr9rr{s r rzIPv6Address.ipv4_mapped<s0  HHNv %488j011r c |jdz dk7ryt|jdz dzt|jdzfS)N`i @rrr{s r teredozIPv6Address.teredoIsN  HHNz )TXX^z9:TXXI 235 5r c` |jdz dk7ryt|jdz dzS)Npi Prrr{s r sixtofourzIPv6Address.sixtofourXs4  HHO &DHHNj899r )rr r rr}rrrrrrrr.r7r:r rPrrHrKrMrOrrrrrs@r rrzs@93I&6PK0C.  **::JJ:: : :Y  .##    2 2 5 5 : :r rceZdZdZej dZfdZdZdZ dZ e jZ e dZe dZe d Ze d Ze d Ze fd ZxZS) r c|j|\}}tj||t||fd|_|jj |_|jj |_yr)rrr}rrrrgrs r r}zIPv6Interface.__init__hrr c.|jjSrWrr{s r r zIPv6Interface.hostmaskprr c>dt||jfzSr)rrrgr|rs r rzIPv6Interface.__str__ts%%'/+//++ +r ctj||}|tus|s|S |j|jk(S#t$rYywxYwr)rrrtrrhrs r rzIPv6Interface.__eq__xrrctj||}|tur|S |j|jkxs|j|jk(xr|S#t$rYywxYwr)rrrtrrhrs r rzIPv6Interface.__lt__sl"))$6 > )  LL5==0CLLEMM1Bl D  s7A A&%A&ct|j|jt|jj fSrWrr{s r rzIPv6Interface.__hash__rr c,t|jSrW)rr9r{s r r>zIPv6Interface.iprr cV|j|jd|jSrrr{s r rzIPv6Interface.with_prefixlenrr cV|j|jd|jSrrr{s r rzIPv6Interface.with_netmaskrr cV|j|jd|jSrrr{s r rzIPv6Interface.with_hostmaskrr cP|jdk(xr|jjSr)r9rrMr{s r rMzIPv6Interface.is_unspecifiedsxx1}<!rrrrMrOrrs@r r r fs2%%+  T **J %%++(())==@@r r c0eZdZ eZddZdZedZy)rc |j|\}t|_|j|\|_|_t |j}|t |jz|k7r6|rtd|zt|t |jz|_|j |jdz k(r|j|_ y|j |jk(r fd|_ yy)Nrr6ctgSrW)rrsr rz&IPv6Network.__init__..rr ) rrrir\rrgrrrNrrrs @r r}zIPv6Network.__init__s <,,W5 d*40(,(:(:4(@% doT))* C % % / !7$!>??'2636t||3D4E(F$ ??t22Q6 7DJ __ 3 3 34DJ4r c#K t|j}t|j}t|dz|dzD]}|j |ywr5rrs r rzIPv6Network.hostssW d**+../ w{IM2A%%a( (3sAAc` |jjxr|jjSrW)rir r_r{s r r zIPv6Network.is_site_locals1 $$225&&44 6r Nr) rr r rrr}rrr r r r rrs- !N.5` ) 6 6r rceZdZedZedZededededededed ed ed edg Zed ed ededededgZededededededededededededededed gZed!Z y")#_IPv6Constantsz fe80::/10zff00::/8z::1/128z::/128z ::ffff:0:0/96z64:ff9b:1::/48z100::/64z 2001::/23z 2001:db8::/32z 2002::/16zfc00::/7z 2001:1::1/128z 2001:1::2/128z 2001:3::/32z2001:4:112::/48z 2001:20::/28z 2001:30::/28z::/8z100::/8z200::/7z400::/6z800::/5z1000::/4z4000::/3z6000::/3z8000::/3zA000::/3zC000::/3zE000::/4zF000::/5zF800::/6zFE00::/9z fec0::/10N) rr r rrrrErGrr r r r r3r3 s6$[1$Z0 IHO$$%JK O$K JK    O$O$M"%&N#N# $  F[3I I 6I J 7JZ!8JZ!8JZ!8JZ!8J %[1r r3r)$ __version__rPrvrrrrrrr!r'r+r3r?rErUrcrorvrxrtotal_orderingrKrqrTrDrVrrrrrrr rr3r r r r6s    0 00 0S:S:UDC( C ( : 4n.b36l2o,o,d hN>hNhNV H4>H4H4V ) JJZI:'<I:X@)K@)FO%'<O%d#2#2L( ' ll^ i:'<i:XH@KH@VY6'<Y6x*2*2Z( ' r