aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-wps.c
diff options
context:
space:
mode:
authorAlexis La Goutte <alexis.lagoutte@gmail.com>2012-12-23 19:17:54 +0000
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2012-12-23 19:17:54 +0000
commit87c1df5ead2f8ee3884fcfa77dbbdf929fc68668 (patch)
tree1b067415aad1577d546c621e81ee3958487de9f7 /epan/dissectors/packet-wps.c
parent6f7a757c04599bbc50361bd826643e61df7b5292 (diff)
From report of Elavarasan via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8099 Named field for each item in Selected Registrar Config methods is not available
The structure of both the Config Methods and Selected Registrar Config Methods are the same. Display filters such as "wps.config_methods.pushbutton", "wps.config_methods.display", etc are available for the different methods in the Config methods whereas the display filters for the elements in the Selected Registrar Config methods are found to be the same as the Config method Display filters. From me : add new filter for selected_registrar config method bitmask (and also permitted config method) svn path=/trunk/; revision=46725
Diffstat (limited to 'epan/dissectors/packet-wps.c')
-rw-r--r--epan/dissectors/packet-wps.c178
1 files changed, 155 insertions, 23 deletions
diff --git a/epan/dissectors/packet-wps.c b/epan/dissectors/packet-wps.c
index 36b5496605..4427645b3d 100644
--- a/epan/dissectors/packet-wps.c
+++ b/epan/dissectors/packet-wps.c
@@ -377,7 +377,33 @@ static int hf_eapwps_tlv_public_key_hash = -1;
static int hf_eapwps_tlv_rekey_key = -1;
static int hf_eapwps_tlv_key_lifetime = -1;
static int hf_eapwps_tlv_permitted_config_methods = -1;
+static int hf_eapwps_tlv_permitted_config_methods_usba = -1;
+static int hf_eapwps_tlv_permitted_config_methods_ethernet = -1;
+static int hf_eapwps_tlv_permitted_config_methods_label = -1;
+static int hf_eapwps_tlv_permitted_config_methods_display = -1;
+static int hf_eapwps_tlv_permitted_config_methods_phy_display = -1;
+static int hf_eapwps_tlv_permitted_config_methods_virt_display = -1;
+static int hf_eapwps_tlv_permitted_config_methods_nfcext = -1;
+static int hf_eapwps_tlv_permitted_config_methods_nfcint = -1;
+static int hf_eapwps_tlv_permitted_config_methods_nfcinf = -1;
+static int hf_eapwps_tlv_permitted_config_methods_pushbutton = -1;
+static int hf_eapwps_tlv_permitted_config_methods_phy_pushbutton = -1;
+static int hf_eapwps_tlv_permitted_config_methods_virt_pushbutton = -1;
+static int hf_eapwps_tlv_permitted_config_methods_keypad = -1;
static int hf_eapwps_tlv_selected_registrar_config_methods = -1;
+static int hf_eapwps_tlv_selected_registrar_config_methods_usba = -1;
+static int hf_eapwps_tlv_selected_registrar_config_methods_ethernet = -1;
+static int hf_eapwps_tlv_selected_registrar_config_methods_label = -1;
+static int hf_eapwps_tlv_selected_registrar_config_methods_display = -1;
+static int hf_eapwps_tlv_selected_registrar_config_methods_phy_display = -1;
+static int hf_eapwps_tlv_selected_registrar_config_methods_virt_display = -1;
+static int hf_eapwps_tlv_selected_registrar_config_methods_nfcext = -1;
+static int hf_eapwps_tlv_selected_registrar_config_methods_nfcint = -1;
+static int hf_eapwps_tlv_selected_registrar_config_methods_nfcinf = -1;
+static int hf_eapwps_tlv_selected_registrar_config_methods_pushbutton = -1;
+static int hf_eapwps_tlv_selected_registrar_config_methods_phy_pushbutton = -1;
+static int hf_eapwps_tlv_selected_registrar_config_methods_virt_pushbutton = -1;
+static int hf_eapwps_tlv_selected_registrar_config_methods_keypad = -1;
static int hf_eapwps_tlv_primary_device_type = -1;
static int hf_eapwps_tlv_primary_device_type_category = -1;
#define WPS_DEVICE_TYPE_CATEGORY_MAX 11
@@ -763,27 +789,6 @@ static const value_string eapwps_tlv_audio_devices_subcategory[] = {
{ 0, NULL }
};
-/* ********************************************************************** */
-/* pinfo may be NULL ! */
-/* ********************************************************************** */
-static void
-dissect_wps_config_methods(proto_tree *root, tvbuff_t *tvb, int offset,
- gint _U_ size, packet_info _U_ *pinfo)
-{
- proto_tree_add_item(root, hf_eapwps_tlv_config_methods_usba, tvb, offset+4, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(root, hf_eapwps_tlv_config_methods_ethernet, tvb, offset+4, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(root, hf_eapwps_tlv_config_methods_label, tvb, offset+4, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(root, hf_eapwps_tlv_config_methods_display, tvb, offset+4, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(root, hf_eapwps_tlv_config_methods_virt_display, tvb, offset+4, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(root, hf_eapwps_tlv_config_methods_phy_display, tvb, offset+4, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(root, hf_eapwps_tlv_config_methods_nfcext, tvb, offset+4, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(root, hf_eapwps_tlv_config_methods_nfcint, tvb, offset+4, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(root, hf_eapwps_tlv_config_methods_nfcinf, tvb, offset+4, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(root, hf_eapwps_tlv_config_methods_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(root, hf_eapwps_tlv_config_methods_virt_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(root, hf_eapwps_tlv_config_methods_phy_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(root, hf_eapwps_tlv_config_methods_keypad, tvb, offset+4, 2, ENC_BIG_ENDIAN);
-}
static void
add_wps_wfa_ext(guint8 id, proto_tree *tree, tvbuff_t *tvb,
@@ -1449,7 +1454,19 @@ dissect_wps_tlvs(proto_tree *eap_tree, tvbuff_t *tvb, int offset,
tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods, tvb, offset+4, 2, ENC_BIG_ENDIAN);
hfindex = hf_eapwps_tlv_permitted_config_methods;
- dissect_wps_config_methods(tlv_root, tvb, offset, size, pinfo);
+ proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_usba, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_ethernet, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_label, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_display, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_virt_display, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_phy_display, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_nfcext, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_nfcint, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_nfcinf, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_virt_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_phy_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tlv_root, hf_eapwps_tlv_permitted_config_methods_keypad, tvb, offset+4, 2, ENC_BIG_ENDIAN);
break;
@@ -1457,7 +1474,19 @@ dissect_wps_tlvs(proto_tree *eap_tree, tvbuff_t *tvb, int offset,
tmp_item = proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods, tvb, offset+4, 2, ENC_BIG_ENDIAN);
hfindex = hf_eapwps_tlv_selected_registrar_config_methods;
- dissect_wps_config_methods(tlv_root, tvb, offset, size, pinfo);
+ proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_usba, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_ethernet, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_label, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_display, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_virt_display, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_phy_display, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_nfcext, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_nfcint, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_nfcinf, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_virt_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_phy_pushbutton, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tlv_root, hf_eapwps_tlv_selected_registrar_config_methods_keypad, tvb, offset+4, 2, ENC_BIG_ENDIAN);
break;
@@ -2119,10 +2148,113 @@ proto_register_wps(void)
{ "Permitted COnfig Methods", "wps.permitted_config_methods",
FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
+ { &hf_eapwps_tlv_permitted_config_methods_usba,
+ { "USB", "wps.permitted_config_methods.usba",
+ FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_USBA, NULL, HFILL }},
+
+ { &hf_eapwps_tlv_permitted_config_methods_ethernet,
+ { "Ethernet", "wps.permitted_config_methods.ethernet",
+ FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_ETHERNET, NULL, HFILL }},
+
+ { &hf_eapwps_tlv_permitted_config_methods_label,
+ { "Label", "wps.permitted_config_methods.label",
+ FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_LABEL, NULL, HFILL }},
+
+ { &hf_eapwps_tlv_permitted_config_methods_display,
+ { "Display", "wps.permitted_config_methods.display",
+ FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_DISPLAY, NULL, HFILL }},
+
+ { &hf_eapwps_tlv_permitted_config_methods_virt_display,
+ { "Virtual Display", "wps.permitted_config_methods.virt_display",
+ FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_VIRT_DISPLAY, NULL, HFILL }},
+
+ { &hf_eapwps_tlv_permitted_config_methods_phy_display,
+ { "Physical Display", "wps.permitted_config_methods.phy_display",
+ FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PHY_DISPLAY, NULL, HFILL }},
+
+ { &hf_eapwps_tlv_permitted_config_methods_nfcext,
+ { "External NFC", "wps.permitted_config_methods.nfcext",
+ FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCEXT, NULL, HFILL }},
+
+ { &hf_eapwps_tlv_permitted_config_methods_nfcint,
+ { "Internal NFC", "wps.permitted_config_methods.nfcint",
+ FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCINT, NULL, HFILL }},
+
+ { &hf_eapwps_tlv_permitted_config_methods_nfcinf,
+ { "NFC Interface", "wps.permitted_config_methods.nfcinf",
+ FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCINF, NULL, HFILL }},
+
+ { &hf_eapwps_tlv_permitted_config_methods_pushbutton,
+ { "Push Button", "wps.permitted_config_methods.pushbutton",
+ FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PUSHBUTTON, NULL, HFILL }},
+
+ { &hf_eapwps_tlv_permitted_config_methods_virt_pushbutton,
+ { "Virtual Push Button", "wps.permitted_config_methods.virt_pushbutton",
+ FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_VIRT_PUSHBUTTON, NULL, HFILL }},
+
+ { &hf_eapwps_tlv_permitted_config_methods_phy_pushbutton,
+ { "Physical Push Button", "wps.permitted_config_methods.phy_pushbutton",
+ FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PHY_PUSHBUTTON, NULL, HFILL }},
+
+ { &hf_eapwps_tlv_permitted_config_methods_keypad,
+ { "Keypad", "wps.permitted_config_methods.keypad",
+ FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_KEYPAD, NULL, HFILL }},
+
{ &hf_eapwps_tlv_selected_registrar_config_methods,
{ "Selected Registrar Config Methods", "wps.selected_registrar_config_methods",
FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
+ { &hf_eapwps_tlv_selected_registrar_config_methods_usba,
+ { "USB", "wps.selected_registrar_config_methods.usba",
+ FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_USBA, NULL, HFILL }},
+
+ { &hf_eapwps_tlv_selected_registrar_config_methods_ethernet,
+ { "Ethernet", "wps.selected_registrar_config_methods.ethernet",
+ FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_ETHERNET, NULL, HFILL }},
+
+ { &hf_eapwps_tlv_selected_registrar_config_methods_label,
+ { "Label", "wps.selected_registrar_config_methods.label",
+ FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_LABEL, NULL, HFILL }},
+
+ { &hf_eapwps_tlv_selected_registrar_config_methods_display,
+ { "Display", "wps.selected_registrar_config_methods.display",
+ FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_DISPLAY, NULL, HFILL }},
+
+ { &hf_eapwps_tlv_selected_registrar_config_methods_virt_display,
+ { "Virtual Display", "wps.selected_registrar_config_methods.virt_display",
+ FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_VIRT_DISPLAY, NULL, HFILL }},
+
+ { &hf_eapwps_tlv_selected_registrar_config_methods_phy_display,
+ { "Physical Display", "wps.selected_registrar_config_methods.phy_display",
+ FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PHY_DISPLAY, NULL, HFILL }},
+
+ { &hf_eapwps_tlv_selected_registrar_config_methods_nfcext,
+ { "External NFC", "wps.selected_registrar_config_methods.nfcext",
+ FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCEXT, NULL, HFILL }},
+
+ { &hf_eapwps_tlv_selected_registrar_config_methods_nfcint,
+ { "Internal NFC", "wps.selected_registrar_config_methods.nfcint",
+ FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCINT, NULL, HFILL }},
+
+ { &hf_eapwps_tlv_selected_registrar_config_methods_nfcinf,
+ { "NFC Interface", "wps.selected_registrar_config_methods.nfcinf",
+ FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_NFCINF, NULL, HFILL }},
+
+ { &hf_eapwps_tlv_selected_registrar_config_methods_pushbutton,
+ { "Push Button", "wps.selected_registrar_config_methods.pushbutton",
+ FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PUSHBUTTON, NULL, HFILL }},
+
+ { &hf_eapwps_tlv_selected_registrar_config_methods_virt_pushbutton,
+ { "Virtual Push Button", "wps.selected_registrar_config_methods.virt_pushbutton",
+ FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_VIRT_PUSHBUTTON, NULL, HFILL }},
+
+ { &hf_eapwps_tlv_selected_registrar_config_methods_phy_pushbutton,
+ { "Physical Push Button", "wps.selected_registrar_config_methods.phy_pushbutton",
+ FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_PHY_PUSHBUTTON, NULL, HFILL }},
+
+ { &hf_eapwps_tlv_selected_registrar_config_methods_keypad,
+ { "Keypad", "wps.selected_registrar_config_methods.keypad",
+ FT_UINT16, BASE_HEX, NULL, EAPWPS_CONFMETH_KEYPAD, NULL, HFILL }},
{ &hf_eapwps_tlv_primary_device_type,
{ "Primary Device Type", "wps.primary_device_type",