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

Function parser_ip4_read

dpdk/app/graph/utils.c:100–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100int
101parser_ip4_read(uint32_t *value, char *p)
102{
103 uint8_t shift = 24;
104 uint32_t ip = 0;
105 char *token;
106
107 token = strtok(p, ".");
108 while (token != NULL) {
109 ip |= (((uint32_t)strtoul(token, NULL, 10)) << shift);
110 token = strtok(NULL, ".");
111 shift -= 8;
112 }
113
114 *value = ip;
115
116 return 0;
117}
118
119int
120parser_ip6_read(uint8_t *value, char *p)

Callers 3

cli_ip4_addrFunction · 0.85
cli_neigh_v4Function · 0.85
cli_ipv4_lookupFunction · 0.85

Calls 2

strtokFunction · 0.85
strtoulFunction · 0.85

Tested by

no test coverage detected