Ñò î¡ßNc@s=dZddkZeZyZddkZeipedƒ‚nei ei ddkl Z l Z l Z eZWn#ddkl Z l Z l Z nXddklZddklZlZlZlZlZlZlZ l!Z"l#Z$l%Z&dZ'dZ(d Z)e Z*d Z+d Z,dZ-d e'd Z.e'e(Z/d e(d Z0e1gZ2e3de'd ƒD]#Z4e2e4e.d e'e4d AfqY[2ƒZ5e1gZ6e3de'd ƒD]#Z4e6e.d e'e4d Ae4fq£[6ƒZ7e1gZ8e3de'd ƒD]Z4e8e4d e'e4d fqí[8ƒZ9e1gZ:e3de'd ƒD]Z4e:d e'e4d e4fq3[:ƒZ;de<fd„ƒYZ=de=fd„ƒYZ>de=fd„ƒYZ?dd„Z@dd„ZAdd„ZCd„ZDd„ZEd„ZFd„Zddd„Zd„Zd„Zd„Zdd „Zd!„Z!d"„Z#d#„Z%dS($s IPv6 address logic. iÿÿÿÿNs IPv6 disabled(t inet_ptont inet_ntoptAF_INET6(tAddrFormatError( t BYTES_TO_BITSt valid_wordst int_to_wordst words_to_intt valid_bitst bits_to_intt int_to_bitst valid_bint int_to_bint bin_to_inti€it:tIPv6iiiit ipv6_compactcBseZdZdZeZRS(s%An IPv6 dialect class - compact form.s%x(t__name__t __module__t__doc__tword_fmttTruetcompact(((s9/usr/lib/python2.6/site-packages/netaddr/strategy/ipv6.pyR\st ipv6_fullcBseZdZeZRS(s*An IPv6 dialect class - 'all zeroes' form.(RRRtFalseR(((s9/usr/lib/python2.6/site-packages/netaddr/strategy/ipv6.pyRdst ipv6_verbosecBseZdZdZeZRS(s5An IPv6 dialect class - extra wide 'all zeroes' form.s%.4x(RRRRRR(((s9/usr/lib/python2.6/site-packages/netaddr/strategy/ipv6.pyRjscCs=|djotdƒ‚nytt|ƒWntSXtS(s @param addr: An IPv6 address in presentation (string) format. @param flags: decides which rules are applied to the interpretation of the addr value. Future use - currently has no effect. @return: C{True} if IPv6 address is valid, C{False} otherwise. ts Empty strings are not supported!(Rt _inet_ptonRRR(taddrtflags((s9/usr/lib/python2.6/site-packages/netaddr/strategy/ipv6.pyt valid_strts cCsGytt|ƒ}t|ƒSWn#tj otd|ƒ‚nXdS(s @param addr: An IPv6 address in string form. @param flags: decides which rules are applied to the interpretation of the addr value. Future use - currently has no effect. @return: The equivalent unsigned integer for a given IPv6 address. s&%r is not a valid IPv6 address string!N(RRt packed_to_intt ExceptionR(RRt packed_int((s9/usr/lib/python2.6/site-packages/netaddr/strategy/ipv6.pyt str_to_int‡s cCsÃ|djo t}nd}y|t|ƒ}|iott|ƒ}nPttid|ƒƒ}g}|D]}||i |ql~}t i |ƒ}Wn#t j ot d|ƒ‚nX|S(së @param int_val: An unsigned integer. @param dialect: (optional) a Python class defining formatting options. @return: The IPv6 presentation (string) format address equivalent to the unsigned integer provided. s>8Hs+%r is not a valid 128-bit unsigned integer!N(tNoneRt int_to_packedRt _inet_ntopRtlistt_structtunpackRtword_septjoinR t ValueError(tint_valtdialectRR!twordst_[1]twordttokens((s9/usr/lib/python2.6/site-packages/netaddr/strategy/ipv6.pyt int_to_str—s    (cCsQt|tƒ}t|iddƒƒ}|iƒ|dddg}di|ƒS(s“ @param int_val: An unsigned integer. @return: The reverse DNS lookup for an IPv6 address in network byte order integer form. RRtip6tarpat.(R2RR&treplacetreverseR*(R,RR1((s9/usr/lib/python2.6/site-packages/netaddr/strategy/ipv6.pyt int_to_arpa¶s  cCs"t|ddƒ}tid|ŒS(s• @param int_val: the integer to be packed. @return: a packed string that is equivalent to value represented by an unsigned integer. ii s>4I(RR'tpack(R,R.((s9/usr/lib/python2.6/site-packages/netaddr/strategy/ipv6.pyR$ÅscCscttid|ƒƒ}d}x>tt|ƒƒD]*\}}|}|d|>}||B}q1W|S(s @param packed_int: a packed string containing an unsigned integer. It is assumed that string is packed in network byte order. @return: An unsigned integer equivalent to value of network address represented by packed binary string. s>4Iii (R&R'R(t enumeratetreversed(R!R.R,titnumR0((s9/usr/lib/python2.6/site-packages/netaddr/strategy/ipv6.pyRÐs cCst|ttƒS(N(t _valid_wordst word_sizet num_words(R.((s9/usr/lib/python2.6/site-packages/netaddr/strategy/ipv6.pyRãscCsL|djotƒd}n|djotƒd}nt|||ƒS(NR@R?(R#tglobalst _int_to_words(R,R@R?((s9/usr/lib/python2.6/site-packages/netaddr/strategy/ipv6.pyRçs   cCst|ttƒS(N(t _words_to_intR?R@(R.((s9/usr/lib/python2.6/site-packages/netaddr/strategy/ipv6.pyRïscCst|ttƒS(N(t _valid_bitstwidthR)(tbits((s9/usr/lib/python2.6/site-packages/netaddr/strategy/ipv6.pyRóscCst|ttƒS(N(t _bits_to_intRER)(RF((s9/usr/lib/python2.6/site-packages/netaddr/strategy/ipv6.pyR ÷scCs1|djotƒd}nt|tt|ƒS(NR)(R#RAt _int_to_bitsR?R@(R,R)((s9/usr/lib/python2.6/site-packages/netaddr/strategy/ipv6.pyR ûs cCs t|tƒS(N(t _valid_binRE(tbin_val((s9/usr/lib/python2.6/site-packages/netaddr/strategy/ipv6.pyR scCs t|tƒS(N(t _int_to_binRE(R,((s9/usr/lib/python2.6/site-packages/netaddr/strategy/ipv6.pyR scCs t|tƒS(N(t _bin_to_intRE(RJ((s9/usr/lib/python2.6/site-packages/netaddr/strategy/ipv6.pyR s(GRtstructR'Rt OPT_IMPORTStsockett_socketthas_ipv6R RRRRR%Rtnetaddr.fbsockett netaddr.coreRtnetaddr.strategyRt_BYTES_TO_BITSRR>RRBRRCRRDR RGR RHR RIR RKR RLRER?R)tfamilyt family_nametversiont word_basetmax_intR@tmax_wordtdictR/trangeR<tprefix_to_netmaskt_[2]tnetmask_to_prefixt_[3]tprefix_to_hostmaskt_[4]thostmask_to_prefixtobjectRRRRR"R#R2R8R$R(((s9/usr/lib/python2.6/site-packages/netaddr/strategy/ipv6.pytsd     F  GGCC