#include <netinet/in.h>
#include <linux/wireless.h>
#include "iw_compat.h"
Go to the source code of this file.
Data Structures | |
struct | vif_info |
struct | ioctl_handler |
Defines | |
#define | MAX_NUM_VIF 2 |
#define | CONFIG_READONLY 0 |
#define | CONFIG_READWRITE 1 |
#define | VIF_WE_VERSION 22 |
#define | VIF_NUM_FREQ sizeof(channel_frequency) / sizeof(long) |
#define | VIF_NUM_CHANNEL VIF_NUM_FREQ |
#define | VIF_MAX_RETRY 255 |
#define | VIF_MAX_RTS 2347 |
#define | VIF_DEFAULT_TXPWR 17 |
#define | VIF_IW_NUM_IOCTL_PRIV (sizeof(vif_private_args) / sizeof(struct iw_priv_args)) |
#define | VIF_NUM_IOCTL sizeof(ioctl_handler_list) / sizeof(ioctl_handler) |
Functions | |
ssize_t | vif_init () |
int | vif_create (const char *) |
int | vif_delete (const char *dev_name) |
int | vif_ioctl (int request, struct iwreq *pwrq) |
int | vif_get_names (char vif_names[MAX_NUM_VIF][IFNAMSIZ+1]) |
void | vif_print (void) |
int | vif_get_mac (unsigned char *, const char *) |
uint16_t | vif_get_channel (const char *) |
double | vif_get_frequency (const char *) |
int16_t | vif_get_sensitivity (const char *) |
int16_t | vif_get_rts (const char *) |
int16_t | vif_get_frag (const char *) |
int16_t | vif_get_txpower (const char *) |
int16_t | vif_get_retry (const char *) |
void | vif_set_debug_function (int(*debug)(const char *format,...)) |
void | vif_set_error_function (int(*error)(const char *format,...)) |
int | vif_siocgiwname (struct iwreq *) |
int | vif_siocgiwnid (struct iwreq *) |
int | vif_siocsiwfreq (struct iwreq *) |
int | vif_siocgiwfreq (struct iwreq *) |
int | vif_siocsiwmode (struct iwreq *) |
int | vif_siocgiwmode (struct iwreq *) |
int | vif_siocsiwsens (struct iwreq *) |
int | vif_siocgiwsens (struct iwreq *) |
int | vif_siocgiwrange (struct iwreq *) |
int | vif_siocgiwpriv (struct iwreq *) |
int | vif_siocgiwap (struct iwreq *) |
int | vif_siocsiwessid (struct iwreq *) |
int | vif_siocgiwessid (struct iwreq *) |
int | vif_siocgiwnickn (struct iwreq *) |
int | vif_siocsiwrate (struct iwreq *) |
int | vif_siocgiwrate (struct iwreq *) |
int | vif_siocsiwrts (struct iwreq *) |
int | vif_siocgiwrts (struct iwreq *) |
int | vif_siocsiwfrag (struct iwreq *) |
int | vif_siocgiwfrag (struct iwreq *) |
int | vif_siocsiwtxpow (struct iwreq *) |
int | vif_siocgiwtxpow (struct iwreq *) |
int | vif_siocsiwretry (struct iwreq *) |
int | vif_siocgiwretry (struct iwreq *) |
int | vif_siocsiwencode (struct iwreq *) |
int | vif_siocgiwencode (struct iwreq *) |
int | vif_siocgiwpower (struct iwreq *) |
Variables | |
static const long | channel_frequency [] |
static struct iw_priv_args | vif_private_args [] |
static const ioctl_handler | ioctl_handler_list [] |
It allows to directly query any wireless parameter of a virtual wireless interface or access it via wireless ioctl() calls.
The shared memory segment is transparently created when invoking vif_create() and attached for read-write. A client can attach it read-only with vif_get_names(). Calling vif_get_names() after vif_create() doesn't change the read-write status.
1) Virtual interface standard ioctls: If you want to add another ioctl() type, add it to the ioctl_handler_list at the end of the file with the corresponding function calls vif_siocgiw...() for getter and vif_siocsiw...() for setter function.
2) Virtual interface private ioctls: If you want to add a private ioctl() call, extend the vif_private_args below.
3) Virtual interface driver capabilities: If you want to change the default interface capabilities, change the values under "DEFAULT VIF PARAMETERS" below or in vif_config_init_iwrange().
4) Initial virtual interface configuration: If you want to change the initial interface state, change the parameter assignment in vif_config_init_wlan().
Definition in file vif.h.
#define MAX_NUM_VIF 2 |
#define VIF_IW_NUM_IOCTL_PRIV (sizeof(vif_private_args) / sizeof(struct iw_priv_args)) |
#define VIF_NUM_FREQ sizeof(channel_frequency) / sizeof(long) |
#define VIF_NUM_IOCTL sizeof(ioctl_handler_list) / sizeof(ioctl_handler) |
#define VIF_WE_VERSION 22 |
int vif_create | ( | const char * | ) |
Create virtual interface (real TUN device and wireless information).
Definition at line 801 of file vif_access.c.
int vif_delete | ( | const char * | dev_name | ) |
Delete virtual interface (remove TUN interface and shared memory interface configuration
Definition at line 841 of file vif_access.c.
uint16_t vif_get_channel | ( | const char * | ) |
Get wireless channel number of a virtual interface
Definition at line 941 of file vif_access.c.
int16_t vif_get_frag | ( | const char * | ) |
Get fragmentation threshold of a virtual interface in Bytes
Definition at line 992 of file vif_access.c.
double vif_get_frequency | ( | const char * | ) |
Get wireless frequency of a virtual interface in Hz
Definition at line 930 of file vif_access.c.
int vif_get_mac | ( | unsigned char * | , | |
const char * | ||||
) |
Return the Ethernet address (MAC) of a virtual interface
Definition at line 918 of file vif_access.c.
int vif_get_names | ( | char | vif_names[MAX_NUM_VIF][IFNAMSIZ+1] | ) |
Get names and number of virtual interfaces.
Definition at line 894 of file vif_access.c.
int16_t vif_get_retry | ( | const char * | ) |
Get number of retry attempts of a virtual interface
Definition at line 1019 of file vif_access.c.
int16_t vif_get_rts | ( | const char * | ) |
Get RTS threshold of a virtual interface in Bytes
Definition at line 981 of file vif_access.c.
int16_t vif_get_sensitivity | ( | const char * | ) |
Get wireless sensitivity of a virtual interface in dB
Definition at line 967 of file vif_access.c.
int16_t vif_get_txpower | ( | const char * | ) |
Get radio txpower of a virtual interface in mW
Definition at line 1002 of file vif_access.c.
ssize_t vif_init | ( | ) |
Load virtual interface configuration and return number of configured interfaces
Definition at line 783 of file vif_access.c.
int vif_ioctl | ( | int | request, | |
struct iwreq * | pwrq | |||
) |
Perform ioctl on virtual interface
request | Type of ioctl() call (see wireless.h) | |
pwrq | Wireless ioctl() request |
Definition at line 853 of file vif_access.c.
void vif_print | ( | void | ) |
Print virtual interface configuration list to debug output
Definition at line 909 of file vif_access.c.
void vif_set_debug_function | ( | int(*)(const char *format,...) | debug | ) |
Set debug output for custom redirection (default: stdout)
Definition at line 771 of file vif_access.c.
void vif_set_error_function | ( | int(*)(const char *format,...) | error | ) |
Set error output for custom redirection (default: stdout)
Definition at line 777 of file vif_access.c.
int vif_siocgiwap | ( | struct iwreq * | ) |
Definition at line 418 of file vif_access.c.
int vif_siocgiwencode | ( | struct iwreq * | ) |
Definition at line 725 of file vif_access.c.
int vif_siocgiwessid | ( | struct iwreq * | ) |
Definition at line 452 of file vif_access.c.
int vif_siocgiwfrag | ( | struct iwreq * | ) |
Definition at line 592 of file vif_access.c.
int vif_siocgiwfreq | ( | struct iwreq * | ) |
Definition at line 287 of file vif_access.c.
int vif_siocgiwmode | ( | struct iwreq * | ) |
Definition at line 321 of file vif_access.c.
int vif_siocgiwname | ( | struct iwreq * | ) |
Definition at line 214 of file vif_access.c.
int vif_siocgiwnickn | ( | struct iwreq * | ) |
Definition at line 470 of file vif_access.c.
int vif_siocgiwnid | ( | struct iwreq * | ) |
Definition at line 228 of file vif_access.c.
int vif_siocgiwpower | ( | struct iwreq * | ) |
Definition at line 751 of file vif_access.c.
int vif_siocgiwpriv | ( | struct iwreq * | ) |
Definition at line 392 of file vif_access.c.
int vif_siocgiwrange | ( | struct iwreq * | ) |
Definition at line 375 of file vif_access.c.
int vif_siocgiwrate | ( | struct iwreq * | ) |
Definition at line 502 of file vif_access.c.
int vif_siocgiwretry | ( | struct iwreq * | ) |
Definition at line 683 of file vif_access.c.
int vif_siocgiwrts | ( | struct iwreq * | ) |
Definition at line 540 of file vif_access.c.
int vif_siocgiwsens | ( | struct iwreq * | ) |
Definition at line 358 of file vif_access.c.
int vif_siocgiwtxpow | ( | struct iwreq * | ) |
Definition at line 643 of file vif_access.c.
int vif_siocsiwencode | ( | struct iwreq * | ) |
Definition at line 698 of file vif_access.c.
int vif_siocsiwessid | ( | struct iwreq * | ) |
Definition at line 434 of file vif_access.c.
int vif_siocsiwfrag | ( | struct iwreq * | ) |
Definition at line 559 of file vif_access.c.
int vif_siocsiwfreq | ( | struct iwreq * | request | ) |
Called for SIOCSIWFREQ (argument can be channel or frequency)
Definition at line 249 of file vif_access.c.
int vif_siocsiwmode | ( | struct iwreq * | ) |
Definition at line 306 of file vif_access.c.
int vif_siocsiwrate | ( | struct iwreq * | ) |
Definition at line 486 of file vif_access.c.
int vif_siocsiwretry | ( | struct iwreq * | ) |
Definition at line 662 of file vif_access.c.
int vif_siocsiwrts | ( | struct iwreq * | ) |
Definition at line 517 of file vif_access.c.
int vif_siocsiwsens | ( | struct iwreq * | ) |
Definition at line 340 of file vif_access.c.
int vif_siocsiwtxpow | ( | struct iwreq * | ) |
Definition at line 611 of file vif_access.c.
const long channel_frequency[] [static] |
const ioctl_handler ioctl_handler_list[] [static] |
Initial value:
{ { SIOCGIWNAME, vif_siocgiwname }, { SIOCGIWNWID, vif_siocgiwnid }, { SIOCSIWFREQ, vif_siocsiwfreq }, { SIOCGIWFREQ, vif_siocgiwfreq }, { SIOCSIWMODE, vif_siocsiwmode }, { SIOCGIWMODE, vif_siocgiwmode }, { SIOCSIWSENS, vif_siocsiwsens }, { SIOCGIWSENS, vif_siocgiwsens }, { SIOCGIWRANGE, vif_siocgiwrange }, { SIOCGIWPRIV, vif_siocgiwpriv }, { SIOCGIWAP, vif_siocgiwap }, { SIOCSIWESSID, vif_siocsiwessid }, { SIOCGIWESSID, vif_siocgiwessid }, { SIOCGIWNICKN, vif_siocgiwnickn }, { SIOCSIWRATE, vif_siocsiwrate }, { SIOCGIWRATE, vif_siocgiwrate }, { SIOCSIWRTS, vif_siocsiwrts }, { SIOCGIWRTS, vif_siocgiwrts }, { SIOCSIWFRAG, vif_siocsiwfrag }, { SIOCGIWFRAG, vif_siocgiwfrag }, { SIOCSIWTXPOW, vif_siocsiwtxpow }, { SIOCGIWTXPOW, vif_siocgiwtxpow }, { SIOCSIWRETRY, vif_siocsiwretry }, { SIOCGIWRETRY, vif_siocgiwretry }, { SIOCSIWENCODE, vif_siocsiwencode }, { SIOCGIWENCODE, vif_siocgiwencode }, { SIOCGIWPOWER, vif_siocgiwpower } }
struct iw_priv_args vif_private_args[] [static] |