Parse port mask */
| 1397 | |
| 1398 | /** Parse port mask */ |
| 1399 | static int |
| 1400 | l2fwd_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 */ |
| 1421 | static int |
no test coverage detected