* Routines for rpc dissection
* Copyright 1999, Uwe Girlich <Uwe.Girlich@philosys.de>
*
- * $Id: packet-rpc.c,v 1.94 2002/05/21 10:17:30 sahlberg Exp $
+ * $Id: packet-rpc.c,v 1.97 2002/06/07 10:11:39 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
static int hf_rpc_value_follows = -1;
static int hf_rpc_array_len = -1;
static int hf_rpc_time = -1;
+static int hf_rpc_fragments = -1;
+static int hf_rpc_fragment = -1;
+static int hf_rpc_fragment_overlap = -1;
+static int hf_rpc_fragment_overlap_conflict = -1;
+static int hf_rpc_fragment_multiple_tails = -1;
+static int hf_rpc_fragment_too_long_fragment = -1;
+static int hf_rpc_fragment_error = -1;
static gint ett_rpc = -1;
static gint ett_rpc_fragments = -1;
+static gint ett_rpc_fragment = -1;
static gint ett_rpc_fraghdr = -1;
static gint ett_rpc_string = -1;
static gint ett_rpc_cred = -1;
static dissector_handle_t rpc_handle;
static dissector_handle_t data_handle;
+fragment_items rpc_frag_items = {
+ &ett_rpc_fragment,
+ &ett_rpc_fragments,
+ &hf_rpc_fragments,
+ &hf_rpc_fragment,
+ &hf_rpc_fragment_overlap,
+ &hf_rpc_fragment_overlap_conflict,
+ &hf_rpc_fragment_multiple_tails,
+ &hf_rpc_fragment_too_long_fragment,
+ &hf_rpc_fragment_error,
+ "fragments"
+};
+
/* Hash table with info on RPC program numbers */
static GHashTable *rpc_progs;
if (is_tcp) {
show_rpc_fraginfo(tvb, frag_tvb, rpc_tree, rpc_rm,
- ipfd_head);
+ ipfd_head, pinfo);
}
}
void
show_rpc_fraginfo(tvbuff_t *tvb, tvbuff_t *frag_tvb, proto_tree *tree,
- guint32 rpc_rm, fragment_data *ipfd_head)
+ guint32 rpc_rm, fragment_data *ipfd_head, packet_info *pinfo)
{
- proto_tree *st = NULL;
- proto_item *si = NULL;
- fragment_data *ipfd;
-
if (tree == NULL)
return; /* don't do any work */
/*
* Show a tree with information about all fragments.
*/
- si = proto_tree_add_text(tree, tvb, 0, -1, "Fragments");
- st = proto_item_add_subtree(si, ett_rpc_fragments);
- for (ipfd = ipfd_head->next; ipfd != NULL; ipfd = ipfd->next) {
- proto_tree_add_text(st, tvb, ipfd->offset, ipfd->len,
- "Frame:%u [%u-%u]",
- ipfd->frame,
- ipfd->offset,
- ipfd->offset + ipfd->len - 1);
- }
+ show_fragment_tree(ipfd_head, &rpc_frag_items, tree, pinfo, tvb);
} else {
/*
* This message was all in one fragment, so just show
/*
* Add defragmented data to the data source list.
*/
- add_new_data_source(pinfo->fd, rec_tvb, "Defragmented");
+ add_new_data_source(pinfo, rec_tvb, "Defragmented");
}
/*
"Time from request", "rpc.time", FT_RELATIVE_TIME, BASE_NONE,
NULL, 0, "Time between Request and Reply for ONC-RPC calls", HFILL }},
+ { &hf_rpc_fragment_overlap,
+ { "Fragment overlap", "rpc.fragment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
+ "Fragment overlaps with other fragments", HFILL }},
+
+ { &hf_rpc_fragment_overlap_conflict,
+ { "Conflicting data in fragment overlap", "rpc.fragment.overlap.conflict", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
+ "Overlapping fragments contained conflicting data", HFILL }},
+
+ { &hf_rpc_fragment_multiple_tails,
+ { "Multiple tail fragments found", "rpc.fragment.multipletails", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
+ "Several tails were found when defragmenting the packet", HFILL }},
+
+ { &hf_rpc_fragment_too_long_fragment,
+ { "Fragment too long", "rpc.fragment.toolongfragment", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
+ "Fragment contained data past end of packet", HFILL }},
+
+ { &hf_rpc_fragment_error,
+ { "Defragmentation error", "rpc.fragment.error", FT_NONE, BASE_NONE, NULL, 0x0,
+ "Defragmentation error due to illegal fragments", HFILL }},
+
+ { &hf_rpc_fragment,
+ { "RPC Fragment", "rpc.fragment", FT_NONE, BASE_NONE, NULL, 0x0,
+ "RPC Fragment", HFILL }},
+
+ { &hf_rpc_fragments,
+ { "RPC Fragments", "rpc.fragments", FT_NONE, BASE_NONE, NULL, 0x0,
+ "RPC Fragments", HFILL }},
};
static gint *ett[] = {
&ett_rpc,
&ett_rpc_fragments,
+ &ett_rpc_fragment,
&ett_rpc_fraghdr,
&ett_rpc_string,
&ett_rpc_cred,