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

# Class EUI

source code

    object --+
             |
          Addr --+
                 |
                EUI

Represents an IEEE EUI (Extended Unique Identifier) indentifier.

Input parser is flexible, supporting EUI-48 (including the many Media Access Control variants) and EUI-64.

Instance Methods
__init__(self, addr, addr_type=0) Constructor. | source code
oui(self, fmt=<class 'netaddr.eui.OUI'>) Returns: The OUI (Organisationally Unique Identifier) for this EUI. | source code
ei(self) Returns: The EI (Extension Identifier) for this EUI | source code
isiab(self) Returns: True if this EUI is an IAB address, False otherwise | source code
iab(self, fmt=<class 'netaddr.eui.IAB'>) Returns: If isiab() is True, the IAB (Individual Address Block) is returned, None otherwise. | 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: new link local IPv6 IP object based on this EUI using technique described in RFC 4291. | source code
info(self) Returns: A record dict containing IEEE registration details for this EUI (MAC-48) if available, None otherwise. | source code
Inherited from `Addr`: `__add__`, `__and__`, `__eq__`, `__ge__`, `__getitem__`, `__gt__`, `__hash__`, `__hex__`, `__iadd__`, `__int__`, `__invert__`, `__isub__`, `__iter__`, `__le__`, `__len__`, `__long__`, `__lshift__`, `__lt__`, `__ne__`, `__or__`, `__repr__`, `__rshift__`, `__setitem__`, `__str__`, `__sub__`, `__xor__`, `bin`, `bits`, `packed` Inherited from `object`: `__delattr__`, `__getattribute__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`

Class Variables
| STRATEGIES = ``(`EUI48Strategy(48, 8, '-', 48, 16, True)`,` AddrStr`...``
| 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-48 (MAC) or EUI-64 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, fmt=<class 'netaddr.eui.OUI'>) | source code
Parameters: `fmt` - callable used on return values. Default: OUI object. Also Supports str(), unicode(), int() and long(). Returns: The OUI (Organisationally Unique Identifier) for this EUI.

### ei(self) | source code
Returns: The EI (Extension Identifier) for this EUI

### isiab(self) | source code
Returns: True if this EUI is an IAB address, False otherwise

### iab(self, fmt=<class 'netaddr.eui.IAB'>) | source code
Parameters: `fmt` - callable used on return values. Default: IAB object. Also Supports str(), unicode(), int() and long(). Returns: If isiab() is True, the IAB (Individual Address Block) is returned, None otherwise.

### 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: new link local IPv6 IP object based on this EUI using technique described in RFC 4291. Please Note: this technique poses security risks in certain scenarios. Please read RFC 4941 for details. Reference: RFCs 4291 and 4941.

### info(self) | source code
Returns: A record dict containing IEEE registration details for this EUI (MAC-48) if available, None otherwise.

Class Variable Details

  ### STRATEGIES Value:
      (EUI48Strategy(48, 8, '-', 48, 16, True),
       AddrStrategy(64, 8, '-', 64, 16, True))