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

Function parse_portmask

dpdk/examples/vhost/main.c:594–609  ·  view source on GitHub ↗

* Parse the portmask provided at run time. */

Source from the content-addressed store, hash-verified

592 * Parse the portmask provided at run time.
593 */
594static int
595parse_portmask(const char *portmask)
596{
597 char *end = NULL;
598 unsigned long pm;
599
600 errno = 0;
601
602 /* parse hexadecimal string */
603 pm = strtoul(portmask, &end, 16);
604 if ((portmask[0] == '\0') || (end == NULL) || (*end != '\0') || (errno != 0))
605 return 0;
606
607 return pm;
608
609}
610
611/*
612 * Parse num options at run time.

Callers 1

us_vhost_parse_argsFunction · 0.70

Calls 1

strtoulFunction · 0.85

Tested by

no test coverage detected