Updated through tag hostap_2_5 from git://w1.fi/hostap.git
[mech_eap.git] / libeap / src / wps / wps_defs.h
index 868f8ad..a23b979 100644 (file)
@@ -2,14 +2,8 @@
  * Wi-Fi Protected Setup - message definitions
  * Copyright (c) 2008, Jouni Malinen <j@w1.fi>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Alternatively, this software may be distributed under the terms of BSD
- * license.
- *
- * See README and COPYING for more details.
+ * This software may be distributed under the terms of the BSD license.
+ * See README for more details.
  */
 
 #ifndef WPS_DEFS_H
 
 extern int wps_version_number;
 extern int wps_testing_dummy_cred;
+extern int wps_corrupt_pkhash;
 #define WPS_VERSION wps_version_number
 
 #else /* CONFIG_WPS_TESTING */
 
-#ifdef CONFIG_WPS2
 #define WPS_VERSION 0x20
-#else /* CONFIG_WPS2 */
-#define WPS_VERSION 0x10
-#endif /* CONFIG_WPS2 */
 
 #endif /* CONFIG_WPS_TESTING */
 
@@ -47,9 +38,14 @@ extern int wps_testing_dummy_cred;
 #define WPS_MGMTAUTHKEY_LEN 32
 #define WPS_MGMTENCKEY_LEN 16
 #define WPS_MGMT_KEY_ID_LEN 16
-#define WPS_OOB_DEVICE_PASSWORD_ATTR_LEN 54
+#define WPS_OOB_DEVICE_PASSWORD_MIN_LEN 16
 #define WPS_OOB_DEVICE_PASSWORD_LEN 32
 #define WPS_OOB_PUBKEY_HASH_LEN 20
