aboutsummaryrefslogtreecommitdiffstats
path: root/packet-frame.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2002-02-18 23:51:55 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2002-02-18 23:51:55 +0000
commitce0b5eadeb7b9d3d76953797a6c5f9557c9005fa (patch)
tree7b55a5cf8df1e890f729f2bf2a75756883f1c6a9 /packet-frame.c
parent3c503f134c838f8a37bc297d98811a51e638871e (diff)
Add support for reassembling RPC-over-TCP fragments, and do that in both
RPC and NDMP. Show the RPC-over-TCP fragment header as a tree with bitfields below it. Add a routine to show a reported bounds error as an "Unreassembled Packet" or a "Malformed Packet" depending on whether "pinfo->fragmented" is set, and have NBNS and RPC use that. Add "ett_ndmp_file_stats" to the list of ett_ values to be initialized (it wasn't in that list, and wasn't getting initialized). When freeing up various hash tables and memory chunks in the RPC dissector, zero out the pointers to them, just to make sure we don't try to free them again. Always destroy the TCP segment key and address memory chunks in "tcp_desegment_init()", regardless of whether TCP desegmentation is enabled - we don't *allocate* them if TCP desegmentation isn't enabled, but we should free them even if it's not enabled. Also, when we free them, set the pointers to them to null, so we don't double-free them. Supply to subdissectors called from the TCP dissector the sequence number of the first byte handed to the sub dissector. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4753 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-frame.c')
-rw-r--r--packet-frame.c55
1 files changed, 30 insertions, 25 deletions
diff --git a/packet-frame.c b/packet-frame.c
index f11586b59d..308797fe28 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.21 2002/01/24 09:20:47 guy Exp $
+ * $Id: packet-frame.c,v 1.22 2002/02/18 23:51:55 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -155,37 +155,42 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
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 );
+ "[Short Frame: %s]", pinfo->current_proto);
}
CATCH(ReportedBoundsError) {
- if (pinfo->fragmented) {
- /*
- * We were dissecting an unreassembled fragmented
- * packet when the exception was thrown, so the
- * problem isn't that the dissector expected
- * something but it wasn't in the packet, the
- * problem is that the dissector expected something
- * but it wasn't in the fragment we dissected.
- */
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_str(pinfo->cinfo, COL_INFO,
- "[Unreassembled Packet]");
- proto_tree_add_protocol_format(tree, proto_unreassembled,
- tvb, 0, 0, "[Unreassembled Packet: %s]",
- pinfo->current_proto );
- } else {
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_str(pinfo->cinfo, COL_INFO,
- "[Malformed Packet]");
- proto_tree_add_protocol_format(tree, proto_malformed,
- tvb, 0, 0, "[Malformed Packet: %s]",
- pinfo->current_proto );
- }
+ show_reported_bounds_error(tvb, pinfo, tree);
}
ENDTRY;
}
void
+show_reported_bounds_error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+{
+ if (pinfo->fragmented) {
+ /*
+ * We were dissecting an unreassembled fragmented
+ * packet when the exception was thrown, so the
+ * problem isn't that the dissector expected
+ * something but it wasn't in the packet, the
+ * problem is that the dissector expected something
+ * but it wasn't in the fragment we dissected.
+ */
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_append_str(pinfo->cinfo, COL_INFO,
+ "[Unreassembled Packet]");
+ proto_tree_add_protocol_format(tree, proto_unreassembled,
+ tvb, 0, 0, "[Unreassembled Packet: %s]",
+ pinfo->current_proto);
+ } else {
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_append_str(pinfo->cinfo, COL_INFO,
+ "[Malformed Packet]");
+ proto_tree_add_protocol_format(tree, proto_malformed,
+ tvb, 0, 0, "[Malformed Packet: %s]", pinfo->current_proto);
+ }
+}
+
+void
proto_register_frame(void)
{
static hf_register_info hf[] = {