| 703 | } |
| 704 | |
| 705 | static int |
| 706 | parse_portmask(const char *portmask) |
| 707 | { |
| 708 | char *end = NULL; |
| 709 | unsigned long pm; |
| 710 | |
| 711 | /* parse hexadecimal string */ |
| 712 | pm = strtoul(portmask, &end, 16); |
| 713 | if ((portmask[0] == '\0') || (end == NULL) || (*end != '\0')) |
| 714 | return 0; |
| 715 | |
| 716 | return pm; |
| 717 | } |
| 718 | |
| 719 | /* Parse the argument given in the command line of the application */ |
| 720 | static int |