aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-11-15 20:06:36 -0800
committerGuy Harris <guy@alum.mit.edu>2018-11-16 09:20:36 +0000
commita1372f6d017cb9798dce7de5e25d329c82a2da79 (patch)
tree4588e90f67d25c13f4b944242328b901e0a27514 /epan
parente12753d5f6e6f474af9934e8102cb4190aaa5846 (diff)
Use an enum for compression types in various interfaces.
This: 1) means that we don't have to flag the compression argument with a comment to indicate what it means (FALSE doesn't obviously say "not compressed", WTAP_UNCOMPRESSED does); 2) leaves space in the interfaces in question for additional compression types. (No, this is not part 1 of an implementation of additional compression types, it's just an API cleanup. Implementing additional compression types involves significant work in libwiretap, as well as UI changes to replace "compress the file" checkboxes with something to indicate *how* to compress the file, or to always use some other form of compression). Change-Id: I1d23dc720be10158e6b34f97baa247ba8a537abf Reviewed-on: https://code.wireshark.org/review/30660 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-snort.c2
-rw-r--r--epan/wslua/wslua_capture_info.c4
-rw-r--r--epan/wslua/wslua_dumper.c4
-rw-r--r--epan/wslua/wslua_file.c2
4 files changed, 6 insertions, 6 deletions
diff --git a/epan/dissectors/packet-snort.c b/epan/dissectors/packet-snort.c
index d868defec4..a360aff48c 100644
--- a/epan/dissectors/packet-snort.c
+++ b/epan/dissectors/packet-snort.c
@@ -1168,7 +1168,7 @@ snort_dissector(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
params.snaplen = WTAP_MAX_PACKET_SIZE_STANDARD;
current_session.pdh = wtap_dump_fdopen(current_session.in,
WTAP_FILE_TYPE_SUBTYPE_PCAP,
- FALSE, /* compressed */
+ WTAP_UNCOMPRESSED,
&params,
&open_err);
if (!current_session.pdh) {
diff --git a/epan/wslua/wslua_capture_info.c b/epan/wslua/wslua_capture_info.c
index 996b313d1b..bf62a844ae 100644
--- a/epan/wslua/wslua_capture_info.c
+++ b/epan/wslua/wslua_capture_info.c
@@ -337,8 +337,8 @@ WSLUA_METAMETHOD CaptureInfoConst__tostring(lua_State* L) {
lua_pushstring(L,"CaptureInfoConst pointer is NULL!");
} else {
wtap_dumper *wdh = fi->wdh;
- lua_pushfstring(L, "CaptureInfoConst: file_type_subtype=%d, snaplen=%d, encap=%d, compressed=%d",
- wdh->file_type_subtype, wdh->snaplen, wdh->encap, wdh->compressed);
+ lua_pushfstring(L, "CaptureInfoConst: file_type_subtype=%d, snaplen=%d, encap=%d, compression_type=%d",
+ wdh->file_type_subtype, wdh->snaplen, wdh->encap, wdh->compression_type);
}
WSLUA_RETURN(1); /* String of debug information. */
diff --git a/epan/wslua/wslua_dumper.c b/epan/wslua/wslua_dumper.c
index 2e738e4225..00779d3a6f 100644
--- a/epan/wslua/wslua_dumper.c
+++ b/epan/wslua/wslua_dumper.c
@@ -208,7 +208,7 @@ WSLUA_CONSTRUCTOR Dumper_new(lua_State* L) {
wtap_dump_params params = WTAP_DUMP_PARAMS_INIT;
params.encap = encap;
- d = wtap_dump_open(filename, filetype, FALSE, &params, &err);
+ d = wtap_dump_open(filename, filetype, WTAP_UNCOMPRESSED, &params, &err);
if (! d ) {
/* WSLUA_ERROR("Error while opening file for writing"); */
@@ -372,7 +372,7 @@ WSLUA_METHOD Dumper_new_for_current(lua_State* L) {
encap = lua_pinfo->rec->rec_header.packet_header.pkt_encap;
params.encap = encap;
- d = wtap_dump_open(filename, filetype, FALSE, &params, &err);
+ d = wtap_dump_open(filename, filetype, WTAP_UNCOMPRESSED, &params, &err);
if (! d ) {
switch (err) {
diff --git a/epan/wslua/wslua_file.c b/epan/wslua/wslua_file.c
index 4c43a95a2f..5beaafa9b2 100644
--- a/epan/wslua/wslua_file.c
+++ b/epan/wslua/wslua_file.c
@@ -477,7 +477,7 @@ static int File_get_compressed(lua_State* L) {
if (file_is_reader(f)) {
lua_pushboolean(L, file_iscompressed(f->file));
} else {
- lua_pushboolean(L, f->wdh->compressed);
+ lua_pushboolean(L, f->wdh->compression_type != WTAP_UNCOMPRESSED);
}
return 1;
}