diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-05-31 05:09:07 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-05-31 05:09:07 +0000 |
commit | 283ce59938ad2be252a6232e40a958e177a40e1a (patch) | |
tree | b451d4a712d9b914022ba872296e70e55b8d9bc5 /packet-ncp.c | |
parent | aa553f63ecc7b9e310a05b743502c50f6dffb800 (diff) |
Add routines for adding items to a protocol tree that take arguments of
a particular type, rather than taking a varargs list, along the lines of
the "proto_tree_add_XXX_format()" routines.
Replace most calls to "proto_tree_add_item()" and
"proto_tree_add_item_hidden()" with calls to those routines.
Rename "proto_tree_add_item()" and "proto_tree_add_item_hidden()" to
"proto_tree_add_item_old()" and "proto_tree_add_item_hidden_old()", and
add new "proto_tree_add_item()" and "proto_tree_add_item_hidden()"
routines that don't take the item to be added as an argument - instead,
they fetch the argument from the packet whose tvbuff was handed to them,
from the offset handed to them.
svn path=/trunk/; revision=2031
Diffstat (limited to 'packet-ncp.c')
-rw-r--r-- | packet-ncp.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/packet-ncp.c b/packet-ncp.c index b8c04b521a..9f18cd22c6 100644 --- a/packet-ncp.c +++ b/packet-ncp.c @@ -3,7 +3,7 @@ * Gilbert Ramirez <gram@xiexie.org> * Modified to allow NCP over TCP/IP decodes by James Coe <jammer@cin.net> * - * $Id: packet-ncp.c,v 1.36 2000/05/30 03:35:53 guy Exp $ + * $Id: packet-ncp.c,v 1.37 2000/05/31 05:07:22 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -575,14 +575,14 @@ dissect_ncp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { nw_ncp_type = header.type; if (tree) { - ti = proto_tree_add_item(tree, proto_ncp, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_ncp, NullTVB, offset, END_OF_FRAME, FALSE); ncp_tree = proto_item_add_subtree(ti, ett_ncp); if ( pi.ptype == PT_TCP || pi.ptype == PT_UDP ) { - proto_tree_add_item(ncp_tree, hf_ncp_ip_sig, NullTVB, offset - 16, 4, ncpiph.signature); + proto_tree_add_uint(ncp_tree, hf_ncp_ip_sig, NullTVB, offset - 16, 4, ncpiph.signature); proto_tree_add_text(ncp_tree, NullTVB, offset - 12, 4, "Length: %d", ncpiph.length); if ( ncpiph.signature == NCPIP_RQST ) { - proto_tree_add_item(ncp_tree, hf_ncp_ip_ver, NullTVB, offset - 8, 4, ncpiphrq.version); + proto_tree_add_uint(ncp_tree, hf_ncp_ip_ver, NullTVB, offset - 8, 4, ncpiphrq.version); proto_tree_add_text(ncp_tree, NullTVB, offset - 4, 4, "Reply buffer size: %d", ncpiphrq.rplybufsize); }; }; @@ -594,13 +594,13 @@ dissect_ncp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { request_reply_values, "Unknown (%04X)")); - proto_tree_add_item(ncp_tree, hf_ncp_seq, NullTVB, + proto_tree_add_uint(ncp_tree, hf_ncp_seq, NullTVB, offset+2, 1, header.sequence); - proto_tree_add_item(ncp_tree, hf_ncp_connection, NullTVB, + proto_tree_add_uint(ncp_tree, hf_ncp_connection, NullTVB, offset+3, 3, nw_connection); - proto_tree_add_item(ncp_tree, hf_ncp_task, NullTVB, + proto_tree_add_uint(ncp_tree, hf_ncp_task, NullTVB, offset+4, 1, header.task); } |