#include <stdio.h>
#include <stdlib.h>
#include <glib.h>
#include <net/ethernet.h>
#include <linux/socket.h>
#include <gconf/gconf-client.h>
#include <osso-ic-dbus.h>
#include <syslog.h>
#include <dbus/dbus.h>
#include <eap-dbus.h>
#include <wlancond-dbus.h>
#include "log.h"
#include "dbus.h"
#include "dbus-helper.h"
#include "dbus-handler.h"
#include "common.h"
#include "wpa.h"
Go to the source code of this file.
Data Structures | |
struct | method_handler_t |
Defines | |
#define | DBUS_API_SUBJECT_TO_CHANGE |
#define | WLANCOND_SHUTDOWN_DELAY 4 |
#define | WLANCOND_CONNECT_TIMEOUT 10 |
#define | WLANCOND_SCAN_TIMEOUT 8 |
#define | WLANCOND_RESCAN_DELAY 1 |
#define | WLAN_PREFIX_STR "wlan" |
#define | KILL_SUPPLICANT "/usr/bin/killall" |
#define | SUPPLICANT_NAME "eapd" |
#define | WLANCOND_WAIT_COUNTRY 2000 |
Typedefs | |
typedef DBusHandlerResult(* | handler_func )(DBusMessage *message, DBusConnection *connection) |
Functions | |
void | wlancond_print (guint priority, const char *debug,...) |
int | socket_open (void) |
void | init_iwreq (struct iwreq *req) |
static int | get_own_mac (void) |
static gint | get_gconf_int (const gchar *path) |
static gboolean | get_setting_bool (const gchar *path, gboolean *error) |
void | init_logging (void) |
void | update_own_ie (unsigned char *wpa_ie, guint wpa_ie_len) |
guint | get_encryption_info (void) |
int | clean_dbus_handler (void) |
void | mode_change (const char *mode) |
static DBusHandlerResult | icd_check_signal_dbus (DBusMessage *message) |
static gint | run_calibration (void) |
static void | kill_supplicant (void) |
static gint | check_country_code (void) |
static void | set_bt_coex_state (unsigned int state) |
static DBusHandlerResult | csd_check_signal_dbus (DBusMessage *message) |
static DBusHandlerResult | bluez_check_adapter_signal_dbus (DBusMessage *message) |
static DBusHandlerResult | bluez_check_headset_signal_dbus (DBusMessage *message) |
static gchar * | gateway_bluez_default_adapter_path (void) |
static gboolean | gateway_adapter_point_iter_to_value (DBusMessageIter *msg_iter, const gchar *property_name) |
static DBusMessage * | gateway_adapter_get_property_values (const gchar *adapter_path,...) |
static gint | handle_country (void) |
static void | check_bt_status (void) |
int | init_dbus_handler (void) |
static gboolean | in_flight_mode (void) |
void | set_wlan_signal (gboolean high_or_low) |
void | remove_roam_scan_timer (void) |
void | remove_connect_timer (void) |
static void | remove_wlan_if_timer (void) |
void | remove_scan_timer (void) |
static gboolean | wlan_connect_timer_cb (void *data) |
static gboolean | wlan_scan_cb (void *data) |
static gboolean | wlan_if_down_cb (void *data) |
int | mlme_command (guchar *addr, guint16 cmd, guint16 reason_code) |
static int | set_mode (guint32 mode) |
static int | set_wep_keys (struct connect_params_t *conn) |
int | set_essid (char *essid, int essid_len) |
int | set_bssid (unsigned char *bssid) |
void | set_wlan_state (int new_state, int send_signal, force_t force) |
guint | get_wlan_state (void) |
void | set_scan_state (guint new_state) |
guint | get_scan_state (void) |
guint | get_mode (void) |
gboolean | set_real_power_state (guint new_state, int sock) |
gboolean | set_power_state (guint new_state, int sock) |
static int | init_if (int sock) |
static int | set_we_name (int sock, char *name, char *args[], int count) |
int | get_we_device_name (void) |
int | set_interface_state (int sock, int dir, short flags) |
static gboolean | set_tx_power (guint power, int sock) |
static int | update_algorithms (guint32 encryption, struct scan_results_t *scan_results) |
void | clean_roam_cache (void) |
void | clear_wpa_mode (void) |
gboolean | get_wpa_mode (void) |
static gint | compare_pmk_entry (gconstpointer a, gconstpointer b) |
static void | add_to_pmksa_cache (unsigned char *pmkid, unsigned char *mac) |
gboolean | remove_from_pmksa_cache (unsigned char *mac) |
int | find_pmkid_from_pmk_cache (unsigned char *mac, unsigned char **pmkid) |
int | scan (gchar *ssid, int ssid_len, gboolean add_timer) |
static int | set_freq (int channel) |
static void | init_conn_params (struct connect_params_t *conn_params) |
void | clear_wpa_keys (unsigned char *bssid) |
static int | check_connect_arguments (struct connect_params_t *conn, char *ssid, unsigned char **key) |
static DBusHandlerResult | settings_and_connect_request (DBusMessage *message, DBusConnection *connection) |
int | associate (struct scan_results_t *scan_results) |
static DBusHandlerResult | scan_request (DBusMessage *message, DBusConnection *connection) |
static int | network_compare (gconstpointer a, gconstpointer b) |
static gint | compare_scan_entry (gconstpointer a, gconstpointer b) |
static void | add_to_roam_cache (struct scan_results_t *scan_results) |
gboolean | remove_from_roam_cache (unsigned char *bssid) |
gboolean | decrease_signal_in_roam_cache (unsigned char *bssid) |
static int | check_group_cipher (guint32 c1, guint32 c2) |
static int | check_ciphers (guint32 c1, guint32 c2) |
static gboolean | wlan_roam_scan_cb (void *data) |
void | schedule_scan (guint seconds) |
static void | reschedule_scan (void) |
static gboolean | check_capabilities (struct scan_results_t *scan_results, struct connect_params_t *conn) |
struct scan_results_t * | find_connection (GSList *ap_list, struct connect_params_t *conn, gboolean update_roam_cache) |
static dbus_uint32_t | find_adhoc_channel (GSList *ap_list) |
int | find_connection_and_associate (GSList *scan_results, gboolean update_roam_cache, gboolean create_new_adhoc, gboolean autoconnect) |
static void | registrar_error_signal (void) |
static gboolean | rescan (void *data) |
static void | connect_from_scan_results (GSList *scan_results) |
int | scan_results_ioctl (int ifindex, GSList **scan_results_save) |
gboolean | ask_scan_results (int ifindex) |
static DBusHandlerResult | disconnect_request (DBusMessage *message, DBusConnection *connection) |
static DBusHandlerResult | disassociate_request (DBusMessage *message, DBusConnection *connection) |
static DBusHandlerResult | status_request (DBusMessage *message, DBusConnection *connection) |
static DBusHandlerResult | interface_request (DBusMessage *message, DBusConnection *connection) |
static DBusHandlerResult | connection_status_request (DBusMessage *message, DBusConnection *connection) |
static DBusHandlerResult | set_pmksa_request (DBusMessage *message, DBusConnection *connection) |
static DBusHandlerResult | set_powersave_request (DBusMessage *message, DBusConnection *connection) |
static void | wpa_ie_push_cb (DBusPendingCall *pending, void *user_data) |
int | wpa_ie_push (unsigned char *ap_mac_addr, unsigned char *ap_wpa_ie, int ap_wpa_ie_len, char *ssid, int ssid_len, unsigned int authentication_type) |
int | wpa_mic_failure_event (dbus_bool_t key_type, dbus_bool_t is_fatal) |
int | associate_supplicant (void) |
static void | disassociate_cb (DBusPendingCall *pending, void *user_data) |
int | disassociate_eap (void) |
int | check_pmksa_cache (unsigned char *own_mac, int own_mac_len, unsigned char *bssid, int bssid_len, uint32_t authentication_type, uint32_t pairwise_key_cipher_suite, uint32_t group_key_cipher_suite, int *status) |
DBusHandlerResult | wlancond_req_handler (DBusConnection *connection, DBusMessage *message, void *user_data) |
void | init_dbus_handlers (DBusConnection *connection) |
void | destroy_dbus_handlers (DBusConnection *connection) |
Variables | |
static char * | scan_name_cache = NULL |
static char * | connect_name_cache = NULL |
static int | wlan_socket = -1 |
struct wlan_status_t | wlan_status |
static gboolean | _flight_mode = FALSE |
static gboolean | power_down_after_scan = FALSE |
static dbus_bool_t | saved_inactivity = FALSE |
static dbus_bool_t | saved_bt_power = FALSE |
static guint | wlan_if_down_timer_id = 0 |
static guint | wlan_connect_timer_id = 0 |
static guint | powersave = WLANCOND_SHORT_CAM |
static gint | debug_level = 0 |
static method_handler_t | handlers [] |
static DBusObjectPathVTable | wlancond_req_vtable |
Portions of this file are Copyright (c) 1997-2002 Jean Tourrilhes <jt@hpl.hp.com>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Definition in file dbus-handler.c.
#define KILL_SUPPLICANT "/usr/bin/killall" |
Kill supplicant.
Definition at line 457 of file dbus-handler.c.
static void add_to_pmksa_cache | ( | unsigned char * | pmkid, | |
unsigned char * | mac | |||
) | [static] |
Add PMKID to PMKSA cache.
pmkid | PMKID to add. | |
mac | MAC address associated to PMKID. |
Definition at line 1787 of file dbus-handler.c.
Referenced by set_pmksa_request().
static void add_to_roam_cache | ( | struct scan_results_t * | scan_results | ) | [static] |
Add scan results to roam cache.
scan_results | Scan results to add. |
Definition at line 2551 of file dbus-handler.c.
Referenced by find_connection().
gboolean ask_scan_results | ( | int | ifindex | ) |
Scan results request.
ifindex | Interface index. |
Definition at line 3173 of file dbus-handler.c.
References clean_roam_cache(), clean_scan_results(), connect_from_scan_results(), get_scan_state(), get_wlan_state(), network_compare(), scan_results_ioctl(), send_dbus_scan_results(), set_interface_state(), set_scan_state(), set_wlan_state(), and socket_open().
Referenced by print_event_token().
int associate | ( | struct scan_results_t * | scan_results | ) |
Associate function to associate to selected access point.
scan_results | Scan results. |
Definition at line 2302 of file dbus-handler.c.
References clear_wpa_keys(), get_wpa_mode(), set_bssid(), set_encryption_method(), set_essid(), set_freq(), set_wep_keys(), update_algorithms(), wlan_connect_timer_cb(), and wpa_ie_push().
Referenced by find_connection_and_associate().
int associate_supplicant | ( | void | ) |
Associate EAP D-BUS request.
Definition at line 3798 of file dbus-handler.c.
Referenced by handle_wap_event().
static DBusHandlerResult bluez_check_adapter_signal_dbus | ( | DBusMessage * | message | ) | [static] |
Check BlueZ Adapter DBUS signal.
message | DBUS message. |
Definition at line 613 of file dbus-handler.c.
Referenced by wlancond_req_handler().
static DBusHandlerResult bluez_check_headset_signal_dbus | ( | DBusMessage * | message | ) | [static] |
Check BlueZ Headset DBUS signal.
message | DBUS message. |
Definition at line 660 of file dbus-handler.c.
Referenced by wlancond_req_handler().
static void check_bt_status | ( | void | ) | [static] |
Handles BT state.
Definition at line 902 of file dbus-handler.c.
References gateway_bluez_default_adapter_path().
Referenced by init_dbus_handler().
static gboolean check_capabilities | ( | struct scan_results_t * | scan_results, | |
struct connect_params_t * | conn | |||
) | [static] |
Check capabilities from scan results.
scan_results | Scan results. | |
conn | Connection paramters. |
Definition at line 2752 of file dbus-handler.c.
References check_ciphers().
Referenced by find_connection().
static int check_ciphers | ( | guint32 | c1, | |
guint32 | c2 | |||
) | [static] |
Compare ciphers.
c1 | Cipher 1. | |
c2 | Cipher 2. |
Definition at line 2663 of file dbus-handler.c.
References check_group_cipher().
Referenced by check_capabilities().
static int check_connect_arguments | ( | struct connect_params_t * | conn, | |
char * | ssid, | |||
unsigned char ** | key | |||
) | [static] |
Helper function for checking settings_and_connect DBUS parameters.
conn | Connection parameters. | |
ssid | SSID. | |
key | Encryption keys. |
Definition at line 2036 of file dbus-handler.c.
Referenced by settings_and_connect_request().
static gint check_country_code | ( | void | ) | [static] |
Check country code.
Definition at line 476 of file dbus-handler.c.
Referenced by handle_country().
static int check_group_cipher | ( | guint32 | c1, | |
guint32 | c2 | |||
) | [static] |
Compare group ciphers.
c1 | Cipher 1. | |
c2 | Cipher 2. |
Definition at line 2640 of file dbus-handler.c.
Referenced by check_ciphers().
int check_pmksa_cache | ( | unsigned char * | own_mac, | |
int | own_mac_len, | |||
unsigned char * | bssid, | |||
int | bssid_len, | |||
uint32_t | authentication_type, | |||
uint32_t | pairwise_key_cipher_suite, | |||
uint32_t | group_key_cipher_suite, | |||
int * | status | |||
) |
Checks the PMKSA cache status from the EAP daemon.
own_mac | Our own mac address. | |
own_mac_len | The length of the address(usually ETH_ALEN) | |
bssid | The mac address of the access point. | |
bssid_len | The length of the address(usually ETH_ALEN) | |
authentication_type | The authentication type used. | |
pairwise_key_cipher_suite | The cipher suite to be used | |
group_key_cipher_suite | The cipher suite to be used | |
status | TRUE if the key exists in the cache. On errors this value won't be set. |
Definition at line 3906 of file dbus-handler.c.
Referenced by find_pmkid_from_pmk_cache().
int clean_dbus_handler | ( | void | ) |
Helper function for cleaning handler.
Definition at line 296 of file dbus-handler.c.
void clean_roam_cache | ( | void | ) |
Clean roaming cache.
Definition at line 1739 of file dbus-handler.c.
References clean_scan_results().
Referenced by ask_scan_results(), find_connection(), and set_wlan_state().
void clear_wpa_keys | ( | unsigned char * | bssid | ) |
Clear WPA keys.
bssid | optional BSSID which keys to remove. |
Definition at line 1978 of file dbus-handler.c.
References init_iwreq(), and socket_open().
Referenced by associate(), clear_wpa_mode(), disassociate_request(), and handle_wap_event().
void clear_wpa_mode | ( | void | ) |
Clear WPA mode related stuff.
Definition at line 1746 of file dbus-handler.c.
References clear_wpa_keys().
Referenced by set_wlan_state().
static void connect_from_scan_results | ( | GSList * | scan_results | ) | [static] |
Connects based on scan results.
scan_results_save | List of scan results. |
Definition at line 2980 of file dbus-handler.c.
References clean_scan_results(), find_connection_and_associate(), get_wlan_state(), registrar_error_signal(), rescan(), reschedule_scan(), and set_wlan_state().
Referenced by ask_scan_results().
static DBusHandlerResult connection_status_request | ( | DBusMessage * | message, | |
DBusConnection * | connection | |||
) | [static] |
Connection status D_BUS request.
message | DBUS message. | |
connection | DBUS connection. |
Definition at line 3509 of file dbus-handler.c.
References get_wlan_state().
static DBusHandlerResult csd_check_signal_dbus | ( | DBusMessage * | message | ) | [static] |
Check CSD DBUS signal.
message | DBUS message. |
Definition at line 569 of file dbus-handler.c.
Referenced by wlancond_req_handler().
gboolean decrease_signal_in_roam_cache | ( | unsigned char * | bssid | ) |
Give penalty to failed AP.
bssid | BSSID. |
Definition at line 2615 of file dbus-handler.c.
Referenced by handle_wap_event().
void destroy_dbus_handlers | ( | DBusConnection * | connection | ) |
Destroy D-BUS handlers.
connection | DBUS connection. |
Definition at line 4301 of file dbus-handler.c.
Referenced by main().
static void disassociate_cb | ( | DBusPendingCall * | pending, | |
void * | user_data | |||
) | [static] |
Disassociate callback.
pending | Pending DBUS message. | |
user_data | Callback data. |
Definition at line 3839 of file dbus-handler.c.
Referenced by disassociate_eap().
int disassociate_eap | ( | void | ) |
Disassociate EAP D-BUS request.
Definition at line 3865 of file dbus-handler.c.
References disassociate_cb().
Referenced by handle_wap_event().
static DBusHandlerResult disassociate_request | ( | DBusMessage * | message, | |
DBusConnection * | connection | |||
) | [static] |
Disassociate WLAN D-BUS request.
message | DBUS message. | |
connection | DBUS connection. |
Definition at line 3259 of file dbus-handler.c.
References clear_wpa_keys(), get_wlan_state(), get_wpa_mode(), mlme_command(), scan(), and set_wlan_state().
static DBusHandlerResult disconnect_request | ( | DBusMessage * | message, | |
DBusConnection * | connection | |||
) | [static] |
Disconnect WLAN and remove kernel module D-BUS request.
message | DBUS message. | |
connection | DBUS connection. |
Definition at line 3239 of file dbus-handler.c.
References set_scan_state(), and set_wlan_state().
static dbus_uint32_t find_adhoc_channel | ( | GSList * | ap_list | ) | [static] |
Select Adhoc channel.
ap_list | List of scanned APs. |
Definition at line 2859 of file dbus-handler.c.
Referenced by find_connection_and_associate().
struct scan_results_t* find_connection | ( | GSList * | ap_list, | |
struct connect_params_t * | conn, | |||
gboolean | update_roam_cache | |||
) | [read] |
Find connection.
ap_list | List of access points. | |
conn | Connection parameters. | |
update_roam_cache | Update roaming cache or not. |
Definition at line 2779 of file dbus-handler.c.
References add_to_roam_cache(), check_capabilities(), clean_roam_cache(), and is_ap_in_black_list().
Referenced by find_connection_and_associate().
int find_connection_and_associate | ( | GSList * | scan_results, | |
gboolean | update_roam_cache, | |||
gboolean | create_new_adhoc, | |||
gboolean | autoconnect | |||
) |
Find connection and associate.
scan_results | Scan results. |
Definition at line 2894 of file dbus-handler.c.
References associate(), find_adhoc_channel(), and find_connection().
Referenced by connect_from_scan_results(), handle_wap_event(), settings_and_connect_request(), and wlan_connect_timer_cb().
int find_pmkid_from_pmk_cache | ( | unsigned char * | mac, | |
unsigned char ** | pmkid | |||
) |
Find entry from PMKSA cache.
mac | MAC address to identify the entry. | |
pmkid | This pointer will be set to point the pmkid. This won't be set on errors. |
Definition at line 1860 of file dbus-handler.c.
References check_pmksa_cache(), and remove_from_pmksa_cache().
Referenced by generate_wpa2_ie().
static gchar* gateway_bluez_default_adapter_path | ( | void | ) | [static] |
Check Bluez default adpater.
Definition at line 717 of file dbus-handler.c.
Referenced by check_bt_status().
guint get_encryption_info | ( | void | ) |
Get encryption info.
Definition at line 276 of file dbus-handler.c.
Referenced by handle_wap_event().
static gint get_gconf_int | ( | const gchar * | path | ) | [static] |
Helper function for getting Gconf values.
path | Gconf path to search for user specified value. |
Definition at line 166 of file dbus-handler.c.
Referenced by init_logging(), and set_real_power_state().
guint get_mode | ( | void | ) |
Helper function for getting the wlan mode.
Definition at line 1420 of file dbus-handler.c.
Referenced by icd_check_signal_dbus(), and status_request().
static int get_own_mac | ( | void | ) | [static] |
Function to get own MAC address.
Definition at line 144 of file dbus-handler.c.
References socket_open().
Referenced by init_dbus_handler().
guint get_scan_state | ( | void | ) |
Helper function for getting the scan state.
Definition at line 1412 of file dbus-handler.c.
Referenced by ask_scan_results(), handle_wap_event(), print_event_token(), scan(), and scan_request().
static gboolean get_setting_bool | ( | const gchar * | path, | |
gboolean * | error | |||
) | [static] |
Helper function for getting boolean value from the settings.
path | Setting path to search for user specified value. | |
error | Variable to hold possible error. |
Definition at line 208 of file dbus-handler.c.
Referenced by init_dbus_handler().
int get_we_device_name | ( | void | ) |
Find the name of the wireless device, needed in all ioctl calls. Save the result so that we don't need to find it in every ioctl call.
Definition at line 1579 of file dbus-handler.c.
References set_we_name(), and socket_open().
Referenced by main().
guint get_wlan_state | ( | void | ) |
Helper function for getting the wlan state.
Definition at line 1379 of file dbus-handler.c.
Referenced by ask_scan_results(), connect_from_scan_results(), connection_status_request(), disassociate_request(), handle_custom_event(), handle_wap_event(), icd_check_signal_dbus(), init_if(), rescan(), scan_request(), set_powersave_request(), set_wlan_state(), status_request(), wlan_connect_timer_cb(), and wlan_if_down_cb().
gboolean get_wpa_mode | ( | void | ) |
Check if WPA mode is in use.
Definition at line 1766 of file dbus-handler.c.
Referenced by associate(), disassociate_request(), handle_wap_event(), and set_wlan_state().
static gint handle_country | ( | void | ) | [static] |
Handles WLAN country.
Definition at line 881 of file dbus-handler.c.
References check_country_code(), and run_calibration().
Referenced by init_dbus_handler(), and init_if().
static DBusHandlerResult icd_check_signal_dbus | ( | DBusMessage * | message | ) | [static] |
Helper function for mode change DBUS handling.
message | DBUS message. Check ICD DBUS signal. | |
message | DBUS message. |
Definition at line 395 of file dbus-handler.c.
References get_mode(), get_wlan_state(), set_power_state(), set_wlan_state(), and socket_open().
Referenced by wlancond_req_handler().
int init_dbus_handler | ( | void | ) |
Helper function for initializing handler structs
Definition at line 943 of file dbus-handler.c.
References check_bt_status(), get_own_mac(), get_setting_bool(), and handle_country().
Referenced by main().
void init_dbus_handlers | ( | DBusConnection * | connection | ) |
Create bindings for D-BUS handlers.
connection | DBUS connection. |
Definition at line 4271 of file dbus-handler.c.
Referenced by main().
static int init_if | ( | int | sock | ) | [static] |
Initialize the WLAN interface.
sock | socket. |
Definition at line 1522 of file dbus-handler.c.
References get_wlan_state(), handle_country(), set_interface_state(), set_power_state(), and set_wlan_state().
Referenced by scan_request(), and settings_and_connect_request().
void init_iwreq | ( | struct iwreq * | req | ) |
Helper function for initializing the iwreq.
Definition at line 136 of file dbus-handler.c.
Referenced by clear_wpa_keys(), mlme_command(), scan(), scan_results_ioctl(), set_bssid(), set_encryption_method_helper(), set_essid(), set_freq(), set_mode(), set_real_power_state(), set_tx_power(), set_wep_keys(), set_wpa_ie(), and status_request().
void init_logging | ( | void | ) |
Initialize logging.
Definition at line 251 of file dbus-handler.c.
References get_gconf_int().
Referenced by main().
static DBusHandlerResult interface_request | ( | DBusMessage * | message, | |
DBusConnection * | connection | |||
) | [static] |
Interface D_BUS request.
message | DBUS message. | |
connection | DBUS connection. |
Definition at line 3487 of file dbus-handler.c.
int mlme_command | ( | guchar * | addr, | |
guint16 | cmd, | |||
guint16 | reason_code | |||
) |
MLME command.
addr | Access point MAC address. | |
cmd | Command. | |
reason_code | Reason for leaving. |
Definition at line 1096 of file dbus-handler.c.
References init_iwreq(), and socket_open().
Referenced by disassociate_request(), handle_mic_failure(), and set_wlan_state().
void mode_change | ( | const char * | mode | ) |
Helper function for mode change.
mode | New mode. |
Definition at line 307 of file dbus-handler.c.
References set_wlan_state().
Referenced by main().
static int network_compare | ( | gconstpointer | a, | |
gconstpointer | b | |||
) | [static] |
Network compare.
a | Pointer to scan_result 1. | |
b | Pointer to scan result 2. |
Definition at line 2502 of file dbus-handler.c.
Referenced by ask_scan_results().
static void registrar_error_signal | ( | void | ) | [static] |
Send WPS too many registrars signal.
Definition at line 2949 of file dbus-handler.c.
Referenced by connect_from_scan_results().
gboolean remove_from_pmksa_cache | ( | unsigned char * | mac | ) |
Removes an entry with the given mac address from the PMKSA cache.
mac | The mac address to be removed. |
Definition at line 1834 of file dbus-handler.c.
Referenced by find_pmkid_from_pmk_cache().
gboolean remove_from_roam_cache | ( | unsigned char * | bssid | ) |
Remove from roam cache.
bssid | BSSID to remove. |
Definition at line 2587 of file dbus-handler.c.
Referenced by wlan_connect_timer_cb().
static gboolean rescan | ( | void * | data | ) | [static] |
Helper function for rescanning from a timer.
Definition at line 2964 of file dbus-handler.c.
References get_wlan_state(), scan(), and set_wlan_state().
Referenced by connect_from_scan_results().
static void reschedule_scan | ( | void | ) | [static] |
Reschedule scan.
Definition at line 2724 of file dbus-handler.c.
References schedule_scan().
Referenced by connect_from_scan_results().
static gint run_calibration | ( | void | ) | [static] |
Runs calibration data to WLAN firmware.
Definition at line 442 of file dbus-handler.c.
Referenced by handle_country().
int scan | ( | gchar * | ssid, | |
int | ssid_len, | |||
gboolean | add_timer | |||
) |
Helper function for scanning.
ssid | SSID to scan. | |
ssid_len | SSID length. |
Definition at line 1907 of file dbus-handler.c.
References get_scan_state(), init_iwreq(), set_scan_state(), socket_open(), and wlan_scan_cb().
Referenced by disassociate_request(), handle_wap_event(), rescan(), scan_request(), settings_and_connect_request(), and wlan_connect_timer_cb().
static DBusHandlerResult scan_request | ( | DBusMessage * | message, | |
DBusConnection * | connection | |||
) | [static] |
Scan D-BUS request.
message | DBUS message. | |
connection | DBUS connection. |
Definition at line 2385 of file dbus-handler.c.
References get_scan_state(), get_wlan_state(), init_if(), scan(), set_tx_power(), set_wlan_state(), and socket_open().
int scan_results_ioctl | ( | int | ifindex, | |
GSList ** | scan_results_save | |||
) |
Get scan results from mac80211.
ifindex | Interface index. | |
scan_results_save | Scan results to save. |
Definition at line 3032 of file dbus-handler.c.
References get_interface_data(), init_iwreq(), print_event_token(), save_scan_results(), and socket_open().
Referenced by ask_scan_results(), and settings_and_connect_request().
void schedule_scan | ( | guint | seconds | ) |
Schedule scan.
seconds | Delay scan for this many seconds. |
Definition at line 2711 of file dbus-handler.c.
Referenced by handle_custom_event(), and reschedule_scan().
int set_bssid | ( | unsigned char * | bssid | ) |
Helper function for setting the BSSID.
bssid | BSSID. |
Definition at line 1245 of file dbus-handler.c.
References init_iwreq(), and socket_open().
Referenced by associate(), handle_wap_event(), and set_wlan_state().
int set_essid | ( | char * | essid, | |
int | essid_len | |||
) |
Helper function for setting the ESSID.
essid | ESSID. | |
essid_len | ESSID length. |
Definition at line 1222 of file dbus-handler.c.
References init_iwreq(), and socket_open().
Referenced by associate(), handle_wap_event(), and set_wlan_state().
static int set_freq | ( | int | channel | ) | [static] |
Helper function for setting the channel.
channel | Channel. |
Definition at line 1953 of file dbus-handler.c.
References init_iwreq(), and socket_open().
Referenced by associate().
int set_interface_state | ( | int | sock, | |
int | dir, | |||
short | flags | |||
) |
Set interface state.
socket | socket. | |
dir | direction. | |
flags | settings flags. |
Definition at line 1599 of file dbus-handler.c.
Referenced by ask_scan_results(), init_if(), and set_wlan_state().
static int set_mode | ( | guint32 | mode | ) | [static] |
Helper function for setting the operating mode.
Definition at line 1126 of file dbus-handler.c.
References init_iwreq(), and socket_open().
Referenced by settings_and_connect_request().
static DBusHandlerResult set_pmksa_request | ( | DBusMessage * | message, | |
DBusConnection * | connection | |||
) | [static] |
Set pmksa D-BUS request.
message | DBUS message. | |
connection | DBUS connection. |
Definition at line 3539 of file dbus-handler.c.
References add_to_pmksa_cache().
gboolean set_power_state | ( | guint | new_state, | |
int | sock | |||
) |
Request WLAN power state.
state | New power state. | |
sock | socket. |
Definition at line 1493 of file dbus-handler.c.
References set_real_power_state().
Referenced by icd_check_signal_dbus(), init_if(), set_powersave_request(), set_wlan_state(), and settings_and_connect_request().
static DBusHandlerResult set_powersave_request | ( | DBusMessage * | message, | |
DBusConnection * | connection | |||
) | [static] |
Set powersave D-BUS request.
message | DBUS message. | |
connection | DBUS connection. |
Definition at line 3600 of file dbus-handler.c.
References get_wlan_state(), set_power_state(), set_wlan_state(), and socket_open().
gboolean set_real_power_state | ( | guint | new_state, | |
int | sock | |||
) |
Sets the real WLAN hardware power state.
state | New power state. | |
sock | socket. |
Definition at line 1431 of file dbus-handler.c.
References get_gconf_int(), and init_iwreq().
Referenced by set_power_state().
void set_scan_state | ( | guint | new_state | ) |
Helper function for setting new scan state.
new_state | New scan state. |
Definition at line 1388 of file dbus-handler.c.
References send_dbus_scan_results().
Referenced by ask_scan_results(), del_interface_data(), disconnect_request(), scan(), set_wlan_state(), and settings_and_connect_request().
static gboolean set_tx_power | ( | guint | power, | |
int | sock | |||
) | [static] |
Set tx power level.
power | Power level. | |
sock | socket. |
Definition at line 1635 of file dbus-handler.c.
References init_iwreq().
Referenced by scan_request(), and settings_and_connect_request().
static int set_we_name | ( | int | sock, | |
char * | name, | |||
char * | args[], | |||
int | count | |||
) | [static] |
Cache the wireless interface name.
sock | socket. | |
name | inteface name. | |
args | not used. | |
count | not used. |
Definition at line 1554 of file dbus-handler.c.
Referenced by get_we_device_name().
static int set_wep_keys | ( | struct connect_params_t * | conn | ) | [static] |
Helper function for setting the WEP keys.
conn | Connection parameters. |
Definition at line 1157 of file dbus-handler.c.
References init_iwreq(), and socket_open().
Referenced by associate().
void set_wlan_state | ( | int | new_state, | |
int | send_signal, | |||
force_t | force | |||
) |
Helper function for setting new wlan state
new_state | New state for WLAN. | |
send_signal | Should signal be sent. | |
force | If shutdown is forced or not. |
Definition at line 1270 of file dbus-handler.c.
References clean_roam_cache(), clear_wpa_mode(), disconnected_signal(), get_wlan_state(), get_wpa_mode(), mlme_command(), set_bssid(), set_essid(), set_interface_state(), set_power_state(), set_scan_state(), socket_open(), and wlan_if_down_cb().
Referenced by ask_scan_results(), connect_from_scan_results(), del_interface_data(), disassociate_request(), disconnect_request(), handle_mic_failure(), handle_wap_event(), icd_check_signal_dbus(), init_if(), main(), mode_change(), print_event_token(), rescan(), scan_request(), set_powersave_request(), settings_and_connect_request(), wlan_connect_timer_cb(), wlan_if_down_cb(), wlan_scan_cb(), and wpa_ie_push_cb().
static DBusHandlerResult settings_and_connect_request | ( | DBusMessage * | message, | |
DBusConnection * | connection | |||
) | [static] |
Settings and connect D-BUS request.
message | DBUS message. | |
connection | DBUS connection. |
Definition at line 2122 of file dbus-handler.c.
References check_connect_arguments(), clean_scan_results(), find_connection_and_associate(), init_if(), scan(), scan_results_ioctl(), set_mode(), set_power_state(), set_scan_state(), set_tx_power(), set_wlan_state(), and socket_open().
int socket_open | ( | void | ) |
Helper function for socket opening.
Definition at line 121 of file dbus-handler.c.
Referenced by ask_scan_results(), clear_wpa_keys(), get_interface_data(), get_own_mac(), get_we_device_name(), icd_check_signal_dbus(), mlme_command(), scan(), scan_request(), scan_results_ioctl(), set_bssid(), set_encryption_method_helper(), set_essid(), set_freq(), set_mode(), set_powersave_request(), set_wep_keys(), set_wlan_state(), set_wpa_ie(), settings_and_connect_request(), and status_request().
static DBusHandlerResult status_request | ( | DBusMessage * | message, | |
DBusConnection * | connection | |||
) | [static] |
Status D_BUS request.
message | DBUS message. | |
connection | DBUS connection. |
Definition at line 3300 of file dbus-handler.c.
References get_mode(), get_wlan_state(), init_iwreq(), and socket_open().
static int update_algorithms | ( | guint32 | encryption, | |
struct scan_results_t * | scan_results | |||
) | [static] |
Updates algorithms to internal status.
encryption | Encryption settings. |
Definition at line 1664 of file dbus-handler.c.
Referenced by associate().
void update_own_ie | ( | unsigned char * | wpa_ie, | |
guint | wpa_ie_len | |||
) |
Update our Information Element.
wpa_ie | WPA Information Element. | |
wpa_ie_len | WPA Information Element length. |
Definition at line 266 of file dbus-handler.c.
Referenced by generate_wpa2_ie(), and generate_wpa_ie().
static gboolean wlan_connect_timer_cb | ( | void * | data | ) | [static] |
WLAN connect timer callback.
data | User data. |
Definition at line 1014 of file dbus-handler.c.
References find_connection_and_associate(), get_wlan_state(), remove_from_roam_cache(), scan(), and set_wlan_state().
Referenced by associate().
static gboolean wlan_if_down_cb | ( | void * | data | ) | [static] |
WLAN interface down callback.
data | User data. |
Definition at line 1074 of file dbus-handler.c.
References get_wlan_state(), and set_wlan_state().
Referenced by set_wlan_state().
static gboolean wlan_scan_cb | ( | void * | data | ) | [static] |
WLAN scan callback.
data | User data. |
Definition at line 1058 of file dbus-handler.c.
References set_wlan_state().
Referenced by scan().
void wlancond_print | ( | guint | priority, | |
const char * | debug, | |||
... | ||||
) |
Wlancond debug printing function.
Definition at line 82 of file dbus-handler.c.
DBusHandlerResult wlancond_req_handler | ( | DBusConnection * | connection, | |
DBusMessage * | message, | |||
void * | user_data | |||
) |
Generic handler for D-Bus requests.
message | DBUS message. | |
connection | DBUS connection. |
Definition at line 4187 of file dbus-handler.c.
References bluez_check_adapter_signal_dbus(), bluez_check_headset_signal_dbus(), csd_check_signal_dbus(), and icd_check_signal_dbus().
int wpa_ie_push | ( | unsigned char * | ap_mac_addr, | |
unsigned char * | ap_wpa_ie, | |||
int | ap_wpa_ie_len, | |||
char * | ssid, | |||
int | ssid_len, | |||
unsigned int | authentication_type | |||
) |
WPA IE D-BUS push.
ap_mac_addr | Access point MAC address. | |
ap_wpa_ie | Pointer to access point WPA IE. | |
ap_wpa_ie_len | Access point WPA IE length. | |
authentication_type | authentication type. |
Definition at line 3697 of file dbus-handler.c.
References wpa_ie_push_cb().
Referenced by associate().
static void wpa_ie_push_cb | ( | DBusPendingCall * | pending, | |
void * | user_data | |||
) | [static] |
WPA IE callback.
pending | Pending DBUS message. | |
user_data | Callback data. |
Definition at line 3661 of file dbus-handler.c.
References set_wlan_state().
Referenced by wpa_ie_push().
int wpa_mic_failure_event | ( | dbus_bool_t | key_type, | |
dbus_bool_t | is_fatal | |||
) |
WPA MIC failure event D-BUS request.
key_type | Key type, Unicast/Broadcast key. | |
is_fatal | Error is fatal if true. |
Definition at line 3754 of file dbus-handler.c.
Referenced by handle_mic_failure().
method_handler_t handlers[] [static] |
Initial value:
{ { WLANCOND_REQ_INTERFACE, WLANCOND_SETTINGS_AND_CONNECT_REQ, settings_and_connect_request}, { WLANCOND_REQ_INTERFACE, WLANCOND_SCAN_REQ, scan_request}, { WLANCOND_REQ_INTERFACE, WLANCOND_STATUS_REQ, status_request}, { WLANCOND_REQ_INTERFACE, WLANCOND_INTERFACE_REQ, interface_request}, { WLANCOND_REQ_INTERFACE, WLANCOND_CONNECTION_STATUS_REQ, connection_status_request}, { WLANCOND_REQ_INTERFACE, WLANCOND_SET_PMKSA_REQ, set_pmksa_request}, { WLANCOND_REQ_INTERFACE, WLANCOND_SET_POWERSAVE_REQ, set_powersave_request}, { WLANCOND_REQ_INTERFACE, WLANCOND_DISCONNECT_REQ, disconnect_request}, { WLANCOND_REQ_INTERFACE, WLANCOND_DISASSOCIATE_REQ, disassociate_request}, { NULL } }
Definition at line 4164 of file dbus-handler.c.
DBusObjectPathVTable wlancond_req_vtable [static] |
Initial value:
{ .message_function = wlancond_req_handler, .unregister_function = NULL }
Definition at line 4261 of file dbus-handler.c.