aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2014-04-06 21:25:04 +0200
committerMartin Kaiser <wireshark@kaiser.cx>2014-04-08 15:03:08 +0000
commitab145d205750391bee6681f9ceff8c60eaec0293 (patch)
treec9ccaffe8afa933b646fe64846b557a6682edd82 /epan
parentdfd3680ae78fda0a50438830f6eb3e0a4b282ee6 (diff)
reformat the nested switch-case part
Change-Id: Idd98825cbbc6bcc27823afac26b1997182e994cd Reviewed-on: https://code.wireshark.org/review/1011 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-usb.c79
1 files changed, 39 insertions, 40 deletions
diff --git a/epan/dissectors/packet-usb.c b/epan/dissectors/packet-usb.c
index 9878343199..bd54965dac 100644
--- a/epan/dissectors/packet-usb.c
+++ b/epan/dissectors/packet-usb.c
@@ -2940,54 +2940,53 @@ dissect_usb_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent,
}
switch (type_2) {
-
- case RQT_SETUP_TYPE_STANDARD:
- /*
- * This is a standard request which is managed by this
- * dissector
- */
- proto_tree_add_item(setup_tree, hf_usb_request, tvb, offset, 1, ENC_LITTLE_ENDIAN);
- offset += 1;
-
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s Request",
- val_to_str_ext(usb_trans_info->setup.request, &setup_request_names_vals_ext, "Unknown type %x"));
-
- dissector = NULL;
- for(tmp = setup_request_dissectors;tmp->dissector;tmp++) {
- if (tmp->request == usb_trans_info->setup.request) {
- dissector = tmp->dissector;
- break;
+ case RQT_SETUP_TYPE_STANDARD:
+ /*
+ * This is a standard request which is managed by this
+ * dissector
+ */
+ proto_tree_add_item(setup_tree, hf_usb_request, tvb, offset, 1, ENC_LITTLE_ENDIAN);
+ offset += 1;
+
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s Request",
+ val_to_str_ext(usb_trans_info->setup.request, &setup_request_names_vals_ext, "Unknown type %x"));
+
+ dissector = NULL;
+ for(tmp = setup_request_dissectors;tmp->dissector;tmp++) {
+ if (tmp->request == usb_trans_info->setup.request) {
+ dissector = tmp->dissector;
+ break;
+ }
}
- }
- if (dissector) {
- offset = dissector(pinfo, setup_tree, tvb, offset, usb_trans_info,
- usb_conv_info, bus_id, device_address);
- } else {
+ if (dissector) {
+ offset = dissector(pinfo, setup_tree, tvb, offset, usb_trans_info,
+ usb_conv_info, bus_id, device_address);
+ } else {
+ proto_tree_add_item(setup_tree, hf_usb_value, tvb, offset, 2, ENC_LITTLE_ENDIAN);
+ offset += 2;
+ proto_tree_add_item(setup_tree, hf_usb_index, tvb, offset, 2, ENC_LITTLE_ENDIAN);
+ offset += 2;
+ proto_tree_add_item(setup_tree, hf_usb_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
+ offset += 2;
+ }
+ break;
+ default:
+ /* no dissector found - display generic fields */
+ proto_tree_add_item(setup_tree, hf_usb_request_unknown_class, tvb, offset, 1, ENC_LITTLE_ENDIAN);
+ offset += 1;
proto_tree_add_item(setup_tree, hf_usb_value, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(setup_tree, hf_usb_index, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(setup_tree, hf_usb_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
- }
- break;
- default:
- /* no dissector found - display generic fields */
- proto_tree_add_item(setup_tree, hf_usb_request_unknown_class, tvb, offset, 1, ENC_LITTLE_ENDIAN);
- offset += 1;
- proto_tree_add_item(setup_tree, hf_usb_value, tvb, offset, 2, ENC_LITTLE_ENDIAN);
- offset += 2;
- proto_tree_add_item(setup_tree, hf_usb_index, tvb, offset, 2, ENC_LITTLE_ENDIAN);
- offset += 2;
- proto_tree_add_item(setup_tree, hf_usb_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
- offset += 2;
-
- if (header_info & (USB_HEADER_IS_LINUX | USB_HEADER_IS_64_BYTES)) {
- setup_tvb = tvb_new_composite();
- next_tvb = tvb_new_subset(tvb, offset - 7, 7, 7);
- tvb_composite_append(setup_tvb, next_tvb);
- }
+
+ if (header_info & (USB_HEADER_IS_LINUX | USB_HEADER_IS_64_BYTES)) {
+ setup_tvb = tvb_new_composite();
+ next_tvb = tvb_new_subset(tvb, offset - 7, 7, 7);
+ tvb_composite_append(setup_tvb, next_tvb);
+ }
}
} else {
if (header_info & USB_HEADER_IS_LINUX) {