aboutsummaryrefslogtreecommitdiffstats
path: root/packet-clip.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-clip.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-clip.c')
-rw-r--r--packet-clip.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/packet-clip.c b/packet-clip.c
index 7a86713a89..856342a90c 100644
--- a/packet-clip.c
+++ b/packet-clip.c
@@ -1,7 +1,7 @@
/* packet-clip.c
* Routines for clip packet disassembly
*
- * $Id: packet-clip.c,v 1.10 2000/05/25 18:32:06 oabad Exp $
+ * $Id: packet-clip.c,v 1.11 2000/11/18 10:38:23 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -40,6 +40,8 @@
static gint ett_clip = -1;
+static dissector_handle_t ip_handle;
+
void
capture_clip( const u_char *pd, packet_counts *ld ) {
@@ -51,8 +53,6 @@ dissect_clip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree *fh_tree;
proto_item *ti;
- const guint8 *this_pd;
- int this_offset;
pinfo->current_proto = "CLIP";
@@ -82,8 +82,7 @@ dissect_clip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
fh_tree = proto_item_add_subtree(ti, ett_clip);
proto_tree_add_text(fh_tree, tvb, 0, 0, "No link information available");
}
- tvb_compat(tvb, &this_pd, &this_offset);
- dissect_ip(this_pd, this_offset, pinfo->fd, tree);
+ call_dissector(ip_handle, tvb, pinfo, tree);
}
void
@@ -95,3 +94,12 @@ proto_register_clip(void)
proto_register_subtree_array(ett, array_length(ett));
}
+
+void
+proto_reg_handoff_clip(void)
+{
+ /*
+ * Get a handle for the IP dissector.
+ */
+ ip_handle = find_dissector("ip");
+}