From a7fd6f2083443a5e88b649aa4c54fe6322f8cbe0 Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Sun, 13 Dec 2015 09:50:01 -0500 Subject: Standardize the capture dissector function signature. This will make it easier to mold into (capture) dissector tables. Change-Id: Iad63f2c2869782977992a3a072adb020be4b1818 Reviewed-on: https://code.wireshark.org/review/12587 Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- epan/dissectors/Makefile.common | 1 - epan/dissectors/packet-ap1394.c | 2 +- epan/dissectors/packet-arcnet.c | 4 ++-- epan/dissectors/packet-atm.c | 6 +++--- epan/dissectors/packet-ax25.c | 16 ++++++++++++---- epan/dissectors/packet-chdlc.c | 2 +- epan/dissectors/packet-clip.c | 2 +- epan/dissectors/packet-enc.c | 4 ++-- epan/dissectors/packet-eth.c | 4 ++-- epan/dissectors/packet-ethertype.c | 18 +++++++++--------- epan/dissectors/packet-fr.c | 6 +++--- epan/dissectors/packet-ieee80211-radiotap.c | 2 +- epan/dissectors/packet-ieee80211.c | 14 +++++++------- epan/dissectors/packet-ieee80211.h | 2 +- epan/dissectors/packet-ieee8021ah.c | 8 ++++---- epan/dissectors/packet-ieee8021ah.h | 2 +- epan/dissectors/packet-ip.c | 2 +- epan/dissectors/packet-ip.h | 2 +- epan/dissectors/packet-ipv6.c | 2 +- epan/dissectors/packet-ipv6.h | 2 +- epan/dissectors/packet-ipx.c | 2 +- epan/dissectors/packet-ipx.h | 2 +- epan/dissectors/packet-llc.c | 18 +++++++++--------- epan/dissectors/packet-llc.h | 2 +- epan/dissectors/packet-netbios.c | 2 +- epan/dissectors/packet-netbios.h | 2 +- epan/dissectors/packet-netrom.c | 2 +- epan/dissectors/packet-netrom.h | 2 +- epan/dissectors/packet-nhrp.c | 1 - epan/dissectors/packet-nhrp.h | 29 ----------------------------- epan/dissectors/packet-null.c | 10 +++++----- epan/dissectors/packet-ppp.c | 6 +++--- epan/dissectors/packet-raw.c | 6 +++--- epan/dissectors/packet-sll.c | 4 ++-- epan/dissectors/packet-vines.c | 2 +- epan/dissectors/packet-vines.h | 2 +- epan/dissectors/packet-vlan.c | 8 ++++---- epan/dissectors/packet-vlan.h | 2 +- epan/packet.h | 2 +- 39 files changed, 91 insertions(+), 114 deletions(-) delete mode 100644 epan/dissectors/packet-nhrp.h diff --git a/epan/dissectors/Makefile.common b/epan/dissectors/Makefile.common index 2736a783af..0dec2fa646 100644 --- a/epan/dissectors/Makefile.common +++ b/epan/dissectors/Makefile.common @@ -1609,7 +1609,6 @@ DISSECTOR_INCLUDES = \ packet-netlink.h \ packet-netrom.h \ packet-nfs.h \ - packet-nhrp.h \ packet-nisplus.h \ packet-nlm.h \ packet-ntlmssp.h \ diff --git a/epan/dissectors/packet-ap1394.c b/epan/dissectors/packet-ap1394.c index 7db71c5712..73f3d055e8 100644 --- a/epan/dissectors/packet-ap1394.c +++ b/epan/dissectors/packet-ap1394.c @@ -58,7 +58,7 @@ capture_ap1394(const guchar *pd, int offset, int len, packet_counts *ld, const u etype = pntoh16(&pd[offset]); offset += 2; - capture_ethertype(etype, pd, offset, len, ld); + capture_ethertype(etype, pd, offset, len, ld, pseudo_header); } static int diff --git a/epan/dissectors/packet-arcnet.c b/epan/dissectors/packet-arcnet.c index 8c7c4669fc..7622c4cddb 100644 --- a/epan/dissectors/packet-arcnet.c +++ b/epan/dissectors/packet-arcnet.c @@ -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 */ - capture_ip(pd, offset + 1, len, ld); + capture_ip(pd, offset + 1, len, ld, pseudo_header); break; case ARCNET_PROTO_IP_1201: @@ -135,7 +135,7 @@ capture_arcnet_common(const guchar *pd, int offset, int len, packet_counts *ld, type appears after the padding. */ offset += 4; } - capture_ip(pd, offset + 3, len, ld); + capture_ip(pd, offset + 3, len, ld, pseudo_header); break; case ARCNET_PROTO_ARP_1051: diff --git a/epan/dissectors/packet-atm.c b/epan/dissectors/packet-atm.c index 195c71a83e..dba720bc95 100644 --- a/epan/dissectors/packet-atm.c +++ b/epan/dissectors/packet-atm.c @@ -664,8 +664,8 @@ dissect_le_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } static void -capture_lane(const union wtap_pseudo_header *pseudo_header, const guchar *pd, - int len, packet_counts *ld) +capture_lane(const guchar *pd, int offset _U_, + int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header) { /* Is it LE Control, 802.3, 802.5, or "none of the above"? */ switch (pseudo_header->atm.subtype) { @@ -820,7 +820,7 @@ capture_atm(const guchar *pd, int offset _U_, break; case TRAF_LANE: - capture_lane(pseudo_header, pd, len, ld); + capture_lane(pd, offset, len, ld, pseudo_header); break; default: diff --git a/epan/dissectors/packet-ax25.c b/epan/dissectors/packet-ax25.c index cb6512dc55..1539379ac7 100644 --- a/epan/dissectors/packet-ax25.c +++ b/epan/dissectors/packet-ax25.c @@ -284,10 +284,18 @@ capture_ax25( const guchar *pd, int offset, int len, packet_counts *ld, const un l_offset += 1; /* step over the pid and point to the first byte of the payload */ switch ( pid & 0x0ff ) { - case AX25_P_NETROM : capture_netrom( pd, l_offset, len, ld ); break; - case AX25_P_IP : capture_ip( pd, l_offset, len, ld ); break; - case AX25_P_ARP : ld->arp++; break; - default : ld->other++; break; + case AX25_P_NETROM : + capture_netrom( pd, l_offset, len, ld, pseudo_header ); + break; + case AX25_P_IP : + capture_ip( pd, l_offset, len, ld, pseudo_header ); + break; + case AX25_P_ARP : + ld->arp++; + break; + default : + ld->other++; + break; } } } diff --git a/epan/dissectors/packet-chdlc.c b/epan/dissectors/packet-chdlc.c index b81796af59..3706b44d80 100644 --- a/epan/dissectors/packet-chdlc.c +++ b/epan/dissectors/packet-chdlc.c @@ -121,7 +121,7 @@ capture_chdlc( const guchar *pd, int offset, int len, packet_counts *ld, const u } switch (pntoh16(&pd[offset + 2])) { case ETHERTYPE_IP: - capture_ip(pd, offset + 4, len, ld); + capture_ip(pd, offset + 4, len, ld, pseudo_header); break; default: ld->other++; diff --git a/epan/dissectors/packet-clip.c b/epan/dissectors/packet-clip.c index 17027c3dbc..60528c12fa 100644 --- a/epan/dissectors/packet-clip.c +++ b/epan/dissectors/packet-clip.c @@ -46,7 +46,7 @@ static dissector_handle_t ip_handle; static void capture_clip( const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_ ) { - capture_ip(pd, offset, len, ld); + capture_ip(pd, offset, len, ld, pseudo_header); } static int diff --git a/epan/dissectors/packet-enc.c b/epan/dissectors/packet-enc.c index a78d643e1b..327f68db61 100644 --- a/epan/dissectors/packet-enc.c +++ b/epan/dissectors/packet-enc.c @@ -79,11 +79,11 @@ capture_enc(const guchar *pd, int offset _U_, int len, packet_counts *ld, const switch (af) { case BSD_AF_INET: - capture_ip(pd, BSD_ENC_HDRLEN, len, ld); + capture_ip(pd, BSD_ENC_HDRLEN, len, ld, pseudo_header); break; case BSD_AF_INET6_BSD: - capture_ipv6(pd, BSD_ENC_HDRLEN, len, ld); + capture_ipv6(pd, BSD_ENC_HDRLEN, len, ld, pseudo_header); break; default: diff --git a/epan/dissectors/packet-eth.c b/epan/dissectors/packet-eth.c index c04995ca22..6b0be85f56 100644 --- a/epan/dissectors/packet-eth.c +++ b/epan/dissectors/packet-eth.c @@ -272,13 +272,13 @@ capture_eth(const guchar *pd, int offset, int len, packet_counts *ld, const unio switch (ethhdr_type) { case ETHERNET_802_3: - capture_ipx(ld); + capture_ipx(pd, offset, len, ld, pseudo_header); break; case ETHERNET_802_2: capture_llc(pd, offset, len, ld, pseudo_header); break; case ETHERNET_II: - capture_ethertype(etype, pd, offset, len, ld); + capture_ethertype(etype, pd, offset, len, ld, pseudo_header); break; } } diff --git a/epan/dissectors/packet-ethertype.c b/epan/dissectors/packet-ethertype.c index 97256e00fe..72ddce9ea6 100644 --- a/epan/dissectors/packet-ethertype.c +++ b/epan/dissectors/packet-ethertype.c @@ -206,37 +206,37 @@ static void add_dix_trailer(packet_info *pinfo, proto_tree *tree, proto_tree *fh void capture_ethertype(guint16 etype, const guchar *pd, int offset, int len, - packet_counts *ld) + packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_) { switch (etype) { case ETHERTYPE_ARP: ld->arp++; break; case ETHERTYPE_IP: - capture_ip(pd, offset, len, ld); + capture_ip(pd, offset, len, ld, pseudo_header); break; case ETHERTYPE_IPv6: - capture_ipv6(pd, offset, len, ld); + capture_ipv6(pd, offset, len, ld, pseudo_header); break; case ETHERTYPE_IPX: - capture_ipx(ld); + capture_ipx(pd, offset, len, ld, pseudo_header); break; case ETHERTYPE_VLAN: - capture_vlan(pd, offset, len, ld); + capture_vlan(pd, offset, len, ld, pseudo_header); break; case ETHERTYPE_IEEE_802_1AD: case ETHERTYPE_IEEE_802_1AH: - capture_ieee8021ah(pd, offset, len, ld); + capture_ieee8021ah(pd, offset, len, ld, pseudo_header); break; case ETHERTYPE_VINES_IP: case ETHERTYPE_VINES_ECHO: - capture_vines(ld); + capture_vines(pd, offset, len, ld, pseudo_header); break; case ETHERTYPE_BPQ: - capture_bpq(pd, offset, len, ld, NULL); + capture_bpq(pd, offset, len, ld, pseudo_header); break; case ETHERTYPE_JUMBO_LLC: - capture_llc(pd, offset, len, ld, NULL); + capture_llc(pd, offset, len, ld, pseudo_header); break; default: ld->other++; diff --git a/epan/dissectors/packet-fr.c b/epan/dissectors/packet-fr.c index a762e22169..bc3d18b945 100644 --- a/epan/dissectors/packet-fr.c +++ b/epan/dissectors/packet-fr.c @@ -337,11 +337,11 @@ capture_fr(const guchar *pd, int offset, int len, packet_counts *ld, const union switch (fr_nlpid) { case NLPID_IP: - capture_ip(pd, offset, len, ld); + capture_ip(pd, offset, len, ld, pseudo_header); break; case NLPID_IP6: - capture_ipv6(pd, offset, len, ld); + capture_ipv6(pd, offset, len, ld, pseudo_header); break; case NLPID_PPP: @@ -349,7 +349,7 @@ capture_fr(const guchar *pd, int offset, int len, packet_counts *ld, const union break; case NLPID_SNAP: - capture_snap(pd, offset, len, ld); + capture_snap(pd, offset, len, ld, pseudo_header); break; default: diff --git a/epan/dissectors/packet-ieee80211-radiotap.c b/epan/dissectors/packet-ieee80211-radiotap.c index 2831e43081..1e08cd6c49 100644 --- a/epan/dissectors/packet-ieee80211-radiotap.c +++ b/epan/dissectors/packet-ieee80211-radiotap.c @@ -546,7 +546,7 @@ capture_radiotap(const guchar * pd, int offset, int len, packet_counts * ld, con /* 802.11 header follows */ if (rflags & IEEE80211_RADIOTAP_F_DATAPAD) - capture_ieee80211_datapad(pd, offset + it_len, len, ld); + capture_ieee80211_datapad(pd, offset + it_len, len, ld, pseudo_header); else capture_ieee80211(pd, offset + it_len, len, ld, pseudo_header); } diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c index 4c0beb3bbc..a5e4567247 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 void capture_ieee80211_common (const guchar * pd, int offset, int len, - packet_counts * ld, gboolean datapad) + packet_counts * ld, const union wtap_pseudo_header *pseudo_header _U_, gboolean datapad) { guint16 fcf, hdr_length; @@ -5741,12 +5741,12 @@ capture_ieee80211_common (const guchar * pd, int offset, int len, } #endif if ((pd[offset+hdr_length] == 0xff) && (pd[offset+hdr_length+1] == 0xff)) - capture_ipx (ld); + capture_ipx (pd, offset+hdr_length, len, ld, pseudo_header); else if ((pd[offset+hdr_length] == 0x00) && (pd[offset+hdr_length+1] == 0x00)) - capture_llc (pd, offset + hdr_length + 2, len, ld, NULL); + capture_llc (pd, offset + hdr_length + 2, len, ld, pseudo_header); } else { - capture_llc (pd, offset + hdr_length, len, ld, NULL); + capture_llc (pd, offset + hdr_length, len, ld, pseudo_header); } break; } @@ -5763,7 +5763,7 @@ capture_ieee80211_common (const guchar * pd, int offset, int len, void capture_ieee80211 (const guchar * pd, int offset, int len, packet_counts * ld, const union wtap_pseudo_header *pseudo_header _U_) { - capture_ieee80211_common (pd, offset, len, ld, FALSE); + capture_ieee80211_common (pd, offset, len, ld, pseudo_header, FALSE); } /* @@ -5771,9 +5771,9 @@ capture_ieee80211 (const guchar * pd, int offset, int len, packet_counts * ld, c */ void capture_ieee80211_datapad (const guchar * pd, int offset, int len, - packet_counts * ld) + packet_counts * ld, const union wtap_pseudo_header *pseudo_header _U_) { - capture_ieee80211_common (pd, offset, len, ld, TRUE); + capture_ieee80211_common (pd, offset, len, ld, pseudo_header, TRUE); } diff --git a/epan/dissectors/packet-ieee80211.h b/epan/dissectors/packet-ieee80211.h index 29c36bf8e5..d14afa6021 100644 --- a/epan/dissectors/packet-ieee80211.h +++ b/epan/dissectors/packet-ieee80211.h @@ -33,7 +33,7 @@ extern "C" { extern void capture_ieee80211 (const guchar *, int, int, packet_counts *, const union wtap_pseudo_header *pseudo_header); -void capture_ieee80211_datapad (const guchar *, int, int, packet_counts *); +void capture_ieee80211_datapad (const guchar *, int, int, packet_counts *, const union wtap_pseudo_header *pseudo_header); extern void capture_wlancap(const guchar *, int, int, packet_counts *, const union wtap_pseudo_header *pseudo_header); diff --git a/epan/dissectors/packet-ieee8021ah.c b/epan/dissectors/packet-ieee8021ah.c index c830ffd4f1..2ac42caf63 100644 --- a/epan/dissectors/packet-ieee8021ah.c +++ b/epan/dissectors/packet-ieee8021ah.c @@ -76,7 +76,7 @@ static gint ett_ieee8021ad = -1; void -capture_ieee8021ah(const guchar *pd, int offset, int len, packet_counts *ld) +capture_ieee8021ah(const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_) { guint16 encap_proto; @@ -88,14 +88,14 @@ capture_ieee8021ah(const guchar *pd, int offset, int len, packet_counts *ld) if (encap_proto <= IEEE_802_3_MAX_LEN) { if ( pd[offset + IEEE8021AH_LEN] == 0xff && pd[offset + IEEE8021AH_LEN + 1] == 0xff ) { - capture_ipx(ld); + capture_ipx(pd, offset + IEEE8021AH_LEN, len, ld, pseudo_header); } else { - capture_llc(pd, offset + IEEE8021AH_LEN,len,ld, NULL); + capture_llc(pd, offset + IEEE8021AH_LEN, len, ld, pseudo_header); } } else { - capture_ethertype(encap_proto, pd, offset + IEEE8021AH_LEN, len, ld); + capture_ethertype(encap_proto, pd, offset + IEEE8021AH_LEN, len, ld, pseudo_header); } } diff --git a/epan/dissectors/packet-ieee8021ah.h b/epan/dissectors/packet-ieee8021ah.h index a46fc39585..b1ad038807 100644 --- a/epan/dissectors/packet-ieee8021ah.h +++ b/epan/dissectors/packet-ieee8021ah.h @@ -26,6 +26,6 @@ #define IEEE8021AH_LEN 18 #define IEEE8021AH_ISIDMASK 0x00FFFFFF -void capture_ieee8021ah(const guchar *, int, int, packet_counts *); +void capture_ieee8021ah(const guchar *, int, int, packet_counts *, const union wtap_pseudo_header *pseudo_header); #endif diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c index 923ed98350..894a461409 100644 --- a/epan/dissectors/packet-ip.c +++ b/epan/dissectors/packet-ip.c @@ -567,7 +567,7 @@ ip_defragment_cleanup(void) } void -capture_ip(const guchar *pd, int offset, int len, packet_counts *ld) { +capture_ip(const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_) { if (!BYTES_ARE_IN_FRAME(offset, len, IPH_MIN_LEN)) { ld->other++; return; diff --git a/epan/dissectors/packet-ip.h b/epan/dissectors/packet-ip.h index 698e5047e0..8ab6f3962e 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) -void capture_ip(const guchar *, int, int, packet_counts *); +void capture_ip(const guchar *, int, int, packet_counts *, 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-ipv6.c b/epan/dissectors/packet-ipv6.c index ad988153c2..4466f6c4fb 100644 --- a/epan/dissectors/packet-ipv6.c +++ b/epan/dissectors/packet-ipv6.c @@ -525,7 +525,7 @@ static const value_string ipv6_opt_vals[] = { void -capture_ipv6(const guchar *pd, int offset, int len, packet_counts *ld) +capture_ipv6(const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_) { guint8 nxt; int advance; diff --git a/epan/dissectors/packet-ipv6.h b/epan/dissectors/packet-ipv6.h index 6e62fd02b3..514ee749ec 100644 --- a/epan/dissectors/packet-ipv6.h +++ b/epan/dissectors/packet-ipv6.h @@ -168,7 +168,7 @@ struct ip6_shim { extern "C" { #endif /* __cplusplus */ -void capture_ipv6(const guchar *, int, int, packet_counts *); +void capture_ipv6(const guchar *, int, int, packet_counts *, const union wtap_pseudo_header *pseudo_header); #ifdef __cplusplus } diff --git a/epan/dissectors/packet-ipx.c b/epan/dissectors/packet-ipx.c index cd0b1485ed..a39961e56a 100644 --- a/epan/dissectors/packet-ipx.c +++ b/epan/dissectors/packet-ipx.c @@ -273,7 +273,7 @@ static const value_string ipxmsg_sigchar_vals[] = { }; void -capture_ipx(packet_counts *ld) +capture_ipx(const guchar *pd _U_, int offset _U_, int len _U_, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_) { ld->ipx++; } diff --git a/epan/dissectors/packet-ipx.h b/epan/dissectors/packet-ipx.h index 35bb68ae4a..c5f5ae54e2 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; -void capture_ipx(packet_counts *); +void capture_ipx(const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header); /* * Structure passed to SPX subdissectors, containing information from diff --git a/epan/dissectors/packet-llc.c b/epan/dissectors/packet-llc.c index 588f5c2581..402fa94f76 100644 --- a/epan/dissectors/packet-llc.c +++ b/epan/dissectors/packet-llc.c @@ -282,27 +282,27 @@ capture_llc(const guchar *pd, int offset, int len, packet_counts *ld, const unio return; } if (is_snap) - capture_snap(pd, offset+llc_header_len, len, ld); + capture_snap(pd, offset+llc_header_len, len, ld, pseudo_header); else { /* non-SNAP */ switch (pd[offset]) { case SAP_IP: - capture_ip(pd, offset + llc_header_len, len, ld); + capture_ip(pd, offset + llc_header_len, len, ld, pseudo_header); break; case SAP_NETWARE1: case SAP_NETWARE2: - capture_ipx(ld); + capture_ipx(pd, offset + llc_header_len, len, ld, pseudo_header); break; case SAP_NETBIOS: - capture_netbios(ld); + capture_netbios(pd, offset + llc_header_len, len, ld, pseudo_header); break; case SAP_VINES1: case SAP_VINES2: - capture_vines(ld); + capture_vines(pd, offset + llc_header_len, len, ld, pseudo_header); break; default: @@ -313,7 +313,7 @@ capture_llc(const guchar *pd, int offset, int len, packet_counts *ld, const unio } void -capture_snap(const guchar *pd, int offset, int len, packet_counts *ld) +capture_snap(const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_) { guint32 oui; guint16 etype; @@ -337,11 +337,11 @@ capture_snap(const guchar *pd, int offset, int len, packet_counts *ld) AppleTalk data packets - but used OUI_ENCAP_ETHER and an Ethernet packet type for AARP packets. */ - capture_ethertype(etype, pd, offset+5, len, ld); + capture_ethertype(etype, pd, offset+5, len, ld, pseudo_header); break; case OUI_CISCO: - capture_ethertype(etype, pd, offset+5, len, ld); + capture_ethertype(etype, pd, offset+5, len, ld, pseudo_header); break; case OUI_MARVELL: @@ -351,7 +351,7 @@ capture_snap(const guchar *pd, int offset, int len, packet_counts *ld) * the payload. (We assume the header is * 5 bytes, for now). */ - capture_ethertype(etype, pd, offset+5+5, len, ld); + capture_ethertype(etype, pd, offset+5+5, len, ld, pseudo_header); break; default: diff --git a/epan/dissectors/packet-llc.h b/epan/dissectors/packet-llc.h index 153c122ac1..ea40ed2460 100644 --- a/epan/dissectors/packet-llc.h +++ b/epan/dissectors/packet-llc.h @@ -28,7 +28,7 @@ void capture_llc(const guchar *, int, int, packet_counts *, const union wtap_pse extern const value_string sap_vals[]; -void capture_snap(const guchar *, int, int, packet_counts *); +void capture_snap(const guchar *, int, int, packet_counts *, 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 4a4305b10d..e0c8d41739 100644 --- a/epan/dissectors/packet-netbios.c +++ b/epan/dissectors/packet-netbios.c @@ -285,7 +285,7 @@ static const value_string max_frame_size_vals[] = { void -capture_netbios(packet_counts *ld) +capture_netbios(const guchar *pd _U_, int offset _U_, int len _U_, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_) { ld->netbios++; } diff --git a/epan/dissectors/packet-netbios.h b/epan/dissectors/packet-netbios.h index 7ea79ee03e..8011ac3d57 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 -void capture_netbios(packet_counts *); +void capture_netbios(const guchar *pd, int offset, int len, packet_counts *ld, 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 7afdad7b92..7238876e48 100644 --- a/epan/dissectors/packet-netrom.c +++ b/epan/dissectors/packet-netrom.c @@ -489,7 +489,7 @@ dissect_netrom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ } void -capture_netrom( const guchar *pd _U_, int offset, int len, packet_counts *ld) +capture_netrom( const guchar *pd _U_, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_) { if ( ! BYTES_ARE_IN_FRAME( offset, len, NETROM_MIN_SIZE ) ) { diff --git a/epan/dissectors/packet-netrom.h b/epan/dissectors/packet-netrom.h index 1ad29c39aa..62f9183e1b 100644 --- a/epan/dissectors/packet-netrom.h +++ b/epan/dissectors/packet-netrom.h @@ -25,6 +25,6 @@ #ifndef __PACKET_NETROM_H__ #define __PACKET_NETROM_H__ -void capture_netrom(const guchar *, int, int, packet_counts *); +void capture_netrom(const guchar *, int, int, packet_counts *, const union wtap_pseudo_header *pseudo_header); #endif diff --git a/epan/dissectors/packet-nhrp.c b/epan/dissectors/packet-nhrp.c index 32fb8ebd6a..d3f971e2e5 100644 --- a/epan/dissectors/packet-nhrp.c +++ b/epan/dissectors/packet-nhrp.c @@ -40,7 +40,6 @@ #include #include "packet-iana-oui.h" #include "packet-llc.h" -#include "packet-nhrp.h" #include "packet-gre.h" void proto_register_nhrp(void); diff --git a/epan/dissectors/packet-nhrp.h b/epan/dissectors/packet-nhrp.h deleted file mode 100644 index ea7c157d75..0000000000 --- a/epan/dissectors/packet-nhrp.h +++ /dev/null @@ -1,29 +0,0 @@ -/* packet-nhrp.h - * Definitions for NHRP - * - * Wireshark - Network traffic analyzer - * By Gerald Combs - * Copyright 1998 Gerald Combs - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - - -#ifndef __PACKET_NHRP_H__ -#define __PACKET_NHRP_H__ - -void capture_nhrp(const guchar *, int, int, packet_counts *); - -#endif diff --git a/epan/dissectors/packet-null.c b/epan/dissectors/packet-null.c index de405238d0..41d7b12cad 100644 --- a/epan/dissectors/packet-null.c +++ b/epan/dissectors/packet-null.c @@ -317,19 +317,19 @@ 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) - capture_ethertype((guint16) null_header, pd, 4, len, ld); + capture_ethertype((guint16) null_header, pd, 4, len, ld, pseudo_header); else { switch (null_header) { case BSD_AF_INET: - capture_ip(pd, 4, len, ld); + capture_ip(pd, 4, len, ld, pseudo_header); break; case BSD_AF_INET6_BSD: case BSD_AF_INET6_FREEBSD: case BSD_AF_INET6_DARWIN: - capture_ipv6(pd, 4, len, ld); + capture_ipv6(pd, 4, len, ld, pseudo_header); break; default: @@ -354,13 +354,13 @@ capture_loop( const guchar *pd, int offset _U_, int len, packet_counts *ld, cons switch (loop_family) { case BSD_AF_INET: - capture_ip(pd, 4, len, ld); + capture_ip(pd, 4, len, ld, pseudo_header); break; case BSD_AF_INET6_BSD: case BSD_AF_INET6_FREEBSD: case BSD_AF_INET6_DARWIN: - capture_ipv6(pd, 4, len, ld); + capture_ipv6(pd, 4, len, ld, pseudo_header); break; default: diff --git a/epan/dissectors/packet-ppp.c b/epan/dissectors/packet-ppp.c index 6803988543..e8a18ce0d0 100644 --- a/epan/dissectors/packet-ppp.c +++ b/epan/dissectors/packet-ppp.c @@ -1967,13 +1967,13 @@ capture_ppp_hdlc(const guchar *pd, int offset, int len, packet_counts *ld, const } switch (pntoh16(&pd[offset + 2])) { case PPP_IP: - capture_ip(pd, offset + 4, len, ld); + capture_ip(pd, offset + 4, len, ld, pseudo_header); break; case PPP_IPX: - capture_ipx(ld); + capture_ipx(pd, offset + 4, len, ld, pseudo_header); break; case PPP_VINES: - capture_vines(ld); + capture_vines(pd, offset + 4, len, ld, pseudo_header); break; default: ld->other++; diff --git a/epan/dissectors/packet-raw.c b/epan/dissectors/packet-raw.c index c6e64d755d..f4faf407d9 100644 --- a/epan/dissectors/packet-raw.c +++ b/epan/dissectors/packet-raw.c @@ -69,7 +69,7 @@ capture_raw(const guchar *pd, int offset _U_, int len, packet_counts *ld, const /* ...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) { - capture_ip(pd, 10, len, ld); + capture_ip(pd, 10, len, ld, pseudo_header); } else { /* @@ -80,13 +80,13 @@ capture_raw(const guchar *pd, int offset _U_, int len, packet_counts *ld, const case 0x40: /* IPv4 */ - capture_ip(pd, 0, len, ld); + capture_ip(pd, 0, len, ld, pseudo_header); break; #if 0 case 0x60: /* IPv6 */ - capture_ipv6(pd, 0, len, ld); + capture_ipv6(pd, 0, len, ld, pseudo_header); break; #endif } diff --git a/epan/dissectors/packet-sll.c b/epan/dissectors/packet-sll.c index 029ab31ad1..18205f155c 100644 --- a/epan/dissectors/packet-sll.c +++ b/epan/dissectors/packet-sll.c @@ -173,7 +173,7 @@ capture_sll(const guchar *pd, int offset _U_, int len, packet_counts *ld, const * Novell IPX inside 802.3 with no 802.2 LLC * header. */ - capture_ipx(ld); + capture_ipx(pd, SLL_HEADER_SIZE, len, ld, pseudo_header); break; case LINUX_SLL_P_PPPHDLC: @@ -188,7 +188,7 @@ capture_sll(const guchar *pd, int offset _U_, int len, packet_counts *ld, const break; } } else - capture_ethertype(protocol, pd, SLL_HEADER_SIZE, len, ld); + capture_ethertype(protocol, pd, SLL_HEADER_SIZE, len, ld, pseudo_header); } static int diff --git a/epan/dissectors/packet-vines.c b/epan/dissectors/packet-vines.c index fa58b881d4..07e2cc524f 100644 --- a/epan/dissectors/packet-vines.c +++ b/epan/dissectors/packet-vines.c @@ -309,7 +309,7 @@ typedef struct _e_vipc { } e_vipc; void -capture_vines(packet_counts *ld) +capture_vines(const guchar *pd _U_, int offset _U_, int len _U_, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_) { ld->vines++; } diff --git a/epan/dissectors/packet-vines.h b/epan/dissectors/packet-vines.h index d8b15fe938..b33d7092c5 100644 --- a/epan/dissectors/packet-vines.h +++ b/epan/dissectors/packet-vines.h @@ -26,6 +26,6 @@ #ifndef __PACKETVINES_H__ #define __PACKETVINES_H__ -void capture_vines(packet_counts *); +void capture_vines(const guchar *pd, int offset, int len, packet_counts *ld, 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 f2f9270f8a..778f512e6a 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; void -capture_vlan(const guchar *pd, int offset, int len, packet_counts *ld ) { +capture_vlan(const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_ ) { guint16 encap_proto; if ( !BYTES_ARE_IN_FRAME(offset,len,5) ) { ld->other++; @@ -108,12 +108,12 @@ capture_vlan(const guchar *pd, int offset, int len, packet_counts *ld ) { encap_proto = pntoh16( &pd[offset+2] ); if ( encap_proto <= IEEE_802_3_MAX_LEN) { if ( pd[offset+4] == 0xff && pd[offset+5] == 0xff ) { - capture_ipx(ld); + capture_ipx(pd,offset+4,len,ld, pseudo_header); } else { - capture_llc(pd,offset+4,len,ld, NULL); + capture_llc(pd,offset+4,len,ld, pseudo_header); } } else { - capture_ethertype(encap_proto, pd, offset+4, len, ld); + capture_ethertype(encap_proto, pd, offset+4, len, ld, pseudo_header); } } diff --git a/epan/dissectors/packet-vlan.h b/epan/dissectors/packet-vlan.h index a1185bfe41..4523f5ea64 100644 --- a/epan/dissectors/packet-vlan.h +++ b/epan/dissectors/packet-vlan.h @@ -22,6 +22,6 @@ #ifndef __PACKET_VLAN_H__ #define __PACKET_VLAN_H__ -void capture_vlan(const guchar *, int, int, packet_counts *); +void capture_vlan(const guchar *, int, int, packet_counts *, const union wtap_pseudo_header *pseudo_header); #endif diff --git a/epan/packet.h b/epan/packet.h index c585bda83f..5b98f2396d 100644 --- a/epan/packet.h +++ b/epan/packet.h @@ -701,7 +701,7 @@ extern void dissect_file(struct epan_dissect *edt, /* These functions are in packet-ethertype.c */ extern void capture_ethertype(guint16 etype, const guchar *pd, int offset, - int len, packet_counts *ld); + int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header); /* Structure passed to the ethertype dissector */ typedef struct ethertype_data_s { -- cgit v1.2.3