Data Structures | Defines | Typedefs | Enumerations | Functions

common.h File Reference

#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 <mce/mode-names.h>
#include <stdio.h>
#include <net/if.h>
#include <connsettings/conn_settings.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  roam_cache_key_t

Defines

#define DBUS_API_SUBJECT_TO_CHANGE
#define PMK_CACHE_SIZE   32
#define WLANCOND_IF_NAME   "wlan0"
#define WLANCOND_LOW   TRUE
#define WLANCOND_HIGH   FALSE
#define CALL_VOIP   (1<<0)
#define CALL_CELLULAR   (1<<1)
#define CALL_GPRS   (1<<2)
#define WLANCOND_TX_POWERLIMITED   1300
#define WLANCOND_TX_POWER10DBM   1000
#define WLANCOND_TX_POWER100DBM   2000
#define NULL_BSSID   (unsigned char*)"\x00\x00\x00\x00\x00\x00"
#define WLANCOND_LATENCY_FILE   "/dev/network_latency"
#define WLANCOND_DEFAULT_NETWORK_LATENCY   2000000000
#define WLANCOND_FULL_PSM_LATENCY   1900000001
#define MIC_FAILURE_TIMEOUT   60
#define NO_SIGNAL   0
#define DISCONNECTED_SIGNAL   1
#define WLANCOND_MAX_NETWORKS   30
#define WLANCOND_MAX_SCAN_TRIES   3
#define WLANCOND_INITIAL_ROAM_SCAN_DELAY   2
#define WLANCOND_ROAM_THRESHOLD   10
#define WLANCOND_5GHZ_BENEFIT   5
#define WLANCOND_MIN_ROAM_SCAN_INTERVAL   60
#define WLANCOND_MAX_ROAM_SCAN_INTERVAL   16*60
#define WLANCOND_COUNTRY_CACHE_TIME   3600
#define WLANCOND_RSSI_PENALTY   25
#define WLANCOND_MINIMUM_SIGNAL   -99
#define WLANCOND_MINIMUM_AUTOCONNECT_RSSI   -85
#define WLANCOND_INITIAL_CHANNEL   1
#define SCAN_SYSFS_FILE   "/sys/devices/platform/wl1271/"
#define SCAN_SIZE_FILE   SCAN_SYSFS_FILE "scan_size"
#define SCAN_DELAY_FILE   SCAN_SYSFS_FILE "scan_delay"
#define SCAN_SIZE_SPLIT   1
#define SCAN_SIZE_NORMAL   24
#define SCAN_DELAY_SPLIT   40
#define SCAN_DELAY_NORMAL   0
#define WLANCOND_DEBUG_LEVEL   "wlancond_debug_level"
#define WLANCOND_ALLOW_ALL_CIPHERS   "allow_wep_ciphers_in_WPA"
#define WLANCOND_PRIO_HIGH   2
#define WLANCOND_PRIO_MEDIUM   1
#define WLANCOND_PRIO_LOW   0
#define WLANCOND_MLME_DEAUTH   0
#define WLANCOND_MLME_DISASSOC   1
#define WLANCOND_NL80211_MLME_DISCONNECT   0xD15C
#define WLANCOND_REASON_LEAVING   3
#define WLANCOND_REASON_MIC_FAILURE   14
#define CSNET_INTERFACE   "com.nokia.csd.CSNet"
#define CSNET_OBJECT   "/com/nokia/csd/csnet"
#define CSNET_ACTION   "Get"
#define CSNET_OPER_IFACE   "com.nokia.csd.CSNet.NetworkOperator"
#define CSNET_OPER_MCC   "OperatorMCC"
#define CSNET_OPERATOR_CHANGED_SIG   "OperatorChanged"
#define GPRS_DBUS_INTERFACE   "com.nokia.csd.GPRS"
#define GPRS_DBUS_DATACOUNTERS_SIG   "DataCounters"
#define POLICY_SERVICE_NAME   "com.nokia.policy"
#define POLICY_ACTIONS_SIG   "audio_actions"
#define FULL_PSM_SETTING   "full_psm_enabled"
#define WLANCOND_WEP40   (1<<0)
#define WLANCOND_WEP104   (1<<1)
#define WLANCOND_WEP40_GROUP   (1<<2)
#define WLANCOND_WEP104_GROUP   (1<<3)
#define WLANCOND_UAPSD_SUPPORTED   (1<<31)
#define WLANCOND_IF_DORMANT   1
#define WLANCOND_IF_READY   6

Typedefs

