aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-radiotap.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2011-05-20 02:42:14 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2011-05-20 02:42:14 +0000
commitda8ec2c2d6261abf260befd97976d4ff48bbaecf (patch)
tree527ad29db1247356551d331cd24f4dd97a7cd281 /epan/dissectors/packet-radiotap.c
parent4b7cc99d00056e1e7b8cbdc0b54d7e751e2d3c65 (diff)
Use proto_tree_add_item() instead of proto_tree_add_xxx() with a pointer into
the TVB. Introduce and start using tvb_get_manuf_name() and tvb_get_manuf_name_if_known() which do the same as the non-tvb versions but take a tvb and an offset instead of (commonly) a pointer into a TVB. svn path=/trunk/; revision=37317
Diffstat (limited to 'epan/dissectors/packet-radiotap.c')
-rw-r--r--epan/dissectors/packet-radiotap.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/epan/dissectors/packet-radiotap.c b/epan/dissectors/packet-radiotap.c
index e21a7e7d21..57252213b9 100644
--- a/epan/dissectors/packet-radiotap.c
+++ b/epan/dissectors/packet-radiotap.c
@@ -1516,26 +1516,23 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
if (iter.this_arg_index == IEEE80211_RADIOTAP_VENDOR_NAMESPACE
&& tree) {
proto_tree *vt, *ven_tree = NULL;
- const guint8 *data_ptr;
const gchar *manuf_name;
guint8 subns;
- data_ptr = tvb_get_ptr(tvb, offset, 4);
- manuf_name = get_manuf_name(data_ptr);
- subns = data_ptr[3];
+ manuf_name = tvb_get_manuf_name(tvb, offset);
+ subns = tvb_get_guint8(tvb, offset+3);
vt = proto_tree_add_bytes_format(radiotap_tree,
hf_radiotap_vendor_ns,
tvb, offset,
iter.this_arg_size,
- data_ptr,
+ NULL,
"Vendor namespace: %s-%d",
manuf_name, subns);
- ven_tree =
- proto_item_add_subtree(vt, ett_radiotap_vendor);
+ ven_tree = proto_item_add_subtree(vt, ett_radiotap_vendor);
proto_tree_add_bytes_format(ven_tree,
hf_radiotap_ven_oui, tvb,
- offset, 3, data_ptr,
+ offset, 3, NULL,
"Vendor: %s", manuf_name);
proto_tree_add_item(ven_tree, hf_radiotap_ven_subns,
tvb, offset + 3, 1, FALSE);