dbus-handler.c File Reference

#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 <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"

Include dependency graph for dbus-handler.c:

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   4000
#define WLANCOND_CONNECT_TIMEOUT   15000
#define WLANCOND_SCAN_TIMEOUT   12000
#define WLAN_PREFIX_STR   "wlan"
#define DEBUG_KEY

Typedefs

typedef DBusHandlerResult(*) handler_func (DBusMessage *message, DBusConnection *connection)

Functions

int socket_open (void)
void init_iwreq (struct iwreq *req)
static int get_own_mac (void)
static gint get_gconf_int (const gchar *path)
void update_own_ie (unsigned char *wpa_ie, guint wpa_ie_len)
guint get_encryption_info (void)
int init_dbus_handler (void)
int clean_dbus_handler (void)
void mode_change (const char *mode)
static DBusHandlerResult icd_check_signal_dbus (DBusMessage *message)
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)
static 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_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)
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)
unsigned char * find_pmkid_from_pmk_cache (unsigned char *mac)
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)
static void reschedule_scan (void)
static gboolean check_capabilities (struct scan_results_t *scan_results, struct connect_params_t *conn)
scan_results_tfind_connection (GSList *ap_list, struct connect_params_t *conn, gboolean update_roam_cache)
int find_connection_and_associate (GSList *scan_results, gboolean update_roam_cache)
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)
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
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 guint wlan_if_down_timer_id = 0
static guint wlan_connect_timer_id = 0
static guint powersave = WLANCOND_SHORT_CAM
static method_handler_t handlers []
static DBusObjectPathVTable wlancond_req_vtable


Detailed Description

Copyright (C) 2004-2008 Nokia Corporation. All rights reserved.

Author:
Janne Ylälehto <janne.ylalehto@nokia.com>
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.


Function Documentation

static void add_to_pmksa_cache ( unsigned char *  pmkid,
unsigned char *  mac 
) [static]

Add PMKID to PMKSA cache.

Parameters:
pmkid PMKID to add.
mac MAC address associated to PMKID.

Definition at line 1092 of file dbus-handler.c.

References pmksa_cache_t::mac, wlan_status_t::pmk_cache, PMK_CACHE_SIZE, print_mac(), and wlan_status.

Referenced by set_pmksa_request().

Here is the call graph for this function:

static void add_to_roam_cache ( struct scan_results_t scan_results  )  [static]

Add scan results to roam cache.

Parameters:
scan_results Scan results to add.

Definition at line 1746 of file dbus-handler.c.

References scan_results_t::bssid, clean_scan_results_item(), compare_scan_entry(), print_mac(), wlan_status_t::roam_cache, wlan_status, scan_results_t::wpa_ie, and scan_results_t::wpa_ie_len.

Here is the call graph for this function:

gboolean ask_scan_results ( int  ifindex  ) 

Scan results request.

Parameters:
ifindex Interface index.
Returns:
status.

Definition at line 2206 of file dbus-handler.c.

References clean_roam_cache(), clean_scan_results(), CLEAR, connect_from_scan_results(), get_scan_state(), get_wlan_state(), network_compare(), NO_SIGNAL, power_down_after_scan, wlan_status_t::roam_cache, scan_name_cache, scan_results_ioctl(), send_dbus_scan_results(), set_interface_state(), set_scan_state(), set_wlan_state(), wlan_status_t::signal, socket_open(), wlan_status, WLANCOND_LOW, and WLANCOND_MAX_NETWORKS.

Referenced by print_event_token().

Here is the call graph for this function:

int associate ( struct scan_results_t scan_results  ) 

Associate function to associate to selected access point.

Parameters:
scan_results Scan results.
Returns:
status.

Definition at line 1510 of file dbus-handler.c.

References connect_params_t::adhoc_channel, connect_params_t::authentication_type, connect_params_t::bssid, scan_results_t::bssid, scan_results_t::channel, clear_wpa_keys(), wlan_status_t::conn, connect_params_t::encryption, get_wpa_mode(), connect_params_t::mode, set_bssid(), set_encryption_method(), set_essid(), set_freq(), set_wep_keys(), scan_results_t::ssid, connect_params_t::ssid, scan_results_t::ssid_len, connect_params_t::ssid_len, update_algorithms(), wlan_connect_timer_cb(), wlan_connect_timer_id, wlan_status, WLANCOND_CONNECT_TIMEOUT, scan_results_t::wpa_ie, scan_results_t::wpa_ie_len, and wpa_ie_push().

Referenced by find_connection_and_associate().

Here is the call graph for this function:

int associate_supplicant ( void   ) 

Associate EAP D-BUS request.

Returns:
status.

Definition at line 2831 of file dbus-handler.c.

Referenced by handle_wap_event().

static gboolean check_capabilities ( struct scan_results_t scan_results,
struct connect_params_t conn 
) [static]

Check capabilities from scan results.

Parameters:
scan_results Scan results.
conn Connection paramters.
Returns:
status.

Definition at line 1919 of file dbus-handler.c.

References scan_results_t::cap_bits, check_ciphers(), connect_params_t::encryption, and connect_params_t::mode.

Referenced by find_connection().

Here is the call graph for this function:

static int check_ciphers ( guint32  c1,
guint32  c2 
) [static]

Compare ciphers.

Parameters:
c1 Cipher 1.
c2 Cipher 2.
Returns:
1 if matches.

Definition at line 1853 of file dbus-handler.c.

References check_group_cipher().

Referenced by check_capabilities().

Here is the call graph for this function:

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.

Parameters:
conn Connection parameters.
ssid SSID.
key Encryption keys.
Returns:
status.

Definition at line 1280 of file dbus-handler.c.

References connect_params_t::authentication_type, connect_params_t::encryption, connect_params_t::flags, connect_params_t::key, connect_params_t::key_len, connect_params_t::mode, connect_params_t::power_level, powersave, and connect_params_t::ssid_len.

Referenced by settings_and_connect_request().

static int check_group_cipher ( guint32  c1,
guint32  c2 
) [static]

Compare group ciphers.

Parameters:
c1 Cipher 1.
c2 Cipher 2.
Returns:
1 if matches.

Definition at line 1830 of file dbus-handler.c.

Referenced by check_ciphers().

int clean_dbus_handler ( void   ) 

Helper function for cleaning handler.

Definition at line 206 of file dbus-handler.c.

References wlan_socket.

Referenced by clean_data().

void clean_roam_cache ( void   ) 

Clean roaming cache.

Definition at line 1044 of file dbus-handler.c.

References clean_scan_results(), wlan_status_t::roam_cache, and wlan_status.

Referenced by ask_scan_results(), find_connection(), and set_wlan_state().

Here is the call graph for this function:

void clear_wpa_keys ( unsigned char *  bssid  ) 

Clear WPA keys.

Parameters:
bssid optional BSSID which keys to remove.

Definition at line 1222 of file dbus-handler.c.

References init_iwreq(), and socket_open().

Referenced by associate(), clear_wpa_mode(), disassociate_request(), and handle_wap_event().

Here is the call graph for this function:

void clear_wpa_mode ( void   ) 

Clear WPA mode related stuff.

Definition at line 1051 of file dbus-handler.c.

References clear_wpa_keys(), wlan_status_t::group_cipher, wpa_ie_save_t::ie, wpa_ie_save_t::ie_len, wlan_status_t::pairwise_cipher, wlan_status_t::pmk_cache, wlan_status, and wlan_status_t::wpa_ie.

Referenced by set_wlan_state().

Here is the call graph for this function:

static void connect_from_scan_results ( GSList *  scan_results  )  [static]

Connects based on scan results.

Parameters:
scan_results_save List of scan results.

Definition at line 2049 of file dbus-handler.c.

References clean_scan_results(), DISCONNECTED_SIGNAL, find_connection_and_associate(), get_wlan_state(), reschedule_scan(), and set_wlan_state().

Referenced by ask_scan_results().

Here is the call graph for this function:

static DBusHandlerResult connection_status_request ( DBusMessage *  message,
DBusConnection *  connection 
) [static]

Connection status D_BUS request.

Parameters:
message DBUS message.
connection DBUS connection.
Returns:
status.

Definition at line 2544 of file dbus-handler.c.

References get_wlan_state().

Here is the call graph for this function:

gboolean decrease_signal_in_roam_cache ( unsigned char *  bssid  ) 

Give penalty to failed AP.

Parameters:
bssid BSSID.
Returns:
status.

Definition at line 1806 of file dbus-handler.c.

References compare_scan_entry(), print_mac(), wlan_status_t::roam_cache, scan_results_t::rssi, wlan_status, and WLANCOND_RSSI_PENALTY.

Referenced by handle_wap_event().

Here is the call graph for this function:

void destroy_dbus_handlers ( DBusConnection *  connection  ) 

Destroy D-BUS handlers.

Parameters:
connection DBUS connection.

Definition at line 3037 of file dbus-handler.c.

Referenced by main().

static void disassociate_cb ( DBusPendingCall *  pending,
void *  user_data 
) [static]

Disassociate callback.

Parameters:
pending Pending DBUS message.
user_data Callback data.
Returns:
status

Definition at line 2872 of file dbus-handler.c.

Referenced by disassociate_eap().

int disassociate_eap ( void   ) 

Disassociate EAP D-BUS request.

Returns:
status.

Definition at line 2898 of file dbus-handler.c.

References disassociate_cb().

Referenced by handle_wap_event().

Here is the call graph for this function:

static DBusHandlerResult disassociate_request ( DBusMessage *  message,
DBusConnection *  connection 
) [static]

Disassociate WLAN D-BUS request.

Parameters:
message DBUS message.
connection DBUS connection.
Returns:
status.

Definition at line 2292 of file dbus-handler.c.

References connect_params_t::bssid, clear_wpa_keys(), wlan_status_t::conn, DISCONNECTED_SIGNAL, get_wlan_state(), get_wpa_mode(), mlme_command(), NO_SIGNAL, scan(), set_wlan_state(), connect_params_t::ssid, connect_params_t::ssid_len, wlan_status, and WLANCOND_REASON_LEAVING.

Here is the call graph for this function:

static DBusHandlerResult disconnect_request ( DBusMessage *  message,
DBusConnection *  connection 
) [static]

Disconnect WLAN and remove kernel module D-BUS request.

Parameters:
message DBUS message.
connection DBUS connection.
Returns:
status.

Definition at line 2272 of file dbus-handler.c.

References DISCONNECTED_SIGNAL, set_scan_state(), and set_wlan_state().

Here is the call graph for this function:

struct scan_results_t* find_connection ( GSList *  ap_list,
struct connect_params_t conn,
gboolean  update_roam_cache 
)

Find connection.

Parameters:
ap_list List of access points.
conn Connection parameters.
update_roam_cache Update roaming cache or not.
Returns:
scan_results_t Returns best connection if found.

Definition at line 1942 of file dbus-handler.c.

References connect_params_t::bssid, check_capabilities(), clean_roam_cache(), wlan_status_t::conn, is_ap_in_black_list(), print_mac(), connect_params_t::ssid, and wlan_status.

Referenced by find_connection_and_associate().

Here is the call graph for this function:

int find_connection_and_associate ( GSList *  scan_results,
gboolean  update_roam_cache 
)

Find connection and associate.

Parameters:
scan_results Scan results.
Returns:
status.

Definition at line 2021 of file dbus-handler.c.

References associate(), connect_params_t::bssid, wlan_status_t::conn, find_connection(), connect_params_t::mode, scan_results_t::ssid, connect_params_t::ssid, connect_params_t::ssid_len, and wlan_status.

Referenced by connect_from_scan_results(), handle_wap_event(), settings_and_connect_request(), and wlan_connect_timer_cb().

Here is the call graph for this function:

unsigned char* find_pmkid_from_pmk_cache ( unsigned char *  mac  ) 

Find entry from PMKSA cache.

Parameters:
mac MAC address to identify the entry.
Returns:
PMKID or NULL.

