EtherMac ()
| EtherMac |
EtherMac (const string& s)
throw (InvalidString) | EtherMac |
Construct EtherMac from a string representation.
Parameters:
s | 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& m)
throw (BadMac) | EtherMac |
Construct EtherMac from Mac.
Parameters:
m | Mac to construct EtherMac from. |
Throws: BadMac, if, the, Mac's, string, representation, is, not, equivalent, to, the, EtherMac's, string, representation.
EtherMac (const ether_addr& ea)
throw (BadMac) | EtherMac |
Construct EtherMac from ether_addr.
bool
get_ether_addr (struct ether_addr& ea)
| get_ether_addr |
[const]
Convert to ether_addr representation.
Parameters:
ea | ether_addr to store representation. |
Returns: true on success, false if underlying string is empty.
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.