aboutsummaryrefslogtreecommitdiffstats
path: root/epan/epan.h
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 /epan/epan.h
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 'epan/epan.h')
-rw-r--r--epan/epan.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/epan/epan.h b/epan/epan.h
index 306c583f8f..5cafb780dc 100644
--- a/epan/epan.h
+++ b/epan/epan.h
@@ -44,7 +44,18 @@ struct epan_column_info;
* time stamps, comments, and other information outside the packet
* data itself.
*/
-struct packet_provider;
+struct packet_provider_data;
+
+/*
+ * Structure containing pointers to functions supplied by the user
+ * of libwireshark.
+ */
+struct packet_provider_funcs {
+ const nstime_t *(*get_frame_ts)(struct packet_provider_data *prov, guint32 frame_num);
+ const char *(*get_interface_name)(struct packet_provider_data *prov, guint32 interface_id);
+ const char *(*get_interface_description)(struct packet_provider_data *prov, guint32 interface_id);
+ const char *(*get_user_comment)(struct packet_provider_data *prov, const frame_data *fd);
+};
/**
@mainpage Wireshark EPAN the packet analyzing engine. Source code can be found in the epan directory
@@ -138,7 +149,8 @@ void epan_conversation_init(void);
*/
typedef struct epan_session epan_t;
-WS_DLL_PUBLIC epan_t *epan_new(struct packet_provider *prov);
+WS_DLL_PUBLIC epan_t *epan_new(struct packet_provider_data *prov,
+ const struct packet_provider_funcs *funcs);
WS_DLL_PUBLIC const char *epan_get_user_comment(const epan_t *session, const frame_data *fd);