aboutsummaryrefslogtreecommitdiffstats
path: root/packet-pim.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-11-18 10:38:33 +0000
committerGuy Harris <guy@alum.mit.edu>2000-11-18 10:38:33 +0000
commitc8196a1d1ca5a5021388cfc1bcbb64cdda5e9dc3 (patch)
tree5e117f446c6e233d14b642596d67c985e685f328 /packet-pim.c
parent56a0c40c18271046d22bffcc5db10cfb16a2bf6c (diff)
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors. Register the IP dissector and have dissectors that call it directly (rather than through a port table) call it through a handle. Add a routine "tvb_set_reported_length()" which a dissector can use if it was handed a tvbuff that contains more data than is actually in its part of the packet - for example, handing a padded Ethernet frame to IP; the routine sets the reported length of the tvbuff (and also adjusts the actual length, as appropriate). Then use it in IP. Given that, "ethertype()" can determine how much of the Ethernet frame was actually part of an IP datagram (and can do the same for other protocols under Ethernet that use "tvb_set_reported_length()"; have it return the actual length, and have "dissect_eth()" and "dissect_vlan()" use that to mark trailer data in Ethernet II frames as well as in 802.3 frames. svn path=/trunk/; revision=2658
Diffstat (limited to 'packet-pim.c')
-rw-r--r--packet-pim.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/packet-pim.c b/packet-pim.c
index 753acbbbd2..86a31cf4d7 100644
--- a/packet-pim.c
+++ b/packet-pim.c
@@ -2,7 +2,7 @@
* Routines for PIM disassembly
* (c) Copyright Jun-ichiro itojun Hagino <itojun@itojun.org>
*
- * $Id: packet-pim.c,v 1.18 2000/11/17 21:00:35 gram Exp $
+ * $Id: packet-pim.c,v 1.19 2000/11/18 10:38:25 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -70,6 +70,8 @@ static int hf_pim_cksum = -1;
static gint ett_pim = -1;
+static dissector_handle_t ip_handle;
+
static const char *
dissect_pim_addr(const u_char *bp, const u_char *ep, enum pimv2_addrtype at,
int *advance) {
@@ -284,9 +286,9 @@ dissect_pim(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
switch((*ip & 0xf0) >> 4) {
case 4: /* IPv4 */
#if 0
- dissect_ip(pd, ip - pd, fd, tree);
+ old_call_dissector(ip_handle, pd, ip - pd, fd, tree);
#else
- dissect_ip(pd, ip - pd, fd, pimopt_tree);
+ old_call_dissector(ip_handle, pd, ip - pd, fd, pimopt_tree);
#endif
break;
case 6: /* IPv6 */
@@ -607,5 +609,9 @@ void
proto_reg_handoff_pim(void)
{
old_dissector_add("ip.proto", IP_PROTO_PIM, dissect_pim);
-}
+ /*
+ * Get a handle for the IP dissector.
+ */
+ ip_handle = find_dissector("ip");
+}