#include "build_config.h"
#include "utils/includes.h"
#include <sys/un.h>
#include <dirent.h>
#include <sys/stat.h>
#include "utils/common.h"
#include "utils/eloop.h"
#include "utils/list.h"
#include "utils/trace.h"
#include "common/ieee802_11_defs.h"
#include "crypto/sha1.h"
#include "l2_packet/l2_packet.h"
#include "driver.h"
Go to the source code of this file.
Classes | |
struct | test_client_socket |
struct | test_driver_bss |
struct | wpa_driver_test_data |
struct | wpa_driver_test_global |
Defines | |
#define | DRIVER_TEST_UNIX |
#define | MAX_IE_LEN 1000 |
#define | MAX_SCAN_RESULTS 30 |
Functions | |
static struct wpa_driver_test_data * | test_alloc_data (void *ctx, const char *ifname) |
static void | test_driver_assoc (struct wpa_driver_test_data *drv, struct sockaddr_un *from, socklen_t fromlen, char *data) |
static int | test_driver_bss_add (void *priv, const char *ifname, const u8 *bssid, void *bss_ctx, void **drv_priv) |
static int | test_driver_bss_remove (void *priv, const char *ifname) |
static void | test_driver_disassoc (struct wpa_driver_test_data *drv, struct sockaddr_un *from, socklen_t fromlen) |
static void | test_driver_eapol (struct wpa_driver_test_data *drv, struct sockaddr_un *from, socklen_t fromlen, u8 *data, size_t datalen) |
static void | test_driver_ether (struct wpa_driver_test_data *drv, struct sockaddr_un *from, socklen_t fromlen, u8 *data, size_t datalen) |
static void | test_driver_free_bss (struct test_driver_bss *bss) |
static void | test_driver_free_bsses (struct wpa_driver_test_data *drv) |
static struct test_client_socket * | test_driver_get_cli (struct wpa_driver_test_data *drv, struct sockaddr_un *from, socklen_t fromlen) |
static int | test_driver_if_add (void *priv, enum wpa_driver_if_type type, const char *ifname, const u8 *addr, void *bss_ctx, void **drv_priv, char *force_ifname, u8 *if_addr) |
static int | test_driver_if_remove (void *priv, enum wpa_driver_if_type type, const char *ifname) |
static void * | test_driver_init (struct hostapd_data *hapd, struct wpa_init_params *params) |
static void | test_driver_mlme (struct wpa_driver_test_data *drv, struct sockaddr_un *from, socklen_t fromlen, u8 *data, size_t datalen) |
static void | test_driver_receive_unix (int sock, void *eloop_ctx, void *sock_ctx) |
static void | test_driver_scan (struct wpa_driver_test_data *drv, struct sockaddr_un *from, socklen_t fromlen, char *data) |
static int | test_driver_send_eapol (void *priv, const u8 *addr, const u8 *data, size_t data_len, int encrypt, const u8 *own_addr) |
static int | test_driver_send_ether (void *priv, const u8 *dst, const u8 *src, u16 proto, const u8 *data, size_t data_len) |
static int | test_driver_set_ap_wps_ie (void *priv, const struct wpabuf *beacon, const struct wpabuf *proberesp) |
static int | test_driver_set_generic_elem (void *priv, const u8 *elem, size_t elem_len) |
static int | test_driver_set_privacy (void *priv, int enabled) |
static int | test_driver_set_ssid (void *priv, const u8 *buf, int len) |
static int | test_driver_set_sta_vlan (void *priv, const u8 *addr, const char *ifname, int vlan_id) |
static int | test_driver_sta_add (void *priv, struct hostapd_sta_add_params *params) |
static int | test_driver_sta_deauth (void *priv, const u8 *own_addr, const u8 *addr, int reason) |
static int | test_driver_sta_disassoc (void *priv, const u8 *own_addr, const u8 *addr, int reason) |
static int | test_driver_valid_bss_mask (void *priv, const u8 *addr, const u8 *mask) |
static void | test_remain_on_channel_timeout (void *eloop_ctx, void *timeout_ctx) |
static void | wpa_driver_scan_dir (struct wpa_driver_test_data *drv, const char *path) |
static int | wpa_driver_test_associate (void *priv, struct wpa_driver_associate_params *params) |
static void | wpa_driver_test_assocresp (struct wpa_driver_test_data *drv, struct sockaddr *from, socklen_t fromlen, const char *data) |
static int | wpa_driver_test_attach (struct wpa_driver_test_data *drv, const char *dir, int ap) |
static int | wpa_driver_test_attach_udp (struct wpa_driver_test_data *drv, char *dst) |
static int | wpa_driver_test_cancel_remain_on_channel (void *priv) |
static void | wpa_driver_test_close_test_socket (struct wpa_driver_test_data *drv) |
static int | wpa_driver_test_deauthenticate (void *priv, const u8 *addr, int reason_code) |
static void | wpa_driver_test_deinit (void *priv) |
static void | wpa_driver_test_disassoc (struct wpa_driver_test_data *drv, struct sockaddr *from, socklen_t fromlen) |
static int | wpa_driver_test_disassociate (void *priv, const u8 *addr, int reason_code) |
static void | wpa_driver_test_eapol (struct wpa_driver_test_data *drv, struct sockaddr *from, socklen_t fromlen, const u8 *data, size_t data_len) |
static int | wpa_driver_test_get_bssid (void *priv, u8 *bssid) |
static int | wpa_driver_test_get_capa (void *priv, struct wpa_driver_capa *capa) |
static struct hostapd_hw_modes * | wpa_driver_test_get_hw_feature_data (void *priv, u16 *num_modes, u16 *flags) |
static struct wpa_interface_info * | wpa_driver_test_get_interfaces (void *global_priv) |
static const u8 * | wpa_driver_test_get_mac_addr (void *priv) |
static struct wpa_scan_results * | wpa_driver_test_get_scan_results2 (void *priv) |
static int | wpa_driver_test_get_ssid (void *priv, u8 *ssid) |
static void | wpa_driver_test_global_deinit (void *priv) |
static void * | wpa_driver_test_global_init (void) |
static void * | wpa_driver_test_init2 (void *ctx, const char *ifname, void *global_priv) |
static void | wpa_driver_test_mlme (struct wpa_driver_test_data *drv, struct sockaddr *from, socklen_t fromlen, const u8 *data, size_t data_len) |
static int | wpa_driver_test_mlme_add_sta (void *priv, const u8 *addr, const u8 *supp_rates, size_t supp_rates_len) |
static int | wpa_driver_test_mlme_remove_sta (void *priv, const u8 *addr) |
static int | wpa_driver_test_mlme_setprotection (void *priv, const u8 *addr, int protect_type, int key_type) |
static void | wpa_driver_test_poll (void *eloop_ctx, void *timeout_ctx) |
static int | wpa_driver_test_probe_req_report (void *priv, int report) |
static void | wpa_driver_test_receive_unix (int sock, void *eloop_ctx, void *sock_ctx) |
static int | wpa_driver_test_remain_on_channel (void *priv, unsigned int freq, unsigned int duration) |
static int | wpa_driver_test_scan (void *priv, struct wpa_driver_scan_params *params) |
static void | wpa_driver_test_scan_cmd (struct wpa_driver_test_data *drv, struct sockaddr *from, socklen_t fromlen, const u8 *data, size_t data_len) |
static void | wpa_driver_test_scan_timeout (void *eloop_ctx, void *timeout_ctx) |
static void | wpa_driver_test_scanresp (struct wpa_driver_test_data *drv, struct sockaddr *from, socklen_t fromlen, const char *data) |
static int | wpa_driver_test_send_action (void *priv, unsigned int freq, const u8 *dst, const u8 *src, const u8 *bssid, const u8 *data, size_t data_len) |
static int | wpa_driver_test_send_disassoc (struct wpa_driver_test_data *drv) |
static int | wpa_driver_test_send_eapol (void *priv, const u8 *dest, u16 proto, const u8 *data, size_t data_len) |
static int | wpa_driver_test_send_mlme (void *priv, const u8 *data, size_t data_len) |
static int | wpa_driver_test_set_bssid (void *priv, const u8 *bssid) |
static int | wpa_driver_test_set_channel (void *priv, enum hostapd_hw_mode phymode, int chan, int freq) |
static int | wpa_driver_test_set_freq (void *priv, struct hostapd_freq_params *freq) |
static int | wpa_driver_test_set_key (const char *ifname, void *priv, enum wpa_alg alg, const u8 *addr, int key_idx, int set_tx, const u8 *seq, size_t seq_len, const u8 *key, size_t key_len) |
static int | wpa_driver_test_set_param (void *priv, const char *param) |
static int | wpa_driver_test_set_ssid (void *priv, const u8 *ssid, size_t ssid_len) |
static int | wpa_driver_update_mode (struct wpa_driver_test_data *drv, int ap) |
static const u8 * | wpa_scan_get_ie (const struct wpa_scan_res *res, u8 ie) |
Variables | |
struct wpa_driver_ops | wpa_driver_test_ops |
#define DRIVER_TEST_UNIX |
Definition at line 27 of file driver_test.c.
#define MAX_IE_LEN 1000 |
#define MAX_SCAN_RESULTS 30 |
Definition at line 84 of file driver_test.c.
static struct wpa_driver_test_data* test_alloc_data | ( | void * | ctx, |
const char * | ifname | ||
) | [static, read] |
Definition at line 1129 of file driver_test.c.
static void test_driver_assoc | ( | struct wpa_driver_test_data * | drv, |
struct sockaddr_un * | from, | ||
socklen_t | fromlen, | ||
char * | data | ||
) | [static] |
Definition at line 553 of file driver_test.c.
static int test_driver_bss_add | ( | void * | priv, |
const char * | ifname, | ||
const u8 * | bssid, | ||
void * | bss_ctx, | ||
void ** | drv_priv | ||
) | [static] |
Definition at line 949 of file driver_test.c.
static int test_driver_bss_remove | ( | void * | priv, |
const char * | ifname | ||
) | [static] |
Definition at line 981 of file driver_test.c.
static void test_driver_disassoc | ( | struct wpa_driver_test_data * | drv, |
struct sockaddr_un * | from, | ||
socklen_t | fromlen | ||
) | [static] |
Definition at line 631 of file driver_test.c.
static void test_driver_eapol | ( | struct wpa_driver_test_data * | drv, |
struct sockaddr_un * | from, | ||
socklen_t | fromlen, | ||
u8 * | data, | ||
size_t | datalen | ||
) | [static] |
Definition at line 644 of file driver_test.c.
static void test_driver_ether | ( | struct wpa_driver_test_data * | drv, |
struct sockaddr_un * | from, | ||
socklen_t | fromlen, | ||
u8 * | data, | ||
size_t | datalen | ||
) | [static] |
Definition at line 680 of file driver_test.c.
static void test_driver_free_bss | ( | struct test_driver_bss * | bss | ) | [static] |
Definition at line 121 of file driver_test.c.
static void test_driver_free_bsses | ( | struct wpa_driver_test_data * | drv | ) | [static] |
Definition at line 130 of file driver_test.c.
static struct test_client_socket* test_driver_get_cli | ( | struct wpa_driver_test_data * | drv, |
struct sockaddr_un * | from, | ||
socklen_t | fromlen | ||
) | [static, read] |
Definition at line 143 of file driver_test.c.
static int test_driver_if_add | ( | void * | priv, |
enum wpa_driver_if_type | type, | ||
const char * | ifname, | ||
const u8 * | addr, | ||
void * | bss_ctx, | ||
void ** | drv_priv, | ||
char * | force_ifname, | ||
u8 * | if_addr | ||
) | [static] |
Definition at line 1015 of file driver_test.c.
static int test_driver_if_remove | ( | void * | priv, |
enum wpa_driver_if_type | type, | ||
const char * | ifname | ||
) | [static] |
Definition at line 1043 of file driver_test.c.
static void* test_driver_init | ( | struct hostapd_data * | hapd, |
struct wpa_init_params * | params | ||
) | [static] |
Definition at line 1166 of file driver_test.c.
static void test_driver_mlme | ( | struct wpa_driver_test_data * | drv, |
struct sockaddr_un * | from, | ||
socklen_t | fromlen, | ||
u8 * | data, | ||
size_t | datalen | ||
) | [static] |
Definition at line 707 of file driver_test.c.
static void test_driver_receive_unix | ( | int | sock, |
void * | eloop_ctx, | ||
void * | sock_ctx | ||
) | [static] |
Definition at line 779 of file driver_test.c.
static void test_driver_scan | ( | struct wpa_driver_test_data * | drv, |
struct sockaddr_un * | from, | ||
socklen_t | fromlen, | ||
char * | data | ||
) | [static] |
Definition at line 476 of file driver_test.c.
static int test_driver_send_eapol | ( | void * | priv, |
const u8 * | addr, | ||
const u8 * | data, | ||
size_t | data_len, | ||
int | encrypt, | ||
const u8 * | own_addr | ||
) | [static] |
Definition at line 160 of file driver_test.c.
static int test_driver_send_ether | ( | void * | priv, |
const u8 * | dst, | ||
const u8 * | src, | ||
u16 | proto, | ||
const u8 * | data, | ||
size_t | data_len | ||
) | [static] |
Definition at line 207 of file driver_test.c.
static int test_driver_set_ap_wps_ie | ( | void * | priv, |
const struct wpabuf * | beacon, | ||
const struct wpabuf * | proberesp | ||
) | [static] |
Definition at line 843 of file driver_test.c.
static int test_driver_set_generic_elem | ( | void * | priv, |
const u8 * | elem, | ||
size_t | elem_len | ||
) | [static] |
Definition at line 818 of file driver_test.c.
static int test_driver_set_privacy | ( | void * | priv, |
int | enabled | ||
) | [static] |
Definition at line 1077 of file driver_test.c.
static int test_driver_set_ssid | ( | void * | priv, |
const u8 * | buf, | ||
int | len | ||
) | [static] |
Definition at line 1060 of file driver_test.c.
static int test_driver_set_sta_vlan | ( | void * | priv, |
const u8 * | addr, | ||
const char * | ifname, | ||
int | vlan_id | ||
) | [static] |
Definition at line 1088 of file driver_test.c.
static int test_driver_sta_add | ( | void * | priv, |
struct hostapd_sta_add_params * | params | ||
) | [static] |
Definition at line 1097 of file driver_test.c.
static int test_driver_sta_deauth | ( | void * | priv, |
const u8 * | own_addr, | ||
const u8 * | addr, | ||
int | reason | ||
) | [static] |
Definition at line 899 of file driver_test.c.
static int test_driver_sta_disassoc | ( | void * | priv, |
const u8 * | own_addr, | ||
const u8 * | addr, | ||
int | reason | ||
) | [static] |
Definition at line 924 of file driver_test.c.
static int test_driver_valid_bss_mask | ( | void * | priv, |
const u8 * | addr, | ||
const u8 * | mask | ||
) | [static] |
Definition at line 1053 of file driver_test.c.
static void test_remain_on_channel_timeout | ( | void * | eloop_ctx, |
void * | timeout_ctx | ||
) | [static] |
Definition at line 2635 of file driver_test.c.
static void wpa_driver_scan_dir | ( | struct wpa_driver_test_data * | drv, |
const char * | path | ||
) | [static] |
Definition at line 1280 of file driver_test.c.
static int wpa_driver_test_associate | ( | void * | priv, |
struct wpa_driver_associate_params * | params | ||
) | [static] |
Definition at line 1480 of file driver_test.c.
static void wpa_driver_test_assocresp | ( | struct wpa_driver_test_data * | drv, |
struct sockaddr * | from, | ||
socklen_t | fromlen, | ||
const char * | data | ||
) | [static] |
Definition at line 1787 of file driver_test.c.
static int wpa_driver_test_attach | ( | struct wpa_driver_test_data * | drv, |
const char * | dir, | ||
int | ap | ||
) | [static] |
Definition at line 2105 of file driver_test.c.
static int wpa_driver_test_attach_udp | ( | struct wpa_driver_test_data * | drv, |
char * | dst | ||
) | [static] |
Definition at line 2161 of file driver_test.c.
static int wpa_driver_test_cancel_remain_on_channel | ( | void * | priv | ) | [static] |
Definition at line 2682 of file driver_test.c.
static void wpa_driver_test_close_test_socket | ( | struct wpa_driver_test_data * | drv | ) | [static] |
Definition at line 2053 of file driver_test.c.
static int wpa_driver_test_deauthenticate | ( | void * | priv, |
const u8 * | addr, | ||
int | reason_code | ||
) | [static] |
Definition at line 1644 of file driver_test.c.
static void wpa_driver_test_deinit | ( | void * | priv | ) | [static] |
Definition at line 2069 of file driver_test.c.
static void wpa_driver_test_disassoc | ( | struct wpa_driver_test_data * | drv, |
struct sockaddr * | from, | ||
socklen_t | fromlen | ||
) | [static] |
Definition at line 1813 of file driver_test.c.
static int wpa_driver_test_disassociate | ( | void * | priv, |
const u8 * | addr, | ||
int | reason_code | ||
) | [static] |
Definition at line 1658 of file driver_test.c.
static void wpa_driver_test_eapol | ( | struct wpa_driver_test_data * | drv, |
struct sockaddr * | from, | ||
socklen_t | fromlen, | ||
const u8 * | data, | ||
size_t | data_len | ||
) | [static] |
Definition at line 1822 of file driver_test.c.
static int wpa_driver_test_get_bssid | ( | void * | priv, |
u8 * | bssid | ||
) | [static] |
Definition at line 1606 of file driver_test.c.
static int wpa_driver_test_get_capa | ( | void * | priv, |
struct wpa_driver_capa * | capa | ||
) | [static] |
Definition at line 2366 of file driver_test.c.
static struct hostapd_hw_modes* wpa_driver_test_get_hw_feature_data | ( | void * | priv, |
u16 * | num_modes, | ||
u16 * | flags | ||
) | [static, read] |
Definition at line 2495 of file driver_test.c.
static struct wpa_interface_info* wpa_driver_test_get_interfaces | ( | void * | global_priv | ) | [static, read] |
Definition at line 2472 of file driver_test.c.
static const u8* wpa_driver_test_get_mac_addr | ( | void * | priv | ) | [static] |
Definition at line 2283 of file driver_test.c.
static struct wpa_scan_results* wpa_driver_test_get_scan_results2 | ( | void * | priv | ) | [static, read] |
Definition at line 1412 of file driver_test.c.
static int wpa_driver_test_get_ssid | ( | void * | priv, |
u8 * | ssid | ||
) | [static] |
Definition at line 1614 of file driver_test.c.
static void wpa_driver_test_global_deinit | ( | void * | priv | ) | [static] |
Definition at line 2464 of file driver_test.c.
static void* wpa_driver_test_global_init | ( | void | ) | [static] |
Definition at line 2455 of file driver_test.c.
static void* wpa_driver_test_init2 | ( | void * | ctx, |
const char * | ifname, | ||
void * | global_priv | ||
) | [static] |
Definition at line 2018 of file driver_test.c.
static void wpa_driver_test_mlme | ( | struct wpa_driver_test_data * | drv, |
struct sockaddr * | from, | ||
socklen_t | fromlen, | ||
const u8 * | data, | ||
size_t | data_len | ||
) | [static] |
Definition at line 1844 of file driver_test.c.
static int wpa_driver_test_mlme_add_sta | ( | void * | priv, |
const u8 * | addr, | ||
const u8 * | supp_rates, | ||
size_t | supp_rates_len | ||
) | [static] |
Definition at line 2424 of file driver_test.c.
static int wpa_driver_test_mlme_remove_sta | ( | void * | priv, |
const u8 * | addr | ||
) | [static] |
Definition at line 2433 of file driver_test.c.
static int wpa_driver_test_mlme_setprotection | ( | void * | priv, |
const u8 * | addr, | ||
int | protect_type, | ||
int | key_type | ||
) | [static] |
Definition at line 2395 of file driver_test.c.
static void wpa_driver_test_poll | ( | void * | eloop_ctx, |
void * | timeout_ctx | ||
) | [static] |
Definition at line 1252 of file driver_test.c.
static int wpa_driver_test_probe_req_report | ( | void * | priv, |
int | report | ||
) | [static] |
Definition at line 2695 of file driver_test.c.
static void wpa_driver_test_receive_unix | ( | int | sock, |
void * | eloop_ctx, | ||
void * | sock_ctx | ||
) | [static] |
Definition at line 1959 of file driver_test.c.
static int wpa_driver_test_remain_on_channel | ( | void * | priv, |
unsigned int | freq, | ||
unsigned int | duration | ||
) | [static] |
Definition at line 2651 of file driver_test.c.
static int wpa_driver_test_scan | ( | void * | priv, |
struct wpa_driver_scan_params * | params | ||
) | [static] |
Definition at line 1348 of file driver_test.c.
static void wpa_driver_test_scan_cmd | ( | struct wpa_driver_test_data * | drv, |
struct sockaddr * | from, | ||
socklen_t | fromlen, | ||
const u8 * | data, | ||
size_t | data_len | ||
) | [static] |
Definition at line 1908 of file driver_test.c.
static void wpa_driver_test_scan_timeout | ( | void * | eloop_ctx, |
void * | timeout_ctx | ||
) | [static] |
Definition at line 1272 of file driver_test.c.
static void wpa_driver_test_scanresp | ( | struct wpa_driver_test_data * | drv, |
struct sockaddr * | from, | ||
socklen_t | fromlen, | ||
const char * | data | ||
) | [static] |
Definition at line 1691 of file driver_test.c.
static int wpa_driver_test_send_action | ( | void * | priv, |
unsigned int | freq, | ||
const u8 * | dst, | ||
const u8 * | src, | ||
const u8 * | bssid, | ||
const u8 * | data, | ||
size_t | data_len | ||
) | [static] |
Definition at line 2593 of file driver_test.c.
static int wpa_driver_test_send_disassoc | ( | struct wpa_driver_test_data * | drv | ) | [static] |
Definition at line 1622 of file driver_test.c.
static int wpa_driver_test_send_eapol | ( | void * | priv, |
const u8 * | dest, | ||
u16 | proto, | ||
const u8 * | data, | ||
size_t | data_len | ||
) | [static] |
Definition at line 2292 of file driver_test.c.
static int wpa_driver_test_send_mlme | ( | void * | priv, |
const u8 * | data, | ||
size_t | data_len | ||
) | [static] |
Definition at line 295 of file driver_test.c.
static int wpa_driver_test_set_bssid | ( | void * | priv, |
const u8 * | bssid | ||
) | [static] |
Definition at line 2448 of file driver_test.c.
static int wpa_driver_test_set_channel | ( | void * | priv, |
enum hostapd_hw_mode | phymode, | ||
int | chan, | ||
int | freq | ||
) | [static] |
Definition at line 2411 of file driver_test.c.
static int wpa_driver_test_set_freq | ( | void * | priv, |
struct hostapd_freq_params * | freq | ||
) | [static] |
Definition at line 2582 of file driver_test.c.
static int wpa_driver_test_set_key | ( | const char * | ifname, |
void * | priv, | ||
enum wpa_alg | alg, | ||
const u8 * | addr, | ||
int | key_idx, | ||
int | set_tx, | ||
const u8 * | seq, | ||
size_t | seq_len, | ||
const u8 * | key, | ||
size_t | key_len | ||
) | [static] |
Definition at line 1445 of file driver_test.c.
static int wpa_driver_test_set_param | ( | void * | priv, |
const char * | param | ||
) | [static] |
Definition at line 2205 of file driver_test.c.
static int wpa_driver_test_set_ssid | ( | void * | priv, |
const u8 * | ssid, | ||
size_t | ssid_len | ||
) | [static] |
Definition at line 2440 of file driver_test.c.
static int wpa_driver_update_mode | ( | struct wpa_driver_test_data * | drv, |
int | ap | ||
) | [static] |
Definition at line 1464 of file driver_test.c.
static const u8* wpa_scan_get_ie | ( | const struct wpa_scan_res * | res, |
u8 | ie | ||
) | [static] |
Definition at line 1672 of file driver_test.c.
Definition at line 2705 of file driver_test.c.