Definition at line 1133 of file dbus-handler.c.

References compare_pmk_entry(), wlan_status_t::pmk_cache, pmksa_cache_t::pmkid, print_mac(), and wlan_status.

Referenced by generate_wpa2_ie().

Here is the call graph for this function:

guint get_encryption_info ( void   ) 

Get encryption info.

Returns:
status.

Definition at line 174 of file dbus-handler.c.

References wlan_status_t::pairwise_cipher, and wlan_status.

Referenced by handle_wap_event().

static gint get_gconf_int ( const gchar *  path  )  [static]

Helper function for getting Gconf values.

Parameters:
path Gconf path to search for user specified value.
Returns:
CAM timeout.

Definition at line 123 of file dbus-handler.c.

Referenced by set_power_state().

guint get_mode ( void   ) 

Helper function for getting the wlan mode.

Returns:
mode.

Definition at line 786 of file dbus-handler.c.

References wlan_status_t::conn, connect_params_t::mode, and wlan_status.

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 101 of file dbus-handler.c.

References wlan_status_t::ifname, wlan_status_t::own_mac, socket_open(), and wlan_status.

Referenced by init_dbus_handler().

Here is the call graph for this function:

guint get_scan_state ( void   ) 

Helper function for getting the scan state.

Returns:
state.

Definition at line 778 of file dbus-handler.c.

References wlan_status_t::scan, and wlan_status.

Referenced by ask_scan_results(), handle_wap_event(), print_event_token(), scan(), and scan_request().

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.

Returns:
status.

Definition at line 909 of file dbus-handler.c.

References set_we_name(), socket_open(), and wlan_status.

Referenced by main().

Here is the call graph for this function:

guint get_wlan_state ( void   ) 

Helper function for getting the wlan state.

Returns:
state.

Definition at line 746 of file dbus-handler.c.

References wlan_status_t::state, and wlan_status.

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(), scan_request(), set_powersave_request(), set_wlan_state(), status_request(), wlan_connect_timer_cb(), wlan_if_down_cb(), wlan_roam_scan_cb(), and wlan_scan_cb().

gboolean get_wpa_mode ( void   ) 

Check if WPA mode is in use.

Returns:
TRUE if mode is in use.

Definition at line 1071 of file dbus-handler.c.

References wlan_status_t::pairwise_cipher, and wlan_status.

Referenced by associate(), disassociate_request(), and handle_wap_event().

static DBusHandlerResult icd_check_signal_dbus ( DBusMessage *  message  )  [static]

Check ICD DBUS signal.

Parameters:
message DBUS message.
Returns:
DBusHandlerResult.

Definition at line 303 of file dbus-handler.c.

References get_mode(), get_wlan_state(), NO_SIGNAL, powersave, set_power_state(), set_wlan_state(), and socket_open().

Referenced by wlancond_req_handler().

Here is the call graph for this function:

int init_dbus_handler ( void   ) 

Helper function for initializing handler structs

Definition at line 194 of file dbus-handler.c.

References get_own_mac().

Referenced by main().

Here is the call graph for this function:

void init_dbus_handlers ( DBusConnection *  connection  ) 

Create bindings for D-BUS handlers.

Parameters:
connection DBUS connection.

Definition at line 3014 of file dbus-handler.c.

Referenced by main().

static int init_if ( int  sock  )  [static]

Initialize the WLAN interface.

Parameters:
sock socket.
Returns:
previous state.

Definition at line 857 of file dbus-handler.c.

References get_wlan_state(), NO_SIGNAL, SET, set_interface_state(), set_power_state(), set_wlan_state(), and wlan_if_down_timer_id.

Referenced by scan_request(), and settings_and_connect_request().

Here is the call graph for this function:

void init_iwreq ( struct iwreq *  req  ) 

Helper function for initializing the iwreq.

Definition at line 93 of file dbus-handler.c.

References wlan_status_t::ifname, and wlan_status.

Referenced by clear_wpa_keys(), mlme_command(), scan(), scan_results_ioctl(), set_bssid(), set_encryption_method_helper(), set_essid(), set_freq(), set_mode(), set_power_state(), set_tx_power(), set_wep_keys(), set_wpa_ie(), and status_request().

