Public Member Functions |
|
| Mac () |
| | Default constructor.
|
| | Mac (const uint8_t *from_uint8) |
| | Constructor from a (uint8_t *) memory pointer.
|
| | Mac (const char *from_cstring) throw (InvalidString) |
| | Constructor from a string.
|
| | Mac (const struct ether_addr &from_ether_addr) |
| | Constructor from ether_addr structure.
|
| | Mac (const struct sockaddr &from_sockaddr) |
| | Constructor from sockaddr structure.
|
| size_t | copy_out (uint8_t *to_uint8) const |
| | Copy the Mac raw address to specified memory location.
|
| size_t | copy_out (struct ether_addr &to_ether_addr) const |
| | Copy the Mac raw address to ether_addr structure.
|
| size_t | copy_out (struct sockaddr &to_sockaddr) const |
| | Copy the Mac raw address to sockaddr structure.
|
| size_t | copy_in (const uint8_t *from_uint8) |
| | Copy a raw Mac address from specified memory location into Mac container.
|
| size_t | copy_in (const struct ether_addr &from_ether_addr) |
| | Copy a raw Mac address from ether_addr structure into Mac container.
|
| size_t | copy_in (const struct sockaddr &from_sockaddr) |
| | Copy a raw Mac address from sockaddr structure into Mac container.
|
| size_t | copy_in (const char *from_cstring) throw (InvalidString) |
| | Copy a Mac address from a string.
|
| bool | operator< (const Mac &other) const |
| | Less-Than Operator.
|
| bool | operator== (const Mac &other) const |
| | Equality Operator.
|
| bool | operator!= (const Mac &other) const |
| | Not-Equal Operator.
|
| string | str () const |
| | Convert this address from binary form to presentation format.
|
| const uint8_t * | addr () const |
| | Get the raw value of this address.
|
| bool | is_zero () const |
| | Test if this address is numerically zero.
|
| bool | is_unicast () const |
| | Test if this address is a valid unicast address.
|
| bool | is_multicast () const |
| | Test if this address is a valid multicast address.
|
Static Public Member Functions |
| static size_t | addr_bytelen () |
| | Get the size of the raw Mac address (in octets).
|
| static uint32_t | addr_bitlen () |
| | Get the size of the raw Mac address (in number of bits).
|
|
static const Mac & | ZERO () |
| | Pre-defined Mac address constants.
|
|
static const Mac & | ALL_ONES () |
|
static const Mac & | BROADCAST () |
|
static const Mac & | STP_MULTICAST () |
|
static const Mac & | LLDP_MULTICAST () |
|
static const Mac & | GMRP_MULTICAST () |
|
static const Mac & | GVRP_MULTICAST () |
Static Public Attributes |
|
static const uint32_t | ADDR_BITLEN = 48 |
| | Number of bits in address as a constant.
|
|
static const uint32_t | ADDR_BYTELEN = ADDR_BITLEN / 8 |
| | Number of bytes in address as a constant.
|
|
static const uint8_t | MULTICAST_BIT = 0x1 |
| | The multicast bit in the first octet of the address.
|
Private Attributes |
|
uint8_t | _addr [ADDR_BYTELEN] |
IEEE standard 48-bit address.