diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-11-07 13:41:35 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-11-07 13:41:35 +0000 |
commit | 1d092509b65227239caf2ef24c5031bd4f431c6e (patch) | |
tree | 18e289fae6c2f55bdf6201269dde058111afcacd /src/opt.c | |
parent | Releasing debian version 2.7.1-1. (diff) | |
download | dnsperf-1d092509b65227239caf2ef24c5031bd4f431c6e.tar.xz dnsperf-1d092509b65227239caf2ef24c5031bd4f431c6e.zip |
Merging upstream version 2.8.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/opt.c')
-rw-r--r-- | src/opt.c | 35 |
1 files changed, 35 insertions, 0 deletions
@@ -366,3 +366,38 @@ void perf_opt_parse(int argc, char** argv) exit(1); } } + +perf_suppress_t perf_opt_parse_suppress(const char* val) +{ + perf_suppress_t s = { false, false, false }; + + while (val && *val) { + const char* next = strchr(val, ','); + int len; + if (next) { + len = next - val; + next += 1; + } else { + len = strlen(val); + next = 0; + } + + if (!strncmp(val, "timeouts", len)) { + s.timeouts = true; + } else if (!strncmp(val, "congestion", len)) { + s.congestion = true; + } else if (!strncmp(val, "sendfailed", len)) { + s.sendfailed = true; + } else if (!strncmp(val, "sockready", len)) { + s.sockready = true; + } else { + fprintf(stderr, "unknown message type to suppress: %.*s\n", len, val); + perf_opt_usage(); + exit(1); + } + + val = next; + } + + return s; +} |