dbus-signal.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <glib.h>
#include <glib-object.h>
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <linux/types.h>
#include <wlancond-dbus.h>
#include <eap-dbus.h>
#include "common.h"
#include "daemon.h"
#include "dbus.h"
#include "dbus-handler.h"
#include "log.h"
#include "dbus-helper.h"
#include "wpa.h"
#include <dbus/dbus.h>

Include dependency graph for dbus-signal.c:

Go to the source code of this file.

Data Structures

struct  rtnl_handle

Functions

static void handle_custom_event (char *event_pointer, int len, struct scan_results_t *scan_results)
static int handle_wpa_ie_event_binary (unsigned char *p, unsigned int length, struct scan_results_t *scan_results)
void print_mac (guint priority, const char *message, guchar *mac)
void clean_scan_results_item (gpointer data, gpointer user_data)
void clean_scan_results (GSList **scan_results_save)
GSList * save_scan_results (struct scan_results_t *scan_results, GSList *scan_results_save)
void send_dbus_scan_results (GSList *scan_results_save, const char *sender, dbus_int32_t number_of_results)
void disconnected_signal (void)
static void connected_signal (char *bssid, dbus_int32_t auth_status)
static void handle_wap_event (struct scan_results_t *scan_results, struct iw_event *event, gboolean scan_event)
int print_event_token (struct iw_event *event, struct scan_results_t *scan_results, int ifindex, gboolean scan_event)
static void save_caps (struct scan_results_t *scan_results, struct ap_info_t *ap_info, unsigned char *p, unsigned int length)
static gboolean roam_scanning (void)
static int index2name (int skfd, int ifindex, char *name)
struct wireless_iface * get_interface_data (int ifindex)
static int print_event_stream (int ifindex, char *data, int len)
void del_all_interface_data (void)
static void del_interface_data (int ifindex)
static void handle_message (struct nlmsghdr *hdr)
static void handle_netlink_event (int fd)
static int init_wi (struct rtnl_handle *rth)
static gboolean _monitor_cb (GIOChannel *chan, GIOCondition cond, gpointer data)
gboolean monitor_wi (void)

Variables

static struct wireless_iface * interface_cache = NULL
struct wlan_status_t wlan_status


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-signal.c.


Function Documentation

static gboolean _monitor_cb ( GIOChannel *  chan,
GIOCondition  cond,
gpointer  data 
) [static]

Callback function for wireless events.

Parameters:
chan GLIB IO Channel
cond GLIB IO condition
data privat pointer.
Returns:
status.

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

References handle_netlink_event().

Referenced by monitor_wi().

Here is the call graph for this function:

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 90 of file dbus-signal.c.

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

static void connected_signal ( char *  bssid,
dbus_int32_t  auth_status 
) [static]

Send connected signal.

Parameters:
scan_results Scan results to be sent.
auth_status Authentication status.

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

Referenced by handle_wap_event().

void del_all_interface_data ( void   ) 

Deletes all interface data

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

static void del_interface_data ( int  ifindex  )  [static]

Delete one interface from the list

Parameters:
ifindex Interface index.

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

References set_scan_state(), and set_wlan_state().

Referenced by handle_message().

Here is the call graph for this function:

void disconnected_signal ( void   ) 

Send disconnected signal.

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

Referenced by set_wlan_state().

struct wireless_iface* get_interface_data ( int  ifindex  )  [read]

Get interface data from cache or live interface.

Parameters:
ifindex Interface index.
Returns:
wireless_iface The wireless interface.

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

References index2name(), and socket_open().

Referenced by print_event_stream(), and scan_results_ioctl().

Here is the call graph for this function:

static void handle_custom_event ( char *  event_pointer,
int  length,
struct scan_results_t *  scan_results 
) [static]

Handle custom event.

Parameters:
event_pointer pointer to custom event.
length custom event length.
scan_results pointer to scan results struct.

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

References get_wlan_state(), handle_mic_failure(), roam_scanning(), and schedule_scan().

Referenced by print_event_token().

