wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
wps_attr_parse.h
Go to the documentation of this file.
1 
5 #ifndef WPS_ATTR_PARSE_H
6 #define WPS_ATTR_PARSE_H
7 
8 #include "wps.h"
9 
11  /* fixed length fields */
12  const u8 *version; /* 1 octet */
13  const u8 *version2; /* 1 octet */
14  const u8 *msg_type; /* 1 octet */
15  const u8 *enrollee_nonce; /* WPS_NONCE_LEN (16) octets */
16  const u8 *registrar_nonce; /* WPS_NONCE_LEN (16) octets */
17  const u8 *uuid_r; /* WPS_UUID_LEN (16) octets */
18  const u8 *uuid_e; /* WPS_UUID_LEN (16) octets */
19  const u8 *auth_type_flags; /* 2 octets */
20  const u8 *encr_type_flags; /* 2 octets */
21  const u8 *conn_type_flags; /* 1 octet */
22  const u8 *config_methods; /* 2 octets */
23  const u8 *sel_reg_config_methods; /* 2 octets */
24  const u8 *primary_dev_type; /* 8 octets */
25  const u8 *rf_bands; /* 1 octet */
26  const u8 *assoc_state; /* 2 octets */
27  const u8 *config_error; /* 2 octets */
28  const u8 *dev_password_id; /* 2 octets */
29  const u8 *os_version; /* 4 octets */
30  const u8 *wps_state; /* 1 octet */
31  const u8 *authenticator; /* WPS_AUTHENTICATOR_LEN (8) octets */
32  const u8 *r_hash1; /* WPS_HASH_LEN (32) octets */
33  const u8 *r_hash2; /* WPS_HASH_LEN (32) octets */
34  const u8 *e_hash1; /* WPS_HASH_LEN (32) octets */
35  const u8 *e_hash2; /* WPS_HASH_LEN (32) octets */
36  const u8 *r_snonce1; /* WPS_SECRET_NONCE_LEN (16) octets */
37  const u8 *r_snonce2; /* WPS_SECRET_NONCE_LEN (16) octets */
38  const u8 *e_snonce1; /* WPS_SECRET_NONCE_LEN (16) octets */
39  const u8 *e_snonce2; /* WPS_SECRET_NONCE_LEN (16) octets */
40  const u8 *key_wrap_auth; /* WPS_KWA_LEN (8) octets */
41  const u8 *auth_type; /* 2 octets */
42  const u8 *encr_type; /* 2 octets */
43  const u8 *network_idx; /* 1 octet */
44  const u8 *network_key_idx; /* 1 octet */
45  const u8 *mac_addr; /* ETH_ALEN (6) octets */
46  const u8 *selected_registrar; /* 1 octet (Bool) */
47  const u8 *request_type; /* 1 octet */
48  const u8 *response_type; /* 1 octet */
49  const u8 *ap_setup_locked; /* 1 octet */
50  const u8 *settings_delay_time; /* 1 octet */
51  const u8 *network_key_shareable; /* 1 octet (Bool) */
52  const u8 *request_to_enroll; /* 1 octet (Bool) */
53  const u8 *ap_channel; /* 2 octets */
54  const u8 *registrar_configuration_methods; /* 2 octets */
55 
56  /* variable length fields */
57  const u8 *manufacturer;
58  const u8 *model_name;
59  const u8 *model_number;
60  const u8 *serial_number;
61  const u8 *dev_name;
62  const u8 *public_key;
63  const u8 *encr_settings;
64  const u8 *ssid; /* <= 32 octets */
65  const u8 *network_key; /* <= 64 octets */
66  const u8 *authorized_macs; /* <= 30 octets */
67  const u8 *sec_dev_type_list; /* <= 128 octets */
68  const u8 *oob_dev_password; /* 38..54 octets */
69  u16 manufacturer_len;
70  u16 model_name_len;
71  u16 model_number_len;
72  u16 serial_number_len;
73  u16 dev_name_len;
74  u16 public_key_len;
75  u16 encr_settings_len;
76  u16 ssid_len;
77  u16 network_key_len;
78  u16 authorized_macs_len;
79  u16 sec_dev_type_list_len;
80  u16 oob_dev_password_len;
81 
82  /* attributes that can occur multiple times */
83 #define MAX_CRED_COUNT 10
84 #define MAX_REQ_DEV_TYPE_COUNT 10
85 
86  unsigned int num_cred;
87  unsigned int num_req_dev_type;
88  unsigned int num_vendor_ext;
89 
90  u16 cred_len[MAX_CRED_COUNT];
91  u16 vendor_ext_len[MAX_WPS_PARSE_VENDOR_EXT];
92 
93  const u8 *cred[MAX_CRED_COUNT];
94  const u8 *req_dev_type[MAX_REQ_DEV_TYPE_COUNT];
95  const u8 *vendor_ext[MAX_WPS_PARSE_VENDOR_EXT];
96 };
97 
98 int wps_parse_msg(const struct wpabuf *msg, struct wps_parse_attr *attr);
99 
100 #endif /* WPS_ATTR_PARSE_H */
Definition: wpabuf.h:16
Wi-Fi Protected Setup.
Definition: wps_attr_parse.h:10