00001
00023 #ifndef _DBUS_HANDLER_H_
00024 #define _DBUS_HANDLER_H_
00025
00026 #include <sys/types.h>
00027 #include <sys/socket.h>
00028 #include <linux/types.h>
00029 #include <linux/netlink.h>
00030 #include <linux/rtnetlink.h>
00031 #include <linux/if_ether.h>
00032 #include <iwlib.h>
00033 #include <wireless.h>
00034 #define DBUS_API_SUBJECT_TO_CHANGE
00035 #include <dbus/dbus.h>
00036 #include <wlancond.h>
00037
00038 #include "common.h"
00039
00043 void init_dbus_handlers(DBusConnection *connection);
00044
00048 void destroy_dbus_handlers(DBusConnection *connection);
00049
00050 int socket_open(void);
00051 void init_iwreq(struct iwreq* req);
00052 gboolean ask_scan_results(int ifindex);
00053 void set_wlan_state(int new_state, int send_signal, force_t force);
00054 guint get_wlan_state(void);
00055 void set_scan_state(guint new_state);
00056 guint get_scan_state(void);
00057 int init_dbus_handler(void);
00058 int clean_dbus_handler(void);
00059 void clear_wpa_mode(void);
00060 int wpa_ie_push(unsigned char* ap_mac_addr, unsigned char* ap_wpa_ie,
00061 int ap_wpa_ie_len, char* ssid, int ssid_len,
00062 unsigned int authentication_type);
00063 gboolean get_wpa_mode(void);
00064 int set_interface_state(int sock, int dir, short flags);
00065 void clear_wpa_keys(unsigned char* bssid);
00066 void clean_roam_cache(void);
00067 guint get_mode(void);
00068 int scan(gchar *ssid, int ssid_len, gboolean add_timer);
00069 void update_own_ie(unsigned char* wpa_ie, guint wpa_ie_len);
00070 gboolean set_power_state(guint state, int sock);
00071 guint get_encryption_info(void);
00072 void remove_connect_timer(void);
00073 int disassociate_eap(void);
00074 int wpa_mic_failure_event(dbus_bool_t key_type, dbus_bool_t is_fatal);
00075 int get_we_device_name(void);
00076 unsigned char* find_pmkid_from_pmk_cache(unsigned char* mac);
00077 DBusHandlerResult wlancond_req_handler(DBusConnection *connection,
00078 DBusMessage *message, void *user_data);
00079
00080 int associate(struct scan_results_t *scan_results);
00081 gboolean remove_from_roam_cache(unsigned char *bssid);
00082 struct scan_results_t* find_connection(
00083 GSList* scan_list, struct connect_params_t *conn,
00084 gboolean update_roam_cache);
00085 void remove_roam_scan_timer(void);
00086 void remove_scan_timer(void);
00087 int associate_supplicant(void);
00088 int set_bssid(unsigned char *bssid);
00089 int set_essid(char* essid, int essid_len);
00090 int find_connection_and_associate(GSList *scan_results,
00091 gboolean update_roam_cache,
00092 gboolean create_new_adhoc);
00093 int scan_results_ioctl(int ifindex, GSList** scan_results_save);
00094 void set_wlan_signal(gboolean high_or_low);
00095 gboolean decrease_signal_in_roam_cache(unsigned char *bssid);
00096 int mlme_command(guchar* addr, guint16 cmd, guint16 reason_code);
00097 void schedule_scan(guint seconds);
00098
00099 #define CLEAR 1
00100 #define SET 2
00101
00102 #define ETOOMANYREGISTRARS -500
00103
00104 #endif