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

Function l2fwd_crypto_parse_portmask

dpdk/examples/l2fwd-crypto/main.c:1399–1418  ·  view source on GitHub ↗

Parse port mask */

Source from the content-addressed store, hash-verified

1397
1398/** Parse port mask */
1399static int
1400l2fwd_crypto_parse_portmask(struct l2fwd_crypto_options *options,
1401 const char *q_arg)
1402{
1403 char *end = NULL;
1404 unsigned long pm;
1405
1406 /* parse hexadecimal string */
1407 pm = strtoul(q_arg, &end, 16);
1408 if ((pm == '\0') || (end == NULL) || (*end != '\0'))
1409 pm = 0;
1410
1411 options->portmask = pm;
1412 if (options->portmask == 0) {
1413 printf("invalid portmask specified\n");
1414 return -1;
1415 }
1416
1417 return pm;
1418}
1419
1420/** Parse number of queues */
1421static int

Callers 1

l2fwd_crypto_parse_argsFunction · 0.85

Calls 2

strtoulFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected