#include <sys/types.h>
#include <sys/socket.h>
#include <linux/types.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#include <linux/if_ether.h>
#include <iwlib.h>
#include <wireless.h>
#include <dbus/dbus.h>
#include <wlancond.h>
Include dependency graph for common.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Data Structures | |
struct | scan_results_t |
struct | wpa_ie_list_t |
struct | wpa_ie_save_t |
struct | connect_params_t |
struct | pmksa_cache_t |
struct | wlan_status_t |
struct | wireless_iface |
Defines | |
#define | DBUS_API_SUBJECT_TO_CHANGE |
#define | PMK_CACHE_SIZE 32 |
#define | WLANCOND_LOW TRUE |
#define | WLANCOND_HIGH FALSE |
#define | WLANCOND_TX_POWER10DBM 10 |
#define | WLANCOND_TX_POWER100DBM 20 |
#define | NULL_BSSID (unsigned char*)"\x00\x00\x00\x00\x00\x00" |
#define | WLANCOND_DEFAULT_SLEEP_TIMEOUT 200 |
#define | WLANCOND_VERY_SHORT_CAM_TIMEOUT 100 |
#define | WLANCOND_LONG_CAM_TIMEOUT 4000 |
#define | MIC_FAILURE_TIMEOUT 60000 |
#define | NO_SIGNAL 0 |
#define | DISCONNECTED_SIGNAL 1 |
#define | WLANCOND_MAX_NETWORKS 30 |
#define | WLANCOND_MAX_SCAN_TRIES 3 |
#define | WLANCOND_ROAM_THRESHOLD 10 |
#define | WLANCOND_MIN_ROAM_SCAN_INTERVAL 60000 |
#define | WLANCOND_MAX_ROAM_SCAN_INTERVAL 16*60000 |
#define | WLANCOND_RSSI_PENALTY 25 |
#define | WLANCOND_MINIMUM_SIGNAL -99 |
#define | GCONF_PATH_PREFIX "/system/osso/connectivity/IAP/" |
#define | SLEEP_GCONF_PATH GCONF_PATH_PREFIX "wlan_sleep_timeout" |
#define | INACTIVE_SLEEP_GCONF_PATH GCONF_PATH_PREFIX "inactive_wlan_sleep_timeout" |
#define | WLANCOND_REASON_LEAVING 3 |
#define | WLANCOND_REASON_MIC_FAILURE 14 |
Typedefs | |
typedef connect_params_t | connect_params |
typedef pmksa_cache_t | pmksa_cache |
Enumerations | |
enum | force_t { FORCE_NO, FORCE_YES } |
enum | scan_state { SCAN_NOT_ACTIVE = 0, SCAN_ACTIVE } |
enum | wlan_state { WLAN_NOT_INITIALIZED = 0, WLAN_INITIALIZED, WLAN_INITIALIZED_FOR_SCAN, WLAN_INITIALIZED_FOR_CONNECTION, WLAN_NO_ADDRESS, WLAN_CONNECTED } |
enum | wlan_power_state { WLANCOND_POWER_ON = 1, WLANCOND_LONG_CAM, WLANCOND_SHORT_CAM, WLANCOND_VERY_SHORT_CAM, WLANCOND_FULL_POWERSAVE } |
Functions | |
gboolean | monitor_wi (void) |
void | del_all_interface_data (void) |
wireless_iface * | get_interface_data (int ifindex) |
int | print_event_token (struct iw_event *event, struct scan_results_t *scan_results, int ifindex, gboolean scan_event) |
void | send_dbus_scan_results (GSList *scan_results_save, const char *sender, dbus_int32_t number_of_results) |
GSList * | save_scan_results (struct scan_results_t *scan_results, GSList *scan_results_save) |
void | clean_scan_results (GSList **scan_results_save) |
void | disconnected_signal (void) |
void | mode_change (const char *mode) |
void | clean_scan_results_item (gpointer data, gpointer user_data) |
void | print_mac (const char *message, guchar *mac) |
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 common.h.
void clean_scan_results | ( | GSList ** | scan_results_save | ) |
Remove saved scan results.
scan_results_save | structure where scan results are saved. |
Definition at line 87 of file dbus-signal.c.
References clean_scan_results_item().
Referenced by ask_scan_results(), clean_roam_cache(), connect_from_scan_results(), and settings_and_connect_request().
Here is the call graph for this function:
void del_all_interface_data | ( | void | ) |
Deletes all interface data
Definition at line 914 of file dbus-signal.c.
References interface_cache, and wireless_iface::next.
Referenced by clean_data().
void disconnected_signal | ( | void | ) |
Send disconnected signal.
Definition at line 194 of file dbus-signal.c.
References wlan_status_t::ifname, and wlan_status.
Referenced by set_wlan_state().
struct wireless_iface* get_interface_data | ( | int | ifindex | ) |
Get interface data from cache or live interface.
ifindex | Interface index. |
Definition at line 827 of file dbus-signal.c.
References wireless_iface::has_range, wireless_iface::ifindex, wireless_iface::ifname, index2name(), interface_cache, wireless_iface::next, wireless_iface::range, and socket_open().
Referenced by print_event_stream(), and scan_results_ioctl().
Here is the call graph for this function:
void mode_change | ( | const char * | mode | ) |
Helper function for mode change.
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:
gboolean monitor_wi | ( | void | ) |
Starts monitoring of wireless events.
Definition at line 1133 of file dbus-signal.c.
References _monitor_cb(), rtnl_handle::fd, and init_wi().
Referenced by main().
Here is the call graph for this function:
int print_event_token | ( | struct iw_event * | event, | |
struct scan_results_t * | scan_results, | |||
int | ifindex, | |||
gboolean | scan_event | |||
) |
Print or save wireless events.
event | extracted token. | |
scan_results | structure where scan results are saved. | |
ifindex | Interface index. |
Definition at line 342 of file dbus-signal.c.
References ask_scan_results(), scan_results_t::cap_bits, scan_results_t::channel, DISCONNECTED_SIGNAL, get_scan_state(), handle_custom_event(), handle_wap_event(), handle_wpa_ie_event_binary(), remove_scan_timer(), scan_results_t::rssi, set_wlan_state(), scan_results_t::ssid, and scan_results_t::ssid_len.
Referenced by print_event_stream(), and scan_results_ioctl().
Here is the call graph for this function:
GSList* save_scan_results | ( | struct scan_results_t * | scan_results, | |
GSList * | scan_results_save | |||
) |
Save scan results to list.
scan_results | structure where scan results are. | |
scan_results_save | structure where scan results are saved. |
Definition at line 103 of file dbus-signal.c.
Referenced by scan_results_ioctl().
void send_dbus_scan_results | ( | GSList * | scan_results_save, | |
const char * | sender, | |||
dbus_int32_t | number_of_results | |||
) |
Send scan results to DBUS.
scan_results_save | structure where scan results are saved. | |
sender | The message is sent to this entity. |
Definition at line 120 of file dbus-signal.c.
References WLANCOND_MAX_NETWORKS.
Referenced by ask_scan_results(), and set_scan_state().