forked from osmocom/wireshark
MBIM data is transferred over CDC-Data interface class. Remove useless code.
svn path=/trunk/; revision=52436
This commit is contained in:
parent
65f5c9a609
commit
f9da278d6c
|
@ -40,6 +40,7 @@
|
|||
#include "packet-gsm_a_common.h"
|
||||
#include "packet-gsm_map.h"
|
||||
#include "packet-gsm_sms.h"
|
||||
#include "packet-usb.h"
|
||||
|
||||
void proto_reg_handoff_mbim(void);
|
||||
|
||||
|
@ -4513,6 +4514,15 @@ dissect_mbim_bulk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
|
|||
static gboolean
|
||||
dissect_mbim_bulk_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
|
||||
{
|
||||
usb_conv_info_t *usb_conv_info;
|
||||
|
||||
usb_conv_info = (usb_conv_info_t *)pinfo->usb_conv_info;
|
||||
if (usb_conv_info &&
|
||||
(usb_conv_info->interfaceClass != IF_CLASS_CDC_DATA) &&
|
||||
(usb_conv_info->interfaceClass != IF_CLASS_UNKNOWN)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (dissect_mbim_bulk(tvb, pinfo, tree, data)) {
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -35,14 +35,11 @@ static int hf_usb_com_descriptor_cdc = -1;
|
|||
static int hf_usb_com_descriptor_payload = -1;
|
||||
static int hf_usb_com_control_subclass = -1;
|
||||
static int hf_usb_com_control_payload = -1;
|
||||
static int hf_usb_com_bulk_subclass = -1;
|
||||
static int hf_usb_com_bulk_payload = -1;
|
||||
|
||||
static gint ett_usb_com = -1;
|
||||
|
||||
static dissector_handle_t mbim_control_handle;
|
||||
static dissector_handle_t mbim_descriptor_handle;
|
||||
static dissector_handle_t mbim_bulk_handle;
|
||||
|
||||
#define CS_INTERFACE 0x24
|
||||
#define CS_ENDPOINT 0x25
|
||||
|
@ -200,43 +197,6 @@ dissect_usb_com_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
|
|||
return tvb_length(tvb);
|
||||
}
|
||||
|
||||
static int
|
||||
dissect_usb_com_bulk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
|
||||
{
|
||||
usb_conv_info_t *usb_conv_info;
|
||||
proto_tree *subtree;
|
||||
proto_item *ti;
|
||||
gint offset = 0;
|
||||
|
||||
usb_conv_info = (usb_conv_info_t *)pinfo->usb_conv_info;
|
||||
|
||||
col_set_str(pinfo->cinfo, COL_PROTOCOL, "USBCOM");
|
||||
|
||||
ti = proto_tree_add_item(tree, proto_usb_com, tvb, 0, -1, ENC_NA);
|
||||
subtree = proto_item_add_subtree(ti, ett_usb_com);
|
||||
|
||||
if (usb_conv_info) {
|
||||
ti = proto_tree_add_uint(subtree, hf_usb_com_bulk_subclass, tvb, 0, 0,
|
||||
usb_conv_info->interfaceSubclass);
|
||||
PROTO_ITEM_SET_GENERATED(ti);
|
||||
|
||||
switch (usb_conv_info->interfaceSubclass)
|
||||
{
|
||||
case COM_SUBCLASS_NCM:
|
||||
case COM_SUBCLASS_MBIM:
|
||||
offset = call_dissector_only(mbim_bulk_handle, tvb, pinfo, tree, NULL);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (tvb_reported_length_remaining(tvb, offset) != 0) {
|
||||
proto_tree_add_item(subtree, hf_usb_com_bulk_payload, tvb, offset, -1, ENC_NA);
|
||||
}
|
||||
return tvb_length(tvb);
|
||||
}
|
||||
|
||||
void
|
||||
proto_register_usb_com(void)
|
||||
{
|
||||
|
@ -255,12 +215,6 @@ proto_register_usb_com(void)
|
|||
VALS(usb_com_subclass_vals), 0, NULL, HFILL }},
|
||||
{ &hf_usb_com_control_payload,
|
||||
{ "Payload", "usbcom.control.payload", FT_BYTES, BASE_NONE,
|
||||
NULL, 0, NULL, HFILL }},
|
||||
{ &hf_usb_com_bulk_subclass,
|
||||
{ "Subclass", "usbcom.bulk.subclass", FT_UINT8, BASE_HEX,
|
||||
VALS(usb_com_subclass_vals), 0, NULL, HFILL }},
|
||||
{ &hf_usb_com_bulk_payload,
|
||||
{ "Payload", "usbcom.bulk.payload", FT_BYTES, BASE_NONE,
|
||||
NULL, 0, NULL, HFILL }}
|
||||
};
|
||||
|
||||
|
@ -276,17 +230,14 @@ proto_register_usb_com(void)
|
|||
void
|
||||
proto_reg_handoff_usb_com(void)
|
||||
{
|
||||
dissector_handle_t usb_com_descriptor_handle, usb_com_control_handle, usb_com_bulk_handle;
|
||||
dissector_handle_t usb_com_descriptor_handle, usb_com_control_handle;
|
||||
|
||||
usb_com_descriptor_handle = new_create_dissector_handle(dissect_usb_com_descriptor, proto_usb_com);
|
||||
dissector_add_uint("usb.descriptor", IF_CLASS_COMMUNICATIONS, usb_com_descriptor_handle);
|
||||
usb_com_control_handle = new_create_dissector_handle(dissect_usb_com_control, proto_usb_com);
|
||||
dissector_add_uint("usb.control", IF_CLASS_COMMUNICATIONS, usb_com_control_handle);
|
||||
usb_com_bulk_handle = new_create_dissector_handle(dissect_usb_com_bulk, proto_usb_com);
|
||||
dissector_add_uint("usb.bulk", IF_CLASS_COMMUNICATIONS, usb_com_bulk_handle);
|
||||
mbim_control_handle = find_dissector("mbim.control");
|
||||
mbim_descriptor_handle = find_dissector("mbim.descriptor");
|
||||
mbim_bulk_handle = find_dissector("mbim.bulk");
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue