aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-btmesh.c
diff options
context:
space:
mode:
authorPedro Malagon <malagon@die.upm.es>2019-10-16 12:46:02 +0200
committerAnders Broman <a.broman58@gmail.com>2019-10-18 03:44:22 +0000
commiteab718e8d051a5e4fd0cd2bf594a621b2a417ae4 (patch)
treeb14d17d112062f0b53df53b4e0e67cb73da92396 /epan/dissectors/packet-btmesh.c
parent7c49d99aca887dfde43a6d2cc2da44d9a8723c4d (diff)
BTMesh: Add support for manufacturer-specific opcodes
Access Layer: add support for manufacturer-specific opcodes (customizable) of 3-octets when bits 7 and 6 of the first opcode octet are set, as specified in Table 3.43: Opcode formats of document Mesh Profile v1.0.1, Bluetooth Specification Change-Id: I3edf8f86bf58d28f15cc2a8f72618cc577a75a44 Reviewed-on: https://code.wireshark.org/review/34787 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-btmesh.c')
-rw-r--r--epan/dissectors/packet-btmesh.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/epan/dissectors/packet-btmesh.c b/epan/dissectors/packet-btmesh.c
index a0abc1fa0f..06a11e351c 100644
--- a/epan/dissectors/packet-btmesh.c
+++ b/epan/dissectors/packet-btmesh.c
@@ -122,6 +122,7 @@
void proto_register_btmesh(void);
static int proto_btmesh = -1;
+static dissector_table_t btmesh_model_vendor_dissector_table;
/*-------------------------------------
* UAT for BT Mesh
@@ -1859,7 +1860,9 @@ static void
dissect_btmesh_model_layer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
{
proto_tree *sub_tree;
+ tvbuff_t *payload_tvb;
guint32 opcode;
+ guint16 vendor;
proto_item *netapp_index_item, *app_index_item, *pub_app_index_item, *net_index_item;
proto_item *relayretransmit_index, *transmit_index;
proto_item *publishperiod_item, *publishretransmit_item;
@@ -1882,9 +1885,11 @@ dissect_btmesh_model_layer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (opcode & 0x40) {
/* Vendor opcode */
proto_tree_add_item(sub_tree, hf_btmesh_model_layer_vendor_opcode, tvb, offset, 1, ENC_NA);
- offset++;
- proto_tree_add_item(sub_tree, hf_btmesh_model_layer_vendor, tvb, offset, 2, ENC_NA);
- offset+=2;
+ vendor = tvb_get_guint16(tvb, offset+1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(sub_tree, hf_btmesh_model_layer_vendor, tvb, offset+1, 2, ENC_NA);
+ payload_tvb = tvb_new_subset_remaining(tvb, offset);
+ dissector_try_uint_new(btmesh_model_vendor_dissector_table, vendor, payload_tvb, pinfo, tree, TRUE, GUINT_TO_POINTER(vendor));
+ offset+=3;
} else {
/* Two octet opcode */
proto_tree_add_item_ret_uint(sub_tree, hf_btmesh_model_layer_opcode, tvb, offset, 2, ENC_NA, &opcode);
@@ -5822,6 +5827,8 @@ proto_register_btmesh(void)
"Configured Mesh Label UUIDs",
btmesh_label_uuid_uat);
+ btmesh_model_vendor_dissector_table = register_dissector_table("btmesh.model.vendor", "BT Mesh model vendor", proto_btmesh, FT_UINT16, BASE_DEC);
+
register_dissector("btmesh.msg", dissect_btmesh_msg, proto_btmesh);
register_init_routine(&upper_transport_init_routine);