class Mac

Generic container for any type of MAC. More...

 
LOGO
 Annotated List  Files  Globals  Hierarchy  Index  Top

Public Methods

Public Static Methods

Protected Methods

Protected Members


Detailed Description

A class intended to carry any type of MAC. The assumption is that all current and future MAC classes will have a printable string representation and can be treated as opaque identifiers.

 Mac ()

Mac

Default constructor.

 Mac (const uint8_t* from_uint8, size_t len)
throw (BadMac)

Mac

Constructor from a (uint8_t *) memory pointer.

Parameters:

from_uint8the pointer to the memory to copy the address value from.
lenthe length of the address.
 Mac (const string& from_string)
throw (InvalidString)

Mac

Construct MAC address from string. Mac address format must conform to one of known types.

Parameters:

from_stringstring representation of MAC.

Throws: InvalidString, if, s, is, not, recognized, Mac, type.

size_t  copy_out (uint8_t* to_uint8)

copy_out

[const]

Copy the Mac raw address to specified memory location.

@param: to_uint8 the pointer to the memory to copy the address to.

Returns: the number of copied octets.

size_t  copy_in (const uint8_t* from_uint8, size_t len)
throw (BadMac)

copy_in

Copy a raw Mac address from specified memory location into Mac container.

Parameters:

from_uint8the memory address to copy the address from.
lenthe length of the address.

Returns: the number of copied octets.

size_t  copy_in (const string& from_string)
throw (InvalidString)

copy_in

Copy a Mac address from string. Mac address format must conform to one of known types.

Parameters:

from_stringthe storage to copy the address from.

Returns: the number of copied octets.

Throws: InvalidString, if, from_string, is, not, recognized, Mac, type.

bool  operator< (const Mac& other)

operator<

[const]

Less-Than Operator

Parameters:

otherthe right-hand operand to compare against.

Returns: true if the left-hand operand is numerically smaller than the right-hand operand.

const string&  str ()

str

[const]

Returns: string representation of MAC address.

string  normalized_str ()

normalized_str

[const]

Get the normalized string of MAC address.

For example, in case of Ethernet MAC address, the original string with an EtherMac address is converted into an "struct ether_addr", and then back to a string. Thus, the string address representation is normalized to the system's internal preference. Example: "00:00:00:00:00:00" -> "0:0:0:0:0:0"

Returns: normalized string representation of MAC address.

size_t  addr_bytelen ()

addr_bytelen

[const]

Get the size of the raw MAC address (in octets).

Returns: the size of the raw MAC address (in octets).

uint32_t  addr_bitlen ()

addr_bitlen

[const]

Get the size of the raw MAC address (in number of bits).

Returns: the size of the raw MAC address (in number of bits).

bool  is_zero ()

is_zero

[const]

Test if this address is numerically zero.

Returns: true if the address is numerically zero.

bool  is_multicast ()

is_multicast

[const]

Test if this address is a valid multicast address.

Returns: true if the address is a valid multicast address.

const Mac&  ZERO ()

ZERO

[static]

Pre-defined MAC address constants.

const Mac&  ALL_ONES ()

ALL_ONES

[static]

const Mac&  STP_MULTICAST ()

STP_MULTICAST

[static]

const Mac&  LLDP_MULTICAST ()

LLDP_MULTICAST

[static]

const Mac&  GMRP_MULTICAST ()

GMRP_MULTICAST

[static]

const Mac&  GVRP_MULTICAST ()

GVRP_MULTICAST

[static]

void  set_rep (const string& s)

set_rep

[protected]

string _srep

_srep

[protected]

inline const Mac&  ZERO ()

ZERO

[protected]

inline const Mac&  ALL_ONES ()

ALL_ONES

[protected]

inline const Mac&  STP_MULTICAST ()

STP_MULTICAST

[protected]

inline const Mac&  LLDP_MULTICAST ()

LLDP_MULTICAST

[protected]

inline const Mac&  GMRP_MULTICAST ()

GMRP_MULTICAST

[protected]

inline const Mac&  GVRP_MULTICAST ()

GVRP_MULTICAST

[protected]


Generated by: bms on anglepoise.lon.incunabulum.net on Wed Jul 23 10:05:24 2008, using kdoc 2.0a54+XORP.