WPS: Add MAC address to validation error message for Probe Request
[libeap.git] / src / wps / wps.h
index 3364a04..e415061 100644 (file)
@@ -75,6 +75,7 @@ struct wps_credential {
  * @pri_dev_type: Primary Device Type
  * @os_version: OS Version
  * @rf_bands: RF bands (WPS_RF_24GHZ, WPS_RF_50GHZ flags)
+ * @p2p: Whether the device is a P2P device
  */
 struct wps_device_data {
        u8 mac_addr[ETH_ALEN];
@@ -86,6 +87,8 @@ struct wps_device_data {
        u8 pri_dev_type[WPS_DEV_TYPE_LEN];
        u32 os_version;
        u8 rf_bands;
+
+       int p2p;
 };
 
 struct oob_conf_data {
@@ -156,6 +159,11 @@ struct wps_config {
         * struct wpa_context::psk.
         */
        int use_psk_key;
+
+       /**
+        * dev_pw_id - Device Password ID for Enrollee when PIN is used
+        */
+       u16 dev_pw_id;
 };
 
 struct wps_data * wps_init(const struct wps_config *cfg);
@@ -344,6 +352,11 @@ struct wps_registrar_config {
         * static_wep_only - Whether the BSS supports only static WEP
         */
        int static_wep_only;
+
+       /**
+        * dualband - Whether this is a concurrent dualband AP
+        */
+       int dualband;
 };
 
 
@@ -713,10 +726,12 @@ int wps_registrar_add_pin(struct wps_registrar *reg, const u8 *addr,
                          const u8 *uuid, const u8 *pin, size_t pin_len,
                          int timeout);
 int wps_registrar_invalidate_pin(struct wps_registrar *reg, const u8 *uuid);
+int wps_registrar_wps_cancel(struct wps_registrar *reg);
 int wps_registrar_unlock_pin(struct wps_registrar *reg, const u8 *uuid);
 int wps_registrar_button_pushed(struct wps_registrar *reg);
 void wps_registrar_probe_req_rx(struct wps_registrar *reg, const u8 *addr,
-                               const struct wpabuf *wps_data);
+                               const struct wpabuf *wps_data,
+                               int p2p_wildcard);
 int wps_registrar_update_ie(struct wps_registrar *reg);
 int wps_registrar_get_info(struct wps_registrar *reg, const u8 *addr,
                           char *buf, size_t buflen);
@@ -753,8 +768,9 @@ u16 wps_config_methods_str2bin(const char *str);
 
 #ifdef CONFIG_WPS_STRICT
 int wps_validate_beacon(const struct wpabuf *wps_ie);
-int wps_validate_beacon_probe_resp(const struct wpabuf *wps_ie, int probe);
-int wps_validate_probe_req(const struct wpabuf *wps_ie);
+int wps_validate_beacon_probe_resp(const struct wpabuf *wps_ie, int probe,
+                                  const u8 *addr);
+int wps_validate_probe_req(const struct wpabuf *wps_ie, const u8 *addr);
 int wps_validate_assoc_req(const struct wpabuf *wps_ie);
 int wps_validate_assoc_resp(const struct wpabuf *wps_ie);
 int wps_validate_m1(const struct wpabuf *tlvs);
@@ -774,18 +790,20 @@ int wps_validate_m8_encr(const struct wpabuf *tlvs, int ap);
 int wps_validate_wsc_ack(const struct wpabuf *tlvs);
 int wps_validate_wsc_nack(const struct wpabuf *tlvs);
 int wps_validate_wsc_done(const struct wpabuf *tlvs);
+int wps_validate_upnp_set_selected_registrar(const struct wpabuf *tlvs);
 #else /* CONFIG_WPS_STRICT */
 static inline int wps_validate_beacon(const struct wpabuf *wps_ie){
        return 0;
 }
 
 static inline int wps_validate_beacon_probe_resp(const struct wpabuf *wps_ie,
-                                                int probe)
+                                                int probe, const u8 *addr)
 {
        return 0;
 }
 
-static inline int wps_validate_probe_req(const struct wpabuf *wps_ie)
+static inline int wps_validate_probe_req(const struct wpabuf *wps_ie,
+                                        const u8 *addr)
 {
        return 0;
 }
@@ -884,6 +902,12 @@ static inline int wps_validate_wsc_done(const struct wpabuf *tlvs)
 {
        return 0;
 }
+
+static inline int wps_validate_upnp_set_selected_registrar(
+       const struct wpabuf *tlvs)
+{
+       return 0;
+}
 #endif /* CONFIG_WPS_STRICT */
 
 #endif /* WPS_H */