diff options
author | Michael Mann <mmann78@netscape.net> | 2017-08-13 13:50:58 -0400 |
---|---|---|
committer | Richard Sharpe <realrichardsharpe@gmail.com> | 2017-08-14 04:36:57 +0000 |
commit | 329cccfc7b3adabbcd961cc328609f23058e5a12 (patch) | |
tree | cd70fc3aab097339fb5e94b6d683f058f527796f /epan/dissectors/packet-wifi-p2p.c | |
parent | 35a6a1396fa8b0a6fa094b39bccac7c1e81a7fd3 (diff) |
packet-ieee80211.c: Add dissector table for vendor specific actions
Gives a little more flexibility for vendor implementations
https://www.wireshark.org/lists/wireshark-dev/201708/msg00053.html
https://ask.wireshark.org/questions/56816/ieee-80211-vendor-specific-action
Change-Id: I0345e43140a8ac99b26932b72d08a99ca0036389
Reviewed-on: https://code.wireshark.org/review/23065
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Diffstat (limited to 'epan/dissectors/packet-wifi-p2p.c')
-rw-r--r-- | epan/dissectors/packet-wifi-p2p.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/epan/dissectors/packet-wifi-p2p.c b/epan/dissectors/packet-wifi-p2p.c index aeffb3d4dc..ee6cdfb0e6 100644 --- a/epan/dissectors/packet-wifi-p2p.c +++ b/epan/dissectors/packet-wifi-p2p.c @@ -24,10 +24,12 @@ #include <epan/packet.h> #include <epan/to_str.h> #include <epan/expert.h> +#include <epan/oui.h> #include "packet-ieee80211.h" void proto_register_p2p(void); +void proto_reg_handoff_p2p(void); enum { P2P_ATTR_STATUS = 0, @@ -419,6 +421,7 @@ static int hf_p2p_anqp_query_data = -1; static int hf_p2p_anqp_status_code = -1; static int hf_p2p_anqp_response_data = -1; +static int hf_p2p_wfa_subtype = -1; static int hf_p2p_action_subtype = -1; static int hf_p2p_action_dialog_token = -1; static int hf_p2p_public_action_subtype = -1; @@ -1190,12 +1193,23 @@ int dissect_wifi_p2p_public_action(packet_info *pinfo, proto_tree *tree, return offset; } -int dissect_wifi_p2p_action(proto_tree *tree, tvbuff_t *tvb, int offset) +static int +dissect_wifi_p2p_action(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { - proto_tree_add_item(tree, hf_p2p_action_subtype, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; - proto_tree_add_item(tree, hf_p2p_action_dialog_token, tvb, offset, 1, ENC_BIG_ENDIAN); + int offset = 0; + guint32 subtype; + + proto_tree_add_item_ret_uint(tree, hf_p2p_wfa_subtype, tvb, offset, 1, ENC_NA, &subtype); offset++; + + if (subtype == 9 /* WFA_SUBTYPE_P2P */ ) + { + proto_tree_add_item(tree, hf_p2p_action_subtype, tvb, offset, 1, ENC_BIG_ENDIAN); + offset++; + proto_tree_add_item(tree, hf_p2p_action_dialog_token, tvb, offset, 1, ENC_BIG_ENDIAN); + offset++; + } + /* Followed by variable length IEs dissected by packet-ieee80211.c */ return offset; } @@ -1774,6 +1788,10 @@ proto_register_p2p(void) { "Response Data", "wifi_p2p.anqp.response_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + {&hf_p2p_wfa_subtype, + {"WFA Subtype", "wifi_p2p.wfa_subtype", + FT_UINT8, BASE_DEC, NULL, 0, + NULL, HFILL }}, { &hf_p2p_action_subtype, { "P2P Action Subtype", "wifi_p2p.action.subtype", FT_UINT8, BASE_DEC, VALS(p2p_action_subtypes), 0x0, NULL, HFILL }}, @@ -1813,6 +1831,12 @@ proto_register_p2p(void) expert_register_field_array(expert_p2p, ei, array_length(ei)); } +void +proto_reg_handoff_p2p(void) +{ + dissector_add_uint("wlan.action.vendor_specific", OUI_WFA, create_dissector_handle(dissect_wifi_p2p_action, proto_p2p)); +} + /* * Editor modelines * |