diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-01-18 07:44:41 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-01-18 07:44:41 +0000 |
commit | 18bfc670eccbc7b9acacd7121e415b3d335b7ff9 (patch) | |
tree | 479f963eaed0ad216b7059a8ce374cb81805e8b8 /packet-sll.c | |
parent | f655d094b544e0c2dc4cf20b46de5d178b4ccc4d (diff) | |
download | wireshark-18bfc670eccbc7b9acacd7121e415b3d335b7ff9.tar.gz wireshark-18bfc670eccbc7b9acacd7121e415b3d335b7ff9.tar.bz2 wireshark-18bfc670eccbc7b9acacd7121e415b3d335b7ff9.zip |
Pull the handling of trailers in Ethernet (as opposed to 802.3) frames
into "ethertype()".
svn path=/trunk/; revision=2915
Diffstat (limited to 'packet-sll.c')
-rw-r--r-- | packet-sll.c | 47 |
1 files changed, 5 insertions, 42 deletions
diff --git a/packet-sll.c b/packet-sll.c index 2e82af1d62..78bec6f64c 100644 --- a/packet-sll.c +++ b/packet-sll.c @@ -1,7 +1,7 @@ /* packet-sll.c * Routines for disassembly of packets from Linux "cooked mode" captures * - * $Id: packet-sll.c,v 1.5 2001/01/09 09:59:28 guy Exp $ + * $Id: packet-sll.c,v 1.6 2001/01/18 07:44:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -138,11 +138,8 @@ dissect_sll(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) guint16 hatype, halen; guint8 *src; proto_item *ti; - volatile guint16 length; - tvbuff_t *volatile next_tvb; - tvbuff_t *volatile trailer_tvb; - proto_tree *volatile fh_tree = NULL; - guint length_before; + tvbuff_t *next_tvb; + proto_tree *fh_tree = NULL; CHECK_DISPLAY_AS_DATA(proto_sll, tvb, pinfo, tree); @@ -201,7 +198,6 @@ dissect_sll(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) protocol); next_tvb = tvb_new_subset(tvb, SLL_HEADER_SIZE, -1, -1); - trailer_tvb = NULL; switch (protocol) { case LINUX_SLL_P_802_2: @@ -224,41 +220,8 @@ dissect_sll(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; } } else { - length_before = tvb_reported_length(tvb); - length = ethertype(protocol, tvb, SLL_HEADER_SIZE, pinfo, tree, - fh_tree, hf_sll_etype) + SLL_HEADER_SIZE; - if (length < length_before) { - /* - * Create a tvbuff for the padding. - */ - TRY { - trailer_tvb = tvb_new_subset(tvb, length, -1, - -1); - } - CATCH2(BoundsError, ReportedBoundsError) { - /* The packet doesn't have "length" bytes - worth of captured data left in it. No - trailer to display. */ - trailer_tvb = NULL; - } - ENDTRY; - } else { - /* - * There is no padding. - */ - trailer_tvb = NULL; - } - } - - /* If there's some bytes left over, mark them. */ - if (trailer_tvb && tree) { - guint trailer_length; - - trailer_length = tvb_length(trailer_tvb); - if (trailer_length != 0) { - proto_tree_add_item(fh_tree, hf_sll_trailer, - trailer_tvb, 0, trailer_length, FALSE); - } + ethertype(protocol, tvb, SLL_HEADER_SIZE, pinfo, tree, + fh_tree, hf_sll_etype, hf_sll_trailer); } } |