diff options
author | Michal Labedzki <michal.labedzki@tieto.com> | 2014-06-02 17:05:31 +0200 |
---|---|---|
committer | Michal Labedzki <michal.labedzki@tieto.com> | 2014-06-22 16:56:31 +0000 |
commit | 164af0050dd070109f4aaa5fdd3f23b41ebaa98d (patch) | |
tree | 9420e78e5c3bc815dccac097b812438841621bc3 /epan/dissectors/packet-hci_usb.c | |
parent | 58bbfa5ee3c3e0beaf16585735261d77bfd8dd79 (diff) |
Bluetooth: Complete sessions
Some interfaces support multiple Bluetooth adapters with events like
add/remove. We must support that to distinquish adapters streams
in case that new adapter has the same id that old one.
Next one is create session for "Connection Handle", so
next layer will now when it is connected and disconnected.
This is also used to distinguish streams.
Change-Id: I9e062c8e4cc9c033b75f1a596e8351a215169843
Reviewed-on: https://code.wireshark.org/review/2548
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Diffstat (limited to 'epan/dissectors/packet-hci_usb.c')
-rw-r--r-- | epan/dissectors/packet-hci_usb.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/epan/dissectors/packet-hci_usb.c b/epan/dissectors/packet-hci_usb.c index b2789ed1ee..d3b2cd7902 100644 --- a/epan/dissectors/packet-hci_usb.c +++ b/epan/dissectors/packet-hci_usb.c @@ -58,6 +58,7 @@ static int hf_msg_fragment_count = -1; static int hf_msg_reassembled_in = -1; static int hf_msg_reassembled_length = -1; +static wmem_tree_t *chandle_sessions = NULL; static wmem_tree_t *chandle_to_bdaddr_table = NULL; static wmem_tree_t *bdaddr_to_name_table = NULL; static wmem_tree_t *localhost_name = NULL; @@ -108,6 +109,8 @@ static const value_string request_vals[] = { }; static value_string_ext(request_vals_ext) = VALUE_STRING_EXT_INIT(request_vals); +static guint32 max_disconnect_in_frame = G_MAXUINT32; + void proto_register_hci_usb(void); void proto_reg_handoff_hci_usb(void); @@ -176,6 +179,9 @@ dissect_hci_usb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) else hci_data->interface_id = HCI_INTERFACE_DEFAULT; hci_data->adapter_id = usb_conv_info->bus_id << 8 | usb_conv_info->device_address; +/* TODO: adapter disconnect on some USB action, for now do not support adapter disconnection */ + hci_data->adapter_disconnect_in_frame = &max_disconnect_in_frame; + hci_data->chandle_sessions = chandle_sessions; hci_data->chandle_to_bdaddr_table = chandle_to_bdaddr_table; hci_data->bdaddr_to_name_table = bdaddr_to_name_table; hci_data->localhost_bdaddr = localhost_bdaddr; @@ -376,6 +382,7 @@ proto_register_hci_usb(void) &addresses_reassembly_table_functions); fragment_info_table = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); + chandle_sessions = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); chandle_to_bdaddr_table = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); /* adapter, chandle: bdaddr */ bdaddr_to_name_table = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); /* bdaddr: name */ localhost_bdaddr = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); /* adapter, frame: bdaddr */ |