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

Class EUI

source code

object --+    
         |    
      Addr --+
             |
            EUI

EUI objects represent IEEE Extended Unique Identifiers. Input parsing is flexible, supporting EUI-48, EUI-64 and all MAC (Media Access Control) address flavours.

Instance Methods
 
__init__(self, addr, addr_type=0)
Constructor.
source code
 
oui(self)
Returns: The OUI (Organisationally Unique Identifier) for this EUI.
source code
 
ei(self)
Returns: The EI (Extension Identifier) for this EUI.
source code
 
eui64(self)
Returns: The value of this EUI object as a new 64-bit EUI object.
source code
 
ipv6_link_local(self)
Returns: An IPv6 IP object initialised using the value of this EUI.
source code

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

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

Class Variables
  STRATEGIES = (netaddr.address.EUI48Strategy(48, 8, '-', 48, Tr...
  ADDR_TYPES = (0, 48, 64)
  strategy = StrategyDescriptor(STRATEGIES)
  addr_type = AddrTypeDescriptor(ADDR_TYPES)

Inherited from Addr: value

Properties

Inherited from object: __class__

Method Details

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

source code 

Constructor.

Parameters:
  • addr - an EUI/MAC address string or a network byte order integer.
  • addr_type - (optional) the specific EUI address type (AT_LINK or AT_EUI64). If addr is an integer, this argument is mandatory.
Overrides: object.__init__

oui(self)

source code 
Returns:
The OUI (Organisationally Unique Identifier) for this EUI.

ei(self)

source code 
Returns:
The EI (Extension Identifier) for this EUI.

eui64(self)

source code 
Returns:
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.

ipv6_link_local(self)

source code 
Returns:
An IPv6 IP object initialised using the value of this EUI.
  • See RFC 4921 for details.

Class Variable Details

STRATEGIES

Value:
(netaddr.address.EUI48Strategy(48, 8, '-', 48, True, True),
 netaddr.address.AddrStrategy(64, 8, '-', 64, True, True))