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-ubertooth.c | |
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-ubertooth.c')
-rw-r--r-- | epan/dissectors/packet-ubertooth.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/dissectors/packet-ubertooth.c b/epan/dissectors/packet-ubertooth.c index 39246f6a7f..c12f1d0670 100644 --- a/epan/dissectors/packet-ubertooth.c +++ b/epan/dissectors/packet-ubertooth.c @@ -332,7 +332,7 @@ static expert_field ei_unknown_data = EI_INIT; static expert_field ei_unexpected_data = EI_INIT; static dissector_handle_t ubertooth_handle; -static dissector_handle_t bluetooth_handle; +static dissector_handle_t bluetooth_ubertooth_handle; static wmem_tree_t *command_info = NULL; @@ -1318,7 +1318,7 @@ dissect_usb_rx_packet(proto_tree *main_tree, proto_tree *tree, packet_info *pinf ubertooth_data->channel = channel; next_tvb = tvb_new_subset_length(tvb, offset, length); - call_dissector_with_data(bluetooth_handle, next_tvb, pinfo, main_tree, ubertooth_data); + call_dissector_with_data(bluetooth_ubertooth_handle, next_tvb, pinfo, main_tree, ubertooth_data); offset += length; if (tvb_length_remaining(tvb, offset) > 0) { @@ -3424,7 +3424,7 @@ proto_register_ubertooth(void) void proto_reg_handoff_ubertooth(void) { - bluetooth_handle = find_dissector("bluetooth"); + bluetooth_ubertooth_handle = find_dissector("bluetooth_ubertooth"); dissector_add_uint("usb.product", (0x1d50 << 16) | 0x6000, ubertooth_handle); /* Ubertooth Zero */ dissector_add_uint("usb.product", (0x1d50 << 16) | 0x6002, ubertooth_handle); /* Ubertooth One */ |