| 28 | #define PARSE_DELIMITER " \f\n\r\t\v" |
| 29 | |
| 30 | static int |
| 31 | parse_uint(uint64_t *value, const char *str) |
| 32 | { |
| 33 | char *next = NULL; |
| 34 | uint64_t n; |
| 35 | |
| 36 | errno = 0; |
| 37 | /* Parse number string */ |
| 38 | if (!strncasecmp(str, "0x", 2)) { |
| 39 | str += 2; |
| 40 | n = strtol(str, &next, 16); |
| 41 | } else { |
| 42 | n = strtol(str, &next, 10); |
| 43 | } |
| 44 | if (errno != 0 || str == next || *next != '\0') |
| 45 | return -1; |
| 46 | |
| 47 | *value = n; |
| 48 | |
| 49 | return 0; |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * Disable the host shaper and re-arm available descriptor threshold event. |
no test coverage detected