diff options
author | Masaru Tsuchiyama <m.tmatma@gmail.com> | 2020-08-09 12:12:24 +0900 |
---|---|---|
committer | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2020-10-30 00:25:22 +0000 |
commit | c14ea41233fa92a1cb97ef29d1f9ded6587e45a5 (patch) | |
tree | b5e1c5169190bddbff0af9c9bce120d0e14e442f /capture_opts.c | |
parent | 9d6ebdc8a5bf56bf3438489474674b8541a22876 (diff) |
add support for compression of capture file
Diffstat (limited to 'capture_opts.c')
-rw-r--r-- | capture_opts.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/capture_opts.c b/capture_opts.c index 05a8e67897..1fb64fd72d 100644 --- a/capture_opts.c +++ b/capture_opts.c @@ -118,6 +118,7 @@ capture_opts_init(capture_options *capture_opts) capture_opts->capture_child = FALSE; capture_opts->print_file_names = FALSE; capture_opts->print_name_to = NULL; + capture_opts->compress_type = NULL; } void @@ -978,6 +979,21 @@ capture_opts_add_opt(capture_options *capture_opts, int opt, const char *optarg_ } } break; + case LONGOPT_COMPRESS_TYPE: /* compress type */ + if (capture_opts->compress_type) { + cmdarg_err("--compress-type can be set only once"); + return 1; + } + if (strcmp(optarg_str_p, "none") == 0) { + ; + } else if (strcmp(optarg_str_p, "gzip") == 0) { + ; + } else { + cmdarg_err("parameter of --compress-type can be 'none' or 'gzip'"); + return 1; + } + capture_opts->compress_type = g_strdup(optarg_str_p); + break; default: /* the caller is responsible to send us only the right opt's */ g_assert_not_reached(); |