Use generic driver event notification for AP mode assoc/disassoc
[libeap.git] / src / ap / hostapd.h
index 39dc640..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,
@@ -176,6 +182,7 @@ struct hostapd_data {
 struct hostapd_iface {
        struct hapd_interfaces *interfaces;
        void *owner;
+       int (*reload_config)(struct hostapd_iface *iface);
        struct hostapd_config * (*config_read_cb)(const char *config_fname);
        char *config_fname;
        struct hostapd_config *conf;
@@ -224,8 +231,16 @@ struct hostapd_iface {
 
        u16 ht_op_mode;
        void (*scan_cb)(struct hostapd_iface *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 */
 int hostapd_reload_config(struct hostapd_iface *iface);
 struct hostapd_data *
 hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,
@@ -234,21 +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);
-int handle_reload_iface(struct hostapd_iface *iface, void *ctx);
-int handle_dump_state_iface(struct hostapd_iface *iface, void *ctx);
-
-int hostapd_for_each_interface(struct hapd_interfaces *interfaces,
-                              int (*cb)(struct hostapd_iface *iface,
-                                        void *ctx), void *ctx);
+void hostapd_interface_free(struct hostapd_iface *iface);
+void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
+                          int reassoc);
 
+/* 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);
 
-int eap_server_register_methods(void);
-void hostapd_set_driver_ops(struct hostapd_driver_ops *ops);
-void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
-                          int reassoc);
+/* 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 */