36 const char* codes =
"0123456789abcdef";
39 for (
int ib=0; ib<6; ib++) {
40 uint64_t
byte = mac & 0xff;
42 if (ib > 0) rval +=
':';
43 rval += codes[(
byte>>4) & 0x0f];
44 rval += codes[
byte & 0x0f];
54 if (str.length() != 17) {
55 emsg.
Init(
"RethTools::String2Mac",
56 string(
"invalid string size for '") + str +
"'");
60 for (
int ib=0; ib<6; ib++) {
63 mac |= uint64_t(
byte&0xff)<<(8*ib);
65 char delim = str[3*ib-1];
66 if (delim !=
':' && delim !=
'-') {
67 emsg.
Init(
"RethTools::String2Mac",
68 string(
"invalid delimiter '") + delim +
"'");
void Init(const std::string &meth, const std::string &text)
FIXME_docs.
Declaration of class ReventLoop.