static DBusHandlerResult interface_request ( DBusMessage *  message,
DBusConnection *  connection 
) [static]

Interface D_BUS request.

Parameters:
message DBUS message.
connection DBUS connection.
Returns:
status.

Definition at line 2522 of file dbus-handler.c.

References wlan_status_t::ifname, and wlan_status.

int mlme_command ( guchar *  addr,
guint16  cmd,
guint16  reason_code 
)

MLME command.

Parameters:
addr Access point MAC address.
cmd Command.
reason_code Reason for leaving.
Returns:
status.

Definition at line 480 of file dbus-handler.c.

References init_iwreq(), and socket_open().

Referenced by disassociate_request(), handle_mic_failure(), and set_wlan_state().

Here is the call graph for this function:

void mode_change ( const char *  mode  ) 

Helper function for mode change.

Parameters:
mode New mode.

Definition at line 216 of file dbus-handler.c.

References _flight_mode, DISCONNECTED_SIGNAL, and set_wlan_state().

Referenced by main().

Here is the call graph for this function:

static int network_compare ( gconstpointer  a,
gconstpointer  b 
) [static]

Network compare.

Parameters:
a Pointer to scan_result 1.
b Pointer to scan result 2.
Returns:
0 if a=b, -1 if a is better than b and 1 if b is better than a.

Definition at line 1703 of file dbus-handler.c.

References scan_results_t::rssi, wlan_status_t::scan_ssid, wlan_status_t::scan_ssid_len, scan_results_t::ssid, and wlan_status.

Referenced by ask_scan_results().

gboolean remove_from_roam_cache ( unsigned char *  bssid  ) 

Remove from roam cache.

Parameters:
bssid BSSID to remove.
Returns:
status.

Definition at line 1779 of file dbus-handler.c.

References clean_scan_results_item(), compare_scan_entry(), print_mac(), wlan_status_t::roam_cache, and wlan_status.

Referenced by wlan_connect_timer_cb().

Here is the call graph for this function:

static void reschedule_scan ( void   )  [static]

Reschedule scan.

Definition at line 1890 of file dbus-handler.c.

References wlan_status_t::roam_scan, wlan_status_t::roam_scan_id, wlan_roam_scan_cb(), wlan_status, WLANCOND_MAX_ROAM_SCAN_INTERVAL, and WLANCOND_MIN_ROAM_SCAN_INTERVAL.

Referenced by connect_from_scan_results().

Here is the call graph for this function:

int scan ( gchar *  ssid,
int  ssid_len,
gboolean  add_timer 
)

Helper function for scanning.

Parameters:
ssid SSID to scan.
ssid_len SSID length.
Returns:
status.

Definition at line 1152 of file dbus-handler.c.

References get_scan_state(), init_iwreq(), wlan_status_t::scan_id, set_scan_state(), socket_open(), wlan_scan_cb(), wlan_status, and WLANCOND_SCAN_TIMEOUT.

Referenced by disassociate_request(), handle_custom_event(), handle_wap_event(), scan_request(), settings_and_connect_request(), wlan_connect_timer_cb(), and wlan_roam_scan_cb().

Here is the call graph for this function:

static DBusHandlerResult scan_request ( DBusMessage *  message,
DBusConnection *  connection 
) [static]

Scan D-BUS request.

Parameters:
message DBUS message.
connection DBUS connection.
Returns:
status.

Definition at line 1593 of file dbus-handler.c.

References connect_params_t::flags, get_scan_state(), get_wlan_state(), in_flight_mode(), init_if(), NO_SIGNAL, power_down_after_scan, connect_params_t::power_level, scan(), scan_name_cache, wlan_status_t::scan_ssid, wlan_status_t::scan_ssid_len, set_tx_power(), set_wlan_state(), socket_open(), connect_params_t::ssid, and wlan_status.

Here is the call graph for this function:

int scan_results_ioctl ( int  ifindex,
GSList **  scan_results_save 
)

