aboutsummaryrefslogtreecommitdiffstats
path: root/cfile.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-12-07 19:31:43 -0800
committerGuy Harris <guy@alum.mit.edu>2017-12-08 03:32:25 +0000
commit797d2f6a87607b146a2ef62e1ff501031dce8212 (patch)
tree7c18adbd5b86d5f2843dd760f6fa492f7c05fef4 /cfile.h
parent0baa4458c5780b143ad4479d387202ddf4add06f (diff)
Move the frame_set stuff back into the capture_file structure.
libwireshark now expects an epan_t to be created with a pointer to a "packet provider" structure; that structure is opaque within libwireshark, and a pointer to it is passed to the callbacks that provide interface names, interface, descriptions, user comments, and packet time stamps, and that set user comments. The code that calls epan_new() is expected to provide those callbacks, and to define the structure, which can be used by the providers. If none of the callbacks need that extra information, the "packet provider" structure can be null. Have a "file" packet provider for all the programs that provide packets from a file. Change-Id: I4b5709a3dd7b098ebd7d2a7d95bcdd7b5903c1a0 Reviewed-on: https://code.wireshark.org/review/24731 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'cfile.h')
-rw-r--r--cfile.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/cfile.h b/cfile.h
index 809e9c8081..05a09794c8 100644
--- a/cfile.h
+++ b/cfile.h
@@ -16,7 +16,6 @@
#include <epan/dfilter/dfilter.h>
#include <epan/frame_data.h>
#include <epan/frame_data_sequence.h>
-#include <epan/frame_set.h>
#include <wiretap/wtap.h>
#ifdef __cplusplus
@@ -44,6 +43,18 @@ typedef enum {
SD_BACKWARD
} search_direction;
+/*
+ * Packet provider for programs using a capture file.
+ */
+struct packet_provider {
+ wtap *wth; /* Wiretap session */
+ const frame_data *ref;
+ frame_data *prev_dis;
+ frame_data *prev_cap;
+ frame_data_sequence *frames; /* Sequence of frames, if we're keeping that information */
+ GTree *frames_user_comments; /* BST with user comments for frames (key = frame_data) */
+};
+
typedef struct _capture_file {
epan_t *epan;
file_state state; /* Current state of capture file */
@@ -90,8 +101,9 @@ typedef struct _capture_file {
/* packet data */
struct wtap_pkthdr phdr; /* Packet header */
Buffer buf; /* Packet data */
+ /* packet provider */
+ struct packet_provider provider;
/* frames */
- frame_set frame_set_info; /* fjfff */
guint32 first_displayed; /* Frame number of first frame displayed */
guint32 last_displayed; /* Frame number of last frame displayed */
column_info cinfo; /* Column formatting information */
@@ -108,6 +120,11 @@ typedef struct _capture_file {
extern void cap_file_init(capture_file *cf);
+const char *cap_file_provider_get_interface_name(struct packet_provider *prov, guint32 interface_id);
+const char *cap_file_provider_get_interface_description(struct packet_provider *prov, guint32 interface_id);
+const char *cap_file_provider_get_user_comment(struct packet_provider *prov, const frame_data *fd);
+void cap_file_provider_set_user_comment(struct packet_provider *prov, frame_data *fd, const char *new_comment);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */