diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-10-23 05:01:39 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-10-23 05:01:39 +0000 |
commit | 78e089fa99f9aac91700ad02927b1ddd9aa6b7ce (patch) | |
tree | fc7f38eea5418d32555417cd1251fa12918c440e | |
parent | b60dec2b52d59da82ef0987c4a8723a3963ed20a (diff) | |
download | wireshark-78e089fa99f9aac91700ad02927b1ddd9aa6b7ce.tar.gz wireshark-78e089fa99f9aac91700ad02927b1ddd9aa6b7ce.tar.bz2 wireshark-78e089fa99f9aac91700ad02927b1ddd9aa6b7ce.zip |
Add a "show_exception()" routine that takes an exception code as an
argument, and puts the appropriate exception indication into the tree.
In "dissect_frame()", do a CATCH_ALL for exceptions, and pass the
exception code to "show_exception()".
svn path=/trunk/; revision=8758
-rw-r--r-- | packet-frame.c | 27 | ||||
-rw-r--r-- | packet-frame.h | 8 |
2 files changed, 27 insertions, 8 deletions
diff --git a/packet-frame.c b/packet-frame.c index cd61a3d5a9..631006698a 100644 --- a/packet-frame.c +++ b/packet-frame.c @@ -2,7 +2,7 @@ * * Top-most dissector. Decides dissector based on Wiretap Encapsulation Type. * - * $Id: packet-frame.c,v 1.39 2003/09/22 09:06:10 sahlberg Exp $ + * $Id: packet-frame.c,v 1.40 2003/10/23 05:01:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -192,18 +192,31 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) call_dissector(data_handle,tvb, pinfo, tree); } } - CATCH(BoundsError) { + CATCH_ALL { + show_exception(tvb, pinfo, tree, EXCEPT_CODE); + } + ENDTRY; + + tap_queue_packet(frame_tap, pinfo, NULL); +} + +void +show_exception(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, + unsigned long exception) +{ + switch (exception) { + + case BoundsError: if (check_col(pinfo->cinfo, COL_INFO)) col_append_str(pinfo->cinfo, COL_INFO, "[Short Frame]"); proto_tree_add_protocol_format(tree, proto_short, tvb, 0, 0, "[Short Frame: %s]", pinfo->current_proto); - } - CATCH(ReportedBoundsError) { + break; + + case ReportedBoundsError: show_reported_bounds_error(tvb, pinfo, tree); + break; } - ENDTRY; - - tap_queue_packet(frame_tap, pinfo, NULL); } void diff --git a/packet-frame.h b/packet-frame.h index 51d848af01..995e378336 100644 --- a/packet-frame.h +++ b/packet-frame.h @@ -2,7 +2,7 @@ * * Top-most dissector. Decides dissector based on Wiretap Encapsulation Type. * - * $Id: packet-frame.h,v 1.5 2002/08/28 21:00:13 jmayer Exp $ + * $Id: packet-frame.h,v 1.6 2003/10/23 05:01:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -24,6 +24,12 @@ */ /* + * Routine used to add an indication of an arbitrary exception to the tree. + */ +void show_exception(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, + unsigned long exception); + +/* * Routine used to add an indication of a ReportedBoundsError exception * to the tree. */ |