aboutsummaryrefslogtreecommitdiffstats
path: root/capture_info.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-12-14 19:25:31 -0500
committerMichael Mann <mmann78@netscape.net>2015-12-17 04:01:56 +0000
commitf342fdcdb83d960bd59ab7e42237c18f9282adcc (patch)
tree81c59810cd548e154d3c1fd95998b3ed0148db4e /capture_info.c
parent8cb03d57a600bc092fd5670f37fb990784fffd96 (diff)
Create capture dissector "info" structure (capture_packet_info_t)
While it currently only contains packet_counts, it will hopefully stabilize the capture function signature if more fields are added. Change-Id: I003552c58043c7c2d67aec458187b12b233057e2 Reviewed-on: https://code.wireshark.org/review/12690 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'capture_info.c')
-rw-r--r--capture_info.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/capture_info.c b/capture_info.c
index 0d4afa380e..171a1e2f90 100644
--- a/capture_info.c
+++ b/capture_info.c
@@ -39,11 +39,6 @@
#include <wsutil/filesystem.h>
-static void capture_info_packet(
-packet_counts *counts, gint wtap_linktype, const guchar *pd, guint32 caplen, union wtap_pseudo_header *pseudo_header);
-
-
-
typedef struct _info_data {
packet_counts counts; /* several packet type counters */
struct wtap* wtap; /* current wtap file */
@@ -202,6 +197,18 @@ gboolean capture_info_new_file(const char *new_filename)
return TRUE;
}
+static void
+capture_info_packet(packet_counts *counts, gint wtap_linktype, const guchar *pd, guint32 caplen, union wtap_pseudo_header *pseudo_header)
+{
+ capture_packet_info_t cpinfo;
+
+ /* Setup the capture packet structure */
+ cpinfo.counts = counts;
+
+ counts->total++;
+ if (!try_capture_dissector("wtap_encap", wtap_linktype, pd, 0, caplen, &cpinfo, pseudo_header))
+ counts->other++;
+}
/* new packets arrived */
void capture_info_new_packets(int to_read)
@@ -246,16 +253,6 @@ void capture_info_close(void)
wtap_close(info_data.wtap);
}
-
-static void
-capture_info_packet(packet_counts *counts, gint wtap_linktype, const guchar *pd, guint32 caplen, union wtap_pseudo_header *pseudo_header)
-{
- counts->total++;
- if (!try_capture_dissector("wtap_encap", wtap_linktype, pd, 0, caplen, counts, pseudo_header))
- counts->other++;
-}
-
-
#endif /* HAVE_LIBPCAP */
/*