aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-11-13 16:10:53 -0800
committerPeter Wu <peter@lekensteyn.nl>2018-11-16 02:18:26 +0000
commit4e17bd6229a09c149c4e0ac7e5a090febfc15c10 (patch)
tree3a389fbe89a5ee12abfe6d3ab1a770c830643d03 /epan
parent658c30dc4b98c7afd1f0a7a5f8380a9399cbb082 (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 'epan')
-rw-r--r--epan/dissectors/packet-snort.c7
-rw-r--r--epan/wslua/wslua_dumper.c13
2 files changed, 9 insertions, 11 deletions
diff --git a/epan/dissectors/packet-snort.c b/epan/dissectors/packet-snort.c
index 9e1d2ad88d..d868defec4 100644
--- a/epan/dissectors/packet-snort.c
+++ b/epan/dissectors/packet-snort.c
@@ -1144,13 +1144,13 @@ snort_dissector(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
else {
/* We expect alerts from Snort. Pass frame into snort on first pass. */
if (!pinfo->fd->flags.visited && current_session.working) {
- wtapng_dump_params params;
int write_err = 0;
gchar *err_info;
wtap_rec rec;
/* First time, open current_session.in to write to for dumping into snort with */
if (!current_session.pdh) {
+ wtap_dump_params params = WTAP_DUMP_PARAMS_INIT;
int open_err;
/* Older versions of Snort don't support capture file with several encapsulations (like pcapng),
@@ -1164,11 +1164,10 @@ snort_dissector(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
* versions of Snort" wouldn't handle multiple encapsulation
* types.
*/
- wtap_dump_params_init(&params, NULL);
+ params.encap = pinfo->rec->rec_header.packet_header.pkt_encap;
+ params.snaplen = WTAP_MAX_PACKET_SIZE_STANDARD;
current_session.pdh = wtap_dump_fdopen(current_session.in,
WTAP_FILE_TYPE_SUBTYPE_PCAP,
- pinfo->rec->rec_header.packet_header.pkt_encap,
- WTAP_MAX_PACKET_SIZE_STANDARD,
FALSE, /* compressed */
&params,
&open_err);
diff --git a/epan/wslua/wslua_dumper.c b/epan/wslua/wslua_dumper.c
index ae947de796..2e738e4225 100644
--- a/epan/wslua/wslua_dumper.c
+++ b/epan/wslua/wslua_dumper.c
@@ -205,10 +205,10 @@ WSLUA_CONSTRUCTOR Dumper_new(lua_State* L) {
int encap = (int)luaL_optinteger(L,WSLUA_OPTARG_Dumper_new_ENCAP,WTAP_ENCAP_ETHERNET);
int err = 0;
const char* filename = cross_plat_fname(fname);
- wtapng_dump_params params;
+ wtap_dump_params params = WTAP_DUMP_PARAMS_INIT;
- wtap_dump_params_init(&params, NULL);
- d = wtap_dump_open(filename, filetype, encap, 0, FALSE, &params, &err);
+ params.encap = encap;
+ d = wtap_dump_open(filename, filetype, FALSE, &params, &err);
if (! d ) {
/* WSLUA_ERROR("Error while opening file for writing"); */
@@ -359,7 +359,7 @@ WSLUA_METHOD Dumper_new_for_current(lua_State* L) {
int encap;
int err = 0;
const char* filename = cross_plat_fname(fname);
- wtapng_dump_params params;
+ wtap_dump_params params = WTAP_DUMP_PARAMS_INIT;
if (! lua_pinfo ) {
WSLUA_ERROR(Dumper_new_for_current,"Cannot be used outside a tap or a dissector");
@@ -371,9 +371,8 @@ WSLUA_METHOD Dumper_new_for_current(lua_State* L) {
}
encap = lua_pinfo->rec->rec_header.packet_header.pkt_encap;
-
- wtap_dump_params_init(&params, NULL);
- d = wtap_dump_open(filename, filetype, encap, 0, FALSE, &params, &err);
+ params.encap = encap;
+ d = wtap_dump_open(filename, filetype, FALSE, &params, &err);
if (! d ) {
switch (err) {