aboutsummaryrefslogtreecommitdiffstats
path: root/packet-llc.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-05-31 05:09:07 +0000
committerGuy Harris <guy@alum.mit.edu>2000-05-31 05:09:07 +0000
commit283ce59938ad2be252a6232e40a958e177a40e1a (patch)
treeb451d4a712d9b914022ba872296e70e55b8d9bc5 /packet-llc.c
parentaa553f63ecc7b9e310a05b743502c50f6dffb800 (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-llc.c')
-rw-r--r--packet-llc.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/packet-llc.c b/packet-llc.c
index b18544c68d..1f060a9b7d 100644
--- a/packet-llc.c
+++ b/packet-llc.c
@@ -2,7 +2,7 @@
* Routines for IEEE 802.2 LLC layer
* Gilbert Ramirez <gram@xiexie.org>
*
- * $Id: packet-llc.c,v 1.64 2000/05/31 03:58:54 gram Exp $
+ * $Id: packet-llc.c,v 1.65 2000/05/31 05:07:17 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -286,20 +286,20 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dsap = tvb_get_guint8(tvb, 0);
if (tree) {
- ti = proto_tree_add_item(tree, proto_llc, tvb, 0, 0, NULL);
+ ti = proto_tree_add_item(tree, proto_llc, tvb, 0, 0, FALSE);
llc_tree = proto_item_add_subtree(ti, ett_llc);
- proto_tree_add_item(llc_tree, hf_llc_dsap, tvb, 0,
+ proto_tree_add_uint(llc_tree, hf_llc_dsap, tvb, 0,
1, dsap & SAP_MASK);
- proto_tree_add_item(llc_tree, hf_llc_dsap_ig, tvb, 0,
+ proto_tree_add_boolean(llc_tree, hf_llc_dsap_ig, tvb, 0,
1, dsap & DSAP_GI_BIT);
} else
llc_tree = NULL;
ssap = tvb_get_guint8(tvb, 1);
if (tree) {
- proto_tree_add_item(llc_tree, hf_llc_ssap, tvb, 1,
+ proto_tree_add_uint(llc_tree, hf_llc_ssap, tvb, 1,
1, ssap & SAP_MASK);
- proto_tree_add_item(llc_tree, hf_llc_ssap_cr, tvb, 1,
+ proto_tree_add_boolean(llc_tree, hf_llc_ssap_cr, tvb, 1,
1, ssap & SSAP_CR_BIT);
} else
llc_tree = NULL;
@@ -315,7 +315,7 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
*/
control = dissect_xdlc_control(tvb, 2, pinfo, llc_tree,
hf_llc_ctrl, ett_llc_ctrl,
- tvb_get_guint8(tvb, 1) & SSAP_CR_BIT, TRUE);
+ ssap & SSAP_CR_BIT, TRUE);
llc_header_len += XDLC_CONTROL_LEN(control, TRUE);
if (is_snap)
llc_header_len += 5; /* 3 bytes of OUI, 2 bytes of protocol ID */
@@ -338,7 +338,7 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
etype);
}
if (tree) {
- proto_tree_add_item(llc_tree, hf_llc_oui, tvb, 3, 3,
+ proto_tree_add_uint(llc_tree, hf_llc_oui, tvb, 3, 3,
oui);
}
@@ -370,7 +370,7 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
are some of them raw or encapsulated
Ethernet? */
if (tree) {
- proto_tree_add_item(llc_tree,
+ proto_tree_add_uint(llc_tree,
hf_llc_pid, tvb, 6, 2, etype);
}
if (XDLC_IS_INFORMATION(control)) {
@@ -404,7 +404,7 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case OUI_CABLE_BPDU: /* DOCSIS cable modem spanning tree BPDU */
if (tree) {
- proto_tree_add_item(llc_tree,
+ proto_tree_add_uint(llc_tree,
hf_llc_pid, tvb, 6, 2, etype);
}
dissect_bpdu(pd, offset, pinfo->fd, tree);
@@ -412,7 +412,7 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
default:
if (tree) {
- proto_tree_add_item(llc_tree,
+ proto_tree_add_uint(llc_tree,
hf_llc_pid, tvb, 6, 2, etype);
}
dissect_data_tvb(next_tvb, pinfo, tree);