| 386 | } |
| 387 | |
| 388 | static int |
| 389 | parse_portmask(const char *portmask) |
| 390 | { |
| 391 | char *end = NULL; |
| 392 | unsigned long pm; |
| 393 | |
| 394 | /* Parse hexadecimal string */ |
| 395 | pm = strtoul(portmask, &end, 16); |
| 396 | if ((portmask[0] == '\0') || (end == NULL) || (*end != '\0')) |
| 397 | return 0; |
| 398 | |
| 399 | return pm; |
| 400 | } |
| 401 | |
| 402 | static int |
| 403 | parse_config(const char *q_arg) |