diff options
Diffstat (limited to 'epan/dissectors/packet-hci_usb.c')
-rw-r--r-- | epan/dissectors/packet-hci_usb.c | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/epan/dissectors/packet-hci_usb.c b/epan/dissectors/packet-hci_usb.c index 799070b8d8..2b25560ab9 100644 --- a/epan/dissectors/packet-hci_usb.c +++ b/epan/dissectors/packet-hci_usb.c @@ -15,34 +15,34 @@ #include <epan/packet.h> #include <epan/prefs.h> #include <epan/reassemble.h> -#include <wiretap/wtap.h> #include "packet-bluetooth.h" - -static int proto_hci_usb = -1; -static int hf_bthci_usb_data = -1; -static int hf_bthci_usb_packet_fragment = -1; -static int hf_bthci_usb_packet_complete = -1; -static int hf_bthci_usb_packet_unknown_fragment = -1; -static int hf_bthci_usb_setup_request = -1; -static int hf_bthci_usb_setup_value = -1; -static int hf_bthci_usb_setup_adapter_id = -1; -static int hf_bthci_usb_setup_length = -1; - -static gint ett_hci_usb = -1; -static gint ett_hci_usb_msg_fragment = -1; -static gint ett_hci_usb_msg_fragments = -1; - -static int hf_msg_fragments = -1; -static int hf_msg_fragment = -1; -static int hf_msg_fragment_overlap = -1; -static int hf_msg_fragment_overlap_conflicts = -1; -static int hf_msg_fragment_multiple_tails = -1; -static int hf_msg_fragment_too_long_fragment = -1; -static int hf_msg_fragment_error = -1; -static int hf_msg_fragment_count = -1; -static int hf_msg_reassembled_in = -1; -static int hf_msg_reassembled_length = -1; +#include "packet-usb.h" + +static int proto_hci_usb; +static int hf_bthci_usb_data; +static int hf_bthci_usb_packet_fragment; +static int hf_bthci_usb_packet_complete; +static int hf_bthci_usb_packet_unknown_fragment; +static int hf_bthci_usb_setup_request; +static int hf_bthci_usb_setup_value; +static int hf_bthci_usb_setup_adapter_id; +static int hf_bthci_usb_setup_length; + +static gint ett_hci_usb; +static gint ett_hci_usb_msg_fragment; +static gint ett_hci_usb_msg_fragments; + +static int hf_msg_fragments; +static int hf_msg_fragment; +static int hf_msg_fragment_overlap; +static int hf_msg_fragment_overlap_conflicts; +static int hf_msg_fragment_multiple_tails; +static int hf_msg_fragment_too_long_fragment; +static int hf_msg_fragment_error; +static int hf_msg_fragment_count; +static int hf_msg_reassembled_in; +static int hf_msg_reassembled_length; static wmem_tree_t *fragment_info_table = NULL; @@ -158,10 +158,10 @@ dissect_hci_usb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) bluetooth_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 */ - bluetooth_data->adapter_disconnect_in_frame = &max_disconnect_in_frame; + bluetooth_data->adapter_disconnect_in_frame = &bluetooth_max_disconnect_in_frame; next_tvb = tvb_new_subset_remaining(tvb, offset); - if (!pinfo->fd->visited && usb_conv_info->endpoint <= 0x02 && + if (!pinfo->fd->visited && usb_conv_info->transfer_type != URB_ISOCHRONOUS && tvb_captured_length(tvb) == tvb_reported_length(tvb)) { fragment_info_t *fragment_info; @@ -175,15 +175,15 @@ dissect_hci_usb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) } if (fragment_info->fragment_id == 0) { - switch(usb_conv_info->endpoint) + switch(usb_conv_info->transfer_type) { - case 0: + case URB_CONTROL: fragment_info->remaining_length = tvb_get_guint8(tvb, offset + 2) + 3; break; - case 1: + case URB_INTERRUPT: fragment_info->remaining_length = tvb_get_guint8(tvb, offset + 1) + 2; break; - case 2: + case URB_BULK: fragment_info->remaining_length = tvb_get_letohs(tvb, offset + 2) + 4; break; } @@ -217,15 +217,15 @@ dissect_hci_usb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) NULL, ttree); } - switch(usb_conv_info->endpoint) + switch(usb_conv_info->transfer_type) { - case 0: + case URB_CONTROL: call_dissector_with_data(bthci_cmd_handle, next_tvb, pinfo, tree, bluetooth_data); break; - case 1: + case URB_INTERRUPT: call_dissector_with_data(bthci_evt_handle, next_tvb, pinfo, tree, bluetooth_data); break; - case 2: + case URB_BULK: call_dissector_with_data(bthci_acl_handle, next_tvb, pinfo, tree, bluetooth_data); break; } @@ -234,9 +234,9 @@ dissect_hci_usb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) proto_item_set_generated(pitem); } - if (usb_conv_info->endpoint == 0x03) { + if (usb_conv_info->transfer_type == URB_ISOCHRONOUS) { call_dissector_with_data(bthci_sco_handle, next_tvb, pinfo, tree, bluetooth_data); - } else if (usb_conv_info->endpoint > 0x03) { + } else if (usb_conv_info->transfer_type == URB_UNKNOWN) { proto_tree_add_item(ttree, hf_bthci_usb_data, tvb, offset, -1, ENC_NA); } |