MCPcopy Create free account
hub / github.com/F-Stack/f-stack / parser_mac_read

Function parser_mac_read

dpdk/app/graph/utils.c:137–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135}
136
137int
138parser_mac_read(uint64_t *value, char *p)
139{
140 uint64_t mac = 0, val = 0;
141 uint8_t shift = 40;
142 char *token;
143
144 token = strtok(p, ":");
145 while (token != NULL) {
146 hex_string_to_uint64(&val, token);
147 mac |= val << shift;
148 token = strtok(NULL, ":");
149 shift -= 8;
150 val = 0;
151 }
152
153 *value = mac;
154
155 return 0;
156}

Callers 2

cli_neigh_v4Function · 0.85
cli_neigh_v6Function · 0.85

Calls 2

strtokFunction · 0.85
hex_string_to_uint64Function · 0.85

Tested by

no test coverage detected