PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB`  w{Zc@s'dZddlZddlZddljZddlZ ddl Z ddl Z ddlmZmZmZmZmZmZddlmZmZddlmZddlmZddlmZm Z de!fd YZ"d e"fd YZ#d e"fd YZ$de"fdYZ%dS(s] Classes and functions for dealing with MAC addresses, EUI-48, EUI-64, OUI, IAB identifiers. iN(tNotRegisteredErrortAddrFormatErrortAddrConversionErrort Subscribert Publishert DictDotLookup(teui48teui64(t mac_eui48(t IPAddress(t_is_intt_is_strtBaseIdentifiercBsJeZdZdZdZdZdZdZdZdZ RS( s$Base class for all IEEE identifiers.t_valuecCs d|_dS(N(tNoneR (tself((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyt__init__ scCs|jS(s)@return: integer value of this identifier(R (R((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyt__int__#scCs|jS(s)@return: integer value of this identifier(R (R((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyt__long__'scCs|jdkrdSd|jS(s8@return: octal string representation of this identifier.it0s0%o(R (R((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyt__oct__+scCs d|jS(s>@return: hexadecimal string representation of this identifier.s0x%x(R (R((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyt__hex__2scCs|jS(sx @return: return the integer value of this identifier when passed to hex(), oct() or bin(). (R (R((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyt __index__7s(s_value( t__name__t __module__t__doc__t __slots__RRRRRR(((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyR s     tOUIcBsSeZdZd ZdZdZedZddZdZ dZ RS( s An individual IEEE OUI (Organisationally Unique Identifier). For online details see - U{http://standards.ieee.org/regauth/oui/} trecordscCsEtt|jddlm}g|_t|tr\t|j ddd|_ nWt |rd|kodknr||_ qt d|nt d ||j |jkr1t|j}xM|j|j D];\}}|j||j|}|j|||qW|jntd |d S( s Constructor @param oui: an OUI string C{XX-XX-XX} or an unsigned integer. Also accepts and parses full MAC/EUI-48 address strings (but not MAC/EUI-48 integers)! i(tieeet-tiiis"OUI int outside expected range: %rsunexpected OUI format: %rsOUI %r not registered!N(tsuperRRt netaddr.euiRRt isinstancetstrtinttreplaceR R t ValueErrort TypeErrort OUI_INDEXtopent OUI_REGISTRYtseektreadt _parse_datatcloseR(RtouiRtfhtoffsettsizetdata((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyRIs$ !    cCsidd6dd6dd6gd6|d6|d6}x|jd D]}|j}|s^q@nd |kr|j|d}g}x9tdD]+}|d@}|jd||dL}q Wdjt|jS(s*@return: string representation of this IABi iis%02xiR(R RBR;R:RCRD(RRERFRGRH((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyRIs  cCsd|S(s@@return: executable Python string to recreate equivalent object.s IAB('%s')((R((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyRJs(srecord( RRRRt staticmethodtFalseRTRR-RARIRJ(((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyRLs 4   tEUIcBsseZdZd!Zd"d"dZdZdZeeed"dZ dZ dZ ee e d"d Z ed Z ed Zd Zed ZedZdZdZdZdZdZdZdZdZdZd"dZedZedZedZdZdZ edZ!dZ"d Z#RS(#s An IEEE EUI (Extended Unique Identifier). Both EUI-48 (used for layer 2 MAC addresses) and EUI-64 are supported. Input parsing for EUI-48 addresses is flexible, supporting many MAC variants. t_modulet_dialectcCsDtt|jd|_t|tr|dk rX||jjkrXtdn|j|_|j|_|j |_ dS|dk r|dkrt |_q.|dkrt |_q.td|n_t |r.d|kodknrt |_q.d|kodknr.t |_q.n||_ ||_ dS( s Constructor. @param addr: an EUI-48 (MAC) or EUI-64 address in string format or an unsigned integer. May also be another EUI object (copy construction). @param version: (optional) the explict EUI address version. Mainly used to distinguish between EUI-48 and EUI-64 identifiers specified as integers which may be numerically equivalent. @param dialect: (optional) the mac_* dialect to be used to configure the formatting of EUI-48 (MAC) addresses. s2cannot switch EUI versions using copy constructor!Ni0i@sunsupported EUI version %rill(R R\RRR]R"tversionR&R tdialectt_eui48t_eui64R tvalue(RtaddrR_R`((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyR0s,            cCs|jS(N(R (R((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyt _get_valueascCs|jdkrxttfD]}y |j||_||_PWqtk ryEdt|kou|jknrt||_||_PnWqt k rqXqXqW|jdkr}td|q}nt |dr3y|jj||_Wq}tk r/td||jj fq}XnJdt|koV|jjknrmt||_ntd|dS(Nis failed to detect EUI version: %rRDsaddress %r is not an EUIv%dsbad address format: %r( R]RRaRbt str_to_intR RR$tmax_intR&thasattrR_(RRctmodule((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyt _set_valueds4  %    (sBa positive integer representing the value of this EUI indentifier.cCs|jS(N(R^(R((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyt _get_dialectscCsR|dkrt|_n6t|drBt|drB||_n tddS(Nt word_sizetword_fmts*custom dialects should subclass mac_eui48!(RRR^RhR'(RRc((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyt _set_dialects    sXa Python class providing support for the interpretation of various MAC address formats.cCsD|jtkr t|jd?S|jtkr@t|jd?SdS(s:The OUI (Organisationally Unique Identifier) for this EUI.ii(N(R]RaRRcRb(R((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyR/scCs|jtkr@djg|dd!D]}d|^q#jS|jtkrdjg|dd!D]}d|^qcjSdS(s*The EI (Extension Identifier) for this EUIRiis%02xiN(R]RaR:RDRb(Rti((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyteis1cCsd|jd?kodkSS(s<@return: True if this EUI is an IAB address, False otherwisei i i/ (R (R((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pytis_iabscCs!|jrt|jd?SdS(sq If is_iab() is True, the IAB (Individual Address Block) is returned, C{None} otherwise. i N(RqRLR (R((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyRUs cCs |jjS(s/The EUI version represented by this EUI object.(R]R_(R((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyR_scCst|re|jj}| |ko4|dknsHtdn|jj|j|j|St|tr|jj|j|j}gt |j t |D]}||^qSt d|dS(s @return: The integer value of the word referenced by index (both positive and negative). Raises C{IndexError} if index is out of bounds. Also supports Python list slices for accessing word groups. is!index out range for address type!sunsupported type %r!N( R R^t num_wordst IndexErrorR]t int_to_wordsR R"tsliceRBtindicesR>R'(RR4RrRFRo((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyt __getitem__s  !0cCst|trtdnt|s9tdnd|koZ|jjdknsrtd|nt|stdnd|ko|jjknstd||jj fnt |j j |j |j}|||<|j j||_ dS( s>Sets the value of the word referenced by index in this addresss"settable slices are not supported!sindex not an integer!iis'index %d outside address type boundary!svalue not an integer!s.value %d outside word size maximum of %d bits!N(R"RutNotImplementedErrorR R'R^RrRstmax_wordRltlistR]RtR t words_to_int(RR4RcRF((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyt __setitem__s & "! cCst|j|jfS(sA@return: hash of this EUI object suitable for dict keys, sets etc(thashR_R (R((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyt__hash__scCs?y&|j|jf|j|jfkSWntk r:tSXdS(sw @return: C{True} if this EUI object is numerically the same as other, C{False} otherwise. N(R_R tAttributeErrortNotImplemented(Rtother((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyt__eq__s& cCs?y&|j|jf|j|jfkSWntk r:tSXdS(s{ @return: C{False} if this EUI object is numerically the same as the other, C{True} otherwise. N(R_R RR(RR((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyt__ne__s& cCs?y&|j|jf|j|jfkSWntk r:tSXdS(s @return: C{True} if this EUI object is numerically lower in value than other, C{False} otherwise. N(R_R RR(RR((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyt__lt__s& cCs?y&|j|jf|j|jfkSWntk r:tSXdS(s @return: C{True} if this EUI object is numerically lower or equal in value to other, C{False} otherwise. N(R_R RR(RR((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyt__le__s& cCs?y&|j|jf|j|jfkSWntk r:tSXdS(s @return: C{True} if this EUI object is numerically greater in value than other, C{False} otherwise. N(R_R RR(RR((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyt__gt__s& cCs?y&|j|jf|j|jfkSWntk r:tSXdS(s @return: C{True} if this EUI object is numerically greater or equal in value to other, C{False} otherwise. N(R_R RR(RR((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyt__ge__s& cCs|jj|j|S(s @param word_sep: (optional) the separator to insert between words. Default: None - use default separator for address type. @return: human-readable binary digit string of this address(R]t int_to_bitsR (Rtword_sep((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pytbits%scCs|jj|jS(s8The value of this EUI address as a packed binary string.(R]t int_to_packedR (R((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pytpacked-scCs|jj|jS(s<A list of unsigned integer octets found in this EUI address.(R]RtR (R((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyRF2scCs|jj|jS(s The value of this EUI 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. (R]t int_to_binR (R((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pytbin7scCs|jdkrug|dd!D]}d|^qddgg|dd!D]}d|^qH}|jdj|Stt|Sd S( sR @return: The value of this EUI object as a new 64-bit EUI object. - If this object represents an EUI-48 it is converted to EUI-64 as per the standard. - If this object is already and EUI-64, it just returns a new, numerically equivalent object is returned instead. i0iis%02xtfftfeiRN(R_t __class__R:R\R#(RRot eui64_words((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pyR@s +%cCsd}|jdkrg|dd!D]}d|^q#ddgg|dd!D]}d|^qN}|td j|d 7}n ||j7}t|dS( s' @return: new link local IPv6 L{IPAddress} object based on this L{EUI} using the technique described in RFC 4291. B{Please Note:} this poses security risks in certain scenarios. Please read RFC 4941 for details. Reference: RFCs 4291 and 4941. l @i0iis%02xRRiRi(R_R$R:R R (RRERot eui64_tokens((s8/usr/lib/python2.7/site-packages/netaddr/eui/__init__.pytipv6_link_localPs+% cCsBi|jjd6}|jr8|jj|d s     .$ky