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-bluetooth.h | |
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-bluetooth.h')
-rw-r--r-- | epan/dissectors/packet-bluetooth.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/epan/dissectors/packet-bluetooth.h b/epan/dissectors/packet-bluetooth.h index b072173140..8de7980a5c 100644 --- a/epan/dissectors/packet-bluetooth.h +++ b/epan/dissectors/packet-bluetooth.h @@ -86,6 +86,14 @@ extern const value_string bluetooth_address_type_vals[]; #define HCI_INTERFACE_DEFAULT 0 #define HCI_ADAPTER_DEFAULT 0 +typedef enum { + BT_PD_NONE, /* no protocol data */ + BT_PD_BTHCI, /* struct bthci_phdr * */ + BT_PD_BTMON, /* struct btmon_phdr * */ + BT_PD_USB_CONV_INFO, /* usb_conv_info_t * */ + BT_PD_UBERTOOTH_DATA /* ubertooth_data_t * */ +} bt_protocol_data_type; + /* chandle_sessions: interface_id + adapter_id + connection_handle + frame_number -> connect_in_frame, disconnect_in_frame */ /* chandle_to_bdaddr: interface_id + adapter_id + connection_handle + frame_number -> bd_addr[6] */ /* chandle_to_mode: interface_id + adapter_id + connection_handle + frame_number -> mode */ @@ -106,8 +114,11 @@ typedef struct _bluetooth_data_t { wmem_tree_t *localhost_name; wmem_tree_t *hci_vendors; + bt_protocol_data_type previous_protocol_data_type; union { - void *data; + void *none; + struct bthci_phdr *bthci; + struct btmon_phdr *btmon; usb_conv_info_t *usb_conv_info; ubertooth_data_t *ubertooth_data; } previous_protocol_data; |