https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /lib/python2.7/site-packages/netaddr/eui/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python2.7/site-packages/netaddr/eui/__init__.pyc
�
o�\c@s�dZddlmZmZmZddlmZmZ	ddl
mZddlm
Z
ddlmZddlmZmZdefd	��YZd
efd��YZdefd
��YZdefd��YZdS(s]
Classes and functions for dealing with MAC addresses, EUI-48, EUI-64, OUI, IAB
identifiers.
i����(tNotRegisteredErrortAddrFormatErrort
DictDotLookup(teui48teui64(t	mac_eui48(t
eui64_base(t	IPAddress(t_is_intt_is_strtBaseIdentifiercBsJeZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	RS(	s$Base class for all IEEE identifiers.t_valuecCs
d|_dS(N(tNoneR(tself((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyt__init__scCs|jS(s):return: integer value of this identifier(R(R
((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyt__int__scCs|jS(s):return: integer value of this identifier(R(R
((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyt__long__scCs|jdkrdSd|jS(s8:return: octal string representation of this identifier.it0s0%o(R(R
((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyt__oct__"scCsd|jS(s>:return: hexadecimal string representation of this identifier.s0x%x(R(R
((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyt__hex__)scCs|jS(sx
        :return: return the integer value of this identifier when passed to
            hex(), oct() or bin().
        (R(R
((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyt	__index__.s(s_value(
t__name__t
__module__t__doc__t	__slots__RRRRRR(((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyR
s					tOUIcBsweZdZd
Zd�Zd�Zd�Zd�Zd�Zd�Z	e
d��Zd	d
�Zd�Z
d�ZRS(s�
    An individual IEEE OUI (Organisationally Unique Identifier).

    For online details see - http://standards.ieee.org/regauth/oui/

    trecordscCsQtt|�j�ddlm}g|_t|t�r\t|j	dd�d�|_
nWt|�r�d|kodknr�||_
q�td|��nt
d	|��|j
|jkr=t|jd
�}xV|j|j
D]D\}}|j|�|j|�jd�}|j|||�q�W|j�ntd|��d
S(s�
        Constructor

        :param oui: an OUI string ``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-tiii���s"OUI int outside expected range: %rsunexpected OUI format: %rtrbsUTF-8sOUI %r not registered!N(tsuperRRtnetaddr.euiRRt
isinstancetstrtinttreplaceRRt
ValueErrort	TypeErrort	OUI_INDEXtopentOUI_REGISTRY_PATHtseektreadtdecodet_parse_datatcloseR(R
touiRtfhtoffsettsizetdata((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyR@s$	!

cCsJt|t�s:y|j|�}Wq:tk
r6tSXn|j|jkS(N(R!Rt	__class__t	ExceptiontNotImplementedR(R
tother((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyt__eq__gs
cCsJt|t�s:y|j|�}Wq:tk
r6tSXn|j|jkS(N(R!RR4R5R6R(R
R7((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyt__ne__os
cCs|j|jfS(s+:returns: Pickled state of an `OUI` object.(RR(R
((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyt__getstate__wscCs|\|_|_dS(s;:param state: data used to unpickle a pickled `OUI` object.N(RR(R
tstate((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyt__setstate__{scCs�idd6dd6dd6gd6|d6|d6}x�|jd	�D]�}|j�}|s^q@nd
|kr�|j|d<|jd
d�d|d<t|�|d<q@d|kr�q@q@|dj|�q@W|jj|�d
S(s.Returns a dict record from raw OUI record dataitidxRR/torgtaddressR1R2s
s(hex)is	(base 16)N(tsplittstripRRR"tappendR(R
R3R1R2trecordtline((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyR-s&

cCs
t|j�S(s0Number of registered organisations with this OUI(tlenR(R
((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyt	reg_count�sicCst|j|�S(s
        The IEEE registration details for this OUI.

        :param index: the index of record (may contain multiple registrations)
            (Default: 0 - first registration)

        :return: Objectified Python data structure containing registration
            details.
        (RR(R
tindex((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pytregistration�s
cCs.|j}d|d?d@|d?d@|d@fS(s*:return: string representation of this OUIs%02X-%02X-%02Xii�i(R(R
tint_val((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyt__str__�s
	cCsd|S(s@:return: executable Python string to recreate equivalent object.s	OUI('%s')((R
((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyt__repr__�s(srecords(RRRRRR8R9R:R<R-tpropertyRFRHRJRK(((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyR7s	'						tIABcBszeZdZdZeed��Zed�Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zd�ZRS(
s�
    An individual IEEE IAB (Individual Address Block) identifier.

    For online details see - http://standards.ieee.org/regauth/oui/

    RCcCs�d|kodknr&|dfSd}d
|A}|d?}||B|}d|koedknr�|r�|dkr�tdt|���q�ntd	t|���||fS(s�
        :param eui_int: a MAC IAB as an unsigned integer.

        :param strict: If True, raises a ValueError if the last 12 bits of
            IAB MAC/EUI-48 address are non-zero, ignores them otherwise.
            (Default: False)
        i i�/iiiii0s%r is not a strict IAB!s%r is not an IAB address!ii�II������(R%thex(teui_inttstrictt	user_masktiab_masktiab_bitst	user_bits((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyt
split_iab_mac�s	


cCs�tt|�j�ddlm}idd6dd6dd6gd6dd	6dd
6|_t|t�r�t|j	dd�d�}|j
|d
|�\}}||_nCt|�r�|j
|d
|�\}}||_nt
d|��|j|jkr�t|jd�}|j|jd\}}	||jd	<|	|jd
<|j|�|j|	�jd�}
|j|
||	�|j�ntd|��dS(s�
        Constructor

        :param iab: an IAB string ``00-50-C2-XX-X0-00`` or an unsigned             integer. This address looks like an EUI-48 but it should not             have any non-zero bits in the last 3 bytes.

        :param strict: If True, raises a ValueError if the last 12 bits             of IAB MAC/EUI-48 address are non-zero, ignores them otherwise.             (Default: False)
        i����(RiR=RtiabR>R?R1R2RiRPsunexpected IAB format: %r!RsUTF-8sIAB %r not unregistered!N(RRMRR RRCR!R"R#R$RURRR&t	IAB_INDEXR(tIAB_REGISTRY_PATHR*R+R,R-R.R(R
RVRPRRItiab_inttuser_intR0R1R2R3((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyR�s6




cCsJt|t�s:y|j|�}Wq:tk
r6tSXn|j|jkS(N(R!RMR4R5R6R(R
R7((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyR8s
cCsJt|t�s:y|j|�}Wq:tk
r6tSXn|j|jkS(N(R!RMR4R5R6R(R
R7((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyR9s
cCs|j|jfS(s+:returns: Pickled state of an `IAB` object.(RRC(R
((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyR:scCs|\|_|_dS(s;:param state: data used to unpickle a pickled `IAB` object.N(RRC(R
R;((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyR<"scCs�x�|jd�D]�}|j�}|s.qnd|kr}|j|jd<|jd	d�d|jd<t|�|jd<qd|kr�qq|jdj|�qWd	S(
s.Returns a dict record from raw IAB record datas
s(hex)R=iR>RVs	(base 16)R?N(R@RARRCRR"RB(R
R3R1R2RD((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyR-&scCs
t|j�S(s*The IEEE registration details for this IAB(RRC(R
((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyRH6scCsH|jd>}d|d?d@|d?d@|d?d@|d?d@|d@fS(s*:return: string representation of this IABis%02X-%02X-%02X-%02X-%02X-00i i�iii(R(R
RI((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyRJ:s
cCsd|S(s@:return: executable Python string to recreate equivalent object.s	IAB('%s')((R
((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyRKEs(srecord(RRRRtstaticmethodtFalseRURR8R9R:R<R-RHRJRK(((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyRM�s4							tEUIcBs�eZdZd%Zd&d&d�Zd�Zd�Zd�Zd�Z	e
ee	d&d�Zd	�Zd
�Z
e
ee
d&d�Ze
d��Ze
d
��Zd�Ze
d��Ze
d��Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd&d�Ze
d��Ze
d��Ze
d��Z d�Z!d�Z"d �Z#d!�Z$e
d"��Z%d#�Z&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|�j�d|_t|t�r�|dk	rX||jjkrXtd��n|j|_|j|_|j	|_	dS|dk	r�|dkr�t
|_q.|dkr�t|_q.td|��n_t|�r.d|ko�dknrt
|_q.d|kodknr.t|_q.n||_
||_	dS(	s2
        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 explicit EUI address version, either             48 or 64. Mainly used to distinguish 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 %riI������l����(RR]RRR^R!tversionR%Rtdialectt_eui48t_eui64Rtvalue(R
taddrR`Ra((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyRVs,		cCs|j|jj|jfS(s+:returns: Pickled state of an `EUI` object.(RR^R`Ra(R
((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyR:�scCsk|\}}}||_|dkr0t|_n.|dkrHt|_ntdt|���||_dS(sN
        :param state: data used to unpickle a pickled `EUI` object.

        i0i@s&unpickling failed for object state: %sN(RRbR^RcR%R"Ra(R
R;RdR`Ra((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyR<�s	cCs|jS(N(R(R
((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyt
_get_value�scCs~|jdkr�x�ttfD]�}y |j|�|_||_PWqtk
r�yEdt|�kou|jknr�t|�|_||_PnWq�t	k
r�q�XqXqW|jdkrztd|��qzn�t
|�r0y|jj|�|_Wqztk
r,td||jjf��qzXnJdt|�koS|jjknrjt|�|_ntd|��dS(Nis failed to detect EUI version: %rsaddress %r is not an EUIv%dsbad address format: %r(R^RRbRct
str_to_intRRR#tmax_intR%R	R`(R
Rdtmodule((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyt
_set_value�s4	
%	

(sBa positive integer representing the value of this EUI indentifier.cCs|jS(N(R_(R
((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyt_get_dialect�scCsm|dkr3|jtkr't|_qit|_n6t|d�r]t|d�r]||_ntd��dS(Nt	word_sizetword_fmts*custom dialects should subclass mac_eui48!(RR^RcRR_RthasattrR&(R
Rd((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyt_set_dialect�s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^RbRRdRc(R
((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyR/�scCsL|jtkr$dt|dd!�S|jtkrHdt|dd!�SdS(s*The EI (Extension Identifier) for this EUIs%02X-%02X-%02Xiis%02X-%02X-%02X-%02X-%02XiN(R^RbttupleRc(R
((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pytei�scCsd|jd?kodkSS(s<:return: True if this EUI is an IAB address, False otherwisei ii�/(R(R
((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pytis_iab�scCs!|j�rt|jd?�SdS(sr
        If is_iab() is True, the IAB (Individual Address Block) is returned,
        ``None`` otherwise.
        iN(RrRMR(R
((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyRV�scCs
|jjS(s/The EUI version represented by this EUI object.(R^R`(R
((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyR`�scCs�t|�re|jj}||ko4|dknsHtd��n|jj|j|j�|St|t�r�|jj|j|j�}gt	|j
t|���D]}||^q�Std|��dS(s�
        :return: The integer value of the word referenced by index (both             positive and negative). Raises ``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(
RR_t	num_wordst
IndexErrorR^tint_to_wordsRR!tslicetrangetindicesRER&(R
R=Rstwordsti((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyt__getitem__�s!0cCst|t�rtd��nt|�s9td��nd|koZ|jjdknsrtd|��nt|�s�td��nd|ko�|jjkns�td||jj	f��nt
|jj|j
|j��}|||<|jj|�|_
dS(	s=Set 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!RvtNotImplementedErrorRR&R_RsRttmax_wordRltlistR^RuRtwords_to_int(R
R=RdRy((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyt__setitem__s&"!
cCst|j|jf�S(sA:return: hash of this EUI object suitable for dict keys, sets etc(thashR`R(R
((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyt__hash__&scCs\t|t�s:y|j|�}Wq:tk
r6tSXn|j|jf|j|jfkS(sy
        :return: ``True`` if this EUI object is numerically the same as other,             ``False`` otherwise.
        (R!R]R4R5R6R`R(R
R7((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyR8*s
cCs\t|t�s:y|j|�}Wq:tk
r6tSXn|j|jf|j|jfkS(sy
        :return: ``True`` if this EUI object is numerically the same as other,             ``False`` otherwise.
        (R!R]R4R5R6R`R(R
R7((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyR96s
cCs\t|t�s:y|j|�}Wq:tk
r6tSXn|j|jf|j|jfkS(s�
        :return: ``True`` if this EUI object is numerically lower in value than             other, ``False`` otherwise.
        (R!R]R4R5R6R`R(R
R7((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyt__lt__Bs
cCs\t|t�s:y|j|�}Wq:tk
r6tSXn|j|jf|j|jfkS(s�
        :return: ``True`` if this EUI object is numerically lower or equal in             value to other, ``False`` otherwise.
        (R!R]R4R5R6R`R(R
R7((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyt__le__Ns
cCs\t|t�s:y|j|�}Wq:tk
r6tSXn|j|jf|j|jfkS(s�
        :return: ``True`` if this EUI object is numerically greater in value             than other, ``False`` otherwise.
        (R!R]R4R5R6R`R(R
R7((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyt__gt__Zs
cCs\t|t�s:y|j|�}Wq:tk
r6tSXn|j|jf|j|jfkS(s�
        :return: ``True`` if this EUI object is numerically greater or equal             in value to other, ``False`` otherwise.
        (R!R]R4R5R6R`R(R
R7((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyt__ge__fs
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^tint_to_bitsR(R
tword_sep((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pytbitsrscCs|jj|j�S(s8The value of this EUI address as a packed binary string.(R^t
int_to_packedR(R
((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pytpacked{scCs|jj|j�S(s<A list of unsigned integer octets found in this EUI address.(R^RuR(R
((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyRy�scCs|jj|j�S(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
((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pytbin�scCsZ|jdkr>|jd?}|jd@}|d>dB|B}n	|j}|j|dd�S(s2
        - If this object represents an EUI-48 it is converted to EUI-64             as per the standard.
        - If this object is already an EUI-64, a new, numerically             equivalent object is returned instead.

        :return: The value of this EUI object as a new 64-bit EUI object.
        i0ii���i(I��R`i@(R`RR4(R
tfirst_threet
last_threet	new_value((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyR�s	

	cCs|j�}|jdN_|S(s�
        - create a new EUI object with a modified EUI-64 as described in RFC 4291 section 2.5.1

        :return: a new and modified 64-bit EUI object.
        I(RR(R
R((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pytmodified_eui64�scCs,t|�t|j��}t|dd�S(s5
        .. note:: This poses security risks in certain scenarios.             Please read RFC 4941 for details. Reference: RFCs 4291 and 4941.

        :param prefix: ipv6 prefix

        :return: new IPv6 `IPAddress` object based on this `EUI`             using the technique described in RFC 4291.
        R`i(R#R�R(R
tprefixRI((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pytipv6�s
cCs
|jd�S(s
        .. note:: This poses security risks in certain scenarios.             Please read RFC 4941 for details. Reference: RFCs 4291 and 4941.

        :return: new link local IPv6 `IPAddress` object based on this `EUI`             using the technique described in RFC 4291.
        l	@�(R�(R
((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pytipv6_link_local�scCsBi|jj�d6}|j�r8|jj�|d<nt|�S(s�
        A record dict containing IEEE registration details for this EUI
        (MAC-48) if available, None otherwise.
        RRM(R/RHRrRVR(R
R3((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pytinfo�scCs|jj|j|j�S(s':return: EUI in representational format(R^t
int_to_strRR_(R
((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyRJ�scCsd|S(s@:return: executable Python string to recreate equivalent object.s	EUI('%s')((R
((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyRK�s(s_modules_dialectN((RRRRRRR:R<RfRjRLRdRkRoRaR/RqRrRVR`R{R�R�R8R9R�R�R�R�R�R�RyR�RR�R�R�R�RJRK(((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyR]JsL	2				"																				
	
	N(Rtnetaddr.coreRRRtnetaddr.strategyRRbRRctnetaddr.strategy.eui48Rtnetaddr.strategy.eui64Rt
netaddr.ipRtnetaddr.compatRR	tobjectR
RRMR](((s7/tmp/pip-install-zM1pc4/netaddr/netaddr/eui/__init__.pyt<module>	s$��

https://t.me/AnonymousX5 - 2025