EtherMac ()
| EtherMac |
explicit EtherMac (const uint8_t* from_uint8)
| EtherMac |
Constructor from a (uint8_t *) memory pointer.
Parameters:
from_uint8 | the pointer to the memory to copy the address value from. |
EtherMac (const string& from_string)
throw (InvalidString) | EtherMac |
Construct EtherMac from a string representation.
Parameters:
from_string | string representation 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.
EtherMac (const Mac& from_mac)
throw (BadMac) | EtherMac |
Construct EtherMac from Mac.
Parameters:
from_mac | Mac to construct EtherMac from. |
Throws: BadMac, if, the, Mac's, string, representation, is, not, equivalent, to, the, EtherMac's, string, representation.
EtherMac (const struct ether_addr& from_ether_addr)
throw (BadMac) | EtherMac |
Construct EtherMac from ether_addr structure.
Parameters:
from_ether_addr | the ether_addr structure to construct EtherMac from. |
Throws: BadMac, if, the, ether_addr, cannot, be, used, to, construct, EtherMac.
EtherMac (const struct sockaddr& from_sockaddr)
throw (BadMac) | EtherMac |
Construct EtherMac from sockaddr structure.
Parameters:
from_sockaddr | the sockaddr structure to construct EtherMac from. |
Throws: BadMac, if, the, sockaddr, cannot, be, used, to, construct, EtherMac.
size_t copy_out (uint8_t* to_uint8)
| copy_out |
[const]
Copy the EtherMac 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.
Reimplemented from Mac.
size_t copy_in (const uint8_t* from_uint8)
| copy_in |
Copy a raw EtherMac address from specified memory location into EtherMac container.
Parameters:
from_uint8 | the memory address to copy the address from. |
Returns: the number of copied octets.
Reimplemented from Mac.
size_t copy_out (struct ether_addr& to_ether_addr)
| copy_out |
[const]
Copy the EtherMac address to ether_addr structure.
Parameters:
to_ether_addr | the storage to copy the address to. |
Returns: the number of copied octets.
Reimplemented from Mac.
size_t copy_in (const struct ether_addr& from_ether_addr)
| copy_in |
Copy a raw Ethernet address from ether_addr structure into EtherMac container.
Parameters:
from_ether_addr | the storage to copy the address from. |
Returns: the number of copied octets.
Reimplemented from Mac.
size_t copy_out (struct sockaddr& to_sockaddr)
| copy_out |
[const]
Copy the EtherMac address to sockaddr structure.
Parameters:
to_sockaddr | the storage to copy the address to. |
Returns: the number of copied octets.
Reimplemented from Mac.
size_t copy_in (const struct sockaddr& from_sockaddr)
| copy_in |
Copy a raw Ethernet address from sockaddr structure into EtherMac container.
Parameters:
from_sockaddr | the storage to copy the address from. |
Returns: the number of copied octets.
Reimplemented from Mac.
size_t copy_out (Mac& to_mac)
| copy_out |
[const]
Copy the EtherMac address to generic Mac container.
Parameters:
to_mac | the storage to copy the address to. |
Returns: the number of copied octets.
Reimplemented from Mac.
size_t copy_in (const Mac& from_mac)
throw (BadMac) | copy_in |
Copy an Ethernet address from Mac container into EtherMac container.
Parameters:
from_mac | the storage to copy the address from. |
Returns: the number of copied octets.
Throws: BadMac, if, the, Mac, cannot, be, used, to, construct, EtherMac.
Reimplemented from Mac.
bool valid (const string& s)
| valid |
[static]
Check whether string contains valid EtherMac representation.
Parameters:
s | potential EtherMac string representation. |
Returns: true if s is valid, false otherwise.
string normalize (const string& s)
throw (InvalidString) | normalize |
[static]
Normalize the string representation of an EtherMac address.
Convert the string with an EtherMac address 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"
Parameters:
s | the string with the EtherMac address to normalize. |
Returns: a string with the normalized EtherMac address.
size_t addr_bytelen ()
| addr_bytelen |
[static]
Get the size of the raw EtherMac address (in octets).
Returns: the size of the raw EtherMac address (in octets).
Reimplemented from Mac.
uint32_t addr_bitlen ()
| addr_bitlen |
[static]
Get the size of the raw EtherMac address (in number of bits).
Returns: the size of the raw EtherMac address (in number of bits).
Reimplemented from Mac.
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.
Reimplemented from Mac.
static const uint32_t ADDR_BITLEN | ADDR_BITLEN |
static const uint32_t ADDR_BYTELEN | ADDR_BYTELEN |
static const uint8_t MULTICAST_BIT | MULTICAST_BIT |