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

Function parse_portmask

dpdk/app/proc-info/main.c:208–223  ·  view source on GitHub ↗

* Parse the portmask provided at run time. */

Source from the content-addressed store, hash-verified

206 * Parse the portmask provided at run time.
207 */
208static int
209parse_portmask(const char *portmask)
210{
211 char *end = NULL;
212
213 errno = 0;
214
215 /* parse hexadecimal string */
216 enabled_port_mask = strtoul(portmask, &end, 16);
217 if (portmask[0] == '\0' || end == NULL || *end != '\0' || errno != 0) {
218 fprintf(stderr, "Invalid portmask '%s'\n", portmask);
219 return -1;
220 }
221
222 return 0;
223}
224
225/*
226 * Parse ids value list into array

Callers 1

proc_info_parse_argsFunction · 0.70

Calls 1

strtoulFunction · 0.85

Tested by

no test coverage detected