+#define WPS_DEV_NAME_MAX_LEN 32
+#define WPS_MANUFACTURER_MAX_LEN 64
+#define WPS_MODEL_NAME_MAX_LEN 32
+#define WPS_MODEL_NUMBER_MAX_LEN 32
+#define WPS_SERIAL_NUMBER_MAX_LEN 32
 
 /* Attribute Types */
 enum wps_attribute {
@@ -151,7 +147,8 @@ enum {
        WFA_ELEM_AUTHORIZEDMACS = 0x01,
        WFA_ELEM_NETWORK_KEY_SHAREABLE = 0x02,
        WFA_ELEM_REQUEST_TO_ENROLL = 0x03,
-       WFA_ELEM_SETTINGS_DELAY_TIME = 0x04
+       WFA_ELEM_SETTINGS_DELAY_TIME = 0x04,
+       WFA_ELEM_REGISTRAR_CONFIGURATION_METHODS = 0x05
 };
 
 /* Device Password ID */
@@ -161,7 +158,9 @@ enum wps_dev_password_id {
        DEV_PW_MACHINE_SPECIFIED = 0x0002,
        DEV_PW_REKEY = 0x0003,
        DEV_PW_PUSHBUTTON = 0x0004,
-       DEV_PW_REGISTRAR_SPECIFIED = 0x0005
+       DEV_PW_REGISTRAR_SPECIFIED = 0x0005,
+       DEV_PW_NFC_CONNECTION_HANDOVER = 0x0007,
+       DEV_PW_P2PS_DEFAULT = 0x0008
 };
 
 /* Message Type */
@@ -186,7 +185,7 @@ enum wps_msg_type {
 /* Authentication Type Flags */
 #define WPS_AUTH_OPEN 0x0001
 #define WPS_AUTH_WPAPSK 0x0002
-#define WPS_AUTH_SHARED 0x0004
+#define WPS_AUTH_SHARED 0x0004 /* deprecated */
 #define WPS_AUTH_WPA 0x0008
 #define WPS_AUTH_WPA2 0x0010
 #define WPS_AUTH_WPA2PSK 0x0020
@@ -195,7 +194,7 @@ enum wps_msg_type {
 
 /* Encryption Type Flags */
 #define WPS_ENCR_NONE 0x0001
-#define WPS_ENCR_WEP 0x0002
+#define WPS_ENCR_WEP 0x0002 /* deprecated */
 #define WPS_ENCR_TKIP 0x0004
 #define WPS_ENCR_AES 0x0008
 #define WPS_ENCR_TYPES (WPS_ENCR_NONE | WPS_ENCR_WEP | WPS_ENCR_TKIP | \
@@ -221,12 +220,24 @@ enum wps_config_error {
        WPS_CFG_SETUP_LOCKED = 15,
        WPS_CFG_MSG_TIMEOUT = 16,
        WPS_CFG_REG_SESS_TIMEOUT = 17,
-       WPS_CFG_DEV_PASSWORD_AUTH_FAILURE = 18
+       WPS_CFG_DEV_PASSWORD_AUTH_FAILURE = 18,
+       WPS_CFG_60G_CHAN_NOT_SUPPORTED = 19,
+       WPS_CFG_PUBLIC_KEY_HASH_MISMATCH = 20
+};
+
+/* Vendor specific Error Indication for WPS event messages */
+enum wps_error_indication {
+       WPS_EI_NO_ERROR,
+       WPS_EI_SECURITY_TKIP_ONLY_PROHIBITED,
+       WPS_EI_SECURITY_WEP_PROHIBITED,
+       WPS_EI_AUTH_FAILURE,
+       NUM_WPS_EI_VALUES
 };
 
 /* RF Bands */
 #define WPS_RF_24GHZ 0x01
 #define WPS_RF_50GHZ 0x02
+#define WPS_RF_60GHZ 0x04
 
 /* Config Methods */
 #define WPS_CONFIG_USBA 0x0001
@@ -238,12 +249,11 @@ enum wps_config_error {
 #define WPS_CONFIG_NFC_INTERFACE 0x0040
 #define WPS_CONFIG_PUSHBUTTON 0x0080
 #define WPS_CONFIG_KEYPAD 0x0100
-#ifdef CONFIG_WPS2
 #define WPS_CONFIG_VIRT_PUSHBUTTON 0x0280
 #define WPS_CONFIG_PHY_PUSHBUTTON 0x0480
+#define WPS_CONFIG_P2PS 0x1000
 #define WPS_CONFIG_VIRT_DISPLAY 0x2008
 #define WPS_CONFIG_PHY_DISPLAY 0x4008
-#endif /* CONFIG_WPS2 */
 
 /* Connection Type Flags */
 #define WPS_CONN_ESS 0x01
@@ -277,30 +287,71 @@ enum wps_dev_categ {
        WPS_DEV_DISPLAY = 7,
        WPS_DEV_MULTIMEDIA = 8,
        WPS_DEV_GAMING = 9,
-       WPS_DEV_PHONE = 10
+       WPS_DEV_PHONE = 10,
+       WPS_DEV_AUDIO = 11,
 };
 
 enum wps_dev_subcateg {
        WPS_DEV_COMPUTER_PC = 1,
        WPS_DEV_COMPUTER_SERVER = 2,
        WPS_DEV_COMPUTER_MEDIA_CENTER = 3,
+       WPS_DEV_COMPUTER_ULTRA_MOBILE = 4,
+       WPS_DEV_COMPUTER_NOTEBOOK = 5,
+       WPS_DEV_COMPUTER_DESKTOP = 6,
+       WPS_DEV_COMPUTER_MID = 7,
+       WPS_DEV_COMPUTER_NETBOOK = 8,
+       WPS_DEV_COMPUTER_TABLET = 9,
+       WPS_DEV_INPUT_KEYBOARD = 1,
+       WPS_DEV_INPUT_MOUSE = 2,
+       WPS_DEV_INPUT_JOYSTICK = 3,
+       WPS_DEV_INPUT_TRACKBALL = 4,
+       WPS_DEV_INPUT_GAMING = 5,
+       WPS_DEV_INPUT_REMOTE = 6,
+       WPS_DEV_INPUT_TOUCHSCREEN = 7,
+       WPS_DEV_INPUT_BIOMETRIC_READER = 8,
+       WPS_DEV_INPUT_BARCODE_READER = 9,
        WPS_DEV_PRINTER_PRINTER = 1,
        WPS_DEV_PRINTER_SCANNER = 2,
+       WPS_DEV_PRINTER_FAX = 3,
+       WPS_DEV_PRINTER_COPIER = 4,
+       WPS_DEV_PRINTER_ALL_IN_ONE = 5,
        WPS_DEV_CAMERA_DIGITAL_STILL_CAMERA = 1,
+       WPS_DEV_CAMERA_VIDEO = 2,
+       WPS_DEV_CAMERA_WEB = 3,
+       WPS_DEV_CAMERA_SECURITY = 4,
        WPS_DEV_STORAGE_NAS = 1,
        WPS_DEV_NETWORK_INFRA_AP = 1,
        WPS_DEV_NETWORK_INFRA_ROUTER = 2,
        WPS_DEV_NETWORK_INFRA_SWITCH = 3,
+       WPS_DEV_NETWORK_INFRA_GATEWAY = 4,
+       WPS_DEV_NETWORK_INFRA_BRIDGE = 5,
        WPS_DEV_DISPLAY_TV = 1,
        WPS_DEV_DISPLAY_PICTURE_FRAME = 2,
        WPS_DEV_DISPLAY_PROJECTOR = 3,
+       WPS_DEV_DISPLAY_MONITOR = 4,
        WPS_DEV_MULTIMEDIA_DAR = 1,
        WPS_DEV_MULTIMEDIA_PVR = 2,
        WPS_DEV_MULTIMEDIA_MCX = 3,
+       WPS_DEV_MULTIMEDIA_SET_TOP_BOX = 4,
+       WPS_DEV_MULTIMEDIA_MEDIA_SERVER = 5,
+       WPS_DEV_MULTIMEDIA_PORTABLE_VIDEO_PLAYER = 6,
        WPS_DEV_GAMING_XBOX = 1,
        WPS_DEV_GAMING_XBOX360 = 2,
        WPS_DEV_GAMING_PLAYSTATION = 3,
-       WPS_DEV_PHONE_WINDOWS_MOBILE = 1
+       WPS_DEV_GAMING_GAME_CONSOLE = 4,
+       WPS_DEV_GAMING_PORTABLE_DEVICE = 5,
+       WPS_DEV_PHONE_WINDOWS_MOBILE = 1,
+       WPS_DEV_PHONE_SINGLE_MODE = 2,
+       WPS_DEV_PHONE_DUAL_MODE = 3,
+       WPS_DEV_PHONE_SP_SINGLE_MODE = 4,
+       WPS_DEV_PHONE_SP_DUAL_MODE = 5,
+       WPS_DEV_AUDIO_TUNER_RECV = 1,
+       WPS_DEV_AUDIO_SPEAKERS = 2,
+       WPS_DEV_AUDIO_PMP = 3,
+       WPS_DEV_AUDIO_HEADSET = 4,
+       WPS_DEV_AUDIO_HEADPHONES = 5,
+       WPS_DEV_AUDIO_MICROPHONE = 6,
+       WPS_DEV_AUDIO_HOME_THEATRE = 7,
 };