P2P: Send AP mode WPS-FAIL event to parent interface
[libeap.git] / src / ap / hostapd.h
index f3cbad2..a4ae8dc 100644 (file)
@@ -27,9 +27,11 @@ struct sta_info;
 struct hostap_sta_driver_data;
 struct ieee80211_ht_capabilities;
 struct full_dynamic_vlan;
+enum wps_event;
+union wps_event_data;
 
 struct hostapd_probereq_cb {
-       void (*cb)(void *ctx, const u8 *sa, const u8 *ie, size_t ie_len);
+       int (*cb)(void *ctx, const u8 *sa, const u8 *ie, size_t ie_len);
        void *ctx;
 };
 
@@ -40,11 +42,15 @@ struct hostapd_rate_data {
        int flags; /* HOSTAPD_RATE_ flags */
 };
 
+struct hostapd_frame_info {
+       u32 channel;
+       u32 datarate;
+       u32 ssi_signal;
+};
+
 
 struct hostapd_driver_ops {
-       int (*set_ap_wps_ie)(struct hostapd_data *hapd,
-                            const struct wpabuf *beacon,
-                            const struct wpabuf *probe);
+       int (*set_ap_wps_ie)(struct hostapd_data *hapd);
        int (*send_mgmt_frame)(struct hostapd_data *hapd, const void *msg,
                               size_t len);
        int (*send_eapol)(struct hostapd_data *hapd, const u8 *addr,
@@ -68,7 +74,7 @@ struct hostapd_driver_ops {
        int (*set_radius_acl_expire)(struct hostapd_data *hapd,
                                     const u8 *mac);
        int (*set_bss_params)(struct hostapd_data *hapd, int use_protection);
-       int (*set_beacon)(const char *ifname, struct hostapd_data *hapd,
+       int (*set_beacon)(struct hostapd_data *hapd,
                          const u8 *head, size_t head_len,
                          const u8 *tail, size_t tail_len, int dtim_period,
                          int beacon_int);
@@ -83,7 +89,7 @@ struct hostapd_driver_ops {
                          int reason);
        int (*sta_disassoc)(struct hostapd_data *hapd, const u8 *addr,
                            int reason);
-       int (*sta_add)(const char *ifname, struct hostapd_data *hapd,
+       int (*sta_add)(struct hostapd_data *hapd,
                       const u8 *addr, u16 aid, u16 capability,
                       const u8 *supp_rates, size_t supp_rates_len,
                       u16 listen_interval,
@@ -158,15 +164,47 @@ struct hostapd_data {
        struct l2_packet_data *l2;
        struct wps_context *wps;
 
-#ifdef CONFIG_WPS
        struct wpabuf *wps_beacon_ie;
        struct wpabuf *wps_probe_resp_ie;
+#ifdef CONFIG_WPS
        unsigned int ap_pin_failures;
        struct upnp_wps_device_sm *wps_upnp;
+       unsigned int ap_pin_lockout_time;
 #endif /* CONFIG_WPS */
 
        struct hostapd_probereq_cb *probereq_cb;
        size_t num_probereq_cb;
+
+       void (*public_action_cb)(void *ctx, const u8 *buf, size_t len,
+                                int freq);
+       void *public_action_cb_ctx;
+
+       int (*vendor_action_cb)(void *ctx, const u8 *buf, size_t len,
+                               int freq);
+       void *vendor_action_cb_ctx;
+
+       void (*wps_reg_success_cb)(void *ctx, const u8 *mac_addr,
+                                  const u8 *uuid_e);
+       void *wps_reg_success_cb_ctx;
+
+       void (*wps_event_cb)(void *ctx, enum wps_event event,
+                            union wps_event_data *data);
+       void *wps_event_cb_ctx;
+
+#ifdef CONFIG_P2P
+       struct p2p_data *p2p;
+       struct p2p_group *p2p_group;
+       struct wpabuf *p2p_beacon_ie;
+       struct wpabuf *p2p_probe_resp_ie;
+
+       /* Number of non-P2P association stations */
+       int num_sta_no_p2p;
+
+       /* Periodic NoA (used only when no non-P2P clients in the group) */
+       int noa_enabled;
+       int noa_start;
+       int noa_duration;
+#endif /* CONFIG_P2P */
 };
 
 
@@ -196,6 +234,7 @@ struct hostapd_iface {
         * current_mode->channels */
        int num_rates;
        struct hostapd_rate_data *current_rates;
+       int freq;
 
        u16 hw_flags;
 
@@ -249,9 +288,14 @@ void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
 
 /* utils.c */
 int hostapd_register_probereq_cb(struct hostapd_data *hapd,
-                                void (*cb)(void *ctx, const u8 *sa,
-                                           const u8 *ie, size_t ie_len),
+                                int (*cb)(void *ctx, const u8 *sa,
+                                          const u8 *ie, size_t ie_len),
                                 void *ctx);
 void hostapd_prune_associations(struct hostapd_data *hapd, const u8 *addr);
 
+/* drv_callbacks.c (TODO: move to somewhere else?) */
+int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr,
+                       const u8 *ie, size_t ielen);
+void hostapd_notif_disassoc(struct hostapd_data *hapd, const u8 *addr);
+
 #endif /* HOSTAPD_H */