diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2000-05-31 05:09:07 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2000-05-31 05:09:07 +0000 |
commit | e41a093685c520e2a86e4391a3e39168b13f7d24 (patch) | |
tree | b451d4a712d9b914022ba872296e70e55b8d9bc5 /packet-tns.c | |
parent | d3cf6abccf0b2b9fbcac9e89a2c3a889c4289eb1 (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.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2031 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-tns.c')
-rw-r--r-- | packet-tns.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/packet-tns.c b/packet-tns.c index 54e6a3f50e..244e542b19 100644 --- a/packet-tns.c +++ b/packet-tns.c @@ -1,7 +1,7 @@ /* packet-tns.c * Routines for MSX tns packet dissection * - * $Id: packet-tns.c,v 1.6 2000/05/11 08:15:53 gram Exp $ + * $Id: packet-tns.c,v 1.7 2000/05/31 05:07:50 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -88,7 +88,7 @@ static void dissect_tns_sns(const u_char *pd, int offset, frame_data *fd, ti = proto_tree_add_text(tns_tree, NullTVB, offset, END_OF_FRAME, "Secure Network Services"); sns_tree = proto_item_add_subtree(ti, ett_tns_sns); - proto_tree_add_item_hidden(tns_tree, hf_tns_sns, NullTVB, 0, 0, TRUE); + proto_tree_add_boolean_hidden(tns_tree, hf_tns_sns, NullTVB, 0, 0, TRUE); } if ( check_col(fd, COL_INFO) ) @@ -109,7 +109,7 @@ static void dissect_tns_data(const u_char *pd, int offset, frame_data *fd, TRUNC(2); if ( tree ) { - proto_tree_add_item(tns_tree, hf_tns_data_flag, NullTVB, + proto_tree_add_uint(tns_tree, hf_tns_data_flag, NullTVB, offset, 2, pntohs(&pd[offset])); } offset += 2; @@ -138,7 +138,7 @@ static void dissect_tns_connect(const u_char *pd, int offset, frame_data *fd, ti = proto_tree_add_text(tns_tree, NullTVB, offset, END_OF_FRAME, "Connect"); connect_tree = proto_item_add_subtree(ti, ett_tns_connect); - proto_tree_add_item_hidden(tns_tree, hf_tns_connect, NullTVB, 0, 0, TRUE); + proto_tree_add_boolean_hidden(tns_tree, hf_tns_connect, NullTVB, 0, 0, TRUE); } if ( check_col(fd, COL_INFO) ) @@ -149,7 +149,7 @@ static void dissect_tns_connect(const u_char *pd, int offset, frame_data *fd, TRUNC(2); if ( connect_tree ) { - proto_tree_add_item(connect_tree, hf_tns_version, NullTVB, + proto_tree_add_uint(connect_tree, hf_tns_version, NullTVB, offset, 2, pntohs(&pd[offset])); } offset += 2; @@ -157,7 +157,7 @@ static void dissect_tns_connect(const u_char *pd, int offset, frame_data *fd, TRUNC(2); if ( connect_tree ) { - proto_tree_add_item(connect_tree, hf_tns_compat_version, NullTVB, + proto_tree_add_uint(connect_tree, hf_tns_compat_version, NullTVB, offset, 2, pntohs(&pd[offset])); } offset += 2; @@ -166,7 +166,7 @@ static void dissect_tns_connect(const u_char *pd, int offset, frame_data *fd, if ( connect_tree ) { /* need to break down w/ bitfield */ - proto_tree_add_item(connect_tree, hf_tns_service_options, NullTVB, + proto_tree_add_uint(connect_tree, hf_tns_service_options, NullTVB, offset, 2, pntohs(&pd[offset])); } offset += 2; @@ -204,19 +204,19 @@ dissect_tns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { - ti = proto_tree_add_item(tree, proto_tns, NullTVB, offset, END_OF_FRAME, NULL); + ti = proto_tree_add_item(tree, proto_tns, NullTVB, offset, END_OF_FRAME, FALSE); tns_tree = proto_item_add_subtree(ti, ett_tns); if (pi.match_port == pi.destport) { - proto_tree_add_item_hidden(tns_tree, hf_tns_request, NullTVB, + proto_tree_add_boolean_hidden(tns_tree, hf_tns_request, NullTVB, offset, END_OF_FRAME, TRUE); proto_tree_add_text(tns_tree, NullTVB, offset, END_OF_FRAME, "Request: <opaque data>" ); } else { - proto_tree_add_item_hidden(tns_tree, hf_tns_response, NullTVB, + proto_tree_add_boolean_hidden(tns_tree, hf_tns_response, NullTVB, offset, END_OF_FRAME, TRUE); proto_tree_add_text(tns_tree, NullTVB, offset, END_OF_FRAME, "Response: <opaque data>"); @@ -229,7 +229,7 @@ dissect_tns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) length = pntohs(&pd[offset]); if (tree) { - proto_tree_add_item(tns_tree, hf_tns_length, NullTVB, + proto_tree_add_uint(tns_tree, hf_tns_length, NullTVB, offset, 2, length); } TRUNC(length); @@ -238,7 +238,7 @@ dissect_tns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) TRUNC(2); if ( tree ) { - proto_tree_add_item(tns_tree, hf_tns_packet_checksum, NullTVB, + proto_tree_add_uint(tns_tree, hf_tns_packet_checksum, NullTVB, offset, 2, pntohs(&pd[offset])); } offset += 2; @@ -247,7 +247,7 @@ dissect_tns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) type = pd[offset]; if ( tree ) { - proto_tree_add_item(tns_tree, hf_tns_packet_type, NullTVB, + proto_tree_add_uint(tns_tree, hf_tns_packet_type, NullTVB, offset, 1, type); } offset += 1; @@ -261,7 +261,7 @@ dissect_tns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) TRUNC(1); if ( tree ) { - proto_tree_add_item(tns_tree, hf_tns_reserved_byte, NullTVB, + proto_tree_add_bytes(tns_tree, hf_tns_reserved_byte, NullTVB, offset, 1, &pd[offset]); } offset += 1; @@ -269,7 +269,7 @@ dissect_tns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) TRUNC(2); if ( tree ) { - proto_tree_add_item(tns_tree, hf_tns_header_checksum, NullTVB, + proto_tree_add_uint(tns_tree, hf_tns_header_checksum, NullTVB, offset, 2, pntohs(&pd[offset])); } offset += 2; |