EUI-64 data type. More...

#include <senf/Socket/Protocols/Raw/EUI64.hh>

Inheritance diagram for senf::EUI64:

Public Member Functions

bool isMACCompatible () const
 true, if EUI64 is MAC compatible, false otherwise More...
 
bool local () const
 true if the local bit is set, false otherwise More...
 
bool group () const
 true if the group bit is set, false otherwise More...
 
 operator bool () const
 true, if EUI64 is != 0, false otherwise More...
 
boost::uint64_t uint64 () const
 Return EUI64 as integer number. More...
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &os, EUI64 const &v)
 Write out EUI64 in it's string representation to stream. More...
 
std::istream & operator>> (std::istream &is, EUI64 &v)
 Read EUI64 string representation from stream. More...
 

Structors and default members

static EUI64 const None
 The empty (0) address. More...
 
 EUI64 (boost::uint64_t v=0u)
 Construct EUI-64. More...
 
 EUI64 (senf::NoInit_t)
 Construct uninitialized EUI-64. More...
 
static EUI64 from_mac (MACAddress const &mac)
 Construct EUI-64 from senf::MACAddress. More...
 
static EUI64 from_string (std::string const &s)
 Construct EUI-64 from string representation. More...
 
template<class InputIterator >
static EUI64 from_data (InputIterator i)
 Construct EUI-64 from 8 data octets. More...
 

Detailed Description

EUI-64 data type.

An EUI-64 is a 64 bit (8 octet) id. The id is represented as an 8 byte sequence in network byte order. An EUI64 can be converted from/to several other representations

boost::uint64_t senf::EUI64(0x1a2b3c4d5f607182ull)
eui64.uint64()
std::string senf::EUI64::from_string("1a:2b:3c:4d-5f:60:71:82")
senf::str(eui64)
raw data
    (8 bytes)
senf::EUI64::from_data(iterator)
eui64.begin()
senf::MACAddress
    (aka EUI-48)
senf::EUI64::from_mac(mac-address)
senf::MACAddress::from_eui64(eui64)

Since senf::EUI64 is based on boost::array, you can access the raw data bytes of the address using begin(), end() or operator[]:

senf::EUI64 eui64 (...);
std::vector<char> data;
data.resize(8);
std::copy(eui64.begin(), eui64.end(), data.begin()); // Copy 8 bytes
    \see <a href="http://tools.ietf.org/html/rfc4291">RFC 4291</a>

Definition at line 66 of file EUI64.hh.

Constructor & Destructor Documentation

◆ EUI64() [1/2]

senf::EUI64::EUI64 ( boost::uint64_t  v = 0u)
explicit

Construct EUI-64.

◆ EUI64() [2/2]

senf::EUI64::EUI64 ( senf::NoInit_t  )
explicit

Construct uninitialized EUI-64.

Member Function Documentation

◆ from_data()

template<class InputIterator >
static EUI64 senf::EUI64::from_data ( InputIterator  i)
static

Construct EUI-64 from 8 data octets.

The iterator i must point to a sequence of 8 octets in network byte order.

◆ from_mac()

static EUI64 senf::EUI64::from_mac ( MACAddress const &  mac)
static

Construct EUI-64 from senf::MACAddress.

◆ from_string()

senf::EUI64 senf::EUI64::from_string ( std::string const &  s)
static

Construct EUI-64 from string representation.

The string representation consists of 8 octets in hexadecimal notation separated by ':' or '-'

Exceptions
senf::AddressSyntaxException

Definition at line 31 of file EUI64.cc.

◆ group()

bool senf::EUI64::group ( ) const

true if the group bit is set, false otherwise

The group bit is the least significant bit of the first octet (bit 7 in standard RFC bit numbering).

◆ isMACCompatible()

bool senf::EUI64::isMACCompatible ( ) const

true, if EUI64 is MAC compatible, false otherwise

An EUI64 is MAC compatible if bytes 4th and 5th byte (in network byte order) are 0xfffe.

◆ local()

bool senf::EUI64::local ( ) const

true if the local bit is set, false otherwise

The local bit is the second least significant bit of the first octet (bit 6 in standard RFC bit numbering).

◆ operator bool()

senf::EUI64::operator bool ( ) const
explicit

true, if EUI64 is != 0, false otherwise

◆ uint64()

boost::uint64_t senf::EUI64::uint64 ( ) const

Return EUI64 as integer number.

Friends And Related Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
EUI64 const &  v 
)
related

Write out EUI64 in it's string representation to stream.

◆ operator>>()

std::istream & operator>> ( std::istream &  is,
EUI64 v 
)
related

Read EUI64 string representation from stream.

Member Data Documentation

◆ None

senf::EUI64 const senf::EUI64::None
static

The empty (0) address.

Definition at line 73 of file EUI64.hh.


The documentation for this struct was generated from the following files: