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-h1.c | |
parent | aa553f63ecc7b9e310a05b743502c50f6dffb800 (diff) | |
download | wireshark-283ce59938ad2be252a6232e40a958e177a40e1a.tar.gz wireshark-283ce59938ad2be252a6232e40a958e177a40e1a.tar.bz2 wireshark-283ce59938ad2be252a6232e40a958e177a40e1a.zip |
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-h1.c')
-rw-r--r-- | packet-h1.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/packet-h1.c b/packet-h1.c index f42eef18d7..eb4f79438e 100644 --- a/packet-h1.c +++ b/packet-h1.c @@ -2,7 +2,7 @@ * Routines for Sinec H1 packet disassembly * Gerrit Gehnen <G.Gehnen@atrie.de> * - * $Id: packet-h1.c,v 1.8 2000/05/11 08:15:09 gram Exp $ + * $Id: packet-h1.c,v 1.9 2000/05/31 05:07:05 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -122,11 +122,11 @@ dissect_h1 (const u_char * pd, int offset, frame_data * fd, proto_tree * tree) col_add_str (fd, COL_INFO, "S5: "); if (tree) { - ti = proto_tree_add_item (tree, proto_h1, NullTVB, offset, 16, NULL); + ti = proto_tree_add_item (tree, proto_h1, NullTVB, offset, 16, FALSE); h1_tree = proto_item_add_subtree (ti, ett_h1); - proto_tree_add_item (h1_tree, hf_h1_header, NullTVB, offset, 2, + proto_tree_add_uint (h1_tree, hf_h1_header, NullTVB, offset, 2, pd[offset] * 0x100 + pd[offset + 1]); - proto_tree_add_item (h1_tree, hf_h1_len, NullTVB, offset + 2, 1, + proto_tree_add_uint (h1_tree, hf_h1_len, NullTVB, offset + 2, 1, pd[offset + 2]); } @@ -137,15 +137,15 @@ dissect_h1 (const u_char * pd, int offset, frame_data * fd, proto_tree * tree) case OPCODE_BLOCK: if (h1_tree) { - ti = proto_tree_add_item (h1_tree, hf_h1_opfield, NullTVB, + ti = proto_tree_add_uint (h1_tree, hf_h1_opfield, NullTVB, offset + position, pd[offset + position + 1], pd[offset + position]); opcode_tree = proto_item_add_subtree (ti, ett_opcode); - proto_tree_add_item (opcode_tree, hf_h1_oplen, NullTVB, + proto_tree_add_uint (opcode_tree, hf_h1_oplen, NullTVB, offset + position + 1, 1, pd[offset + position + 1]); - proto_tree_add_item (opcode_tree, hf_h1_opcode, NullTVB, + proto_tree_add_uint (opcode_tree, hf_h1_opcode, NullTVB, offset + position + 2, 1, pd[offset + position + 2]); } @@ -159,25 +159,25 @@ dissect_h1 (const u_char * pd, int offset, frame_data * fd, proto_tree * tree) case REQUEST_BLOCK: if (h1_tree) { - ti = proto_tree_add_item (h1_tree, hf_h1_requestblock, NullTVB, + ti = proto_tree_add_uint (h1_tree, hf_h1_requestblock, NullTVB, offset + position, pd[offset + position + 1], pd[offset + position]); org_tree = proto_item_add_subtree (ti, ett_org); - proto_tree_add_item (org_tree, hf_h1_requestlen, NullTVB, + proto_tree_add_uint (org_tree, hf_h1_requestlen, NullTVB, offset + position + 1, 1, pd[offset + position + 1]); - proto_tree_add_item (org_tree, hf_h1_org, NullTVB, + proto_tree_add_uint (org_tree, hf_h1_org, NullTVB, offset + position + 2, 1, pd[offset + position + 2]); - proto_tree_add_item (org_tree, hf_h1_dbnr, NullTVB, + proto_tree_add_uint (org_tree, hf_h1_dbnr, NullTVB, offset + position + 3, 1, pd[offset + position + 3]); - proto_tree_add_item (org_tree, hf_h1_dwnr, NullTVB, + proto_tree_add_uint (org_tree, hf_h1_dwnr, NullTVB, offset + position + 4, 2, pd[offset + position + 4] * 0x100 + pd[offset + position + 5]); - proto_tree_add_item (org_tree, hf_h1_dlen, NullTVB, + proto_tree_add_int (org_tree, hf_h1_dlen, NullTVB, offset + position + 6, 2, pd[offset + position + 6] * 0x100 + pd[offset + position + 7]); @@ -199,15 +199,15 @@ dissect_h1 (const u_char * pd, int offset, frame_data * fd, proto_tree * tree) case RESPONSE_BLOCK: if (h1_tree) { - ti = proto_tree_add_item (h1_tree, hf_h1_response, NullTVB, + ti = proto_tree_add_uint (h1_tree, hf_h1_response, NullTVB, offset + position, pd[offset + position + 1], pd[offset + position]); response_tree = proto_item_add_subtree (ti, ett_response); - proto_tree_add_item (response_tree, hf_h1_response_len, NullTVB, + proto_tree_add_uint (response_tree, hf_h1_response_len, NullTVB, offset + position + 1, 1, pd[offset + position + 1]); - proto_tree_add_item (response_tree, hf_h1_response_value, NullTVB, + proto_tree_add_uint (response_tree, hf_h1_response_value, NullTVB, offset + position + 2, 1, pd[offset + position + 2]); } @@ -221,13 +221,13 @@ dissect_h1 (const u_char * pd, int offset, frame_data * fd, proto_tree * tree) case EMPTY_BLOCK: if (h1_tree) { - ti = proto_tree_add_item (h1_tree, hf_h1_empty, NullTVB, + ti = proto_tree_add_uint (h1_tree, hf_h1_empty, NullTVB, offset + position, pd[offset + position + 1], pd[offset + position]); empty_tree = proto_item_add_subtree (ti, ett_empty); - proto_tree_add_item (empty_tree, hf_h1_empty_len, NullTVB, + proto_tree_add_uint (empty_tree, hf_h1_empty_len, NullTVB, offset + position + 1, 1, pd[offset + position + 1]); } |