diff options
author | Gilbert Ramirez <gram@alumni.rice.edu> | 2000-03-12 04:48:32 +0000 |
---|---|---|
committer | Gilbert Ramirez <gram@alumni.rice.edu> | 2000-03-12 04:48:32 +0000 |
commit | f6e92a9e939a28327eea49b5931715ba97a62970 (patch) | |
tree | 0b5f52ee7613baacc77f73697eb895592aa6a137 /packet-rpc.c | |
parent | 3d6cb57256c889b2f1ba51e89886d9bb9ea812fb (diff) | |
download | wireshark-f6e92a9e939a28327eea49b5931715ba97a62970.tar.gz |
Break proto_tree_add_item_format() into multiple functions:
proto_tree_add_protocol_format()
proto_tree_add_uint_format()
proto_tree_add_ipxnet_format()
proto_tree_add_ipv4_format()
proto_tree_add_ipv6_format()
proto_tree_add_bytes_format()
proto_tree_add_string_format()
proto_tree_add_ether_format()
proto_tree_add_time_format()
proto_tree_add_double_format()
proto_tree_add_boolean_format()
If using GCC 2.x, we can check the print-format against the variable args
passed in. Regardless of compiler, we can now check at run-time that the
field type passed into the function corresponds to what that function
expects (FT_UINT, FT_BOOLEAN, etc.)
Note that proto_tree_add_protocol_format() does not require a value field,
since the value of a protocol is always NULL. It's more intuitive w/o the
vestigial argument.
Fixed a proto_tree_add_item_format-related bug in packet-isis-hello.c
Fixed a variable usage bug in packet-v120.c. (ett_* was used instead of hf_*)
Checked in Guy's fix for the function declearation for proto_tree_add_text()
and proto_tree_add_notext().
svn path=/trunk/; revision=1713
Diffstat (limited to 'packet-rpc.c')
-rw-r--r-- | packet-rpc.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/packet-rpc.c b/packet-rpc.c index e1c72fceb1..5652dd6096 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.27 2000/03/09 12:09:53 girlich Exp $ + * $Id: packet-rpc.c,v 1.28 2000/03/12 04:47:49 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -913,7 +913,7 @@ dissect_rpc( const u_char *pd, int offset, frame_data *fd, proto_tree *tree) xid = EXTRACT_UINT(pd,offset+0); if (rpc_tree) { - proto_tree_add_item_format(rpc_tree,hf_rpc_xid, + proto_tree_add_uint_format(rpc_tree,hf_rpc_xid, offset+0, 4, xid, "XID: 0x%x (%u)", xid, xid); } @@ -941,7 +941,7 @@ dissect_rpc( const u_char *pd, int offset, frame_data *fd, proto_tree *tree) prog = EXTRACT_UINT(pd,offset+4); if (rpc_tree) { - proto_tree_add_item_format(rpc_tree, + proto_tree_add_uint_format(rpc_tree, hf_rpc_program, offset+4, 4, prog, "Program: %s (%u)", progname, prog); } @@ -981,7 +981,7 @@ dissect_rpc( const u_char *pd, int offset, frame_data *fd, proto_tree *tree) procname = procname_static; } if (rpc_tree) { - proto_tree_add_item_format(rpc_tree, + proto_tree_add_uint_format(rpc_tree, hf_rpc_procedure, offset+12, 4, proc, "Procedure: %s (%u)", procname, proc); } @@ -1098,12 +1098,12 @@ dissect_rpc( const u_char *pd, int offset, frame_data *fd, proto_tree *tree) } if (rpc_tree) { - proto_tree_add_item_format(rpc_tree, + proto_tree_add_uint_format(rpc_tree, hf_rpc_program, 0, 0, prog, "Program: %s (%u)", progname, prog); proto_tree_add_item(rpc_tree, hf_rpc_programversion, 0, 0, vers); - proto_tree_add_item_format(rpc_tree, + proto_tree_add_uint_format(rpc_tree, hf_rpc_procedure, 0, 0, proc, "Procedure: %s (%u)", procname, proc); } @@ -1220,7 +1220,7 @@ dissect_rpc_prog: if (ptree) { proto_tree_add_item(ptree, hf_rpc_programversion, 0, 0, vers); - proto_tree_add_item_format(ptree, + proto_tree_add_uint_format(ptree, hf_rpc_procedure, 0, 0, proc, "Procedure: %s (%u)", procname, proc); } |