diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-11-13 16:10:53 -0800 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2018-11-16 02:18:26 +0000 |
commit | 4e17bd6229a09c149c4e0ac7e5a090febfc15c10 (patch) | |
tree | 3a389fbe89a5ee12abfe6d3ab1a770c830643d03 /randpkt_core | |
parent | 658c30dc4b98c7afd1f0a7a5f8380a9399cbb082 (diff) |
Use the dump parameters structure for non-pcapng-specific stuff.
Use it for all the per-file information, including the per-file
link-layer type and the per-file snapshot length.
Change-Id: Id75687c7faa6418a2bfcf7f8198206a9f95db629
Reviewed-on: https://code.wireshark.org/review/30616
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'randpkt_core')
-rw-r--r-- | randpkt_core/randpkt_core.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/randpkt_core/randpkt_core.c b/randpkt_core/randpkt_core.c index aef4d29326..7b1822b76f 100644 --- a/randpkt_core/randpkt_core.c +++ b/randpkt_core/randpkt_core.c @@ -654,23 +654,25 @@ gboolean randpkt_example_close(randpkt_example* example) int randpkt_example_init(randpkt_example* example, char* produce_filename, int produce_max_bytes) { - wtapng_dump_params params; int err; if (pkt_rand == NULL) { pkt_rand = g_rand_new(); } - wtap_dump_params_init(¶ms, NULL); + const wtap_dump_params params = { + .encap = example->sample_wtap_encap, + .snaplen = produce_max_bytes, + }; if (strcmp(produce_filename, "-") == 0) { /* Write to the standard output. */ example->dump = wtap_dump_open_stdout(WTAP_FILE_TYPE_SUBTYPE_PCAP, - example->sample_wtap_encap, produce_max_bytes, FALSE /* compressed */, + FALSE /* compressed */, ¶ms, &err); example->filename = "the standard output"; } else { example->dump = wtap_dump_open(produce_filename, WTAP_FILE_TYPE_SUBTYPE_PCAP, - example->sample_wtap_encap, produce_max_bytes, FALSE /* compressed */, + FALSE /* compressed */, ¶ms, &err); example->filename = produce_filename; } |