WPS: Fix MAC Address inside Credential be that of Enrollee's
[libeap.git] / src / wps / wps.h
index 7798ad8..a85d600 100644 (file)
@@ -43,7 +43,7 @@ struct wps_er;
  * @key_idx: Key index
  * @key: Key
  * @key_len: Key length in octets
- * @mac_addr: MAC address of the peer
+ * @mac_addr: MAC address of the Credential receiver
  * @cred_attr: Unparsed Credential attribute data (used only in cred_cb());
  *     this may be %NULL, if not used
  * @cred_attr_len: Length of cred_attr in octets
@@ -351,7 +351,27 @@ enum wps_event {
        /**
         * WPS_EV_PBC_TIMEOUT - PBC walktime expired before protocol run start
         */
-       WPS_EV_PBC_TIMEOUT
+       WPS_EV_PBC_TIMEOUT,
+
+       /**
+        * WPS_EV_ER_AP_ADD - ER: AP added
+        */
+       WPS_EV_ER_AP_ADD,
+
+       /**
+        * WPS_EV_ER_AP_REMOVE - ER: AP removed
+        */
+       WPS_EV_ER_AP_REMOVE,
+
+       /**
+        * WPS_EV_ER_ENROLLEE_ADD - ER: Enrollee added
+        */
+       WPS_EV_ER_ENROLLEE_ADD,
+
+       /**
+        * WPS_EV_ER_ENROLLEE_REMOVE - ER: Enrollee removed
+        */
+       WPS_EV_ER_ENROLLEE_REMOVE
 };
 
 /**
@@ -390,6 +410,33 @@ union wps_event_data {
                int enrollee;
                int part;
        } pwd_auth_fail;
+
+       struct wps_event_er_ap {
+               const u8 *uuid;
+               const char *friendly_name;
+               const char *manufacturer;
+               const char *manufacturer_url;
+               const char *model_description;
+               const char *model_name;
+               const char *model_number;
+               const char *model_url;
+               const char *serial_number;
+               const char *upc;
+       } ap;
+
+       struct wps_event_er_enrollee {
+               const u8 *uuid;
+               const u8 *mac_addr;
+               int m1_received;
+               u16 config_methods;
+               u16 dev_passwd_id;
+               const u8 *pri_dev_type;
+               const char *dev_name;
+               const char *manufacturer;
+               const char *model_name;
+               const char *model_number;
+               const char *serial_number;
+       } enrollee;
 };
 
 /**
@@ -629,5 +676,8 @@ struct wps_er * wps_er_init(struct wps_context *wps, const char *ifname);
 void wps_er_deinit(struct wps_er *er);
 void wps_er_set_sel_reg(struct wps_er *er, int sel_reg, u16 dev_passwd_id,
                        u16 sel_reg_config_methods);
+int wps_er_pbc(struct wps_er *er, const u8 *uuid);
+int wps_er_learn(struct wps_er *er, const u8 *uuid, const u8 *pin,
+                size_t pin_len);
 
 #endif /* WPS_H */