Get scan results from mac80211.

Parameters:
ifindex Interface index.
scan_results_save Scan results to save.
Returns:
status.

Definition at line 2075 of file dbus-handler.c.

References get_interface_data(), wlan_status_t::ifname, init_iwreq(), print_event_token(), wireless_iface::range, save_scan_results(), socket_open(), and wlan_status.

Referenced by ask_scan_results(), and settings_and_connect_request().

Here is the call graph for this function:

int set_bssid ( unsigned char *  bssid  ) 

Helper function for setting the BSSID.

Parameters:
bssid BSSID.
Returns:
status.

Definition at line 629 of file dbus-handler.c.

References init_iwreq(), print_mac(), and socket_open().

Referenced by associate(), handle_wap_event(), and set_wlan_state().

Here is the call graph for this function:

static int set_essid ( char *  essid,
int  essid_len 
) [static]

Helper function for setting the ESSID.

Parameters:
essid ESSID.
essid_len ESSID length.
Returns:
status.

Definition at line 606 of file dbus-handler.c.

References init_iwreq(), and socket_open().

Referenced by associate().

Here is the call graph for this function:

static int set_freq ( int  channel  )  [static]

Helper function for setting the channel.

Parameters:
channel Channel.
Returns:
status.

Definition at line 1197 of file dbus-handler.c.

References init_iwreq(), and socket_open().

Referenced by associate().

Here is the call graph for this function:

int set_interface_state ( int  sock,
int  dir,
short  flags 
)

Set interface state.

Parameters:
socket socket.
dir direction.
flags settings flags.
Returns:
status.

Definition at line 927 of file dbus-handler.c.

References wlan_status_t::ifname, SET, and wlan_status.

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 510 of file dbus-handler.c.

References init_iwreq(), and socket_open().

Referenced by settings_and_connect_request().

Here is the call graph for this function:

static DBusHandlerResult set_pmksa_request ( DBusMessage *  message,
DBusConnection *  connection 
) [static]

Set pmksa D-BUS request.

Parameters:
message DBUS message.
connection DBUS connection.
Returns:
status.

Definition at line 2574 of file dbus-handler.c.

References add_to_pmksa_cache(), and print_mac().

Here is the call graph for this function:

gboolean set_power_state ( guint  new_state,
int  sock 
)

Set WLAN power state.

Parameters:
state New power state.
sock socket.
Returns:
status.

Definition at line 797 of file dbus-handler.c.

References get_gconf_int(), INACTIVE_SLEEP_GCONF_PATH, init_iwreq(), wlan_status_t::power, SLEEP_GCONF_PATH, wlan_status, WLANCOND_DEFAULT_SLEEP_TIMEOUT, WLANCOND_LONG_CAM_TIMEOUT, and WLANCOND_VERY_SHORT_CAM_TIMEOUT.

Referenced by icd_check_signal_dbus(), init_if(), set_powersave_request(), and settings_and_connect_request().

Here is the call graph for this function:

static DBusHandlerResult set_powersave_request ( DBusMessage *  message,
DBusConnection *  connection 
) [static]

Set powersave D-BUS request.

Parameters:
message DBUS message.
connection DBUS connection.
Returns:
status.

Definition at line 2634 of file dbus-handler.c.

References connect_name_cache, get_wlan_state(), NO_SIGNAL, powersave, set_power_state(), set_wlan_state(), and socket_open().

Here is the call graph for this function:

void set_scan_state ( guint  new_state  ) 

Helper function for setting new scan state.

Parameters:
new_state New scan state.

Definition at line 755 of file dbus-handler.c.

References wlan_status_t::scan, scan_name_cache, send_dbus_scan_results(), and wlan_status.

Referenced by ask_scan_results(), disconnect_request(), scan(), set_wlan_state(), and settings_and_connect_request().

Here is the call graph for this function:

static gboolean set_tx_power ( guint  power,
int  sock 
) [static]

Set tx power level.

Parameters:
power Power level.
sock socket.
Returns:
status.

Definition at line 963 of file dbus-handler.c.

