aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-frame.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-02-27 22:43:54 +0000
committerGuy Harris <guy@alum.mit.edu>2013-02-27 22:43:54 +0000
commit6b629c4d92a7223c4930d9b22be1d9e32c375303 (patch)
treefbdbf4b1f847b8388e365010ee64e04413507bd0 /epan/dissectors/packet-frame.h
parent97a0ad8eab5b236f33113858ec62f15f82775f76 (diff)
Move show_exception() and show_reported_bounds_error() to
epan/show_exception.c, as it's used outside epan/dissectors/packet-frame.c. Update their callers to include <epan/show_exception.h> to get their declaration. Add a CATCH_NONFATAL_ERRORS macro that catches all exceptions that, if there's more stuff in the packet to dissect after the dissector call that threw the exception, doesn't mean you shouldn't go ahead and dissect that stuff. Use it in all those cases, including ones where BoundsError was inappropriately being caught (you want those passed up to the top level, so that the packet is reported as having been cut short in the capture process). Add a CATCH_BOUNDS_ERRORS macro that catches all exceptions that correspond to running past the end of the data for a tvbuff; use it rather than explicitly catching those exceptions individually, and rather than just catching all exceptions (the only place that DissectorError should be caught, for example, is at the top level, so dissector bugs show up in the protocol tree). Don't catch and then immediately rethrow exceptions without doing anything else; just let the exceptions go up to the final catcher. Use show_exception() to report non-fatal errors, rather than doing it yourself. If a dissector is called from Lua, catch all non-fatal errors and use show_exception() to report them rather than catching only ReportedBoundsError and adding a proto_malformed item. Don't catch exceptions when constructing a trailer tvbuff in packet-ieee8023.c - just construct it after the payload has been dissected, and let whatever exceptions that throws be handled at the top level. Avoid some TRY/CATCH/ENDTRY cases by using checks such as tvb_bytes_exist() before even looking in the tvbuff. svn path=/trunk/; revision=47924
Diffstat (limited to 'epan/dissectors/packet-frame.h')
-rw-r--r--epan/dissectors/packet-frame.h19
1 files changed, 0 insertions, 19 deletions
diff --git a/epan/dissectors/packet-frame.h b/epan/dissectors/packet-frame.h
index 1bebceed83..cb6edf3b4d 100644
--- a/epan/dissectors/packet-frame.h
+++ b/epan/dissectors/packet-frame.h
@@ -24,19 +24,6 @@
*/
/*
- * 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, const char *exception_message);
-
-/*
- * Routine used to add an indication of a ReportedBoundsError exception
- * to the tree.
- */
-void
-show_reported_bounds_error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
-
-/*
* Routine used to register frame end routine. The routine should only
* be registred when the dissector is used in the frame, not in the
* proto_register_XXX function.
@@ -45,12 +32,6 @@ void
register_frame_end_routine(packet_info *pinfo, void (*func)(void));
/*
- * "Protocol" used for "malformed frame" errors (other than
- * ReportedBoundsError exceptions).
- */
-extern int proto_malformed;
-
-/*
* The frame dissector and the PPI dissector both use this
*/
extern dissector_table_t wtap_encap_dissector_table;