aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-btle.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2016-12-19 15:40:59 +0100
committerStig Bjørlykke <stig@bjorlykke.org>2016-12-20 07:48:40 +0000
commit87a9a2989bf5f004473fb415625fe465f2d4eaad (patch)
treebc5fd45701a3018e0d420c5db5870ca4fc9e9af7 /epan/dissectors/packet-btle.c
parent1656261b955503b8d246029d3c6aa0f42fe204bf (diff)
btle: Add a convenience btle.length field
Add a convenience btle.length field for easier filtering of BTLE packets without data and with specific length ranges. Change-Id: If56eac9c86ccf40741a6ceb50d13a1733132f448 Reviewed-on: https://code.wireshark.org/review/19348 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michal Labedzki <michal.tomasz.labedzki@gmail.com> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'epan/dissectors/packet-btle.c')
-rw-r--r--epan/dissectors/packet-btle.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/epan/dissectors/packet-btle.c b/epan/dissectors/packet-btle.c
index cda6b8880f..1b933dcc15 100644
--- a/epan/dissectors/packet-btle.c
+++ b/epan/dissectors/packet-btle.c
@@ -47,6 +47,7 @@ static int hf_access_address = -1;
static int hf_crc = -1;
static int hf_master_bd_addr = -1;
static int hf_slave_bd_addr = -1;
+static int hf_length = -1;
static int hf_advertising_header = -1;
static int hf_advertising_header_pdu_type = -1;
static int hf_advertising_header_rfu_1 = -1;
@@ -514,6 +515,8 @@ dissect_btle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_tree_add_item(advertising_header_tree, hf_advertising_header_rfu_2, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(advertising_header_tree, hf_advertising_header_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
+ item = proto_tree_add_uint(btle_tree, hf_length, tvb, offset, 1, tvb_get_guint8(tvb, offset) & 0x3F);
+ PROTO_ITEM_SET_HIDDEN(item);
length = tvb_get_guint8(tvb, offset) & 0x3f;
offset += 1;
@@ -857,6 +860,8 @@ dissect_btle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_tree_add_item(data_header_tree, hf_data_header_rfu, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(data_header_tree, hf_data_header_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
+ item = proto_tree_add_uint(btle_tree, hf_length, tvb, offset, 1, tvb_get_guint8(tvb, offset) & 0x1F);
+ PROTO_ITEM_SET_HIDDEN(item);
length = tvb_get_guint8(tvb, offset) & 0x1f;
offset += 1;
@@ -1237,6 +1242,11 @@ proto_register_btle(void)
FT_ETHER, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
+ { &hf_length,
+ { "Length", "btle.length",
+ FT_UINT8, BASE_DEC, NULL, 0x0,
+ NULL, HFILL }
+ },
{ &hf_advertising_header,
{ "Packet Header", "btle.advertising_header",
FT_UINT16, BASE_HEX, NULL, 0x0,