References init_iwreq(), WLANCOND_TX_POWER100DBM, and WLANCOND_TX_POWER10DBM.

Referenced by scan_request(), and settings_and_connect_request().

Here is the call graph for this function:

static int set_we_name ( int  sock,
char *  name,
char *  args[],
int  count 
) [static]

Cache the wireless interface name.

Parameters:
sock socket.
name inteface name.
args not used.
count not used.
Returns:
status.

Definition at line 884 of file dbus-handler.c.

References wlan_status_t::ifname, WLAN_PREFIX_STR, and wlan_status.

Referenced by get_we_device_name().

static int set_wep_keys ( struct connect_params_t conn  )  [static]

Helper function for setting the WEP keys.

Parameters:
conn Connection parameters.
Returns:
status.

Definition at line 541 of file dbus-handler.c.

References init_iwreq(), connect_params_t::key, connect_params_t::key_len, and socket_open().

Referenced by associate().

Here is the call graph for this function:

void set_wlan_state ( int  new_state,
int  send_signal,
force_t  force 
)

Helper function for setting new wlan state

Parameters:
new_state New state for WLAN.
send_signal Should signal be sent.
force If shutdown is forced or not.

Definition at line 654 of file dbus-handler.c.

References connect_params_t::bssid, clean_roam_cache(), CLEAR, clear_wpa_mode(), wlan_status_t::conn, DISCONNECTED_SIGNAL, disconnected_signal(), get_wlan_state(), mlme_command(), NULL_BSSID, remove_connect_timer(), remove_scan_timer(), remove_wlan_if_timer(), wlan_status_t::retry_count, set_bssid(), set_interface_state(), set_scan_state(), set_wlan_signal(), socket_open(), wlan_status_t::state, wlan_if_down_cb(), wlan_if_down_timer_id, wlan_status, WLANCOND_HIGH, WLANCOND_REASON_LEAVING, and WLANCOND_SHUTDOWN_DELAY.

Referenced by ask_scan_results(), connect_from_scan_results(), disassociate_request(), disconnect_request(), handle_mic_failure(), handle_wap_event(), icd_check_signal_dbus(), init_if(), main(), mode_change(), print_event_token(), 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().

Here is the call graph for this function:

static DBusHandlerResult settings_and_connect_request ( DBusMessage *  message,
DBusConnection *  connection 
) [static]

Settings and connect D-BUS request.

Parameters:
message DBUS message.
connection DBUS connection.
Returns:
status.

Definition at line 1365 of file dbus-handler.c.

References connect_params_t::adhoc_channel, check_connect_arguments(), clean_scan_results(), wlan_status_t::conn, connect_name_cache, connect_params_t::default_key, connect_params_t::encryption, find_connection_and_associate(), connect_params_t::flags, wlan_status_t::ifname, in_flight_mode(), init_conn_params(), init_if(), connect_params_t::key, connect_params_t::key_len, connect_params_t::mode, NO_SIGNAL, connect_params_t::power_level, remove_connect_timer(), remove_wlan_if_timer(), wlan_status_t::roam_cache, scan(), scan_results_ioctl(), set_mode(), set_power_state(), set_scan_state(), set_tx_power(), set_wlan_state(), socket_open(), connect_params_t::ssid, connect_params_t::ssid_len, and wlan_status.

Here is the call graph for this function:

int socket_open ( void   ) 

Helper function for socket opening.

Definition at line 78 of file dbus-handler.c.

References wlan_socket.

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.

Parameters:
message DBUS message.
connection DBUS connection.
Returns:
status.

Definition at line 2333 of file dbus-handler.c.

References wlan_status_t::conn, connect_params_t::encryption, get_mode(), get_wlan_state(), wlan_status_t::ifname, init_iwreq(), socket_open(), and wlan_status.

Here is the call graph for this function:

static int update_algorithms ( guint32  encryption  )  [static]

Updates algorithms to internal status.

Parameters:
encryption Encryption settings.
Returns:
status.

Definition at line 992 of file dbus-handler.c.

References wlan_status_t::group_cipher, wlan_status_t::pairwise_cipher, and wlan_status.

