diff options
author | Guy Harris <guy@alum.mit.edu> | 2017-12-07 20:33:22 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-12-08 04:33:55 +0000 |
commit | 48e65c4af4e35c90d7cbc9fb789ecc6e740b300b (patch) | |
tree | 2f6e56d3734bb626584c7bdefeb5c7dce6b066c1 /rawshark.c | |
parent | 797d2f6a87607b146a2ef62e1ff501031dce8212 (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 'rawshark.c')
-rw-r--r-- | rawshark.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/rawshark.c b/rawshark.c index e97ab249ba..eb382fd5ba 100644 --- a/rawshark.c +++ b/rawshark.c @@ -44,7 +44,6 @@ #endif #include <glib.h> -#include <epan/epan-int.h> #include <epan/epan.h> #include <wsutil/cmdarg_err.h> @@ -1464,7 +1463,7 @@ open_failure_message(const char *filename, int err, gboolean for_writing) } static const nstime_t * -raw_get_frame_ts(struct packet_provider *prov, guint32 frame_num) +raw_get_frame_ts(struct packet_provider_data *prov, guint32 frame_num) { if (prov->ref && prov->ref->num == frame_num) return &prov->ref->abs_ts; @@ -1481,14 +1480,14 @@ raw_get_frame_ts(struct packet_provider *prov, guint32 frame_num) static epan_t * raw_epan_new(capture_file *cf) { - epan_t *epan = epan_new(&cf->provider); - - epan->get_frame_ts = raw_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 = NULL; + static const struct packet_provider_funcs funcs = { + raw_get_frame_ts, + cap_file_provider_get_interface_name, + cap_file_provider_get_interface_description, + NULL, + }; - return epan; + return epan_new(&cf->provider, &funcs); } cf_status_t |