#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>
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 (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 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 |
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.
static gboolean _monitor_cb | ( | GIOChannel * | chan, | |
GIOCondition | cond, | |||
gpointer | data | |||
) | [static] |
Callback function for wireless events.
chan | GLIB IO Channel | |
cond | GLIB IO condition | |
data | privat pointer. |
Definition at line 1084 of file dbus-signal.c.
References handle_netlink_event().
Referenced by monitor_wi().
void clean_scan_results | ( | GSList ** | scan_results_save | ) |
Remove saved scan results.
scan_results_save | structure where scan results are saved. |
Definition at line 85 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.
scan_results | Scan results to be sent. | |
auth_status | Authentication status. |
Definition at line 216 of file dbus-signal.c.
Referenced by handle_wap_event().
void del_all_interface_data | ( | void | ) |
Deletes all interface data
Definition at line 888 of file dbus-signal.c.
static void del_interface_data | ( | int | ifindex | ) | [static] |
Delete one interface from the list
ifindex | Interface index. |
Definition at line 909 of file dbus-signal.c.
Referenced by handle_message().
void disconnected_signal | ( | void | ) |
Send disconnected signal.
Definition at line 192 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.
ifindex | Interface index. |
Definition at line 801 of file dbus-signal.c.
References index2name(), and socket_open().
Referenced by print_event_stream(), and scan_results_ioctl().
static void handle_custom_event | ( | char * | event_pointer, | |
int | length, | |||
struct scan_results_t * | scan_results | |||
) | [static] |
Handle custom event.
event_pointer | pointer to custom event. | |
length | custom event length. | |
scan_results | pointer to scan results struct. |
Definition at line 736 of file dbus-signal.c.
References get_wlan_state(), handle_mic_failure(), and schedule_scan().
Referenced by print_event_token().
static void handle_message | ( | struct nlmsghdr * | hdr | ) | [static] |
Netlink event handling continues, now we know that we have a message
hdr | Pointer to message header. |
Definition at line 948 of file dbus-signal.c.
References del_interface_data(), and print_event_stream().
Referenced by handle_netlink_event().
static void handle_netlink_event | ( | int | fd | ) | [static] |
Start netlink event handling
fd | File descriptor. |
Definition at line 987 of file dbus-signal.c.
References handle_message().
Referenced by _monitor_cb().
static void handle_wap_event | ( | struct scan_results_t * | scan_results, | |
struct iw_event * | event, | |||
gboolean | scan_event | |||
) | [static] |
Handle WAP wireless event.
event | extracted token. | |
scan_results | structure where scan results are saved. |
Definition at line 243 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().
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.
p | Pointer to event buffer. | |
length | Event buffer length. | |
scan_results | Pointer to scan results structure. |
Definition at line 647 of file dbus-signal.c.
References handle_wps_ie(), parse_rsn_ie(), parse_wpa_ie(), and save_caps().
Referenced by print_event_token().
static int index2name | ( | int | skfd, | |
int | ifindex, | |||
char * | name | |||
) | [static] |
Get name of interface based on interface index.
skfd | Socket. | |
ifindex | Interface index. | |
name | Interface name. |
Definition at line 777 of file dbus-signal.c.
Referenced by get_interface_data().
static int init_wi | ( | struct rtnl_handle * | rth | ) | [static] |
Initialize wireless interface
rth | private struct. |
Definition at line 1041 of file dbus-signal.c.
Referenced by monitor_wi().
gboolean monitor_wi | ( | void | ) |
Starts monitoring of wireless events.
Definition at line 1108 of file dbus-signal.c.
References _monitor_cb(), and init_wi().
Referenced by main().
static int print_event_stream | ( | int | ifindex, | |
char * | data, | |||
int | len | |||
) | [static] |
Event handling.
ifindex | Interface index. | |
data | Data. | |
len | Data length. |
Definition at line 851 of file dbus-signal.c.
References get_interface_data(), and print_event_token().
Referenced by handle_message().
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 362 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().
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.
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 568 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.
scan_results | structure where scan results are. | |
scan_results_save | structure where scan results are saved. |
Definition at line 101 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 118 of file dbus-signal.c.
Referenced by ask_scan_results(), and set_scan_state().