summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--capture_info.c27
-rw-r--r--epan/capture_dissectors.c4
-rw-r--r--epan/capture_dissectors.h4
-rw-r--r--epan/dissectors/packet-ap1394.c4
-rw-r--r--epan/dissectors/packet-arcnet.c21
-rw-r--r--epan/dissectors/packet-arp.c4
-rw-r--r--epan/dissectors/packet-arp.h2
-rw-r--r--epan/dissectors/packet-atalk.c4
-rw-r--r--epan/dissectors/packet-atm.c8
-rw-r--r--epan/dissectors/packet-ax25-kiss.c6
-rw-r--r--epan/dissectors/packet-ax25.c4
-rw-r--r--epan/dissectors/packet-ax25.h2
-rw-r--r--epan/dissectors/packet-bpq.c4
-rw-r--r--epan/dissectors/packet-chdlc.c4
-rw-r--r--epan/dissectors/packet-chdlc.h2
-rw-r--r--epan/dissectors/packet-enc.c4
-rw-r--r--epan/dissectors/packet-eth.c10
-rw-r--r--epan/dissectors/packet-eth.h2
-rw-r--r--epan/dissectors/packet-fddi.c4
-rw-r--r--epan/dissectors/packet-fr.c14
-rw-r--r--epan/dissectors/packet-gre.c4
-rw-r--r--epan/dissectors/packet-i2c.c6
-rw-r--r--epan/dissectors/packet-icmp.c4
-rw-r--r--epan/dissectors/packet-icmpv6.c4
-rw-r--r--epan/dissectors/packet-ieee80211-prism.c6
-rw-r--r--epan/dissectors/packet-ieee80211-radiotap.c6
-rw-r--r--epan/dissectors/packet-ieee80211-wlancap.c4
-rw-r--r--epan/dissectors/packet-ieee80211.c18
-rw-r--r--epan/dissectors/packet-ieee80211.h6
-rw-r--r--epan/dissectors/packet-ieee8021ah.c8
-rw-r--r--epan/dissectors/packet-ip.c4
-rw-r--r--epan/dissectors/packet-ip.h2
-rw-r--r--epan/dissectors/packet-ipfc.c4
-rw-r--r--epan/dissectors/packet-ipv6.c4
-rw-r--r--epan/dissectors/packet-ipv6.h2
-rw-r--r--epan/dissectors/packet-ipx.c4
-rw-r--r--epan/dissectors/packet-ipx.h2
-rw-r--r--epan/dissectors/packet-isl.c6
-rw-r--r--epan/dissectors/packet-isl.h2
-rw-r--r--epan/dissectors/packet-llc.c20
-rw-r--r--epan/dissectors/packet-llc.h4
-rw-r--r--epan/dissectors/packet-netbios.c4
-rw-r--r--epan/dissectors/packet-netbios.h2
-rw-r--r--epan/dissectors/packet-netrom.c2
-rw-r--r--epan/dissectors/packet-null.c16
-rw-r--r--epan/dissectors/packet-ospf.c4
-rw-r--r--epan/dissectors/packet-pktap.c4
-rw-r--r--epan/dissectors/packet-ppi.c4
-rw-r--r--epan/dissectors/packet-ppp.c6
-rw-r--r--epan/dissectors/packet-ppp.h2
-rw-r--r--epan/dissectors/packet-raw.c14
-rw-r--r--epan/dissectors/packet-sctp.c4
-rw-r--r--epan/dissectors/packet-sll.c6
-rw-r--r--epan/dissectors/packet-tcp.c8
-rw-r--r--epan/dissectors/packet-tr.c4
-rw-r--r--epan/dissectors/packet-tr.h2
-rw-r--r--epan/dissectors/packet-udp.c8
-rw-r--r--epan/dissectors/packet-vines.c4
-rw-r--r--epan/dissectors/packet-vines.h2
-rw-r--r--epan/dissectors/packet-vlan.c8
-rw-r--r--epan/packet.h4
61 files changed, 181 insertions, 181 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 */
/*
diff --git a/epan/capture_dissectors.c b/epan/capture_dissectors.c
index 1368c254e0..a68d76f4cb 100644
--- a/epan/capture_dissectors.c
+++ b/epan/capture_dissectors.c
@@ -97,7 +97,7 @@ void register_capture_dissector(const char* name, const guint32 pattern, capture
g_hash_table_insert(sub_dissectors->hash_table, GUINT_TO_POINTER(pattern), (gpointer) handle);
}
-gboolean try_capture_dissector(const char* name, const guint32 pattern, const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header)
+gboolean try_capture_dissector(const char* name, const guint32 pattern, const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header)
{
struct capture_dissector_table* sub_dissectors;
struct capture_dissector_handle* handle;
@@ -113,7 +113,7 @@ gboolean try_capture_dissector(const char* name, const guint32 pattern, const gu
if (handle == NULL)
return FALSE;
- return handle->dissector(pd, offset, len, ld, pseudo_header);
+ return handle->dissector(pd, offset, len, cpinfo, pseudo_header);
}
/*
diff --git a/epan/capture_dissectors.h b/epan/capture_dissectors.h
index 7d8ab37855..8d353d88f6 100644
--- a/epan/capture_dissectors.h
+++ b/epan/capture_dissectors.h
@@ -34,7 +34,7 @@ extern "C" {
*/
/** callback function definition for capture dissectors */
-typedef gboolean (*capture_dissector_t)(const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header);
+typedef gboolean (*capture_dissector_t)(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header);
/* a protocol uses the function to register a capture sub-dissector table
*/
@@ -44,7 +44,7 @@ WS_DLL_PUBLIC void register_capture_dissector_table(const char *name, const char
/** Register a new capture dissector. */
WS_DLL_PUBLIC void register_capture_dissector(const char* name, const guint32 pattern, capture_dissector_t dissector, const int proto);
-WS_DLL_PUBLIC gboolean try_capture_dissector(const char* name, const guint32 pattern, const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header);
+WS_DLL_PUBLIC gboolean try_capture_dissector(const char* name, const guint32 pattern, const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header);
extern void capture_dissector_init(void);
extern void capture_dissector_cleanup(void);
diff --git a/epan/dissectors/packet-ap1394.c b/epan/dissectors/packet-ap1394.c
index e2446255d9..f864af397e 100644
--- a/epan/dissectors/packet-ap1394.c
+++ b/epan/dissectors/packet-ap1394.c
@@ -44,7 +44,7 @@ static dissector_table_t ethertype_subdissector_table;
static dissector_handle_t data_handle;
static gboolean
-capture_ap1394(const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_ap1394(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
guint16 etype;
@@ -57,7 +57,7 @@ capture_ap1394(const guchar *pd, int offset, int len, packet_counts *ld, const u
etype = pntoh16(&pd[offset]);
offset += 2;
- return try_capture_dissector("ethertype", etype, pd, offset, len, ld, pseudo_header);
+ return try_capture_dissector("ethertype", etype, pd, offset, len, cpinfo, pseudo_header);
}
static int
diff --git a/epan/dissectors/packet-arcnet.c b/epan/dissectors/packet-arcnet.c
index 403d8a6e07..ab10565bc2 100644
--- a/epan/dissectors/packet-arcnet.c
+++ b/epan/dissectors/packet-arcnet.c
@@ -83,7 +83,7 @@ static int arcnet_len(void)
}
static gboolean
-capture_arcnet_common(const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_, gboolean has_exception)
+capture_arcnet_common(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_, gboolean has_exception)
{
if (!BYTES_ARE_IN_FRAME(offset, len, 1)) {
return FALSE;
@@ -93,7 +93,7 @@ capture_arcnet_common(const guchar *pd, int offset, int len, packet_counts *ld,
case ARCNET_PROTO_IP_1051:
/* No fragmentation stuff in the header */
- return capture_ip(pd, offset + 1, len, ld, pseudo_header);
+ return capture_ip(pd, offset + 1, len, cpinfo, pseudo_header);
case ARCNET_PROTO_IP_1201:
/*
@@ -101,7 +101,7 @@ capture_arcnet_common(const guchar *pd, int offset, int len, packet_counts *ld,
*
* XXX - on at least some versions of NetBSD, it appears that we
* might we get ARCNET frames, not reassembled packets; we should
- * perhaps bump "ld->other" for all but the first frame of a packet.
+ * perhaps bump "counts->other" for all but the first frame of a packet.
*
* XXX - but on FreeBSD it appears that we get reassembled packets
* on input (but apparently we get frames on output - or maybe
@@ -133,18 +133,17 @@ capture_arcnet_common(const guchar *pd, int offset, int len, packet_counts *ld,
type appears after the padding. */
offset += 4;
}
- return capture_ip(pd, offset + 3, len, ld, pseudo_header);
+ return capture_ip(pd, offset + 3, len, cpinfo, pseudo_header);
case ARCNET_PROTO_ARP_1051:
case ARCNET_PROTO_ARP_1201:
/*
* XXX - do we have to worry about fragmentation for ARP?
*/
- capture_arp(pd, offset + 1, len, ld, pseudo_header);
- break;
+ return capture_arp(pd, offset + 1, len, cpinfo, pseudo_header);
case ARCNET_PROTO_IPX:
- ld->ipx++;
+ cpinfo->counts->ipx++;
break;
default:
@@ -155,15 +154,15 @@ capture_arcnet_common(const guchar *pd, int offset, int len, packet_counts *ld,
}
static gboolean
-capture_arcnet (const guchar *pd, int offset _U_, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_arcnet (const guchar *pd, int offset _U_, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
- return capture_arcnet_common(pd, 4, len, ld, pseudo_header, FALSE);
+ return capture_arcnet_common(pd, 4, len, cpinfo, pseudo_header, FALSE);
}
static gboolean
-capture_arcnet_has_exception(const guchar *pd, int offset _U_, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_arcnet_has_exception(const guchar *pd, int offset _U_, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
- return capture_arcnet_common(pd, 2, len, ld, pseudo_header, TRUE);
+ return capture_arcnet_common(pd, 2, len, cpinfo, pseudo_header, TRUE);
}
static void
diff --git a/epan/dissectors/packet-arp.c b/epan/dissectors/packet-arp.c
index bf313821f7..beff539f2f 100644
--- a/epan/dissectors/packet-arp.c
+++ b/epan/dissectors/packet-arp.c
@@ -1360,9 +1360,9 @@ dissect_ax25arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
}
gboolean
-capture_arp(const guchar *pd _U_, int offset _U_, int len _U_, packet_counts *ld _U_, const union wtap_pseudo_header *pseudo_header _U_)
+capture_arp(const guchar *pd _U_, int offset _U_, int len _U_, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
- ld->arp++;
+ cpinfo->counts->arp++;
return TRUE;
}
diff --git a/epan/dissectors/packet-arp.h b/epan/dissectors/packet-arp.h
index b686cac7a8..6017506ebd 100644
--- a/epan/dissectors/packet-arp.h
+++ b/epan/dissectors/packet-arp.h
@@ -27,7 +27,7 @@
const gchar *tvb_arphrdaddr_to_str(tvbuff_t *tvb, gint offset, int ad_len, guint16 type);
void dissect_atm_nsap(tvbuff_t *tvb, packet_info* pinfo, int offset, int len, proto_tree *tree);
-gboolean capture_arp(const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header);
+gboolean capture_arp(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header);
extern const value_string arp_hrd_vals[];
diff --git a/epan/dissectors/packet-atalk.c b/epan/dissectors/packet-atalk.c
index 3255b09d2d..67cdac589f 100644
--- a/epan/dissectors/packet-atalk.c
+++ b/epan/dissectors/packet-atalk.c
@@ -1581,10 +1581,10 @@ static const value_string llap_type_vals[] = {
static value_string_ext llap_type_vals_ext = VALUE_STRING_EXT_INIT(llap_type_vals);
static gboolean
-capture_llap(const guchar *pd _U_, int offset _U_, int len _U_, packet_counts *ld _U_, const union wtap_pseudo_header *pseudo_header _U_)
+capture_llap(const guchar *pd _U_, int offset _U_, int len _U_, capture_packet_info_t *cpinfo _U_, const union wtap_pseudo_header *pseudo_header _U_)
{
/* XXX - get its own counter
- ld->other++; */
+ counts->other++; */
return FALSE;
}
diff --git a/epan/dissectors/packet-atm.c b/epan/dissectors/packet-atm.c
index acddf5bde2..6888997681 100644
--- a/epan/dissectors/packet-atm.c
+++ b/epan/dissectors/packet-atm.c
@@ -665,10 +665,10 @@ dissect_le_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
static gboolean
capture_lane(const guchar *pd, int offset _U_,
- int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header)
+ int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header)
{
/* Is it LE Control, 802.3, 802.5, or "none of the above"? */
- return try_capture_dissector("atm_lane", pseudo_header->atm.subtype, pd, 2, len, ld, pseudo_header);
+ return try_capture_dissector("atm_lane", pseudo_header->atm.subtype, pd, 2, len, cpinfo, pseudo_header);
}
static int
@@ -790,10 +790,10 @@ static const value_string ipsilon_type_vals[] = {
static gboolean
capture_atm(const guchar *pd, int offset _U_,
- int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header)
+ int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header)
{
if (pseudo_header->atm.aal == AAL_5) {
- return try_capture_dissector("atm.aal5.type", pseudo_header->atm.type, pd, offset, len, ld, pseudo_header);
+ return try_capture_dissector("atm.aal5.type", pseudo_header->atm.type, pd, offset, len, cpinfo, pseudo_header);
}
return FALSE;
}
diff --git a/epan/dissectors/packet-ax25-kiss.c b/epan/dissectors/packet-ax25-kiss.c
index aa5a26f808..a440de01a1 100644
--- a/epan/dissectors/packet-ax25-kiss.c
+++ b/epan/dissectors/packet-ax25-kiss.c
@@ -179,7 +179,7 @@ static const value_string kiss_frame_types[] = {
};
static gboolean
-capture_ax25_kiss( const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_ax25_kiss( const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
int l_offset;
guint8 kiss_cmd;
@@ -193,7 +193,7 @@ capture_ax25_kiss( const guchar *pd, int offset, int len, packet_counts *ld, con
switch ( kiss_cmd & KISS_CMD_MASK )
{
case KISS_DATA_FRAME :
- return capture_ax25( pd, l_offset, len, ld, pseudo_header );
+ return capture_ax25( pd, l_offset, len, cpinfo, pseudo_header );
case KISS_TXDELAY : break;
case KISS_PERSISTENCE : break;
case KISS_SLOT_TIME : break;
@@ -202,7 +202,7 @@ capture_ax25_kiss( const guchar *pd, int offset, int len, packet_counts *ld, con
case KISS_SETHARDWARE : break;
case KISS_DATA_FRAME_ACK:
l_offset += 2;
- return capture_ax25( pd, l_offset, len, ld, pseudo_header );
+ return capture_ax25( pd, l_offset, len, cpinfo, pseudo_header );
case KISS_POLL_MODE : break;
case KISS_RETURN : break;
default : break;
diff --git a/epan/dissectors/packet-ax25.c b/epan/dissectors/packet-ax25.c
index c5f3885e54..6f21f147e9 100644
--- a/epan/dissectors/packet-ax25.c
+++ b/epan/dissectors/packet-ax25.c
@@ -253,7 +253,7 @@ dissect_ax25( tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void*
}
gboolean
-capture_ax25( const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_ax25( const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
guint8 control;
guint8 pid;
@@ -277,7 +277,7 @@ capture_ax25( const guchar *pd, int offset, int len, packet_counts *ld, const un
pid = pd[ l_offset ];
l_offset += 1; /* step over the pid and point to the first byte of the payload */
- return try_capture_dissector("ax25.pid", pid & 0x0ff, pd, l_offset, len, ld, pseudo_header);
+ return try_capture_dissector("ax25.pid", pid & 0x0ff, pd, l_offset, len, cpinfo, pseudo_header);
}
return FALSE;
}
diff --git a/epan/dissectors/packet-ax25.h b/epan/dissectors/packet-ax25.h
index 8f92f7df1b..dc1ad3976c 100644
--- a/epan/dissectors/packet-ax25.h
+++ b/epan/dissectors/packet-ax25.h
@@ -26,6 +26,6 @@
#define __PACKET_AX25_H__
extern
-gboolean capture_ax25(const guchar *, int, int, packet_counts *, const union wtap_pseudo_header *pseudo_header);
+gboolean capture_ax25(const guchar *, int, int, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header);
#endif
diff --git a/epan/dissectors/packet-bpq.c b/epan/dissectors/packet-bpq.c
index 5c6fb1ff97..39daaa036f 100644
--- a/epan/dissectors/packet-bpq.c
+++ b/epan/dissectors/packet-bpq.c
@@ -102,7 +102,7 @@ dissect_bpq( tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
}
static gboolean
-capture_bpq( const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_bpq( const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
int l_offset;
@@ -111,7 +111,7 @@ capture_bpq( const guchar *pd, int offset, int len, packet_counts *ld, const uni
l_offset = offset;
l_offset += BPQ_HEADER_SIZE; /* step over bpq header to point at the AX.25 packet*/
- return capture_ax25( pd, l_offset, len, ld, pseudo_header );
+ return capture_ax25( pd, l_offset, len, cpinfo, pseudo_header );
}
void
diff --git a/epan/dissectors/packet-chdlc.c b/epan/dissectors/packet-chdlc.c
index d125552dca..72284984c3 100644
--- a/epan/dissectors/packet-chdlc.c
+++ b/epan/dissectors/packet-chdlc.c
@@ -114,13 +114,13 @@ const value_string chdlc_vals[] = {
};
gboolean
-capture_chdlc( const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_ ) {
+capture_chdlc( const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_ ) {
if (!BYTES_ARE_IN_FRAME(offset, len, 4))
return FALSE;
switch (pntoh16(&pd[offset + 2])) {
case ETHERTYPE_IP:
- return capture_ip(pd, offset + 4, len, ld, pseudo_header);
+ return capture_ip(pd, offset + 4, len, cpinfo, pseudo_header);
}
return FALSE;
diff --git a/epan/dissectors/packet-chdlc.h b/epan/dissectors/packet-chdlc.h
index 4cbd7ef4e6..917fcb8155 100644
--- a/epan/dissectors/packet-chdlc.h
+++ b/epan/dissectors/packet-chdlc.h
@@ -32,7 +32,7 @@
#define CHDLC_ADDR_MULTICAST 0x8f
extern
-gboolean capture_chdlc(const guchar *, int, int, packet_counts *, const union wtap_pseudo_header *pseudo_header);
+gboolean capture_chdlc(const guchar *, int, int, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header);
extern const value_string chdlc_vals[];
diff --git a/epan/dissectors/packet-enc.c b/epan/dissectors/packet-enc.c
index 63d6490527..a00795ccf7 100644
--- a/epan/dissectors/packet-enc.c
+++ b/epan/dissectors/packet-enc.c
@@ -59,7 +59,7 @@ static int hf_enc_flags = -1;
static gint ett_enc = -1;
static gboolean
-capture_enc(const guchar *pd, int offset _U_, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_enc(const guchar *pd, int offset _U_, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
guint32 af;
@@ -67,7 +67,7 @@ capture_enc(const guchar *pd, int offset _U_, int len, packet_counts *ld, const
return FALSE;
af = pntoh32(pd);
- return try_capture_dissector("enc", af, pd, BSD_ENC_HDRLEN, len, ld, pseudo_header);
+ return try_capture_dissector("enc", af, pd, BSD_ENC_HDRLEN, len, cpinfo, pseudo_header);
}
static const value_string af_vals[] = {
diff --git a/epan/dissectors/packet-eth.c b/epan/dissectors/packet-eth.c
index 8f5735b650..e57f395876 100644
--- a/epan/dissectors/packet-eth.c
+++ b/epan/dissectors/packet-eth.c
@@ -192,7 +192,7 @@ eth_build_filter(packet_info *pinfo)
#define ETHERNET_SNAP 3
gboolean
-capture_eth(const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_eth(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
guint16 etype, length;
int ethhdr_type; /* the type of ethernet frame */
@@ -210,7 +210,7 @@ capture_eth(const guchar *pd, int offset, int len, packet_counts *ld, const unio
if ((pd[offset] == 0x01 || pd[offset] == 0x0C) && pd[offset+1] == 0x00
&& pd[offset+2] == 0x0C && pd[offset+3] == 0x00
&& pd[offset+4] == 0x00) {
- return capture_isl(pd, offset, len, ld, pseudo_header);
+ return capture_isl(pd, offset, len, cpinfo, pseudo_header);
}
}
@@ -267,11 +267,11 @@ capture_eth(const guchar *pd, int offset, int len, packet_counts *ld, const unio
switch (ethhdr_type) {
case ETHERNET_802_3:
- return capture_ipx(pd, offset, len, ld, pseudo_header);
+ return capture_ipx(pd, offset, len, cpinfo, pseudo_header);
case ETHERNET_802_2:
- return capture_llc(pd, offset, len, ld, pseudo_header);
+ return capture_llc(pd, offset, len, cpinfo, pseudo_header);
case ETHERNET_II:
- return try_capture_dissector("ethertype", etype, pd, offset, len, ld, pseudo_header);
+ return try_capture_dissector("ethertype", etype, pd, offset, len, cpinfo, pseudo_header);
}
return FALSE;
diff --git a/epan/dissectors/packet-eth.h b/epan/dissectors/packet-eth.h
index ac1d66fdd0..d46d4befd0 100644
--- a/epan/dissectors/packet-eth.h
+++ b/epan/dissectors/packet-eth.h
@@ -29,7 +29,7 @@ typedef struct _eth_hdr {
} eth_hdr;
extern
-gboolean capture_eth(const guchar *, int, int, packet_counts *, const union wtap_pseudo_header *pseudo_header);
+gboolean capture_eth(const guchar *, int, int, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header);
void add_ethernet_trailer(packet_info *pinfo, proto_tree *tree, proto_tree *fh_tree,
int trailer_id, tvbuff_t *tvb, tvbuff_t *trailer_tvb,
diff --git a/epan/dissectors/packet-fddi.c b/epan/dissectors/packet-fddi.c
index cd28e8ec1e..f2680249bc 100644
--- a/epan/dissectors/packet-fddi.c
+++ b/epan/dissectors/packet-fddi.c
@@ -200,7 +200,7 @@ fddi_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, con
}
static gboolean
-capture_fddi(const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_fddi(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
int fc;
@@ -231,7 +231,7 @@ capture_fddi(const guchar *pd, int offset, int len, packet_counts *ld, const uni
case FDDI_FC_LLC_ASYNC + 13 :
case FDDI_FC_LLC_ASYNC + 14 :
case FDDI_FC_LLC_ASYNC + 15 :
- return capture_llc(pd, offset, len, ld, pseudo_header);
+ return capture_llc(pd, offset, len, cpinfo, pseudo_header);
} /* fc */
return FALSE;
diff --git a/epan/dissectors/packet-fr.c b/epan/dissectors/packet-fr.c
index 139bd78221..6f47348d6d 100644
--- a/epan/dissectors/packet-fr.c
+++ b/epan/dissectors/packet-fr.c
@@ -207,7 +207,7 @@ static const xdlc_cf_items fr_cf_items_ext = {
};
static gboolean
-capture_fr(const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_fr(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
guint8 fr_octet;
guint32 addr;
@@ -328,16 +328,16 @@ capture_fr(const guchar *pd, int offset, int len, packet_counts *ld, const union
switch (fr_nlpid) {
case NLPID_IP:
- return capture_ip(pd, offset, len, ld, pseudo_header);
+ return capture_ip(pd, offset, len, cpinfo, pseudo_header);
case NLPID_IP6:
- return capture_ipv6(pd, offset, len, ld, pseudo_header);
+ return capture_ipv6(pd, offset, len, cpinfo, pseudo_header);
case NLPID_PPP:
- return capture_ppp_hdlc(pd, offset, len, ld, pseudo_header);
+ return capture_ppp_hdlc(pd, offset, len, cpinfo, pseudo_header);
case NLPID_SNAP:
- return capture_snap(pd, offset, len, ld, pseudo_header);
+ return capture_snap(pd, offset, len, cpinfo, pseudo_header);
default:
return FALSE;
@@ -367,7 +367,7 @@ capture_fr(const guchar *pd, int offset, int len, packet_counts *ld, const union
* If the data does not start with unnumbered information (03) and
* the DLCI# is not 0, then there may be Cisco Frame Relay encapsulation.
*/
- return capture_chdlc(pd, offset, len, ld, pseudo_header);
+ return capture_chdlc(pd, offset, len, cpinfo, pseudo_header);
}
break;
@@ -376,7 +376,7 @@ capture_fr(const guchar *pd, int offset, int len, packet_counts *ld, const union
case RAW_ETHER:
if (addr != 0)
- return capture_eth(pd, offset, len, ld, pseudo_header);
+ return capture_eth(pd, offset, len, cpinfo, pseudo_header);
return FALSE;
}
diff --git a/epan/dissectors/packet-gre.c b/epan/dissectors/packet-gre.c
index a7a20936d1..7e17ea2ce8 100644
--- a/epan/dissectors/packet-gre.c
+++ b/epan/dissectors/packet-gre.c
@@ -312,9 +312,9 @@ dissect_gre_wccp2_redirect_header(tvbuff_t *tvb, int offset, proto_tree *tree)
}
static gboolean
-capture_gre(const guchar *pd _U_, int offset _U_, int len _U_, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_gre(const guchar *pd _U_, int offset _U_, int len _U_, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
- ld->gre++;
+ cpinfo->counts->gre++;
return TRUE;
}
diff --git a/epan/dissectors/packet-i2c.c b/epan/dissectors/packet-i2c.c
index f62eee079a..78a1525298 100644
--- a/epan/dissectors/packet-i2c.c
+++ b/epan/dissectors/packet-i2c.c
@@ -85,12 +85,12 @@ static gpointer i2c_value(packet_info *pinfo _U_)
}
static gboolean
-capture_i2c(const guchar *pd _U_, int offset _U_, int len _U_, packet_counts *ld, const union wtap_pseudo_header *pseudo_header)
+capture_i2c(const guchar *pd _U_, int offset _U_, int len _U_, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header)
{
if (pseudo_header->i2c.is_event) {
- ld->i2c_event++;
+ cpinfo->counts->i2c_event++;
} else {
- ld->i2c_data++;
+ cpinfo->counts->i2c_data++;
}
return TRUE;
diff --git a/epan/dissectors/packet-icmp.c b/epan/dissectors/packet-icmp.c
index e523be9424..f7faaa7af3 100644
--- a/epan/dissectors/packet-icmp.c
+++ b/epan/dissectors/packet-icmp.c
@@ -1165,9 +1165,9 @@ get_best_guess_mstimeofday(tvbuff_t * tvb, gint offset, guint32 comp_ts)
} /* get_best_guess_mstimeofday() */
static gboolean
-capture_icmp(const guchar *pd _U_, int offset _U_, int len _U_, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_icmp(const guchar *pd _U_, int offset _U_, int len _U_, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
- ld->icmp++;
+ cpinfo->counts->icmp++;
return TRUE;
}
diff --git a/epan/dissectors/packet-icmpv6.c b/epan/dissectors/packet-icmpv6.c
index 7cd6dae472..ded2043bac 100644
--- a/epan/dissectors/packet-icmpv6.c
+++ b/epan/dissectors/packet-icmpv6.c
@@ -3452,9 +3452,9 @@ dissect_mldrv2( tvbuff_t *tvb, guint32 offset, packet_info *pinfo _U_, proto_tre
}
static gboolean
-capture_icmpv6(const guchar *pd _U_, int offset _U_, int len _U_, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_icmpv6(const guchar *pd _U_, int offset _U_, int len _U_, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
- ld->icmp++;
+ cpinfo->counts->icmp++;
return TRUE;
}
diff --git a/epan/dissectors/packet-ieee80211-prism.c b/epan/dissectors/packet-ieee80211-prism.c
index 50b69a9567..828b50feba 100644
--- a/epan/dissectors/packet-ieee80211-prism.c
+++ b/epan/dissectors/packet-ieee80211-prism.c
@@ -238,7 +238,7 @@ prism_rate_return(guint32 rate)
static gboolean
-capture_prism(const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_prism(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
guint32 cookie;
@@ -249,7 +249,7 @@ capture_prism(const guchar *pd, int offset, int len, packet_counts *ld, const un
cookie = pntoh32(pd);
if ((cookie == WLANCAP_MAGIC_COOKIE_V1) ||
(cookie == WLANCAP_MAGIC_COOKIE_V2)) {
- return capture_wlancap(pd, offset, len, ld, pseudo_header);
+ return capture_wlancap(pd, offset, len, cpinfo, pseudo_header);
}
/* Prism header */
@@ -259,7 +259,7 @@ capture_prism(const guchar *pd, int offset, int len, packet_counts *ld, const un
offset += PRISM_HEADER_LENGTH;
/* 802.11 header follows */
- return capture_ieee80211(pd, offset, len, ld, pseudo_header);
+ return capture_ieee80211(pd, offset, len, cpinfo, pseudo_header);
}
static int
diff --git a/epan/dissectors/packet-ieee80211-radiotap.c b/epan/dissectors/packet-ieee80211-radiotap.c
index e346422200..3ba618740e 100644
--- a/epan/dissectors/packet-ieee80211-radiotap.c
+++ b/epan/dissectors/packet-ieee80211-radiotap.c
@@ -456,7 +456,7 @@ static const true_false_string preamble_type = {
*/
static gboolean
-capture_radiotap(const guchar * pd, int offset, int len, packet_counts * ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_radiotap(const guchar * pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
guint16 it_len;
guint32 present, xpresent;
@@ -537,9 +537,9 @@ capture_radiotap(const guchar * pd, int offset, int len, packet_counts * ld, con
/* 802.11 header follows */
if (rflags & IEEE80211_RADIOTAP_F_DATAPAD)
- return capture_ieee80211_datapad(pd, offset + it_len, len, ld, pseudo_header);
+ return capture_ieee80211_datapad(pd, offset + it_len, len, cpinfo, pseudo_header);
- return capture_ieee80211(pd, offset + it_len, len, ld, pseudo_header);
+ return capture_ieee80211(pd, offset + it_len, len, cpinfo, pseudo_header);
}
static int
diff --git a/epan/dissectors/packet-ieee80211-wlancap.c b/epan/dissectors/packet-ieee80211-wlancap.c
index a3efb2ff1f..5b19b813ef 100644
--- a/epan/dissectors/packet-ieee80211-wlancap.c
+++ b/epan/dissectors/packet-ieee80211-wlancap.c
@@ -73,7 +73,7 @@ static gint ett_wlancap = -1;
static dissector_handle_t wlancap_handle;
gboolean
-capture_wlancap(const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_wlancap(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
guint32 length;
@@ -88,7 +88,7 @@ capture_wlancap(const guchar *pd, int offset, int len, packet_counts *ld, const
offset += length;
/* 802.11 header follows */
- return capture_ieee80211(pd, offset, len, ld, pseudo_header);
+ return capture_ieee80211(pd, offset, len, cpinfo, pseudo_header);
}
/*
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c
index be7dbc2774..962c61158f 100644
--- a/epan/dissectors/packet-ieee80211.c
+++ b/epan/dissectors/packet-ieee80211.c
@@ -5622,7 +5622,7 @@ add_mimo_compressed_beamforming_feedback_report (proto_tree *tree, tvbuff_t *tvb
/* ************************************************************************* */
static gboolean
capture_ieee80211_common (const guchar * pd, int offset, int len,
- packet_counts * ld, const union wtap_pseudo_header *pseudo_header _U_, gboolean datapad)
+ capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_, gboolean datapad)
{
guint16 fcf, hdr_length;
@@ -5729,17 +5729,17 @@ capture_ieee80211_common (const guchar * pd, int offset, int len,
/* We have two MAC addresses after the header. */
if ((memcmp(&pd[offset+hdr_length+6], pinfo->dl_src.data, 6) == 0) ||
(memcmp(&pd[offset+hdr_length+6], pinfo->dl_dst.data, 6) == 0)) {
- return capture_eth (pd, offset + hdr_length, len, ld);
+ return capture_eth (pd, offset + hdr_length, len, cpinfo, pseudo_header);
}
}
#endif
if ((pd[offset+hdr_length] == 0xff) && (pd[offset+hdr_length+1] == 0xff))
- return capture_ipx (pd, offset+hdr_length, len, ld, pseudo_header);
+ return capture_ipx (pd, offset+hdr_length, len, cpinfo, pseudo_header);
else if ((pd[offset+hdr_length] == 0x00) && (pd[offset+hdr_length+1] == 0x00))
- return capture_llc (pd, offset + hdr_length + 2, len, ld, pseudo_header);
+ return capture_llc (pd, offset + hdr_length + 2, len, cpinfo, pseudo_header);
}
else {
- return capture_llc (pd, offset + hdr_length, len, ld, pseudo_header);
+ return capture_llc (pd, offset + hdr_length, len, cpinfo, pseudo_header);
}
break;
}
@@ -5752,9 +5752,9 @@ capture_ieee80211_common (const guchar * pd, int offset, int len,
* Handle 802.11 with a variable-length link-layer header.
*/
gboolean
-capture_ieee80211 (const guchar * pd, int offset, int len, packet_counts * ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_ieee80211 (const guchar * pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
- return capture_ieee80211_common (pd, offset, len, ld, pseudo_header, FALSE);
+ return capture_ieee80211_common (pd, offset, len, cpinfo, pseudo_header, FALSE);
}
/*
@@ -5762,9 +5762,9 @@ capture_ieee80211 (const guchar * pd, int offset, int len, packet_counts * ld, c
*/
gboolean
capture_ieee80211_datapad (const guchar * pd, int offset, int len,
- packet_counts * ld, const union wtap_pseudo_header *pseudo_header _U_)
+ capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
- return capture_ieee80211_common (pd, offset, len, ld, pseudo_header, TRUE);
+ return capture_ieee80211_common (pd, offset, len, cpinfo, pseudo_header, TRUE);
}
diff --git a/epan/dissectors/packet-ieee80211.h b/epan/dissectors/packet-ieee80211.h
index 3179f92be8..0dbaa6ff6f 100644
--- a/epan/dissectors/packet-ieee80211.h
+++ b/epan/dissectors/packet-ieee80211.h
@@ -32,11 +32,11 @@ extern "C" {
#endif /* __cplusplus */
extern
-gboolean capture_ieee80211 (const guchar *, int, int, packet_counts *, const union wtap_pseudo_header *pseudo_header);
-gboolean capture_ieee80211_datapad (const guchar *, int, int, packet_counts *, const union wtap_pseudo_header *pseudo_header);
+gboolean capture_ieee80211 (const guchar *, int, int, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header);
+gboolean capture_ieee80211_datapad (const guchar *, int, int, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header);
extern
-gboolean capture_wlancap(const guchar *, int, int, packet_counts *, const union wtap_pseudo_header *pseudo_header);
+gboolean capture_wlancap(const guchar *, int, int, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header);
void dissect_wifi_p2p_ie(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
int offset, gint size);
diff --git a/epan/dissectors/packet-ieee8021ah.c b/epan/dissectors/packet-ieee8021ah.c
index ab022d5338..1d3f41c51f 100644
--- a/epan/dissectors/packet-ieee8021ah.c
+++ b/epan/dissectors/packet-ieee8021ah.c
@@ -80,7 +80,7 @@ static gint ett_ieee8021ad = -1;
static gboolean
-capture_ieee8021ah(const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_ieee8021ah(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
guint16 encap_proto;
@@ -91,14 +91,14 @@ capture_ieee8021ah(const guchar *pd, int offset, int len, packet_counts *ld, con
if (encap_proto <= IEEE_802_3_MAX_LEN) {
if ( pd[offset + IEEE8021AH_LEN] == 0xff
&& pd[offset + IEEE8021AH_LEN + 1] == 0xff ) {
- return capture_ipx(pd, offset + IEEE8021AH_LEN, len, ld, pseudo_header);
+ return capture_ipx(pd, offset + IEEE8021AH_LEN, len, cpinfo, pseudo_header);
}
else {
- return capture_llc(pd, offset + IEEE8021AH_LEN, len, ld, pseudo_header);
+ return capture_llc(pd, offset + IEEE8021AH_LEN, len, cpinfo, pseudo_header);
}
}
- return try_capture_dissector("ethertype", encap_proto, pd, offset + IEEE8021AH_LEN, len, ld, pseudo_header);
+ return try_capture_dissector("ethertype", encap_proto, pd, offset + IEEE8021AH_LEN, len, cpinfo, pseudo_header);
}
/* Dissector *************************************************************/
diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c
index 139264d59d..8972e3fbb2 100644
--- a/epan/dissectors/packet-ip.c
+++ b/epan/dissectors/packet-ip.c
@@ -568,11 +568,11 @@ ip_defragment_cleanup(void)
}
gboolean
-capture_ip(const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_) {
+capture_ip(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_) {
if (!BYTES_ARE_IN_FRAME(offset, len, IPH_MIN_LEN))
return FALSE;
- return try_capture_dissector("ip.proto", pd[offset + 9], pd, offset+IPH_MIN_LEN, len, ld, pseudo_header);
+ return try_capture_dissector("ip.proto", pd[offset + 9], pd, offset+IPH_MIN_LEN, len, cpinfo, pseudo_header);
}
#ifdef HAVE_GEOIP
diff --git a/epan/dissectors/packet-ip.h b/epan/dissectors/packet-ip.h
index 441e620640..13cff4f117 100644
--- a/epan/dissectors/packet-ip.h
+++ b/epan/dissectors/packet-ip.h
@@ -50,7 +50,7 @@ typedef struct _ws_ip
#define IPDSFIELD_ECN_MASK 0x03
#define IPDSFIELD_ECN(dsfield) ((dsfield) & IPDSFIELD_ECN_MASK)
-gboolean capture_ip(const guchar *, int, int, packet_counts *, const union wtap_pseudo_header *pseudo_header);
+gboolean capture_ip(const guchar *, int, int, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header);
gboolean ip_try_dissect(gboolean heur_first, tvbuff_t *tvb,
packet_info *pinfo, proto_tree *tree, ws_ip *iph);
diff --git a/epan/dissectors/packet-ipfc.c b/epan/dissectors/packet-ipfc.c
index 711ea29d44..190e2acd4d 100644
--- a/epan/dissectors/packet-ipfc.c
+++ b/epan/dissectors/packet-ipfc.c
@@ -46,12 +46,12 @@ static gint ett_ipfc = -1;
static dissector_handle_t llc_handle;
static gboolean
-capture_ipfc (const guchar *pd, int offset _U_, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_ipfc (const guchar *pd, int offset _U_, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
if (!BYTES_ARE_IN_FRAME(0, len, 16))
return FALSE;
- return capture_llc(pd, 16, len, ld, pseudo_header);
+ return capture_llc(pd, 16, len, cpinfo, pseudo_header);
}
static int
diff --git a/epan/dissectors/packet-ipv6.c b/epan/dissectors/packet-ipv6.c
index f98afc51c0..058f31ce08 100644
--- a/epan/dissectors/packet-ipv6.c
+++ b/epan/dissectors/packet-ipv6.c
@@ -526,7 +526,7 @@ static const value_string ipv6_opt_vals[] = {
gboolean
-capture_ipv6(const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_ipv6(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
guint8 nxt;
int advance;
@@ -587,7 +587,7 @@ again:
goto again;
}
- return try_capture_dissector("ipv6.nxt", nxt, pd, offset, len, ld, pseudo_header);
+ return try_capture_dissector("ipv6.nxt", nxt, pd, offset, len, cpinfo, pseudo_header);
}
/**
diff --git a/epan/dissectors/packet-ipv6.h b/epan/dissectors/packet-ipv6.h
index 3020ce86fc..dea9606fb0 100644
--- a/epan/dissectors/packet-ipv6.h
+++ b/epan/dissectors/packet-ipv6.h
@@ -168,7 +168,7 @@ struct ip6_shim {
extern "C" {
#endif /* __cplusplus */
-gboolean capture_ipv6(const guchar *, int, int, packet_counts *, const union wtap_pseudo_header *pseudo_header);
+gboolean capture_ipv6(const guchar *, int, int, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header);
#ifdef __cplusplus
}
diff --git a/epan/dissectors/packet-ipx.c b/epan/dissectors/packet-ipx.c
index a5df01db1d..7476ff2e5e 100644
--- a/epan/dissectors/packet-ipx.c
+++ b/epan/dissectors/packet-ipx.c
@@ -274,9 +274,9 @@ static const value_string ipxmsg_sigchar_vals[] = {
};
gboolean
-capture_ipx(const guchar *pd _U_, int offset _U_, int len _U_, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_ipx(const guchar *pd _U_, int offset _U_, int len _U_, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
- ld->ipx++;
+ cpinfo->counts->ipx++;
return TRUE;
}
diff --git a/epan/dissectors/packet-ipx.h b/epan/dissectors/packet-ipx.h
index 770590ebfe..9924f72307 100644
--- a/epan/dissectors/packet-ipx.h
+++ b/epan/dissectors/packet-ipx.h
@@ -147,7 +147,7 @@ struct ipx_rip_packet
extern value_string_ext ipx_socket_vals_ext;
extern value_string_ext novell_server_vals_ext;
-gboolean capture_ipx(const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header);
+gboolean capture_ipx(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header);
/*
* Structure passed to SPX subdissectors, containing information from
diff --git a/epan/dissectors/packet-isl.c b/epan/dissectors/packet-isl.c
index 830cb4ada7..2e18868272 100644
--- a/epan/dissectors/packet-isl.c
+++ b/epan/dissectors/packet-isl.c
@@ -89,7 +89,7 @@ static dissector_handle_t tr_handle;
static dissector_handle_t data_handle;
gboolean
-capture_isl(const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_isl(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
guint8 type;
@@ -102,11 +102,11 @@ capture_isl(const guchar *pd, int offset, int len, packet_counts *ld, const unio
case TYPE_ETHER:
offset += 14+12; /* skip the header */
- return capture_eth(pd, offset, len, ld, pseudo_header);
+ return capture_eth(pd, offset, len, cpinfo, pseudo_header);
case TYPE_TR:
offset += 14+17; /* skip the header */
- return capture_tr(pd, offset, len, ld, pseudo_header);
+ return capture_tr(pd, offset, len, cpinfo, pseudo_header);
break;
}
diff --git a/epan/dissectors/packet-isl.h b/epan/dissectors/packet-isl.h
index 4d31454db1..ff5b415359 100644
--- a/epan/dissectors/packet-isl.h
+++ b/epan/dissectors/packet-isl.h
@@ -22,7 +22,7 @@
#ifndef __PACKET_ISL_H__
#define __PACKET_ISL_H__
-gboolean capture_isl(const guchar *, int, int, packet_counts *, const union wtap_pseudo_header *pseudo_header);
+gboolean capture_isl(const guchar *, int, int, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header);
void dissect_isl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int fcs_len);
diff --git a/epan/dissectors/packet-llc.c b/epan/dissectors/packet-llc.c
index 9f4d0e47ec..c2fa07813e 100644
--- a/epan/dissectors/packet-llc.c
+++ b/epan/dissectors/packet-llc.c
@@ -252,7 +252,7 @@ llc_add_oui(guint32 oui, const char *table_name, const char *table_ui_name,
}
gboolean
-capture_llc(const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_) {
+capture_llc(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_) {
int is_snap;
guint16 control;
@@ -279,30 +279,30 @@ capture_llc(const guchar *pd, int offset, int len, packet_counts *ld, const unio
return FALSE;
if (is_snap)
- return capture_snap(pd, offset+llc_header_len, len, ld, pseudo_header);
+ return capture_snap(pd, offset+llc_header_len, len, cpinfo, pseudo_header);
/* non-SNAP */
switch (pd[offset]) {
case SAP_IP:
- return capture_ip(pd, offset + llc_header_len, len, ld, pseudo_header);
+ return capture_ip(pd, offset + llc_header_len, len, cpinfo, pseudo_header);
case SAP_NETWARE1:
case SAP_NETWARE2:
- return capture_ipx(pd, offset + llc_header_len, len, ld, pseudo_header);
+ return capture_ipx(pd, offset + llc_header_len, len, cpinfo, pseudo_header);
case SAP_NETBIOS:
- return capture_netbios(pd, offset + llc_header_len, len, ld, pseudo_header);
+ return capture_netbios(pd, offset + llc_header_len, len, cpinfo, pseudo_header);
case SAP_VINES1:
case SAP_VINES2:
- return capture_vines(pd, offset + llc_header_len, len, ld, pseudo_header);
+ return capture_vines(pd, offset + llc_header_len, len, cpinfo, pseudo_header);
}
return FALSE;
}
gboolean
-capture_snap(const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_snap(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
guint32 oui;
guint16 etype;
@@ -324,10 +324,10 @@ capture_snap(const guchar *pd, int offset, int len, packet_counts *ld, const uni
AppleTalk data packets - but used
OUI_ENCAP_ETHER and an Ethernet
packet type for AARP packets. */
- return try_capture_dissector("ethertype", etype, pd, offset+5, len, ld, pseudo_header);
+ return try_capture_dissector("ethertype", etype, pd, offset+5, len, cpinfo, pseudo_header);
case OUI_CISCO:
- return try_capture_dissector("ethertype", etype, pd, offset+5, len, ld, pseudo_header);
+ return try_capture_dissector("ethertype", etype, pd, offset+5, len, cpinfo, pseudo_header);
case OUI_MARVELL:
/*
@@ -336,7 +336,7 @@ capture_snap(const guchar *pd, int offset, int len, packet_counts *ld, const uni
* the payload. (We assume the header is
* 5 bytes, for now).
*/
- return try_capture_dissector("ethertype", etype, pd, offset+5+5, len, ld, pseudo_header);
+ return try_capture_dissector("ethertype", etype, pd, offset+5+5, len, cpinfo, pseudo_header);
}
return FALSE;
diff --git a/epan/dissectors/packet-llc.h b/epan/dissectors/packet-llc.h
index 99fa5a2448..11e7418264 100644
--- a/epan/dissectors/packet-llc.h
+++ b/epan/dissectors/packet-llc.h
@@ -24,11 +24,11 @@
#include "ws_symbol_export.h"
-gboolean capture_llc(const guchar *, int, int, packet_counts *, const union wtap_pseudo_header *pseudo_header);
+gboolean capture_llc(const guchar *, int, int, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header);
extern const value_string sap_vals[];
-gboolean capture_snap(const guchar *, int, int, packet_counts *, const union wtap_pseudo_header *pseudo_header);
+gboolean capture_snap(const guchar *, int, int, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header);
void dissect_snap(tvbuff_t *, int, packet_info *, proto_tree *,
proto_tree *, int, int, int, int, int);
diff --git a/epan/dissectors/packet-netbios.c b/epan/dissectors/packet-netbios.c
index 06aa57fc11..2617da36e7 100644
--- a/epan/dissectors/packet-netbios.c
+++ b/epan/dissectors/packet-netbios.c
@@ -285,9 +285,9 @@ static const value_string max_frame_size_vals[] = {
gboolean
-capture_netbios(const guchar *pd _U_, int offset _U_, int len _U_, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_netbios(const guchar *pd _U_, int offset _U_, int len _U_, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
- ld->netbios++;
+ cpinfo->counts->netbios++;
return TRUE;
}
diff --git a/epan/dissectors/packet-netbios.h b/epan/dissectors/packet-netbios.h
index c34ec49ea1..ab1e56697a 100644
--- a/epan/dissectors/packet-netbios.h
+++ b/epan/dissectors/packet-netbios.h
@@ -30,7 +30,7 @@
/* Length of NetBIOS names */
#define NETBIOS_NAME_LEN 16
-gboolean capture_netbios(const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header);
+gboolean capture_netbios(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header);
extern int process_netbios_name(const guchar *name_ptr, char *name_ret, int name_ret_len);
extern int get_netbios_name(tvbuff_t *tvb, int offset,
diff --git a/epan/dissectors/packet-netrom.c b/epan/dissectors/packet-netrom.c
index d15d27ee99..8a1ece31c0 100644
--- a/epan/dissectors/packet-netrom.c
+++ b/epan/dissectors/packet-netrom.c
@@ -488,7 +488,7 @@ dissect_netrom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _
}
static gboolean
-capture_netrom( const guchar *pd _U_, int offset, int len, packet_counts *ld _U_, const union wtap_pseudo_header *pseudo_header _U_)
+capture_netrom( const guchar *pd _U_, int offset, int len, capture_packet_info_t *cpinfo _U_, const union wtap_pseudo_header *pseudo_header _U_)
{
if ( ! BYTES_ARE_IN_FRAME( offset, len, NETROM_MIN_SIZE ) )
return FALSE;
diff --git a/epan/dissectors/packet-null.c b/epan/dissectors/packet-null.c
index ee514ebdc9..ac9a239277 100644
--- a/epan/dissectors/packet-null.c
+++ b/epan/dissectors/packet-null.c
@@ -66,7 +66,7 @@ static dissector_handle_t ppp_hdlc_handle;
static dissector_handle_t data_handle;
static gboolean
-capture_null( const guchar *pd, int offset _U_, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_ )
+capture_null( const guchar *pd, int offset _U_, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_ )
{
guint32 null_header;
@@ -259,7 +259,7 @@ capture_null( const guchar *pd, int offset _U_, int len, packet_counts *ld, cons
/*
* Hand it to PPP.
*/
- return capture_ppp_hdlc(pd, 0, len, ld, pseudo_header);
+ return capture_ppp_hdlc(pd, 0, len, cpinfo, pseudo_header);
} else {
/*
* Treat it as a normal DLT_NULL header.
@@ -315,18 +315,18 @@ capture_null( const guchar *pd, int offset _U_, int len, packet_counts *ld, cons
* BSD derivatives have different values?).
*/
if (null_header > IEEE_802_3_MAX_LEN)
- return try_capture_dissector("ethertype", null_header, pd, 4, len, ld, pseudo_header);
+ return try_capture_dissector("ethertype", null_header, pd, 4, len, cpinfo, pseudo_header);
else {
switch (null_header) {
case BSD_AF_INET:
- return capture_ip(pd, 4, len, ld, pseudo_header);
+ return capture_ip(pd, 4, len, cpinfo, pseudo_header);
case BSD_AF_INET6_BSD:
case BSD_AF_INET6_FREEBSD:
case BSD_AF_INET6_DARWIN:
- return capture_ipv6(pd, 4, len, ld, pseudo_header);
+ return capture_ipv6(pd, 4, len, cpinfo, pseudo_header);
}
}
}
@@ -335,7 +335,7 @@ capture_null( const guchar *pd, int offset _U_, int len, packet_counts *ld, cons
}
static gboolean
-capture_loop( const guchar *pd, int offset _U_, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_ )
+capture_loop( const guchar *pd, int offset _U_, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_ )
{
guint32 loop_family;
@@ -347,12 +347,12 @@ capture_loop( const guchar *pd, int offset _U_, int len, packet_counts *ld, cons
switch (loop_family) {
case BSD_AF_INET:
- return capture_ip(pd, 4, len, ld, pseudo_header);
+ return capture_ip(pd, 4, len, cpinfo, pseudo_header);
case BSD_AF_INET6_BSD:
case BSD_AF_INET6_FREEBSD:
case BSD_AF_INET6_DARWIN:
- return capture_ipv6(pd, 4, len, ld, pseudo_header);
+ return capture_ipv6(pd, 4, len, cpinfo, pseudo_header);
}
return FALSE;
diff --git a/epan/dissectors/packet-ospf.c b/epan/dissectors/packet-ospf.c
index 0e4f359214..4f904466be 100644
--- a/epan/dissectors/packet-ospf.c
+++ b/epan/dissectors/packet-ospf.c
@@ -1041,9 +1041,9 @@ ospf_has_at_block(tvbuff_t *tvb, int offset, guint8 packet_type, guint8 version)
}
static gboolean
-capture_ospf(const guchar *pd _U_, int offset _U_, int len _U_, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_ospf(const guchar *pd _U_, int offset _U_, int len _U_, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
- ld->ospf++;
+ cpinfo->counts->ospf++;
return TRUE;
}
diff --git a/epan/dissectors/packet-pktap.c b/epan/dissectors/packet-pktap.c
index b4508808c3..22bdfde1be 100644
--- a/epan/dissectors/packet-pktap.c
+++ b/epan/dissectors/packet-pktap.c
@@ -95,7 +95,7 @@ static dissector_handle_t pktap_handle;
*/
static gboolean
-capture_pktap(const guchar *pd, int offset _U_, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_pktap(const guchar *pd, int offset _U_, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
guint32 hdrlen, rectype, dlt;
@@ -113,7 +113,7 @@ capture_pktap(const guchar *pd, int offset _U_, int len, packet_counts *ld, cons
switch (dlt) {
case 1: /* DLT_EN10MB */
- return capture_eth(pd, hdrlen, len, ld, pseudo_header);
+ return capture_eth(pd, hdrlen, len, cpinfo, pseudo_header);
}
diff --git a/epan/dissectors/packet-ppi.c b/epan/dissectors/packet-ppi.c
index 9275ccbcb0..f179b258f4 100644
--- a/epan/dissectors/packet-ppi.c
+++ b/epan/dissectors/packet-ppi.c
@@ -385,7 +385,7 @@ static gboolean ppi_ampdu_reassemble = TRUE;
static gboolean
-capture_ppi(const guchar *pd, int offset _U_, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_ppi(const guchar *pd, int offset _U_, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
guint32 dlt;
guint ppi_len;
@@ -396,7 +396,7 @@ capture_ppi(const guchar *pd, int offset _U_, int len, packet_counts *ld, const
dlt = pletoh32(pd+4);
- return try_capture_dissector("ppi", dlt, pd, ppi_len, len, ld, pseudo_header);
+ return try_capture_dissector("ppi", dlt, pd, ppi_len, len, cpinfo, pseudo_header);
}
static void
diff --git a/epan/dissectors/packet-ppp.c b/epan/dissectors/packet-ppp.c
index 351898c952..dd578cafaa 100644
--- a/epan/dissectors/packet-ppp.c
+++ b/epan/dissectors/packet-ppp.c
@@ -1957,18 +1957,18 @@ decode_fcs(tvbuff_t *tvb, proto_tree *fh_tree, int fcs_decode, int proto_offset)
}
gboolean
-capture_ppp_hdlc(const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_ppp_hdlc(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
if (!BYTES_ARE_IN_FRAME(offset, len, 2))
return FALSE;
if (pd[0] == CHDLC_ADDR_UNICAST || pd[0] == CHDLC_ADDR_MULTICAST)
- return capture_chdlc(pd, offset, len, ld, pseudo_header);
+ return capture_chdlc(pd, offset, len, cpinfo, pseudo_header);
if (!BYTES_ARE_IN_FRAME(offset, len, 4))
return FALSE;
- return try_capture_dissector("ppp_hdlc", pntoh16(&pd[offset + 2]), pd, offset + 4, len, ld, pseudo_header);
+ return try_capture_dissector("ppp_hdlc", pntoh16(&pd[offset + 2]), pd, offset + 4, len, cpinfo, pseudo_header);
}
static void
diff --git a/epan/dissectors/packet-ppp.h b/epan/dissectors/packet-ppp.h
index 85f4b24602..e02d39e268 100644
--- a/epan/dissectors/packet-ppp.h
+++ b/epan/dissectors/packet-ppp.h
@@ -29,7 +29,7 @@
extern gboolean ppp_vj_decomp;/* FALSE = No VJ header decompression,
TRUE = Decompress VJ */
extern
-gboolean capture_ppp_hdlc(const guchar *, int, int, packet_counts *, const union wtap_pseudo_header *pseudo_header _U_);
+gboolean capture_ppp_hdlc(const guchar *, int, int, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_);
tvbuff_t *decode_fcs(tvbuff_t *tvb, proto_tree *fh_tree, int fcs_decode, int proto_offset);
diff --git a/epan/dissectors/packet-raw.c b/epan/dissectors/packet-raw.c
index 87655ede01..4c3f048784 100644
--- a/epan/dissectors/packet-raw.c
+++ b/epan/dissectors/packet-raw.c
@@ -44,7 +44,7 @@ static dissector_handle_t data_handle;
static dissector_handle_t ppp_hdlc_handle;
static gboolean
-capture_raw(const guchar *pd, int offset _U_, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_raw(const guchar *pd, int offset _U_, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
/* So far, the only time we get raw connection types are with Linux and
* Irix PPP connections. We can't tell what type of data is coming down
@@ -55,21 +55,21 @@ capture_raw(const guchar *pd, int offset _U_, int len, packet_counts *ld, const
* sometimes. This check should be removed when 2.2 is out.
*/
if (BYTES_ARE_IN_FRAME(0,len,2) && pd[0] == 0xff && pd[1] == 0x03) {
- return capture_ppp_hdlc(pd, 0, len, ld, pseudo_header);
+ return capture_ppp_hdlc(pd, 0, len, cpinfo, pseudo_header);
}
/* The Linux ISDN driver sends a fake MAC address before the PPP header
* on its ippp interfaces... */
else if (BYTES_ARE_IN_FRAME(0,len,8) && pd[6] == 0xff && pd[7] == 0x03) {
- return capture_ppp_hdlc(pd, 6, len, ld, pseudo_header);
+ return capture_ppp_hdlc(pd, 6, len, cpinfo, pseudo_header);
}
/* ...except when it just puts out one byte before the PPP header... */
else if (BYTES_ARE_IN_FRAME(0,len,3) && pd[1] == 0xff && pd[2] == 0x03) {
- return capture_ppp_hdlc(pd, 1, len, ld, pseudo_header);
+ return capture_ppp_hdlc(pd, 1, len, cpinfo, pseudo_header);
}
/* ...and if the connection is currently down, it sends 10 bytes of zeroes
* instead of a fake MAC address and PPP header. */
else if (BYTES_ARE_IN_FRAME(0,len,10) && memcmp(pd, zeroes, 10) == 0) {
- return capture_ip(pd, 10, len, ld, pseudo_header);
+ return capture_ip(pd, 10, len, cpinfo, pseudo_header);
}
else {
/*
@@ -80,12 +80,12 @@ capture_raw(const guchar *pd, int offset _U_, int len, packet_counts *ld, const
case 0x40:
/* IPv4 */
- return capture_ip(pd, 0, len, ld, pseudo_header);
+ return capture_ip(pd, 0, len, cpinfo, pseudo_header);
#if 0
case 0x60:
/* IPv6 */
- return capture_ipv6(pd, 0, len, ld, pseudo_header);
+ return capture_ipv6(pd, 0, len, cpinfo, pseudo_header);
#endif
}
}
diff --git a/epan/dissectors/packet-sctp.c b/epan/dissectors/packet-sctp.c
index bd8afaec73..42948149ea 100644
--- a/epan/dissectors/packet-sctp.c
+++ b/epan/dissectors/packet-sctp.c
@@ -4686,9 +4686,9 @@ dissect_sctp_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolea
}
static gboolean
-capture_sctp(const guchar *pd _U_, int offset _U_, int len _U_, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_sctp(const guchar *pd _U_, int offset _U_, int len _U_, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
- ld->sctp++;
+ cpinfo->counts->sctp++;
return TRUE;
}
diff --git a/epan/dissectors/packet-sll.c b/epan/dissectors/packet-sll.c
index d339064f28..f2c1cab08d 100644
--- a/epan/dissectors/packet-sll.c
+++ b/epan/dissectors/packet-sll.c
@@ -138,7 +138,7 @@ static dissector_table_t gre_dissector_table;
static dissector_handle_t data_handle;
static gboolean
-capture_sll(const guchar *pd, int offset _U_, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_sll(const guchar *pd, int offset _U_, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
guint16 protocol;
@@ -151,9 +151,9 @@ capture_sll(const guchar *pd, int offset _U_, int len, packet_counts *ld, const
* "proto" is *not* a length field, it's a Linux internal
* protocol type.
*/
- return try_capture_dissector("sll.ltype", protocol, pd, SLL_HEADER_SIZE, len, ld, pseudo_header);
+ return try_capture_dissector("sll.ltype", protocol, pd, SLL_HEADER_SIZE, len, cpinfo, pseudo_header);
} else {
- return try_capture_dissector("ethertype", protocol, pd, SLL_HEADER_SIZE, len, ld, pseudo_header);
+ return try_capture_dissector("ethertype", protocol, pd, SLL_HEADER_SIZE, len, cpinfo, pseudo_header);
}
return FALSE;
}
diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c
index 89b462e82f..9771f8d5c0 100644
--- a/epan/dissectors/packet-tcp.c
+++ b/epan/dissectors/packet-tcp.c
@@ -4800,14 +4800,14 @@ tcp_flags_to_str_first_letter(const struct tcpheader *tcph)
}
static gboolean
-capture_tcp(const guchar *pd _U_, int offset _U_, int len _U_, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_tcp(const guchar *pd _U_, int offset _U_, int len _U_, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
guint16 src_port, dst_port, low_port, high_port;
if (!BYTES_ARE_IN_FRAME(offset, len, 4))
return FALSE;
- ld->tcp++;
+ cpinfo->counts->tcp++;
src_port = pntoh16(&pd[offset]);
dst_port = pntoh16(&pd[offset+2]);
@@ -4821,11 +4821,11 @@ capture_tcp(const guchar *pd _U_, int offset _U_, int len _U_, packet_counts *ld
}
if (low_port != 0 &&
- try_capture_dissector("tcp.port", low_port, pd, offset+20, len, ld, pseudo_header))
+ try_capture_dissector("tcp.port", low_port, pd, offset+20, len, cpinfo, pseudo_header))
return TRUE;
if (high_port != 0 &&
- try_capture_dissector("tcp.port", high_port, pd, offset+20, len, ld, pseudo_header))
+ try_capture_dissector("tcp.port", high_port, pd, offset+20, len, cpinfo, pseudo_header))
return TRUE;
/* We've at least identified one type of packet, so this shouldn't be "other" */
diff --git a/epan/dissectors/packet-tr.c b/epan/dissectors/packet-tr.c
index da93e10c8b..813aa67d44 100644
--- a/epan/dissectors/packet-tr.c
+++ b/epan/dissectors/packet-tr.c
@@ -247,7 +247,7 @@ static void
add_ring_bridge_pairs(int rcf_len, tvbuff_t*, proto_tree *tree);
gboolean
-capture_tr(const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_) {
+capture_tr(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_) {
int source_routed = 0;
int frame_type;
@@ -360,7 +360,7 @@ capture_tr(const guchar *pd, int offset, int len, packet_counts *ld, const union
/* The package is either MAC (0) or LLC (1)*/
switch (frame_type) {
case 1:
- return capture_llc(pd, offset, len, ld, pseudo_header);
+ return capture_llc(pd, offset, len, cpinfo, pseudo_header);
}
return FALSE;
diff --git a/epan/dissectors/packet-tr.h b/epan/dissectors/packet-tr.h
index 1eacd51b3f..2d4ae09bdc 100644
--- a/epan/dissectors/packet-tr.h
+++ b/epan/dissectors/packet-tr.h
@@ -32,6 +32,6 @@ typedef struct _tr_hdr {
} tr_hdr;
extern
-gboolean capture_tr(const guchar *, int, int, packet_counts *, const union wtap_pseudo_header *pseudo_header);
+gboolean capture_tr(const guchar *, int, int, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header);
#endif
diff --git a/epan/dissectors/packet-udp.c b/epan/dissectors/packet-udp.c
index c9adb6195f..1e784a4a3a 100644
--- a/epan/dissectors/packet-udp.c
+++ b/epan/dissectors/packet-udp.c
@@ -692,14 +692,14 @@ udp_dissect_pdus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
static gboolean
-capture_udp(const guchar *pd _U_, int offset _U_, int len _U_, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_udp(const guchar *pd _U_, int offset _U_, int len _U_, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
guint16 src_port, dst_port, low_port, high_port;
if (!BYTES_ARE_IN_FRAME(offset, len, 4))
return FALSE;
- ld->udp++;
+ cpinfo->counts->udp++;
src_port = pntoh16(&pd[offset]);
dst_port = pntoh16(&pd[offset+2]);
@@ -713,11 +713,11 @@ capture_udp(const guchar *pd _U_, int offset _U_, int len _U_, packet_counts *ld
}
if (low_port != 0 &&
- try_capture_dissector("udp.port", low_port, pd, offset+20, len, ld, pseudo_header))
+ try_capture_dissector("udp.port", low_port, pd, offset+20, len, cpinfo, pseudo_header))
return TRUE;
if (high_port != 0 &&
- try_capture_dissector("udp.port", high_port, pd, offset+20, len, ld, pseudo_header))
+ try_capture_dissector("udp.port", high_port, pd, offset+20, len, cpinfo, pseudo_header))
return TRUE;
/* We've at least identified one type of packet, so this shouldn't be "other" */
diff --git a/epan/dissectors/packet-vines.c b/epan/dissectors/packet-vines.c
index 3c7609f607..44b2cf4c38 100644
--- a/epan/dissectors/packet-vines.c
+++ b/epan/dissectors/packet-vines.c
@@ -310,9 +310,9 @@ typedef struct _e_vipc {
} e_vipc;
gboolean
-capture_vines(const guchar *pd _U_, int offset _U_, int len _U_, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
+capture_vines(const guchar *pd _U_, int offset _U_, int len _U_, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
{
- ld->vines++;
+ cpinfo->counts->vines++;
return TRUE;
}
diff --git a/epan/dissectors/packet-vines.h b/epan/dissectors/packet-vines.h
index d7902df0c5..c6a81a1ab5 100644
--- a/epan/dissectors/packet-vines.h
+++ b/epan/dissectors/packet-vines.h
@@ -26,6 +26,6 @@
#ifndef __PACKETVINES_H__
#define __PACKETVINES_H__
-gboolean capture_vines(const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header);
+gboolean capture_vines(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header);
#endif /* packet-vines.h */
diff --git a/epan/dissectors/packet-vlan.c b/epan/dissectors/packet-vlan.c
index 6f65835825..ea0c66fe2e 100644
--- a/epan/dissectors/packet-vlan.c
+++ b/epan/dissectors/packet-vlan.c
@@ -99,7 +99,7 @@ static gint ett_vlan = -1;
static expert_field ei_vlan_len = EI_INIT;
static gboolean
-capture_vlan(const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_ ) {
+capture_vlan(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_ ) {
guint16 encap_proto;
if ( !BYTES_ARE_IN_FRAME(offset,len,5) )
return FALSE;
@@ -107,13 +107,13 @@ capture_vlan(const guchar *pd, int offset, int len, packet_counts *ld, const uni
encap_proto = pntoh16( &pd[offset+2] );
if ( encap_proto <= IEEE_802_3_MAX_LEN) {
if ( pd[offset+4] == 0xff && pd[offset+5] == 0xff ) {
- return capture_ipx(pd,offset+4,len,ld, pseudo_header);
+ return capture_ipx(pd,offset+4,len, cpinfo, pseudo_header);
} else {
- return capture_llc(pd,offset+4,len,ld, pseudo_header);
+ return capture_llc(pd,offset+4,len, cpinfo, pseudo_header);
}
}
- return try_capture_dissector("ethertype", encap_proto, pd, offset+4, len, ld, pseudo_header);
+ return try_capture_dissector("ethertype", encap_proto, pd, offset+4, len, cpinfo, pseudo_header);
}
static void
diff --git a/epan/packet.h b/epan/packet.h
index a075b6afcf..9690238949 100644
--- a/epan/packet.h
+++ b/epan/packet.h
@@ -81,6 +81,10 @@ typedef struct _packet_counts {
/** Number of packet counts. */
#define PACKET_COUNTS_SIZE sizeof(packet_counts) / sizeof (gint)
+typedef struct _capture_packet_info {
+ packet_counts *counts;
+} capture_packet_info_t;
+
extern void packet_init(void);
extern void packet_cache_proto_handles(void);
extern void packet_cleanup(void);