/usr/lib/python2.6/site-packages/netaddr/strategy
NameSizeModeActions
eui48.py86330644editdlrm
eui48.pyc91970644editdlrm
eui64.py77100644editdlrm
eui64.pyc83220644editdlrm
ipv4.py80860644editdlrm
ipv4.pyc86590644editdlrm
ipv6.py76290644editdlrm
ipv6.pyc79030644editdlrm
__init__.py74710644editdlrm
__init__.pyc79450644editdlrm
Edit: /usr/lib/python2.6/site-packages/netaddr/strategy/eui64.pyc (8322B)
Ñò }DVc @s‰dZddkZddkZddklZddklZ l Z l Z lZlZlZlZlZlZdZdZeZdZdZdedZd e fd „ƒYZ!d e!fd „ƒYZ"d e"fd„ƒYZ#de!fd„ƒYZ$de!fd„ƒYZ%e!Z&ddi'dgdƒdddi'dgdƒdddi'dgdƒdddi'dgdƒdddi'dgdƒdddi'dgdƒd fZ(gZ)e(D]Z*e)ei+e*ei,ƒqÁ[)Z(d!„Z-d"„Z.d#„Z/dd$„Z1d%„Z2d&„Z3dd'„Zdd(„Z dd)„Z dd*„Zdd+„Zdd,„Zdd-„Zd.„Zd/„ZdS(0s6 IEEE 64-bit EUI (Extended Unique Indentifier) logic. iÿÿÿÿN(tAddrFormatError( t valid_wordst int_to_wordst words_to_intt valid_bitst bits_to_intt int_to_bitst valid_bint int_to_bint bin_to_inti@sEUI-64iit eui64_basecBs>eZdZdZeeZdedZdZdZdZ RS(s%A standard IEEE EUI-64 dialect class.iiit-s%.2Xi( t__name__t __module__t__doc__t word_sizetwidtht num_wordstmax_wordtword_septword_fmtt word_base(((s7/tmp/pip-build-lt8jXN/netaddr/netaddr/strategy/eui64.pyR +s t eui64_unixcBs0eZdZdZeeZdZdZdZRS(s'A UNIX-style MAC address dialect class.it:s%xi( R R RRRRRRR(((s7/tmp/pip-build-lt8jXN/netaddr/netaddr/strategy/eui64.pyR@s  teui64_unix_expandedcBseZdZdZRS(s;A UNIX-style MAC address dialect class with leading zeroes.s%.2x(R R RR(((s7/tmp/pip-build-lt8jXN/netaddr/netaddr/strategy/eui64.pyRIst eui64_ciscocBs0eZdZdZeeZdZdZdZRS(s2A Cisco 'triple hextet' MAC address dialect class.it.s%.4x( R R RRRRRRR(((s7/tmp/pip-build-lt8jXN/netaddr/netaddr/strategy/eui64.pyRNs  t eui64_barecBs0eZdZdZeeZdZdZdZRS(s1A bare (no delimiters) MAC address dialect class.i@ts%.16Xi( R R RRRRRRR(((s7/tmp/pip-build-lt8jXN/netaddr/netaddr/strategy/eui64.pyRWs  t^Rs([0-9A-F]{1,2})it$R s([0-9A-F]{1,4})is\.s^(Rs[0-9A-F]is)$cCs4x-|D]%}|i|ƒ}|o |dSqWdS(Ni(tfindall(taddresstformatstregexptmatch((s7/tmp/pip-build-lt8jXN/netaddr/netaddr/strategy/eui64.pyt_get_match_resultxs cCs3yt|tƒotSWntj onXtS(s :param addr: An IEEE EUI-64 indentifier in string form. :return: ``True`` if EUI-64 indentifier is valid, ``False`` otherwise. (R$tRE_EUI64_FORMATStTruet TypeErrortFalse(taddr((s7/tmp/pip-build-lt8jXN/netaddr/netaddr/strategy/eui64.pyt valid_strs  c Csfg}y$t|tƒ}|p t‚nWn#tj otd|ƒ‚nXt|tƒon |f}t|ƒdjoDtdig}|D]}|dt|dƒq”~ƒdƒ}nŸt|ƒdjoDtdig}|D]}|dt|dƒqë~ƒdƒ}nHt|ƒdjo$td t|d dƒdƒ}ntd |ƒ‚|S( sÏ :param addr: An IEEE EUI-64 indentifier in string form. :return: An unsigned integer that is equivalent to value represented by EUI-64 string address formatted according to the dialect s#invalid IEEE EUI-64 identifier: %r!iRs%.2xiis%.4xis%016xis)bad word count for EUI-64 identifier: %r!( R$R%R'Rt isinstancettupletlentinttjoin(R)twordst_[1]twtint_valt_[2]((s7/tmp/pip-build-lt8jXN/netaddr/netaddr/strategy/eui64.pyt str_to_intŽs& DD$ cCsd|djo t}nt||ƒ}g}|D]}||i|q1~}|ii|ƒ}|S(sÉ :param int_val: An unsigned integer. :param dialect: (optional) a Python class defining formatting options :return: An IEEE EUI-64 identifier that is equivalent to unsigned integer. N(tNoneR RRRR/(R3tdialectR0R1tittokensR)((s7/tmp/pip-build-lt8jXN/netaddr/netaddr/strategy/eui64.pyt int_to_str³s   (cCst|ƒ}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. s>8B(Rt_structtpack(R3R0((s7/tmp/pip-build-lt8jXN/netaddr/netaddr/strategy/eui64.pyt int_to_packedÃs cCscttid|ƒƒ}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>8Bii(tlistR;tunpackt enumeratetreversed(t packed_intR0R3R8tnumtword((s7/tmp/pip-build-lt8jXN/netaddr/netaddr/strategy/eui64.pyt packed_to_intÎs cCs-|djo t}nt||i|iƒS(N(R6tDEFAULT_EUI64_DIALECTt _valid_wordsRR(R0R7((s7/tmp/pip-build-lt8jXN/netaddr/netaddr/strategy/eui64.pyRás  cCs-|djo t}nt||i|iƒS(N(R6RFt _int_to_wordsRR(R3R7((s7/tmp/pip-build-lt8jXN/netaddr/netaddr/strategy/eui64.pyRçs  cCs-|djo t}nt||i|iƒS(N(R6RFt _words_to_intRR(R0R7((s7/tmp/pip-build-lt8jXN/netaddr/netaddr/strategy/eui64.pyRís  cCs*|djo t}nt|t|iƒS(N(R6RFt _valid_bitsRR(tbitsR7((s7/tmp/pip-build-lt8jXN/netaddr/netaddr/strategy/eui64.pyRós  cCs*|djo t}nt|t|iƒS(N(R6RFt _bits_to_intRR(RKR7((s7/tmp/pip-build-lt8jXN/netaddr/netaddr/strategy/eui64.pyRùs  cCs3|djo t}nt||i|i|iƒS(N(R6RFt _int_to_bitsRRR(R3R7((s7/tmp/pip-build-lt8jXN/netaddr/netaddr/strategy/eui64.pyRÿs  cCs$|djo t}nt|tƒS(N(R6RFt _valid_binR(tbin_valR7((s7/tmp/pip-build-lt8jXN/netaddr/netaddr/strategy/eui64.pyRs  cCs t|tƒS(N(t _int_to_binR(R3((s7/tmp/pip-build-lt8jXN/netaddr/netaddr/strategy/eui64.pyR scCs t|tƒS(N(t _bin_to_intR(RO((s7/tmp/pip-build-lt8jXN/netaddr/netaddr/strategy/eui64.pyR s(4RtstructR;tret_ret netaddr.coreRtnetaddr.strategyRRGRRHRRIRRJRRLRRMRRNRRPR RQtAF_EUI64Rtfamilyt family_nametversiontmax_inttobjectR RRRRRFR/R%R1t_tcompilet IGNORECASER$R*R5R6R:R=RE(((s7/tmp/pip-build-lt8jXN/netaddr/netaddr/strategy/eui64.pytsL  @    !0   %