class Mac

IEEE standard 48-bit address. More...

 
LOGO
 Annotated List  Files  Globals  Hierarchy  Index  Top

Public Methods

Public Static Methods

Public Members


Detailed Description

 Mac ()

Mac

Default constructor.

explicit  Mac (const uint8_t* from_uint8)

Mac

Constructor from a (uint8_t *) memory pointer.

Parameters:

from_uint8the pointer to the memory to copy the address value from.
 Mac (const char* from_cstring)
throw (InvalidString)

Mac

Constructor from a string.

Parameters:

from_cstringC-style string of the form XX:XX:XX:XX:XX:XX where X represents a hex-digit.

Throws: InvalidString, if, string, passed, does, not, match, expected, format.

 Mac (const struct ether_addr& from_ether_addr)

Mac

Constructor from ether_addr structure.

Parameters:

from_ether_addrthe ether_addr structure to construct the Mac address from.
 Mac (const struct sockaddr& from_sockaddr)

Mac

Constructor from sockaddr structure.

Parameters:

from_sockaddrthe sockaddr structure to construct the Mac address from.
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_out (struct ether_addr& to_ether_addr)

copy_out

[const]

Copy the Mac raw address to ether_addr structure.

Parameters:

to_ether_addrthe storage to copy the address to.

Returns: the number of copied octets.

size_t  copy_out (struct sockaddr& to_sockaddr)

copy_out

[const]

Copy the Mac raw address to sockaddr structure.

Parameters:

to_sockaddrthe storage to copy the address to.

Returns: the number of copied octets.

size_t  copy_in (const uint8_t* from_uint8)

copy_in

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

Parameters:

from_uint8the memory address to copy the address from.

Returns: the number of copied octets.

size_t  copy_in (const struct ether_addr& from_ether_addr)

copy_in

Copy a raw Mac address from ether_addr structure into Mac container.

Parameters:

from_ether_addrthe storage to copy the address from.

Returns: the number of copied octets.

size_t  copy_in (const struct sockaddr& from_sockaddr)

copy_in

Copy a raw Mac address from sockaddr structure into Mac container.

Parameters:

from_sockaddrthe storage to copy the address from.

Returns: the number of copied octets.

size_t  copy_in (const char* from_cstring)
throw (InvalidString)

copy_in

Copy a Mac address from a string.

Parameters:

from_cstringC-style string of the form XX:XX:XX:XX:XX:XX where X represents a hex-digit.

Throws: InvalidString, if, string, passed, does, not, match, expected, format.

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.

bool  operator== (const Mac& other)

operator==

[const]

Equality Operator

Parameters:

otherthe right-hand operand to compare against.

Returns: true if the left-hand operand is numerically same as the right-hand operand.

bool  operator!= (const Mac& other)

operator!=

[const]

Not-Equal Operator

Parameters:

otherthe right-hand operand to compare against.

Returns: true if the left-hand operand is numerically not same as the right-hand operand.

string  str ()

str

[const]

Convert this address from binary form to presentation format.

Returns: C++ string with the human-readable ASCII representation of the address.

size_t  addr_bytelen ()

addr_bytelen

[static]

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

[static]

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_unicast ()

is_unicast

[const]

Test if this address is a valid unicast address.

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

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.

static const uint32_t ADDR_BITLEN

ADDR_BITLEN

static const uint32_t ADDR_BYTELEN

ADDR_BYTELEN

static const uint8_t MULTICAST_BIT

MULTICAST_BIT

const Mac&  ZERO ()

ZERO

[static]

Pre-defined Mac address constants.

const Mac&  ALL_ONES ()

ALL_ONES

[static]

const Mac&  BROADCAST ()

BROADCAST

[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]


Generated by: pavlin on kobe.xorp.net on Wed Jan 7 19:10:36 2009, using kdoc 2.0a54+XORP.