Here is the call graph for this function:

static void handle_message ( struct nlmsghdr *  hdr  )  [static]

Netlink event handling continues, now we know that we have a message

Parameters:
hdr Pointer to message header.

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

References del_interface_data(), and print_event_stream().

Referenced by handle_netlink_event().

Here is the call graph for this function:

static void handle_netlink_event ( int  fd  )  [static]

Start netlink event handling

Parameters:
fd File descriptor.

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

References handle_message().

Referenced by _monitor_cb().

Here is the call graph for this function:

static void handle_wap_event ( struct scan_results_t *  scan_results,
struct iw_event *  event,
gboolean  scan_event 
) [static]

Handle WAP wireless event.

Parameters:
event extracted token.
scan_results structure where scan results are saved.
Returns:
status.

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

References associate_supplicant(), clear_wpa_keys(), connected_signal(), decrease_signal_in_roam_cache(), disassociate_eap(), find_connection_and_associate(), get_encryption_info(), get_scan_state(), get_wlan_state(), get_wpa_mode(), scan(), set_bssid(), set_essid(), set_wlan_state(), and set_wpa_ie().

Referenced by print_event_token().

Here is the call graph for this function:

static int handle_wpa_ie_event_binary ( unsigned char *  p,
unsigned int  length,
struct scan_results_t *  scan_results 
) [static]

WPA Information element event binary.

Parameters:
p Pointer to event buffer.
length Event buffer length.
scan_results Pointer to scan results structure.

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

References handle_wps_ie(), parse_rsn_ie(), parse_wpa_ie(), and save_caps().

Referenced by print_event_token().

Here is the call graph for this function:

static int index2name ( int  skfd,
int  ifindex,
char *  name 
) [static]

Get name of interface based on interface index.

Parameters:
skfd Socket.
ifindex Interface index.
name Interface name.
Returns:
status.

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

Referenced by get_interface_data().

static int init_wi ( struct rtnl_handle *  rth  )  [static]

Initialize wireless interface

Parameters:
rth private struct.
Returns:
status.

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

Referenced by monitor_wi().

gboolean monitor_wi ( void   ) 

Starts monitoring of wireless events.

Returns:
status.

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

References _monitor_cb(), and init_wi().

Referenced by main().

Here is the call graph for this function:

static int print_event_stream ( int  ifindex,
char *  data,
int  len 
) [static]

Event handling.

Parameters:
ifindex Interface index.
data Data.
len Data length.
Returns:
status.

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

References get_interface_data(), and print_event_token().

Referenced by handle_message().

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.

Parameters:
event extracted token.
scan_results structure where scan results are saved.
ifindex Interface index.
Returns:
status.

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

References ask_scan_results(), get_scan_state(), handle_custom_event(), handle_wap_event(), handle_wpa_ie_event_binary(), and set_wlan_state().

Referenced by print_event_stream(), and scan_results_ioctl().

Here is the call graph for this function:

static gboolean roam_scanning ( void   )  [static]

Check if we have scanned in last WLANCOND_MIN_ROAM_SCAN_INTERVAL.

Returns:
TRUE if we have scanned, FALSE otherwise.

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

Referenced by handle_custom_event().

static void save_caps ( struct scan_results_t *  scan_results,
struct ap_info_t *  ap_info,
unsigned char *  p,
unsigned int  length 
) [static]

Save WPA capabilities and print them to log.

Parameters:
scan_results Pointer to scan results structure.
ap_info Pointer to AP information structure.
p Pointer to event buffer.
length Event buffer length.

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

Referenced by handle_wpa_ie_event_binary().

GSList* save_scan_results ( struct scan_results_t *  scan_results,
GSList *  scan_results_save 
)

Save scan results to list.

Parameters:
scan_results structure where scan results are.
scan_results_save structure where scan results are saved.

Definition at line 106 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.

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

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

Referenced by ask_scan_results(), and set_scan_state().


Generated on Mon Jul 5 12:21:37 2010 for WLAN Connection Daemon by  doxygen 1.5.6