diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-06-15 20:23:24 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-06-16 03:23:51 +0000 |
commit | 68e65021e07914e9be40776ac6cc0b5bc416a718 (patch) | |
tree | 1702ea1aa07b91a15e98a896c81bc68dddffe053 /epan/dissectors/packet-btle.c | |
parent | 60ab49592b58075d54db68353c60c8cfb2409b31 (diff) |
Clean up handling of metadata in Bluetooth dissectors.
Make the "previous protocol data" union in bluetooth_data_t a
discriminated union, and use the discriminator to decide whether to use
a given member of the union or not (or to check whether the member you
plan to use is valid).
Have separate top-level dissectors depending on what the data type
pointed to by the "data" argument is.
Use that member to point to pseudo-header metadata, and, for now, set it
to point to the appropriate pinfo->pseudo_header value; eventually, we
plan to pass the pseudo-header pointer in as the "data" argument from
the "frame" dissector.
Don't overwrite the pseudo-header in the packetlogger dissector -
construct a new one and pass it in.
Change-Id: Ia1ef71e7082a964c5d92d47221f8c00e32f3f087
Reviewed-on: https://code.wireshark.org/review/8943
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-btle.c')
-rw-r--r-- | epan/dissectors/packet-btle.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/epan/dissectors/packet-btle.c b/epan/dissectors/packet-btle.c index 08eaed3739..641f6df742 100644 --- a/epan/dissectors/packet-btle.c +++ b/epan/dissectors/packet-btle.c @@ -38,7 +38,6 @@ static int proto_btle = -1; static int proto_btle_rf = -1; -static int proto_ubertooth = -1; static int hf_access_address = -1; static int hf_crc = -1; @@ -346,7 +345,7 @@ dissect_btle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) } list_data = wmem_list_frame_prev(list_data); - if (bluetooth_data && list_data && proto_ubertooth == GPOINTER_TO_INT(wmem_list_frame_data(list_data))) { + if (bluetooth_data && bluetooth_data->previous_protocol_data_type == BT_PD_UBERTOOTH_DATA) { ubertooth_data = bluetooth_data->previous_protocol_data.ubertooth_data; } } @@ -1396,7 +1395,6 @@ proto_reg_handoff_btle(void) btl2cap_handle = find_dissector("btl2cap"); proto_btle_rf = proto_get_id_by_filter_name("btle_rf"); - proto_ubertooth = proto_get_id_by_filter_name("ubertooth"); dissector_add_uint("bluetooth.encap", WTAP_ENCAP_BLUETOOTH_LE_LL, btle_handle); } |