Package netaddr :: Module address :: Class EUI
[frames] | no frames]

Class EUI

source code

object --+    
         |    
      Addr --+
             |
            EUI

A class whose objects represent IEEE Extended Unique Identifiers. Supports EUI-48 (along with common MAC flavours) and EUI-64.

Instance Methods
 
__init__(self, addr, addr_type=0)
Constructor.
source code
 
oui(self)
Returns the OUI (Organisationally Unique Identifier for this EUI-48/MAC address.
source code
 
ei(self)
Returns the EI (Extension Identifier) for this EUI-48 address.
source code
 
to_eui64(self)
Returns the value of this EUI object as a new EUI address initialised as a 64-bit EUI.
source code
 
ipv6_link_local(self)
Returns an IP() object class (IPv6 address type) initialised using the value of this EUI.
source code

Inherited from Addr: __eq__, __ge__, __getitem__, __gt__, __hex__, __iadd__, __int__, __isub__, __iter__, __le__, __len__, __long__, __lt__, __setitem__, __str__, bits, setvalue

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__

Properties

Inherited from object: __class__

Method Details

__init__(self, addr, addr_type=0)
(Constructor)

source code 

Constructor.

addr - the string form of an EUI-48/64 address or a network byte order int/long value.

addr_type - (optional) the EUI address type (AT_LINK or AT_EUI64). If addr is an int or long, this argument becomes mandatory.

Overrides: object.__init__

to_eui64(self)

source code 

Returns the value of this EUI object as a new EUI address initialised as a 64-bit EUI.

So if this address represents an EUI-48 address it converts the value of this address to EUI-64 as per the standard.

If this class is already and EUI-64 address, it just returns a new object that is numerically equivalent to itself.