diff options
author | Gilbert Ramirez <gram@alumni.rice.edu> | 2000-05-15 06:22:07 +0000 |
---|---|---|
committer | Gilbert Ramirez <gram@alumni.rice.edu> | 2000-05-15 06:22:07 +0000 |
commit | ec3337ed07279039c217a70826947efc2bbdc2e3 (patch) | |
tree | 648cc6836e71384dde1353c1d103ce19894cbc90 /packet-atm.c | |
parent | 6c2a7af1f68d5b919f2d52e69e889ef5a1858392 (diff) | |
download | wireshark-ec3337ed07279039c217a70826947efc2bbdc2e3.tar.gz wireshark-ec3337ed07279039c217a70826947efc2bbdc2e3.tar.bz2 wireshark-ec3337ed07279039c217a70826947efc2bbdc2e3.zip |
Convert token-ring dissector to use tvbuffs.
Modify ethernet dissector to catch BoundsError if the attempt to
create next_tvb with the length specified in the ethernet header throws
an exception. In that case, next_tv is created with as many bytes as
are available in the frame.
Both dissect_tr() and dissect_eth() now have TRY blocks, which means
I had to fiddle with 'volatile' and 'static' storage options to get
things right (at least according to gcc).
svn path=/trunk/; revision=1962
Diffstat (limited to 'packet-atm.c')
-rw-r--r-- | packet-atm.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/packet-atm.c b/packet-atm.c index 60f7f91715..658b0e3112 100644 --- a/packet-atm.c +++ b/packet-atm.c @@ -1,7 +1,7 @@ /* packet-atm.c * Routines for ATM packet disassembly * - * $Id: packet-atm.c,v 1.15 2000/05/11 22:04:15 gram Exp $ + * $Id: packet-atm.c,v 1.16 2000/05/15 06:22:05 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -373,6 +373,10 @@ dissect_le_control(const u_char *pd, int offset, frame_data *fd, proto_tree *tre static void dissect_lane(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { + tvbuff_t *next_tvb; + + next_tvb = tvb_new_subset(pi.compat_top_tvb, offset, -1); + if (check_col(fd, COL_PROTOCOL)) col_add_str(fd, COL_PROTOCOL, "ATM LANE"); if (check_col(fd, COL_INFO)) @@ -400,12 +404,12 @@ dissect_lane(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) offset += 2; /* Dissect as Token-Ring */ - dissect_tr(pd, offset, fd, tree); + dissect_tr(next_tvb, &pi, tree); break; default: /* Dump it as raw data. */ - dissect_data(pd, offset, fd, tree); + dissect_data_tvb(next_tvb, &pi, tree); break; } } |