typedef struct scan_results_t scan_results_t
typedef struct wpa_ie_list_t wpa_ie_list_t
typedef struct wpa_ie_save_t wpa_ie_save_t
typedef struct connect_params_t connect_params
typedef struct pmksa_cache_t pmksa_cache
typedef struct wlan_status_t wlan_status_t
typedef struct roam_cache_key_t roam_cache_key_t

Enumerations

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_CAM_TIMEOUT, WLANCOND_FULL_POWERSAVE }

Functions

void init_logging (void)
void wlancond_print (guint priority, const char *debug,...)
gboolean monitor_wi (void)
void send_dbus_scan_results (GSList *scan_results_save, const char *sender, dbus_int32_t number_of_results)
void clean_scan_results (GSList **scan_results_save)
void disconnected_signal (void)
void mode_change (dbus_uint32_t radio_mode)
void clean_scan_results_item (gpointer data, gpointer user_data)
void print_mac (guint priority, const char *message, guchar *mac)
gboolean roam_scanning (void)
int netlink_send_linkmode (int lmode)
int set_iptables (void)
void remove_iptables (void)
gboolean monitor_iap_keys (void)
gboolean is_connected_state (void)

Detailed Description

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

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


Function Documentation

void clean_scan_results ( GSList **  scan_results_save  ) 

Remove saved scan results.

Parameters:
scan_results_save structure where scan results are saved.

Definition at line 99 of file dbus-signal.c.

Referenced by ask_scan_results(), clean_roam_cache(), connect_from_scan_results(), and settings_and_connect_request().

void disconnected_signal ( void   ) 

Send disconnected signal.

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

References wlan_status.

Referenced by handle_netlink_wap_event(), and set_wlan_state().

void init_logging ( void   ) 

Initialize logging.

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

References debug_level, get_setting_int(), and wlan_status.

Referenced by main().

Here is the call graph for this function:

gboolean is_connected_state ( void   ) 

Get connected state.

Returns:
TRUE if connected, FALSE otherwise.

Definition at line 266 of file dbus-signal.c.

References get_wlan_state().

Referenced by handle_message(), handle_netlink_wap_event(), and mode_change().

Here is the call graph for this function:

void mode_change ( dbus_uint32_t  radio_mode  ) 

Helper function for mode change.

Parameters:
radio_mode New mode.

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

References is_connected_state(), and set_wlan_state().

Referenced by main().

Here is the call graph for this function:

gboolean monitor_iap_keys ( void   ) 

Starts monitoring the power save flag change.

Returns:
status.

Definition at line 725 of file dbus-signal.c.

References get_setting_bool(), monitor_full_ps_cb(), and wlan_status.

Referenced by main().

Here is the call graph for this function:

gboolean monitor_wi ( void   ) 

Starts monitoring of wireless events.

Returns:
status.

Definition at line 623 of file dbus-signal.c.

References _monitor_cb(), init_nflog(), init_wi(), and netlink_socket.

Referenced by main().

Here is the call graph for this function:

int netlink_send_linkmode ( int  lmode  ) 

Sends the link mode signal to the kernel.

Parameters:
lmode mode status.
Returns:
status.

Definition at line 646 of file dbus-signal.c.

References netlink_socket, and wlan_status.

Referenced by associate(), eap_check_signal_dbus(), and handle_netlink_wap_event().

void remove_iptables ( void   ) 

Set iptables inactive.

Definition at line 585 of file dbus-signal.c.

References set_iptables_state().

Referenced by set_wlan_state().

Here is the call graph for this function:

gboolean roam_scanning ( void   ) 

Check if we have scanned in last WLANCOND_MIN_ROAM_SCAN_INTERVAL.

Returns:
TRUE if we have scanned, FALSE otherwise.

Definition at line 250 of file dbus-signal.c.

References wlan_status.

Referenced by process_cqm_event().

void send_dbus_scan_results ( GSList *  scan_results_save,
const char *  sender,
dbus_int32_t  number_of_results 
)

Send scan results to DBUS.

Parameters:
scan_results_save structure where scan results are saved.
sender The message is sent to this entity.
number_of_results number of scan results.

Definition at line 116 of file dbus-signal.c.

Referenced by ask_scan_results(), and set_scan_state().

int set_iptables ( void   ) 

Load iptables and set them active.

Definition at line 593 of file dbus-signal.c.

References set_iptables_state(), and wlan_status.

Referenced by handle_netlink_wap_event().

Here is the call graph for this function:

void wlancond_print ( guint  priority,
const char *  debug,
  ... 
)

Wlancond debug printing function.

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

References debug_level.