diff options
author | Yunchih Chen <yunchih.cat@gmail.com> | 2018-03-05 09:41:11 +0800 |
---|---|---|
committer | Yunchih Chen <yunchih.cat@gmail.com> | 2018-03-05 09:41:44 +0800 |
commit | 692a091becf285adbc606758125a735c10c8287d (patch) | |
tree | 8cc9435ac891e92ddb76c0279cc725c03af1352e /nfcollect.c | |
parent | 71f6b20e99e03c16bf9bf8c5d509ade84b6d5db4 (diff) | |
download | nfcollect-692a091becf285adbc606758125a735c10c8287d.tar nfcollect-692a091becf285adbc606758125a735c10c8287d.tar.gz nfcollect-692a091becf285adbc606758125a735c10c8287d.tar.bz2 nfcollect-692a091becf285adbc606758125a735c10c8287d.tar.lz nfcollect-692a091becf285adbc606758125a735c10c8287d.tar.xz nfcollect-692a091becf285adbc606758125a735c10c8287d.tar.zst nfcollect-692a091becf285adbc606758125a735c10c8287d.zip |
Add more extractor implementation
Diffstat (limited to 'nfcollect.c')
-rw-r--r-- | nfcollect.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/nfcollect.c b/nfcollect.c index 5d7aaf1..10ad512 100644 --- a/nfcollect.c +++ b/nfcollect.c @@ -58,19 +58,20 @@ int main(int argc, char *argv[]) { uint32_t trunk_cnt = 0, trunk_size = 0; uint32_t entries_max; nflog_global_t g; - int nfl_group_id; - char *storage_dir = NULL; + int nfl_group_id = -1; + char *compression_flag = NULL, *storage_dir = NULL; struct option longopts[] = {/* name, has_args, flag, val */ {"nflog-group", required_argument, NULL, 'g'}, {"storage_dir", required_argument, NULL, 'd'}, {"storage_size", required_argument, NULL, 's'}, + {"compression", optional_argument, NULL, 'z'}, {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'v'}, {0, 0, 0, 0}}; int opt; - while ((opt = getopt_long(argc, argv, "g:d:s:hv", longopts, NULL)) != -1) { + while ((opt = getopt_long(argc, argv, "c:g:d:s:hv", longopts, NULL)) != -1) { switch (opt) { case 'h': printf("%s", help_text); @@ -80,6 +81,9 @@ int main(int argc, char *argv[]) { printf("%s %s", PACKAGE, VERSION); exit(0); break; + case 'c': + compression_flag = optarg; + break; case 'd': storage_dir = optarg; break; @@ -119,6 +123,7 @@ int main(int argc, char *argv[]) { nfl_cal_trunk(storage_size, &trunk_cnt, &trunk_size); nfl_cal_entries(trunk_size, &entries_max); + nfl_setup_compression(compression_flag, &g.compression_opt); // Set up commit worker g.nfl_commit_queue = malloc(sizeof(sem_t)); |