Data Structures | Defines | Functions

libnl-handler.h File Reference

#include <netlink/genl/genl.h>
#include <netlink/genl/family.h>
#include <netlink/genl/ctrl.h>
#include <linux/nl80211.h>
#include "common.h"
Include dependency graph for libnl-handler.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  get_family_t

Defines

#define WLANCOND_CIPHER_SUITE_NONE   0x000FAC00
#define WLANCOND_CIPHER_SUITE_WEP40   0x000FAC01
#define WLANCOND_CIPHER_SUITE_TKIP   0x000FAC02
#define WLANCOND_CIPHER_SUITE_CCMP   0x000FAC04
#define WLANCOND_CIPHER_SUITE_WEP104   0x000FAC05
#define WLANCOND_KEY_MGMT_802_1X   0x000FAC01
#define WLANCOND_KEY_MGMT_PSK   0x000FAC02
#define WLANCOND_CQM_THRESHOLD_ACTIVE   -70
#define WLANCOND_CQM_THRESHOLD_IDLE   -80
#define WLANCOND_CQM_HYSTERESIS   3

Functions

int init_nl80211 (void)
int nl_send_recv_msgs (struct nl_msg *msg, int(*valid_handler)(struct nl_msg *, void *), void *valid_data)
void nl80211_cleanup (void)
int nl80211_connect (struct scan_results_t *scan_results, struct wlan_status_t *wlan_status)
int nl80211_leave_adhoc (guint32 ifindex)
int nl80211_set_op_mode (guint32 ifindex, guint32 mode)
int nl80211_mlme_command (guchar *addr, guint16 cmd, guint16 reason_code, guint32 ifindex)
int nl80211_get_signal_info (guint8 *power, struct wlan_status_t *wlan_status)
int nl80211_set_power_save (gboolean new_state, guint32 ifindex)
int nl80211_scan (wlan_status_t *const wlan_status, int ssid_len, char *const ssid)
int nl80211_send_get_scan_results (wlan_status_t *const wlan_status, GSList **const scan_results)
void nl80211_scan_ready (void)
int nl80211_set_cqm (guint32 threshold, guint32 hyst)
int nl80211_set_tx_power (int tx_power, guint32 ifindex)
int nl80211_get_phy_info (guint32 ifindex)
int nl80211_set_channel (guint32 ifindex, guint32 channel)

Detailed Description

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

Author:
Usman Rahim <usman.rahim@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 libnl-handler.h.


Function Documentation

int init_nl80211 ( void   ) 

initialize the netlink library sockets

Returns:
status.

Definition at line 494 of file libnl-handler.c.

References event_receive(), nl80211_get_family(), and nl_handle.

Referenced by main().

Here is the call graph for this function:

void nl80211_cleanup ( void   ) 

Cleaning the pointers on close down.

Definition at line 690 of file libnl-handler.c.

References nl_handle.

Referenced by main().

int nl80211_connect ( struct scan_results_t scan_results,
struct wlan_status_t wlan_status 
)

Connect function to connect to selected access point.

Parameters:
scan_results Scan results.
Returns:
status.

Definition at line 808 of file libnl-handler.c.

References channel_to_freq(), get_mode(), get_wpa_mode(), nl80211_set_wep_keys(), and nl_send_recv_msgs().

Referenced by associate().

Here is the call graph for this function:

int nl80211_get_phy_info ( guint32  ifindex  ) 

Helper function for getting the phy information.

Parameters:
ifindex Interface index.
Returns:
status.

Definition at line 1107 of file libnl-handler.c.

References nl_send_recv_msgs(), and phy_info_handler().

Referenced by handle_netlink_wap_event().

Here is the call graph for this function:

int nl80211_get_signal_info ( guint8 *  power,
struct wlan_status_t wlan_status 
)

Ask for station stats.

Parameters:
power Signal power.
wlan_status Wlan status.
Returns:
status.

Definition at line 1327 of file libnl-handler.c.

References nl80211_signal_power_handler(), and nl_send_recv_msgs().

Referenced by status_request().

Here is the call graph for this function:

int nl80211_leave_adhoc ( guint32  ifindex  ) 

Leave the adhoc network.

Parameters:
ifindex Interface index.
Returns:
status.

Definition at line 1176 of file libnl-handler.c.

References nl_send_recv_msgs().

Referenced by mlme_command().

Here is the call graph for this function:

int nl80211_mlme_command ( guchar *  addr,
guint16  cmd,
guint16  reason_code,
guint32  ifindex 
)

MLME nl80211 commands.

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

Definition at line 1213 of file libnl-handler.c.

References nl_send_recv_msgs().

Referenced by mlme_command().

Here is the call graph for this function:

int nl80211_scan ( wlan_status_t *const   wlan_status,
int  ssid_len,
char *const   ssid 
)

Function to send scan trigger command.

Parameters:
wlan_status Pointer to WLAN status structure.
ssid_len Length of SSID if given.
ssid SSID if given.
Returns:
status.

Definition at line 1413 of file libnl-handler.c.

References nl_send_recv_msgs().

Referenced by scan().

Here is the call graph for this function:

void nl80211_scan_ready ( void   ) 

Handles scan results ready netlink event

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

References ask_scan_results(), get_scan_state(), and set_wlan_state().

Referenced by print_netlink_event_token().

Here is the call graph for this function:

int nl80211_send_get_scan_results ( wlan_status_t *const   wlan_status,
GSList **const   scan_results 
)

Function to send get scan results command.

Parameters:
wlan_status Pointer to WLAN status structure.
scan_results Pointer to scan result list.
Returns:
status.

Definition at line 1468 of file libnl-handler.c.

References nl80211_scan_result_handler(), and nl_send_recv_msgs().

Referenced by ask_scan_results(), and settings_and_connect_request().

Here is the call graph for this function:

int nl80211_set_channel ( guint32  ifindex,
guint32  channel 
)

Helper function for setting the channel.

Parameters:
ifindex Interface index.
channel Channel.
Returns:
status.

Definition at line 1141 of file libnl-handler.c.

References channel_to_freq(), and nl_send_recv_msgs().

Referenced by settings_and_connect_request().

Here is the call graph for this function:

int nl80211_set_cqm ( guint32  threshold,
guint32  hyst 
)

Set the connection quality monitor.

Parameters:
threshold Threshold value for receiving events.
hyst Hysteresis value.
Returns:
status.

Definition at line 1812 of file libnl-handler.c.

References get_mode(), nl_send_recv_msgs(), and wlan_status.

Referenced by set_mode().

Here is the call graph for this function:

int nl80211_set_op_mode ( guint32  ifindex,
guint32  mode 
)

Helper function for setting the operating mode using netlink.

Parameters:
ifindex Interface index.
mode Operating mode.
Returns:
status.

Definition at line 1026 of file libnl-handler.c.

References nl_send_recv_msgs().

Referenced by set_mode().

Here is the call graph for this function:

int nl80211_set_power_save ( gboolean  new_state,
guint32  ifindex 
)

Set the power save state.

Parameters:
power_save Enable/disable.
ifindex Interface index.
Returns:
status.

Definition at line 1367 of file libnl-handler.c.

References nl_send_recv_msgs().

Referenced by set_power_state().

Here is the call graph for this function:

int nl80211_set_tx_power ( int  tx_power,
guint32  ifindex 
)

Set the transmit power level.

Parameters:
tx_power value.
ifindex Interface index.
Returns:
status.

Definition at line 1982 of file libnl-handler.c.

References nl_send_recv_msgs().

Referenced by set_tx_power().

Here is the call graph for this function:

int nl_send_recv_msgs ( struct nl_msg *  msg,
int(*)(struct nl_msg *, void *)  valid_handler,
void *  valid_data 
)

Send the netlink command to the kernel.

Parameters:
msg structure Containing the command.
valid_handler Pointer to call back function.
valid_data Argument for call back function.
Returns:
status.

Definition at line 628 of file libnl-handler.c.

References nl_handle.

Referenced by nl80211_connect(), nl80211_get_family(), nl80211_get_phy_info(), nl80211_get_signal_info(), nl80211_leave_adhoc(), nl80211_mlme_command(), nl80211_scan(), nl80211_send_get_scan_results(), nl80211_set_channel(), nl80211_set_cqm(), nl80211_set_op_mode(), nl80211_set_power_save(), and nl80211_set_tx_power().