aboutsummaryrefslogtreecommitdiffstats
path: root/packet-rpc.c
diff options
context:
space:
mode:
authorNathan Neulinger <nneul@umr.edu>1999-11-11 16:20:25 +0000
committerNathan Neulinger <nneul@umr.edu>1999-11-11 16:20:25 +0000
commit6043b610ed2bce00a511a70f441da68dab5a17b7 (patch)
tree7637eb730d1eefaa6ebe8fa760810c9419842c26 /packet-rpc.c
parent76710fcc54eff453da0ce1118b1368b8dd144bd4 (diff)
downloadwireshark-6043b610ed2bce00a511a70f441da68dab5a17b7.tar.gz
wireshark-6043b610ed2bce00a511a70f441da68dab5a17b7.tar.bz2
wireshark-6043b610ed2bce00a511a70f441da68dab5a17b7.zip
Expanded bootparams dissector to handle decoding getfile calls and replies.
Added proto_registrar_get_name routine to proto.c to retrieve the name of particular proto_tree field. Added dissect_rpc_string_item to packet-rpc.c. This routine does the same thing as dissect_rpc_string, except it takes a hfindex of a proto_tree item instead of a name. It uses the p_r_get_name call to get the name, and adds the actual string content as a hidden field (so that the subtree highlights the entire data area - length, data, and padding). There is only one call to dissect_rpc_string, so I believe that this routine should replace it. svn path=/trunk/; revision=1011
Diffstat (limited to 'packet-rpc.c')
-rw-r--r--packet-rpc.c45
1 files changed, 44 insertions, 1 deletions
diff --git a/packet-rpc.c b/packet-rpc.c
index 4336f94508..bafd325775 100644
--- a/packet-rpc.c
+++ b/packet-rpc.c
@@ -2,7 +2,7 @@
* Routines for rpc dissection
* Copyright 1999, Uwe Girlich <Uwe.Girlich@philosys.de>
*
- * $Id: packet-rpc.c,v 1.6 1999/11/10 17:23:54 nneul Exp $
+ * $Id: packet-rpc.c,v 1.7 1999/11/11 16:20:24 nneul Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
@@ -391,6 +391,49 @@ dissect_rpc_string(const u_char *pd, int offset, frame_data *fd, proto_tree *tre
return offset;
}
+int
+dissect_rpc_string_item(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, int hfindex)
+{
+ proto_item *string_item;
+ proto_tree *string_tree = NULL;
+
+ guint32 string_length;
+ guint32 string_fill;
+ guint32 string_length_full;
+ char string_buffer[RPC_STRING_MAXBUF];
+
+ if (!BYTES_ARE_IN_FRAME(offset,4)) return offset;
+ string_length = EXTRACT_UINT(pd,offset+0);
+ string_length_full = roundup(string_length);
+ string_fill = string_length_full - string_length;
+ if (!BYTES_ARE_IN_FRAME(offset+4,string_length_full)) return offset;
+ if (string_length>=sizeof(string_buffer)) return offset;
+ memcpy(string_buffer,pd+offset+4,string_length);
+ string_buffer[string_length] = '\0';
+ if (tree) {
+ string_item = proto_tree_add_text(tree,offset+0,
+ 4+string_length_full,
+ "%s: %s", proto_registrar_get_name(hfindex), string_buffer);
+ proto_tree_add_item_hidden(tree, hfindex, offset+4,
+ string_length, string_buffer);
+ if (string_item) {
+ string_tree = proto_item_add_subtree(string_item, ETT_RPC_STRING);
+ }
+ }
+ if (string_tree) {
+ proto_tree_add_text(string_tree,offset+0,4,
+ "length: %u", string_length);
+ proto_tree_add_text(string_tree,offset+4,string_length,
+ "text: %s", string_buffer);
+ if (string_fill)
+ proto_tree_add_text(string_tree,offset+4+string_length,string_fill,
+ "fill bytes: opaque data");
+ }
+
+ offset += 4 + string_length_full;
+ return offset;
+}
+
void
dissect_rpc_auth( const u_char *pd, int offset, frame_data *fd, proto_tree *tree)