Referenced by associate().

void update_own_ie ( unsigned char *  wpa_ie,
guint  wpa_ie_len 
)

Update our Information Element.

Parameters:
wpa_ie WPA Information Element.
wpa_ie_len WPA Information Element length.

Definition at line 164 of file dbus-handler.c.

References wpa_ie_save_t::ie, wpa_ie_save_t::ie_len, wlan_status, and wlan_status_t::wpa_ie.

Referenced by generate_wpa2_ie(), and generate_wpa_ie().

static gboolean wlan_connect_timer_cb ( void *  data  )  [static]

WLAN connect timer callback.

Parameters:
data User data.
Returns:
status.

Definition at line 399 of file dbus-handler.c.

References connect_params_t::bssid, wlan_status_t::conn, DISCONNECTED_SIGNAL, find_connection_and_associate(), get_wlan_state(), remove_from_roam_cache(), wlan_status_t::retry_count, wlan_status_t::roam_cache, scan(), set_wlan_state(), connect_params_t::ssid, connect_params_t::ssid_len, wlan_connect_timer_id, wlan_status, and WLANCOND_MAX_SCAN_TRIES.

Referenced by associate().

Here is the call graph for this function:

static gboolean wlan_if_down_cb ( void *  data  )  [static]

WLAN interface down callback.

Parameters:
data User data.
Returns:
status.

Definition at line 458 of file dbus-handler.c.

References get_wlan_state(), NO_SIGNAL, set_wlan_state(), and wlan_if_down_timer_id.

Referenced by set_wlan_state().

Here is the call graph for this function:

static gboolean wlan_scan_cb ( void *  data  )  [static]

WLAN scan callback.

Parameters:
data User data.
Returns:
status.

Definition at line 439 of file dbus-handler.c.

References DISCONNECTED_SIGNAL, get_wlan_state(), wlan_status_t::scan_id, set_wlan_state(), and wlan_status.

Referenced by scan().

Here is the call graph for this function:

DBusHandlerResult wlancond_req_handler ( DBusConnection *  connection,
DBusMessage *  message,
void *  user_data 
)

Generic handler for D-Bus requests.

Parameters:
message DBUS message.
connection DBUS connection.
Returns:
status.

Definition at line 2953 of file dbus-handler.c.

References method_handler_t::func, handlers, icd_check_signal_dbus(), method_handler_t::interface, and method_handler_t::name.

Here is the call graph for this function:

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.

Parameters:
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.
Returns:
status.

Definition at line 2730 of file dbus-handler.c.

References wlan_status_t::group_cipher, wpa_ie_save_t::ie, wpa_ie_save_t::ie_len, wlan_status_t::pairwise_cipher, wlan_status, wlan_status_t::wpa_ie, and wpa_ie_push_cb().

Referenced by associate().

Here is the call graph for this function:

static void wpa_ie_push_cb ( DBusPendingCall *  pending,
void *  user_data 
) [static]

WPA IE callback.

Parameters:
pending Pending DBUS message.
user_data Callback data.
Returns:
status

Definition at line 2694 of file dbus-handler.c.

References DISCONNECTED_SIGNAL, and set_wlan_state().

Referenced by wpa_ie_push().

Here is the call graph for this function:

int wpa_mic_failure_event ( dbus_bool_t  key_type,
dbus_bool_t  is_fatal 
)

WPA MIC failure event D-BUS request.

Parameters:
key_type Key type, Unicast/Broadcast key.
is_fatal Error is fatal if true.
Returns:
status.

Definition at line 2787 of file dbus-handler.c.

Referenced by handle_mic_failure().


Variable Documentation

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 2934 of file dbus-handler.c.

Referenced by wlancond_req_handler().

DBusObjectPathVTable wlancond_req_vtable [static]

Initial value:

 {
        .message_function    = wlancond_req_handler,
        .unregister_function = NULL
}

Definition at line 3004 of file dbus-handler.c.


Generated on Sat Dec 6 22:17:16 2008 for WLAN Connection Daemon by  doxygen 1.5.1