00001
00016 #ifndef WPS_DEFS_H
00017 #define WPS_DEFS_H
00018
00019 #define WPS_VERSION 0x10
00020
00021
00022 #define WPS_DH_GROUP 5
00023
00024 #define WPS_UUID_LEN 16
00025 #define WPS_NONCE_LEN 16
00026 #define WPS_AUTHENTICATOR_LEN 8
00027 #define WPS_AUTHKEY_LEN 32
00028 #define WPS_KEYWRAPKEY_LEN 16
00029 #define WPS_EMSK_LEN 32
00030 #define WPS_PSK_LEN 16
00031 #define WPS_SECRET_NONCE_LEN 16
00032 #define WPS_HASH_LEN 32
00033 #define WPS_KWA_LEN 8
00034 #define WPS_MGMTAUTHKEY_LEN 32
00035 #define WPS_MGMTENCKEY_LEN 16
00036 #define WPS_MGMT_KEY_ID_LEN 16
00037 #define WPS_OOB_DEVICE_PASSWORD_ATTR_LEN 54
00038 #define WPS_OOB_DEVICE_PASSWORD_LEN 32
00039 #define WPS_OOB_PUBKEY_HASH_LEN 20
00040
00041
00042 enum wps_attribute {
00043 ATTR_AP_CHANNEL = 0x1001,
00044 ATTR_ASSOC_STATE = 0x1002,
00045 ATTR_AUTH_TYPE = 0x1003,
00046 ATTR_AUTH_TYPE_FLAGS = 0x1004,
00047 ATTR_AUTHENTICATOR = 0x1005,
00048 ATTR_CONFIG_METHODS = 0x1008,
00049 ATTR_CONFIG_ERROR = 0x1009,
00050 ATTR_CONFIRM_URL4 = 0x100a,
00051 ATTR_CONFIRM_URL6 = 0x100b,
00052 ATTR_CONN_TYPE = 0x100c,
00053 ATTR_CONN_TYPE_FLAGS = 0x100d,
00054 ATTR_CRED = 0x100e,
00055 ATTR_ENCR_TYPE = 0x100f,
00056 ATTR_ENCR_TYPE_FLAGS = 0x1010,
00057 ATTR_DEV_NAME = 0x1011,
00058 ATTR_DEV_PASSWORD_ID = 0x1012,
00059 ATTR_E_HASH1 = 0x1014,
00060 ATTR_E_HASH2 = 0x1015,
00061 ATTR_E_SNONCE1 = 0x1016,
00062 ATTR_E_SNONCE2 = 0x1017,
00063 ATTR_ENCR_SETTINGS = 0x1018,
00064 ATTR_ENROLLEE_NONCE = 0x101a,
00065 ATTR_FEATURE_ID = 0x101b,
00066 ATTR_IDENTITY = 0x101c,
00067 ATTR_IDENTITY_PROOF = 0x101d,
00068 ATTR_KEY_WRAP_AUTH = 0x101e,
00069 ATTR_KEY_ID = 0x101f,
00070 ATTR_MAC_ADDR = 0x1020,
00071 ATTR_MANUFACTURER = 0x1021,
00072 ATTR_MSG_TYPE = 0x1022,
00073 ATTR_MODEL_NAME = 0x1023,
00074 ATTR_MODEL_NUMBER = 0x1024,
00075 ATTR_NETWORK_INDEX = 0x1026,
00076 ATTR_NETWORK_KEY = 0x1027,
00077 ATTR_NETWORK_KEY_INDEX = 0x1028,
00078 ATTR_NEW_DEVICE_NAME = 0x1029,
00079 ATTR_NEW_PASSWORD = 0x102a,
00080 ATTR_OOB_DEVICE_PASSWORD = 0x102c,
00081 ATTR_OS_VERSION = 0x102d,
00082 ATTR_POWER_LEVEL = 0x102f,
00083 ATTR_PSK_CURRENT = 0x1030,
00084 ATTR_PSK_MAX = 0x1031,
00085 ATTR_PUBLIC_KEY = 0x1032,
00086 ATTR_RADIO_ENABLE = 0x1033,
00087 ATTR_REBOOT = 0x1034,
00088 ATTR_REGISTRAR_CURRENT = 0x1035,
00089 ATTR_REGISTRAR_ESTABLISHED = 0x1036,
00090 ATTR_REGISTRAR_LIST = 0x1037,
00091 ATTR_REGISTRAR_MAX = 0x1038,
00092 ATTR_REGISTRAR_NONCE = 0x1039,
00093 ATTR_REQUEST_TYPE = 0x103a,
00094 ATTR_RESPONSE_TYPE = 0x103b,
00095 ATTR_RF_BANDS = 0x103c,
00096 ATTR_R_HASH1 = 0x103d,
00097 ATTR_R_HASH2 = 0x103e,
00098 ATTR_R_SNONCE1 = 0x103f,
00099 ATTR_R_SNONCE2 = 0x1040,
00100 ATTR_SELECTED_REGISTRAR = 0x1041,
00101 ATTR_SERIAL_NUMBER = 0x1042,
00102 ATTR_WPS_STATE = 0x1044,
00103 ATTR_SSID = 0x1045,
00104 ATTR_TOTAL_NETWORKS = 0x1046,
00105 ATTR_UUID_E = 0x1047,
00106 ATTR_UUID_R = 0x1048,
00107 ATTR_VENDOR_EXT = 0x1049,
00108 ATTR_VERSION = 0x104a,
00109 ATTR_X509_CERT_REQ = 0x104b,
00110 ATTR_X509_CERT = 0x104c,
00111 ATTR_EAP_IDENTITY = 0x104d,
00112 ATTR_MSG_COUNTER = 0x104e,
00113 ATTR_PUBKEY_HASH = 0x104f,
00114 ATTR_REKEY_KEY = 0x1050,
00115 ATTR_KEY_LIFETIME = 0x1051,
00116 ATTR_PERMITTED_CFG_METHODS = 0x1052,
00117 ATTR_SELECTED_REGISTRAR_CONFIG_METHODS = 0x1053,
00118 ATTR_PRIMARY_DEV_TYPE = 0x1054,
00119 ATTR_SECONDARY_DEV_TYP_ELIST = 0x1055,
00120 ATTR_PORTABLE_DEV = 0x1056,
00121 ATTR_AP_SETUP_LOCKED = 0x1057,
00122 ATTR_APPLICATION_EXT = 0x1058,
00123 ATTR_EAP_TYPE = 0x1059,
00124 ATTR_IV = 0x1060,
00125 ATTR_KEY_PROVIDED_AUTO = 0x1061,
00126 ATTR_802_1X_ENABLED = 0x1062,
00127 ATTR_APPSESSIONKEY = 0x1063,
00128 ATTR_WEPTRANSMITKEY = 0x1064
00129 };
00130
00131
00132 enum wps_dev_password_id {
00133 DEV_PW_DEFAULT = 0x0000,
00134 DEV_PW_USER_SPECIFIED = 0x0001,
00135 DEV_PW_MACHINE_SPECIFIED = 0x0002,
00136 DEV_PW_REKEY = 0x0003,
00137 DEV_PW_PUSHBUTTON = 0x0004,
00138 DEV_PW_REGISTRAR_SPECIFIED = 0x0005
00139 };
00140
00141
00142 enum wps_msg_type {
00143 WPS_Beacon = 0x01,
00144 WPS_ProbeRequest = 0x02,
00145 WPS_ProbeResponse = 0x03,
00146 WPS_M1 = 0x04,
00147 WPS_M2 = 0x05,
00148 WPS_M2D = 0x06,
00149 WPS_M3 = 0x07,
00150 WPS_M4 = 0x08,
00151 WPS_M5 = 0x09,
00152 WPS_M6 = 0x0a,
00153 WPS_M7 = 0x0b,
00154 WPS_M8 = 0x0c,
00155 WPS_WSC_ACK = 0x0d,
00156 WPS_WSC_NACK = 0x0e,
00157 WPS_WSC_DONE = 0x0f
00158 };
00159
00160
00161 #define WPS_AUTH_OPEN 0x0001
00162 #define WPS_AUTH_WPAPSK 0x0002
00163 #define WPS_AUTH_SHARED 0x0004
00164 #define WPS_AUTH_WPA 0x0008
00165 #define WPS_AUTH_WPA2 0x0010
00166 #define WPS_AUTH_WPA2PSK 0x0020
00167 #define WPS_AUTH_TYPES (WPS_AUTH_OPEN | WPS_AUTH_WPAPSK | WPS_AUTH_SHARED | \
00168 WPS_AUTH_WPA | WPS_AUTH_WPA2 | WPS_AUTH_WPA2PSK)
00169
00170
00171 #define WPS_ENCR_NONE 0x0001
00172 #define WPS_ENCR_WEP 0x0002
00173 #define WPS_ENCR_TKIP 0x0004
00174 #define WPS_ENCR_AES 0x0008
00175 #define WPS_ENCR_TYPES (WPS_ENCR_NONE | WPS_ENCR_WEP | WPS_ENCR_TKIP | \
00176 WPS_ENCR_AES)
00177
00178
00179 enum wps_config_error {
00180 WPS_CFG_NO_ERROR = 0,
00181 WPS_CFG_OOB_IFACE_READ_ERROR = 1,
00182 WPS_CFG_DECRYPTION_CRC_FAILURE = 2,
00183 WPS_CFG_24_CHAN_NOT_SUPPORTED = 3,
00184 WPS_CFG_50_CHAN_NOT_SUPPORTED = 4,
00185 WPS_CFG_SIGNAL_TOO_WEAK = 5,
00186 WPS_CFG_NETWORK_AUTH_FAILURE = 6,
00187 WPS_CFG_NETWORK_ASSOC_FAILURE = 7,
00188 WPS_CFG_NO_DHCP_RESPONSE = 8,
00189 WPS_CFG_FAILED_DHCP_CONFIG = 9,
00190 WPS_CFG_IP_ADDR_CONFLICT = 10,
00191 WPS_CFG_NO_CONN_TO_REGISTRAR = 11,
00192 WPS_CFG_MULTIPLE_PBC_DETECTED = 12,
00193 WPS_CFG_ROGUE_SUSPECTED = 13,
00194 WPS_CFG_DEVICE_BUSY = 14,
00195 WPS_CFG_SETUP_LOCKED = 15,
00196 WPS_CFG_MSG_TIMEOUT = 16,
00197 WPS_CFG_REG_SESS_TIMEOUT = 17,
00198 WPS_CFG_DEV_PASSWORD_AUTH_FAILURE = 18
00199 };
00200
00201
00202 #define WPS_RF_24GHZ 0x01
00203 #define WPS_RF_50GHZ 0x02
00204
00205
00206 #define WPS_CONFIG_USBA 0x0001
00207 #define WPS_CONFIG_ETHERNET 0x0002
00208 #define WPS_CONFIG_LABEL 0x0004
00209 #define WPS_CONFIG_DISPLAY 0x0008
00210 #define WPS_CONFIG_EXT_NFC_TOKEN 0x0010
00211 #define WPS_CONFIG_INT_NFC_TOKEN 0x0020
00212 #define WPS_CONFIG_NFC_INTERFACE 0x0040
00213 #define WPS_CONFIG_PUSHBUTTON 0x0080
00214 #define WPS_CONFIG_KEYPAD 0x0100
00215
00216
00217 #define WPS_CONN_ESS 0x01
00218 #define WPS_CONN_IBSS 0x02
00219
00220
00221 enum wps_state {
00222 WPS_STATE_NOT_CONFIGURED = 1,
00223 WPS_STATE_CONFIGURED = 2
00224 };
00225
00226
00227 enum wps_assoc_state {
00228 WPS_ASSOC_NOT_ASSOC = 0,
00229 WPS_ASSOC_CONN_SUCCESS = 1,
00230 WPS_ASSOC_CFG_FAILURE = 2,
00231 WPS_ASSOC_FAILURE = 3,
00232 WPS_ASSOC_IP_FAILURE = 4
00233 };
00234
00235
00236
00237 struct wps_dev_type {
00238 u8 categ_id[2];
00239 u8 oui[4];
00240 u8 sub_categ_id[2];
00241 };
00242
00243 #define WPS_DEV_OUI_WFA 0x0050f204
00244
00245 enum wps_dev_categ {
00246 WPS_DEV_COMPUTER = 1,
00247 WPS_DEV_INPUT = 2,
00248 WPS_DEV_PRINTER = 3,
00249 WPS_DEV_CAMERA = 4,
00250 WPS_DEV_STORAGE = 5,
00251 WPS_DEV_NETWORK_INFRA = 6,
00252 WPS_DEV_DISPLAY = 7,
00253 WPS_DEV_MULTIMEDIA = 8,
00254 WPS_DEV_GAMING = 9,
00255 WPS_DEV_PHONE = 10
00256 };
00257
00258 enum wps_dev_subcateg {
00259 WPS_DEV_COMPUTER_PC = 1,
00260 WPS_DEV_COMPUTER_SERVER = 2,
00261 WPS_DEV_COMPUTER_MEDIA_CENTER = 3,
00262 WPS_DEV_PRINTER_PRINTER = 1,
00263 WPS_DEV_PRINTER_SCANNER = 2,
00264 WPS_DEV_CAMERA_DIGITAL_STILL_CAMERA = 1,
00265 WPS_DEV_STORAGE_NAS = 1,
00266 WPS_DEV_NETWORK_INFRA_AP = 1,
00267 WPS_DEV_NETWORK_INFRA_ROUTER = 2,
00268 WPS_DEV_NETWORK_INFRA_SWITCH = 3,
00269 WPS_DEV_DISPLAY_TV = 1,
00270 WPS_DEV_DISPLAY_PICTURE_FRAME = 2,
00271 WPS_DEV_DISPLAY_PROJECTOR = 3,
00272 WPS_DEV_MULTIMEDIA_DAR = 1,
00273 WPS_DEV_MULTIMEDIA_PVR = 2,
00274 WPS_DEV_MULTIMEDIA_MCX = 3,
00275 WPS_DEV_GAMING_XBOX = 1,
00276 WPS_DEV_GAMING_XBOX360 = 2,
00277 WPS_DEV_GAMING_PLAYSTATION = 3,
00278 WPS_DEV_PHONE_WINDOWS_MOBILE = 1
00279 };
00280
00281
00282
00283 enum wps_request_type {
00284 WPS_REQ_ENROLLEE_INFO = 0,
00285 WPS_REQ_ENROLLEE = 1,
00286 WPS_REQ_REGISTRAR = 2,
00287 WPS_REQ_WLAN_MANAGER_REGISTRAR = 3
00288 };
00289
00290
00291 enum wps_response_type {
00292 WPS_RESP_ENROLLEE_INFO = 0,
00293 WPS_RESP_ENROLLEE = 1,
00294 WPS_RESP_REGISTRAR = 2,
00295 WPS_RESP_AP = 3
00296 };
00297
00298
00299 #define WPS_PBC_WALK_TIME 120
00300
00301 #endif
00302