aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-12-07 20:33:22 -0800
committerGuy Harris <guy@alum.mit.edu>2017-12-08 04:33:55 +0000
commit48e65c4af4e35c90d7cbc9fb789ecc6e740b300b (patch)
tree2f6e56d3734bb626584c7bdefeb5c7dce6b066c1 /file.c
parent797d2f6a87607b146a2ef62e1ff501031dce8212 (diff)
Hand the packet provider functions to epan_new().
Have separate packet_provider_data structures and packet_provider_funcs structures; the latter holds a table of functions that libwireshark can call for information about packets, the latter holds the data that those functions use. This means we no longer need to expose the structure of an epan_t outside epan/epan.c; get rid of epan/epan-int.h. Change-Id: I381b88993aa19e55720ce02c42ad33738e3f51f4 Reviewed-on: https://code.wireshark.org/review/24732 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'file.c')
-rw-r--r--file.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/file.c b/file.c
index 7fda336642..d0080c4802 100644
--- a/file.c
+++ b/file.c
@@ -26,7 +26,6 @@
#include <wiretap/merge.h>
#include <epan/exceptions.h>
-#include <epan/epan-int.h>
#include <epan/epan.h>
#include <epan/column.h>
#include <epan/packet.h>
@@ -223,7 +222,7 @@ static void compute_elapsed(capture_file *cf, GTimeVal *start_time)
}
static const nstime_t *
-ws_get_frame_ts(struct packet_provider *prov, guint32 frame_num)
+ws_get_frame_ts(struct packet_provider_data *prov, guint32 frame_num)
{
if (prov->prev_dis && prov->prev_dis->num == frame_num)
return &prov->prev_dis->abs_ts;
@@ -243,14 +242,14 @@ ws_get_frame_ts(struct packet_provider *prov, guint32 frame_num)
static epan_t *
ws_epan_new(capture_file *cf)
{
- epan_t *epan = epan_new(&cf->provider);
-
- epan->get_frame_ts = ws_get_frame_ts;
- epan->get_interface_name = cap_file_provider_get_interface_name;
- epan->get_interface_description = cap_file_provider_get_interface_description;
- epan->get_user_comment = cap_file_provider_get_user_comment;
-
- return epan;
+ static const struct packet_provider_funcs funcs = {
+ ws_get_frame_ts,
+ cap_file_provider_get_interface_name,
+ cap_file_provider_get_interface_description,
+ cap_file_provider_get_user_comment
+ };
+
+ return epan_new(&cf->provider, &funcs);
}
cf_status_t