MCPcopy Create free account
hub / github.com/NetSys/bess / parse_mac_addr

Function parse_mac_addr

core/modules/l2_forward.cc:529–540  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

527}
528
529static int parse_mac_addr(const char *str, char *addr) {
530 if (str != nullptr && addr != nullptr) {
531 int r = sscanf(str, "%2hhx:%2hhx:%2hhx:%2hhx:%2hhx:%2hhx", addr, addr + 1,
532 addr + 2, addr + 3, addr + 4, addr + 5);
533
534 if (r != 6) {
535 return -EINVAL;
536 }
537 }
538
539 return 0;
540}
541
542/******************************************************************************/
543

Callers 4

CommandAddMethod · 0.85
CommandDeleteMethod · 0.85
CommandLookupMethod · 0.85
CommandPopulateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected