#include <sys/types.h>
#include <sys/ioctl.h>
#include <stdio.h>
#include <math.h>
#include <errno.h>
#include <fcntl.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <netdb.h>
#include <net/ethernet.h>
#include <sys/time.h>
#include <net/if_arp.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/if_ether.h>
#include <linux/types.h>
#include <net/if.h>
#include "wireless.h"
Go to the source code of this file.
Classes | |
struct | iw_modul_descr |
struct | iw_pk_event |
struct | iw_pk_point |
struct | stream_descr |
struct | wireless_config |
struct | wireless_info |
struct | wireless_scan |
struct | wireless_scan_head |
Defines | |
#define | __user |
#define | ARPHRD_IEEE80211 801 /* IEEE 802.11 */ |
#define | GIGA 1e9 |
#define | IW_EV_ADDR_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct sockaddr)) |
#define | IW_EV_CHAR_PK_LEN (IW_EV_LCP_PK_LEN + IFNAMSIZ) |
#define | IW_EV_FREQ_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_freq)) |
#define | IW_EV_LCP_PK2_LEN (sizeof(struct iw_pk_event) - sizeof(union iwreq_data)) |
#define | IW_EV_LCP_PK_LEN (4) |
#define | IW_EV_PARAM_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_param)) |
#define | IW_EV_POINT_PK2_LEN (IW_EV_LCP_PK2_LEN + sizeof(struct iw_pk_point) - IW_EV_POINT_OFF) |
#define | IW_EV_POINT_PK_LEN (IW_EV_LCP_PK_LEN + 4) |
#define | IW_EV_QUAL_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_quality)) |
#define | IW_EV_UINT_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(__u32)) |
#define | IW_NUM_OPER_MODE 7 |
#define | IW_NUM_OPER_MODE_EXT 8 |
#define | IW_SIZE_MODUL_LIST 16 |
#define | KILO 1e3 |
#define | LOG10_MAGIC 1.25892541179 |
#define | MEGA 1e6 |
#define | PROC_NET_DEV "/proc/net/dev" |
#define | PROC_NET_WIRELESS "/proc/net/wireless" |
#define | WE_MAX_VERSION 22 |
#define | WE_VERSION 21 |
#define | WT_VERSION 29 |
Typedefs | |
typedef int(* | iw_enum_handler )(int skfd, char *ifname, char *args[], int count) |
typedef struct iw_modul_descr | iw_modul_descr |
typedef struct iw_freq | iwfreq |
typedef struct iw_param | iwparam |
typedef struct iw_priv_args | iwprivargs |
typedef struct iw_quality | iwqual |
typedef struct iw_range | iwrange |
typedef struct iw_statistics | iwstats |
typedef struct sockaddr | sockaddr |
typedef struct stream_descr | stream_descr |
typedef struct wireless_config | wireless_config |
typedef struct wireless_info | wireless_info |
typedef struct wireless_scan | wireless_scan |
typedef struct wireless_scan_head | wireless_scan_head |
Functions | |
struct iw_pk_event | __attribute__ ((packed)) |
static void | iw_broad_ether (struct sockaddr *sap) |
int | iw_channel_to_freq (int channel, double *pfreq, const struct iw_range *range) |
int | iw_check_if_addr_type (int skfd, const char *ifname) |
int | iw_check_mac_addr_type (int skfd, const char *ifname) |
int | iw_dbm2mwatt (int in) |
void | iw_enum_devices (int skfd, iw_enum_handler fn, char *args[], int count) |
int | iw_ether_aton (const char *bufp, struct ether_addr *eth) |
static int | iw_ether_cmp (const struct ether_addr *eth1, const struct ether_addr *eth2) |
void | iw_ether_ntop (const struct ether_addr *eth, char *buf) |
int | iw_extract_event_stream (struct stream_descr *stream, struct iw_event *iwe, int we_version) |
void | iw_float2freq (double in, iwfreq *out) |
double | iw_freq2float (const iwfreq *in) |
int | iw_freq_to_channel (double freq, const struct iw_range *range) |
int | iw_get_basic_config (int skfd, const char *ifname, wireless_config *info) |
static int | iw_get_ext (int skfd, const char *ifname, int request, struct iwreq *pwrq) |
int | iw_get_kernel_we_version (void) |
int | iw_get_priv_info (int skfd, const char *ifname, iwprivargs **ppriv) |
int | iw_get_priv_size (int args) |
int | iw_get_range_info (int skfd, const char *ifname, iwrange *range) |
int | iw_get_stats (int skfd, const char *ifname, iwstats *stats, const iwrange *range, int has_range) |
int | iw_in_addr (int skfd, const char *ifname, char *bufp, struct sockaddr *sap) |
int | iw_in_inet (char *bufp, struct sockaddr *sap) |
int | iw_in_key (const char *input, unsigned char *key) |
int | iw_in_key_full (int skfd, const char *ifname, const char *input, unsigned char *key, __u16 *flags) |
void | iw_init_event_stream (struct stream_descr *stream, char *data, int len) |
int | iw_mac_aton (const char *orig, unsigned char *mac, int macmax) |
char * | iw_mac_ntop (const unsigned char *mac, int maclen, char *buf, int buflen) |
int | iw_mwatt2dbm (int in) |
static void | iw_null_ether (struct sockaddr *sap) |
void | iw_print_bitrate (char *buffer, int buflen, int bitrate) |
void | iw_print_freq (char *buffer, int buflen, double freq, int channel, int freq_flags) |
void | iw_print_freq_value (char *buffer, int buflen, double freq) |
void | iw_print_key (char *buffer, int buflen, const unsigned char *key, int key_size, int key_flags) |
void | iw_print_pm_mode (char *buffer, int buflen, int flags) |
void | iw_print_pm_value (char *buffer, int buflen, int value, int flags, int we_version) |
void | iw_print_retry_value (char *buffer, int buflen, int value, int flags, int we_version) |
void | iw_print_stats (char *buffer, int buflen, const iwqual *qual, const iwrange *range, int has_range) |
void | iw_print_timeval (char *buffer, int buflen, const struct timeval *time, const struct timezone *tz) |
void | iw_print_txpower (char *buffer, int buflen, struct iw_param *txpower) |
int | iw_print_version_info (const char *toolname) |
int | iw_process_scan (int skfd, char *ifname, int we_version, wireless_scan_head *context) |
int | iw_protocol_compare (const char *protocol1, const char *protocol2) |
static int | iw_saether_aton (const char *bufp, struct sockaddr *sap) |
static char * | iw_saether_ntop (const struct sockaddr *sap, char *bufp) |
char * | iw_sawap_ntop (const struct sockaddr *sap, char *buf) |
int | iw_scan (int skfd, char *ifname, int we_version, wireless_scan_head *context) |
int | iw_set_basic_config (int skfd, const char *ifname, wireless_config *info) |
static int | iw_set_ext (int skfd, const char *ifname, int request, struct iwreq *pwrq) |
static void | iw_sockets_close (int skfd) |
int | iw_sockets_open (void) |
Variables | |
__u16 | cmd |
__u16 | flags |
struct iw_modul_descr | iw_modul_list [] |
const char *const | iw_operation_mode [] |
__u16 | len |
__u16 | length |
void __user * | pointer |
union iwreq_data | u |
#define ARPHRD_IEEE80211 801 /* IEEE 802.11 */ |
#define IW_EV_ADDR_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct sockaddr)) |
#define IW_EV_CHAR_PK_LEN (IW_EV_LCP_PK_LEN + IFNAMSIZ) |
#define IW_EV_FREQ_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_freq)) |
#define IW_EV_LCP_PK2_LEN (sizeof(struct iw_pk_event) - sizeof(union iwreq_data)) |
#define IW_EV_LCP_PK_LEN (4) |
#define IW_EV_PARAM_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_param)) |
#define IW_EV_POINT_PK2_LEN (IW_EV_LCP_PK2_LEN + sizeof(struct iw_pk_point) - IW_EV_POINT_OFF) |
#define IW_EV_POINT_PK_LEN (IW_EV_LCP_PK_LEN + 4) |
#define IW_EV_QUAL_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_quality)) |
#define IW_EV_UINT_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(__u32)) |
#define IW_NUM_OPER_MODE 7 |
#define IW_NUM_OPER_MODE_EXT 8 |
#define IW_SIZE_MODUL_LIST 16 |
#define LOG10_MAGIC 1.25892541179 |
#define PROC_NET_DEV "/proc/net/dev" |
#define PROC_NET_WIRELESS "/proc/net/wireless" |
#define WE_MAX_VERSION 22 |
#define WE_VERSION 21 |
#define WT_VERSION 29 |
typedef int(* iw_enum_handler)(int skfd, char *ifname, char *args[], int count) |
typedef struct iw_modul_descr iw_modul_descr |
typedef struct iw_priv_args iwprivargs |
typedef struct iw_quality iwqual |
typedef struct iw_statistics iwstats |
typedef struct stream_descr stream_descr |
typedef struct wireless_config wireless_config |
typedef struct wireless_info wireless_info |
typedef struct wireless_scan wireless_scan |
typedef struct wireless_scan_head wireless_scan_head |
struct iw_pk_event __attribute__ | ( | (packed) | ) |
static void iw_broad_ether | ( | struct sockaddr * | sap | ) | [inline, static] |
int iw_channel_to_freq | ( | int | channel, |
double * | pfreq, | ||
const struct iw_range * | range | ||
) |
int iw_check_if_addr_type | ( | int | skfd, |
const char * | ifname | ||
) |
int iw_check_mac_addr_type | ( | int | skfd, |
const char * | ifname | ||
) |
int iw_dbm2mwatt | ( | int | in | ) |
void iw_enum_devices | ( | int | skfd, |
iw_enum_handler | fn, | ||
char * | args[], | ||
int | count | ||
) |
int iw_ether_aton | ( | const char * | bufp, |
struct ether_addr * | eth | ||
) |
static int iw_ether_cmp | ( | const struct ether_addr * | eth1, |
const struct ether_addr * | eth2 | ||
) | [inline, static] |
void iw_ether_ntop | ( | const struct ether_addr * | eth, |
char * | buf | ||
) |
int iw_extract_event_stream | ( | struct stream_descr * | stream, |
struct iw_event * | iwe, | ||
int | we_version | ||
) |
void iw_float2freq | ( | double | in, |
iwfreq * | out | ||
) |
double iw_freq2float | ( | const iwfreq * | in | ) |
int iw_freq_to_channel | ( | double | freq, |
const struct iw_range * | range | ||
) |
int iw_get_basic_config | ( | int | skfd, |
const char * | ifname, | ||
wireless_config * | info | ||
) |
static int iw_get_ext | ( | int | skfd, |
const char * | ifname, | ||
int | request, | ||
struct iwreq * | pwrq | ||
) | [inline, static] |
int iw_get_kernel_we_version | ( | void | ) |
int iw_get_priv_info | ( | int | skfd, |
const char * | ifname, | ||
iwprivargs ** | ppriv | ||
) |
int iw_get_priv_size | ( | int | args | ) |
int iw_get_range_info | ( | int | skfd, |
const char * | ifname, | ||
iwrange * | range | ||
) |
int iw_get_stats | ( | int | skfd, |
const char * | ifname, | ||
iwstats * | stats, | ||
const iwrange * | range, | ||
int | has_range | ||
) |
int iw_in_addr | ( | int | skfd, |
const char * | ifname, | ||
char * | bufp, | ||
struct sockaddr * | sap | ||
) |
int iw_in_inet | ( | char * | bufp, |
struct sockaddr * | sap | ||
) |
int iw_in_key | ( | const char * | input, |
unsigned char * | key | ||
) |
int iw_in_key_full | ( | int | skfd, |
const char * | ifname, | ||
const char * | input, | ||
unsigned char * | key, | ||
__u16 * | flags | ||
) |
void iw_init_event_stream | ( | struct stream_descr * | stream, |
char * | data, | ||
int | len | ||
) |
int iw_mac_aton | ( | const char * | orig, |
unsigned char * | mac, | ||
int | macmax | ||
) |
char* iw_mac_ntop | ( | const unsigned char * | mac, |
int | maclen, | ||
char * | buf, | ||
int | buflen | ||
) |
int iw_mwatt2dbm | ( | int | in | ) |
static void iw_null_ether | ( | struct sockaddr * | sap | ) | [inline, static] |
void iw_print_bitrate | ( | char * | buffer, |
int | buflen, | ||
int | bitrate | ||
) |
void iw_print_freq | ( | char * | buffer, |
int | buflen, | ||
double | freq, | ||
int | channel, | ||
int | freq_flags | ||
) |
void iw_print_freq_value | ( | char * | buffer, |
int | buflen, | ||
double | freq | ||
) |
void iw_print_key | ( | char * | buffer, |
int | buflen, | ||
const unsigned char * | key, | ||
int | key_size, | ||
int | key_flags | ||
) |
void iw_print_pm_mode | ( | char * | buffer, |
int | buflen, | ||
int | flags | ||
) |
void iw_print_pm_value | ( | char * | buffer, |
int | buflen, | ||
int | value, | ||
int | flags, | ||
int | we_version | ||
) |
void iw_print_retry_value | ( | char * | buffer, |
int | buflen, | ||
int | value, | ||
int | flags, | ||
int | we_version | ||
) |
void iw_print_stats | ( | char * | buffer, |
int | buflen, | ||
const iwqual * | qual, | ||
const iwrange * | range, | ||
int | has_range | ||
) |
void iw_print_timeval | ( | char * | buffer, |
int | buflen, | ||
const struct timeval * | time, | ||
const struct timezone * | tz | ||
) |
void iw_print_txpower | ( | char * | buffer, |
int | buflen, | ||
struct iw_param * | txpower | ||
) |
int iw_print_version_info | ( | const char * | toolname | ) |
int iw_process_scan | ( | int | skfd, |
char * | ifname, | ||
int | we_version, | ||
wireless_scan_head * | context | ||
) |
int iw_protocol_compare | ( | const char * | protocol1, |
const char * | protocol2 | ||
) |
static int iw_saether_aton | ( | const char * | bufp, |
struct sockaddr * | sap | ||
) | [inline, static] |
static char* iw_saether_ntop | ( | const struct sockaddr * | sap, |
char * | bufp | ||
) | [inline, static] |
char* iw_sawap_ntop | ( | const struct sockaddr * | sap, |
char * | buf | ||
) |
int iw_scan | ( | int | skfd, |
char * | ifname, | ||
int | we_version, | ||
wireless_scan_head * | context | ||
) |
int iw_set_basic_config | ( | int | skfd, |
const char * | ifname, | ||
wireless_config * | info | ||
) |
static int iw_set_ext | ( | int | skfd, |
const char * | ifname, | ||
int | request, | ||
struct iwreq * | pwrq | ||
) | [inline, static] |
static void iw_sockets_close | ( | int | skfd | ) | [inline, static] |
int iw_sockets_open | ( | void | ) |
struct iw_modul_descr iw_modul_list[] |
const char* const iw_operation_mode[] |
union iwreq_data u |