Use generic driver event notification for AP mode assoc/disassoc
[libeap.git] / src / ap / hostapd.h
index 1f753cf..7c6b0b7 100644 (file)
@@ -29,7 +29,7 @@ struct ieee80211_ht_capabilities;
 struct full_dynamic_vlan;
 
 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,6 +40,12 @@ 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,
@@ -52,7 +58,7 @@ struct hostapd_driver_ops {
        int (*set_authorized)(struct hostapd_data *hapd, struct sta_info *sta,
                              int authorized);
        int (*set_key)(const char *ifname, struct hostapd_data *hapd,
-                      wpa_alg alg, const u8 *addr, int key_idx,
+                      enum wpa_alg alg, const u8 *addr, int key_idx,
                       int set_tx, const u8 *seq, size_t seq_len,
                       const u8 *key, size_t key_len);
        int (*read_sta_data)(struct hostapd_data *hapd,
@@ -228,6 +234,10 @@ struct hostapd_iface {
 
        int (*ctrl_iface_init)(struct hostapd_data *hapd);
        void (*ctrl_iface_deinit)(struct hostapd_data *hapd);
+
+       int (*for_each_interface)(struct hapd_interfaces *interfaces,
+                                 int (*cb)(struct hostapd_iface *iface,
+                                           void *ctx), void *ctx);
 };
 
 /* hostapd.c */
@@ -239,19 +249,20 @@ hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,
 int hostapd_setup_interface(struct hostapd_iface *iface);
 int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err);
 void hostapd_interface_deinit(struct hostapd_iface *iface);
+void hostapd_interface_free(struct hostapd_iface *iface);
 void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
                           int reassoc);
 
-/* main.c */
-int hostapd_for_each_interface(struct hapd_interfaces *interfaces,
-                              int (*cb)(struct hostapd_iface *iface,
-                                        void *ctx), void *ctx);
-
 /* 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 */