mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-02-14 17:51:51 +00:00
datastorage/test: improve scalability and performance
datastorage: convert to linked lists and optimise use of pointers datastorage: AP, client, probe, auth entry and MAC list converted to linked list datastorage: functions adjusted to take pointers as parameters datastorage: optimised sort and search functions added mac_utils: struct dawn_mac added and comparisons adjusted general: adjust code to call new datastorage functions test_storage: large scale 100 AP, 3000 client, 70k probe added [fix commit] Signed-off-by: Nick Hainke <vincent@systemli.org>
This commit is contained in:
parent
2f585043c3
commit
7262cf02d0
20 changed files with 77420 additions and 1437 deletions
|
@ -9,20 +9,35 @@
|
|||
#include "mac_utils.h"
|
||||
#include "utils.h"
|
||||
|
||||
// Core data storage array sizes
|
||||
#define ARRAY_AP_LEN 100
|
||||
#define ARRAY_CLIENT_LEN 300
|
||||
#define PROBE_ARRAY_LEN 1000
|
||||
#define DENY_REQ_ARRAY_LEN 100
|
||||
|
||||
/* Mac */
|
||||
|
||||
// ---------------- Defines -------------------
|
||||
#define MAC_LIST_LENGTH 100
|
||||
|
||||
// ---------------- Global variables ----------------
|
||||
extern uint8_t mac_list[][ETH_ALEN];
|
||||
extern struct mac_entry_s *mac_set;
|
||||
|
||||
struct mac_entry_s {
|
||||
struct mac_entry_s* next_mac;
|
||||
struct dawn_mac mac;
|
||||
};
|
||||
|
||||
// ---------------- Functions ----------
|
||||
void insert_macs_from_file();
|
||||
|
||||
int insert_to_maclist(uint8_t mac[]);
|
||||
int insert_to_maclist(struct dawn_mac mac);
|
||||
|
||||
int mac_in_maclist(uint8_t mac[]);
|
||||
int mac_in_maclist(struct dawn_mac mac);
|
||||
|
||||
struct mac_entry_s* insert_to_mac_array(struct mac_entry_s* entry, struct mac_entry_s** insert_pos);
|
||||
|
||||
void mac_array_delete(struct mac_entry_s* entry);
|
||||
|
||||
|
||||
// ---------------- Global variables ----------------
|
||||
|
@ -97,7 +112,7 @@ extern struct probe_metric_s dawn_metric;
|
|||
|
||||
/*** Core DAWN data structures for tracking network devices and status ***/
|
||||
// Define this to remove printing / reporing of fields, and hence observe
|
||||
// which fields are evaluated in use.
|
||||
// which fields are evaluated in use at compile time.
|
||||
// #define DAWN_NO_OUTPUT
|
||||
|
||||
// TODO notes:
|
||||
|
@ -108,9 +123,11 @@ extern struct probe_metric_s dawn_metric;
|
|||
|
||||
// ---------------- Structs ----------------
|
||||
typedef struct probe_entry_s {
|
||||
uint8_t bssid_addr[ETH_ALEN];
|
||||
uint8_t client_addr[ETH_ALEN];
|
||||
uint8_t target_addr[ETH_ALEN]; // TODO: Never evaluated?
|
||||
struct probe_entry_s* next_probe;
|
||||
struct probe_entry_s* next_probe_skip;
|
||||
struct dawn_mac client_addr;
|
||||
struct dawn_mac bssid_addr;
|
||||
struct dawn_mac target_addr; // TODO: Never evaluated?
|
||||
uint32_t signal; // eval_probe_metric()
|
||||
uint32_t freq; // eval_probe_metric()
|
||||
uint8_t ht_capabilities; // eval_probe_metric()
|
||||
|
@ -126,10 +143,17 @@ typedef struct probe_entry_s {
|
|||
uint32_t rsni;
|
||||
} probe_entry;
|
||||
|
||||
//struct probe_entry_s {
|
||||
// struct dawn_mac client_addr;
|
||||
// struct dawn_mac bssid_addr;
|
||||
// struct probe_entry_s* entry;
|
||||
//};
|
||||
|
||||
typedef struct auth_entry_s {
|
||||
uint8_t bssid_addr[ETH_ALEN];
|
||||
uint8_t client_addr[ETH_ALEN];
|
||||
uint8_t target_addr[ETH_ALEN]; // TODO: Never evaluated?
|
||||
struct auth_entry_s* next_auth;
|
||||
struct dawn_mac bssid_addr;
|
||||
struct dawn_mac client_addr;
|
||||
struct dawn_mac target_addr; // TODO: Never evaluated?
|
||||
uint32_t signal; // TODO: Never evaluated?
|
||||
uint32_t freq; // TODO: Never evaluated?
|
||||
time_t time; // Never used for removal?
|
||||
|
@ -137,62 +161,42 @@ typedef struct auth_entry_s {
|
|||
} auth_entry;
|
||||
|
||||
typedef struct hostapd_notify_entry_s {
|
||||
uint8_t bssid_addr[ETH_ALEN];
|
||||
uint8_t client_addr[ETH_ALEN];
|
||||
struct dawn_mac bssid_addr;
|
||||
struct dawn_mac client_addr;
|
||||
} hostapd_notify_entry;
|
||||
|
||||
typedef struct auth_entry_s assoc_entry;
|
||||
|
||||
// ---------------- Defines ----------------
|
||||
#define DENY_REQ_ARRAY_LEN 100
|
||||
#define PROBE_ARRAY_LEN 1000
|
||||
|
||||
#define SSID_MAX_LEN 32
|
||||
#define NEIGHBOR_REPORT_LEN 200
|
||||
|
||||
// ---------------- Global variables ----------------
|
||||
extern struct auth_entry_s denied_req_array[];
|
||||
extern int denied_req_last;
|
||||
extern struct auth_entry_s *denied_req_set;
|
||||
extern pthread_mutex_t denied_array_mutex;
|
||||
|
||||
extern struct probe_entry_s probe_array[];
|
||||
extern int probe_entry_last;
|
||||
extern struct probe_entry_s *probe_set;
|
||||
extern pthread_mutex_t probe_array_mutex;
|
||||
|
||||
// ---------------- Functions ----------------
|
||||
probe_entry insert_to_array(probe_entry entry, int inc_counter, int save_80211k, int is_beacon);
|
||||
|
||||
void probe_array_insert(probe_entry entry);
|
||||
|
||||
probe_entry probe_array_delete(probe_entry entry);
|
||||
|
||||
probe_entry probe_array_get_entry(uint8_t bssid_addr[], uint8_t client_addr[]);
|
||||
|
||||
void remove_old_probe_entries(time_t current_time, long long int threshold);
|
||||
|
||||
void print_probe_array();
|
||||
|
||||
void print_probe_entry(probe_entry entry);
|
||||
|
||||
int eval_probe_metric(struct probe_entry_s probe_entry);
|
||||
|
||||
void denied_req_array_insert(auth_entry entry);
|
||||
|
||||
auth_entry denied_req_array_delete(auth_entry entry);
|
||||
|
||||
auth_entry insert_to_denied_req_array(auth_entry entry, int inc_counter);
|
||||
|
||||
void print_auth_entry(auth_entry entry);
|
||||
|
||||
/* AP, Client */
|
||||
|
||||
#define SIGNATURE_LEN 1024
|
||||
#define MAX_INTERFACE_NAME 64
|
||||
|
||||
// ---------------- Structs ----------------
|
||||
// Testing only: Removes the ability to find clients via secondary search, hence replicates
|
||||
// the pre-optimisation behaviour of only scanning the BSSID+MAC orderd list
|
||||
//#define DAWN_CLIENT_SCAN_BC_ONLY
|
||||
|
||||
typedef struct client_s {
|
||||
uint8_t bssid_addr[ETH_ALEN];
|
||||
uint8_t client_addr[ETH_ALEN];
|
||||
struct client_s* next_entry_bc;
|
||||
struct client_s* next_skip_entry_bc;
|
||||
#ifndef DAWN_CLIENT_SCAN_BC_ONLY
|
||||
struct client_s* next_entry_c;
|
||||
#endif
|
||||
struct dawn_mac bssid_addr;
|
||||
struct dawn_mac client_addr;
|
||||
char signature[SIGNATURE_LEN]; // TODO: Never evaluated?
|
||||
uint8_t ht_supported; // TODO: Never evaluated?
|
||||
uint8_t vht_supported; // TODO: Never evaluated?
|
||||
|
@ -214,7 +218,8 @@ typedef struct client_s {
|
|||
} client;
|
||||
|
||||
typedef struct ap_s {
|
||||
uint8_t bssid_addr[ETH_ALEN];
|
||||
struct ap_s* next_ap;
|
||||
struct dawn_mac bssid_addr;
|
||||
uint32_t freq; // TODO: Never evaluated?
|
||||
uint8_t ht_support; // eval_probe_metric()
|
||||
uint8_t vht_support; // eval_probe_metric()
|
||||
|
@ -231,71 +236,90 @@ typedef struct ap_s {
|
|||
} ap;
|
||||
|
||||
// ---------------- Defines ----------------
|
||||
#define ARRAY_AP_LEN 50
|
||||
#define TIME_THRESHOLD_AP 30
|
||||
|
||||
#define ARRAY_CLIENT_LEN 1000
|
||||
#define TIME_THRESHOLD_CLIENT 30
|
||||
#define TIME_THRESHOLD_CLIENT_UPDATE 10
|
||||
#define TIME_THRESHOLD_CLIENT_KICK 60
|
||||
|
||||
// ---------------- Global variables ----------------
|
||||
extern struct ap_s ap_array[];
|
||||
extern int ap_entry_last;
|
||||
extern struct ap_s* ap_set;
|
||||
extern pthread_mutex_t ap_array_mutex;
|
||||
|
||||
extern struct client_s client_array[];
|
||||
extern int client_entry_last;
|
||||
extern struct client_s *client_set_bc;
|
||||
extern pthread_mutex_t client_array_mutex;
|
||||
|
||||
// ---------------- Functions ----------------
|
||||
probe_entry *insert_to_array(probe_entry *entry, int inc_counter, int save_80211k, int is_beacon);
|
||||
|
||||
int probe_array_update_rssi(uint8_t bssid_addr[], uint8_t client_addr[], uint32_t rssi, int send_network);
|
||||
int probe_array_delete(probe_entry *entry);
|
||||
|
||||
int probe_array_update_rcpi_rsni(uint8_t bssid_addr[], uint8_t client_addr[], uint32_t rcpi, uint32_t rsni, int send_network);
|
||||
probe_entry *probe_array_get_entry(struct dawn_mac bssid_addr, struct dawn_mac client_addr);
|
||||
|
||||
void remove_old_probe_entries(time_t current_time, long long int threshold);
|
||||
|
||||
void print_probe_array();
|
||||
|
||||
void print_probe_entry(probe_entry *entry);
|
||||
|
||||
int eval_probe_metric(struct probe_entry_s * probe_entry, ap *ap_entry);
|
||||
|
||||
void denied_req_array_delete(auth_entry *entry);
|
||||
|
||||
auth_entry *insert_to_denied_req_array(auth_entry*entry, int inc_counter);
|
||||
|
||||
void print_auth_entry(auth_entry *entry);
|
||||
|
||||
// ---------------- Functions ----------------
|
||||
|
||||
int probe_array_update_rssi(struct dawn_mac bssid_addr, struct dawn_mac client_addr, uint32_t rssi, int send_network);
|
||||
|
||||
int probe_array_update_rcpi_rsni(struct dawn_mac bssid_addr, struct dawn_mac client_addr, uint32_t rcpi, uint32_t rsni, int send_network);
|
||||
|
||||
void remove_old_client_entries(time_t current_time, long long int threshold);
|
||||
|
||||
void insert_client_to_array(client entry);
|
||||
void insert_client_to_array(client *entry);
|
||||
|
||||
int kick_clients(uint8_t bssid[], uint32_t id);
|
||||
int kick_clients(ap* kicking_ap, uint32_t id);
|
||||
|
||||
void update_iw_info(uint8_t bssid[]);
|
||||
void update_iw_info(struct dawn_mac bssid);
|
||||
|
||||
void client_array_insert(client entry);
|
||||
void client_array_insert(client *entry, client ** insert_pos);
|
||||
|
||||
client client_array_get_client(const uint8_t* client_addr);
|
||||
client *client_array_get_client(const struct dawn_mac client_addr);
|
||||
|
||||
client client_array_delete(client entry);
|
||||
client *client_array_delete(client *entry, int unlink_only);
|
||||
|
||||
void print_client_array();
|
||||
|
||||
void print_client_entry(client entry);
|
||||
void print_client_entry(client *entry);
|
||||
|
||||
int is_connected_somehwere(uint8_t client_addr[]);
|
||||
int is_connected_somehwere(struct dawn_mac client_addr);
|
||||
|
||||
ap insert_to_ap_array(ap entry);
|
||||
ap *insert_to_ap_array(ap *entry);
|
||||
|
||||
void remove_old_ap_entries(time_t current_time, long long int threshold);
|
||||
|
||||
void print_ap_array();
|
||||
|
||||
ap ap_array_get_ap(uint8_t bssid_addr[]);
|
||||
ap *ap_array_get_ap(struct dawn_mac bssid_mac);
|
||||
|
||||
int probe_array_set_all_probe_count(uint8_t client_addr[], uint32_t probe_count);
|
||||
int probe_array_set_all_probe_count(struct dawn_mac client_addr, uint32_t probe_count);
|
||||
|
||||
#ifndef DAWN_NO_OUTPUT
|
||||
int ap_get_collision_count(int col_domain);
|
||||
#endif
|
||||
|
||||
void send_beacon_reports(uint8_t bssid[], int id);
|
||||
void send_beacon_reports(struct dawn_mac bssid, int id);
|
||||
|
||||
/* Utils */
|
||||
// deprecate use of this - it makes things slow
|
||||
#define SORT_LENGTH 5
|
||||
extern char sort_string[];
|
||||
|
||||
|
||||
// ---------------- Functions -------------------
|
||||
int better_ap_available(uint8_t bssid_addr[], uint8_t client_addr[], char* neighbor_report, int automatic_kick);
|
||||
int better_ap_available(ap *kicking_ap, struct dawn_mac client_addr, char* neighbor_report);
|
||||
|
||||
// All users of datastorage should call init_ / destroy_mutex at initialisation and termination respectively
|
||||
int init_mutex();
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "mac_utils.h"
|
||||
|
||||
// ---------------- Global variables ----------------
|
||||
#define HOSTAPD_DIR_LEN 200
|
||||
extern char hostapd_dir_glob[];
|
||||
|
@ -14,7 +16,7 @@ extern char hostapd_dir_glob[];
|
|||
* @param client_addr - mac adress of the client
|
||||
* @return The RSSI of the client if successful. INT_MIN if client was not found.
|
||||
*/
|
||||
int get_rssi_iwinfo(uint8_t *client_addr);
|
||||
int get_rssi_iwinfo(struct dawn_mac client_addr);
|
||||
|
||||
/**
|
||||
* Get expected throughut using the mac adress of the client.
|
||||
|
@ -25,7 +27,7 @@ int get_rssi_iwinfo(uint8_t *client_addr);
|
|||
* + INT_MIN if client was not found.
|
||||
* + 0 if the client is not supporting this feature.
|
||||
*/
|
||||
int get_expected_throughput_iwinfo(uint8_t *client_addr);
|
||||
int get_expected_throughput_iwinfo(struct dawn_mac client_addr);
|
||||
|
||||
/**
|
||||
* Get rx and tx bandwidth using the mac of the client.
|
||||
|
@ -35,7 +37,7 @@ int get_expected_throughput_iwinfo(uint8_t *client_addr);
|
|||
* @param tx_rate - float pointer for returning the tx rate
|
||||
* @return 0 if successful 1 otherwise.
|
||||
*/
|
||||
int get_bandwidth_iwinfo(uint8_t *client_addr, float *rx_rate, float *tx_rate);
|
||||
int get_bandwidth_iwinfo(struct dawn_mac client_addr, float *rx_rate, float *tx_rate);
|
||||
|
||||
/**
|
||||
* Function checks if two bssid adresses have the same essid.
|
||||
|
@ -44,7 +46,7 @@ int get_bandwidth_iwinfo(uint8_t *client_addr, float *rx_rate, float *tx_rate);
|
|||
* @param bssid_addr_to_compares
|
||||
* @return 1 if the bssid adresses have the same essid.
|
||||
*/
|
||||
int compare_essid_iwinfo(uint8_t *bssid_addr, uint8_t *bssid_addr_to_compare);
|
||||
int compare_essid_iwinfo(struct dawn_mac bssid_addr, struct dawn_mac bssid_addr_to_compare);
|
||||
|
||||
/**
|
||||
* Function returns the expected throughput using the interface and the client address.
|
||||
|
@ -55,9 +57,9 @@ int compare_essid_iwinfo(uint8_t *bssid_addr, uint8_t *bssid_addr_to_compare);
|
|||
* + INT_MIN if client was not found.
|
||||
* + 0 if the client is not supporting this feature.
|
||||
*/
|
||||
int get_expected_throughput(const char *ifname, uint8_t *client_addr);
|
||||
int get_expected_throughput(const char *ifname, struct dawn_mac client_addr);
|
||||
|
||||
int get_bssid(const char *ifname, uint8_t *bssid_addr);
|
||||
int get_bssid(const char *ifname, uint8_t bssid_addr[]);
|
||||
|
||||
int get_ssid(const char *ifname, char *ssid, size_t ssidmax);
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#define __DAWN_MAC_UTILS_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
|
||||
#define STR2MAC(a) &(a)[0], &(a)[1], &(a)[2], &(a)[3], &(a)[4], &(a)[5]
|
||||
|
@ -13,6 +14,22 @@
|
|||
#define ETH_ALEN 6
|
||||
#endif
|
||||
|
||||
// Simplify some handling of MAC addresses
|
||||
struct __attribute__((__packed__)) dawn_mac
|
||||
{
|
||||
uint8_t u8[ETH_ALEN];
|
||||
};
|
||||
|
||||
// Compare a raw MAC address to 00:00:00:00:00:00
|
||||
#define mac_is_null(a1) ((a1)[0] == 0) && ((a1)[1] == 0) && ((a1)[2] == 0) && ((a1)[3] == 0) && ((a1)[4] == 0) && ((a1)[5] == 0)
|
||||
|
||||
// For byte arrays outside MAC structure
|
||||
#define mac_is_equal(addr1, addr2) (memcmp(addr1, addr2, ETH_ALEN) == 0)
|
||||
|
||||
// For byte arrays inside MAC structure
|
||||
#define mac_compare_bb(addr1, addr2) memcmp((addr1).u8, (addr2).u8, ETH_ALEN)
|
||||
#define mac_is_equal_bb(addr1, addr2) (memcmp((addr1).u8, (addr2).u8, ETH_ALEN) == 0)
|
||||
|
||||
/**
|
||||
* Convert mac adress string to mac adress.
|
||||
* @param txt
|
||||
|
@ -21,23 +38,11 @@
|
|||
*/
|
||||
int hwaddr_aton(const char* txt, uint8_t* addr);
|
||||
|
||||
/**
|
||||
* Convert mac to use big characters.
|
||||
* @param in
|
||||
* @param out
|
||||
* @return
|
||||
*/
|
||||
int convert_mac(char* in, char* out);
|
||||
|
||||
/**
|
||||
* Write mac to a file.
|
||||
* @param path
|
||||
* @param addr
|
||||
*/
|
||||
void write_mac_to_file(char* path, uint8_t addr[]);
|
||||
|
||||
int mac_is_equal(const uint8_t addr1[], const uint8_t addr2[]);
|
||||
|
||||
int mac_is_greater(const uint8_t addr1[], const uint8_t addr2[]);
|
||||
void write_mac_to_file(char* path, struct dawn_mac addr);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
* @param prob_req
|
||||
* @return
|
||||
*/
|
||||
int parse_to_probe_req(struct blob_attr* msg, probe_entry* prob_req);
|
||||
probe_entry *parse_to_probe_req(struct blob_attr* msg);
|
||||
|
||||
/**
|
||||
* Dump a client array into the database.
|
||||
|
|
|
@ -7,8 +7,10 @@
|
|||
** Contains declerations, etc needed across datastorage and its test harness,
|
||||
** but not more widely.
|
||||
*/
|
||||
void ap_array_insert(ap entry);
|
||||
void ap_array_insert(ap *entry);
|
||||
|
||||
ap ap_array_delete(ap entry);
|
||||
int ap_array_delete(ap *entry);
|
||||
|
||||
auth_entry** auth_entry_find_first_entry(struct dawn_mac bssid_mac, struct dawn_mac client_mac);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -60,7 +60,7 @@ int parse_to_assoc_req(struct blob_attr *msg, assoc_entry *assoc_req);
|
|||
* @param deauth - if the client should be deauthenticated.
|
||||
* @param ban_time - the ban time the client is not allowed to connect again.
|
||||
*/
|
||||
void del_client_all_interfaces(const uint8_t *client_addr, uint32_t reason, uint8_t deauth, uint32_t ban_time);
|
||||
void del_client_all_interfaces(const struct dawn_mac client_addr, uint32_t reason, uint8_t deauth, uint32_t ban_time);
|
||||
|
||||
/**
|
||||
* Update the hostapd sockets.
|
||||
|
@ -73,9 +73,9 @@ void update_hostapd_sockets(struct uloop_timeout *t);
|
|||
* @param client_addr
|
||||
* @return
|
||||
*/
|
||||
int send_add_mac(uint8_t *client_addr);
|
||||
int send_add_mac(struct dawn_mac client_addr);
|
||||
|
||||
void ubus_send_beacon_report(uint8_t client[], int id);
|
||||
void ubus_send_beacon_report(struct dawn_mac client, int id);
|
||||
|
||||
void uloop_add_data_cbs();
|
||||
|
||||
|
@ -85,7 +85,7 @@ int build_hearing_map_sort_client(struct blob_buf* b);
|
|||
|
||||
int build_network_overview(struct blob_buf* b);
|
||||
|
||||
int ap_get_nr(struct blob_buf* b, uint8_t own_bssid_addr[]);
|
||||
int ap_get_nr(struct blob_buf* b, struct dawn_mac own_bssid_addr);
|
||||
|
||||
int parse_add_mac_to_file(struct blob_attr* msg);
|
||||
|
||||
|
@ -96,7 +96,7 @@ int handle_auth_req(struct blob_attr* msg);
|
|||
* @param probe_entry
|
||||
* @return
|
||||
*/
|
||||
int ubus_send_probe_via_network(struct probe_entry_s probe_entry);
|
||||
int ubus_send_probe_via_network(struct probe_entry_s *probe_entry);
|
||||
|
||||
/**
|
||||
* Add mac to a list that contains addresses of clients that can not be controlled.
|
||||
|
@ -104,7 +104,7 @@ int ubus_send_probe_via_network(struct probe_entry_s probe_entry);
|
|||
* @param name
|
||||
* @param addr
|
||||
*/
|
||||
void blobmsg_add_macaddr(struct blob_buf *buf, const char *name, const uint8_t *addr);
|
||||
void blobmsg_add_macaddr(struct blob_buf *buf, const char *name, const struct dawn_mac addr);
|
||||
|
||||
/**
|
||||
* Send message via network.
|
||||
|
@ -128,7 +128,7 @@ void add_client_update_timer(time_t time);
|
|||
* @param deauth - if the client should be deauthenticated.
|
||||
* @param ban_time - the ban time the client is not allowed to connect again.
|
||||
*/
|
||||
void del_client_interface(uint32_t id, const uint8_t* client_addr, uint32_t reason, uint8_t deauth, uint32_t ban_time);
|
||||
void del_client_interface(uint32_t id, const struct dawn_mac client_addr, uint32_t reason, uint8_t deauth, uint32_t ban_time);
|
||||
|
||||
/**
|
||||
* Function to set the probe counter to the min probe request.
|
||||
|
@ -136,7 +136,7 @@ void del_client_interface(uint32_t id, const uint8_t* client_addr, uint32_t reas
|
|||
* @param client_addr
|
||||
* @return
|
||||
*/
|
||||
int send_set_probe(uint8_t client_addr[]);
|
||||
int send_set_probe(struct dawn_mac client_addr);
|
||||
|
||||
/**
|
||||
* Function to tell a client that it is about to be disconnected.
|
||||
|
@ -146,6 +146,6 @@ int send_set_probe(uint8_t client_addr[]);
|
|||
* @param duration
|
||||
* @return - 0 = asynchronous (client has been told to remove itself, and caller should manage arrays); 1 = synchronous (caller should assume arrays are updated)
|
||||
*/
|
||||
int wnm_disassoc_imminent(uint32_t id, const uint8_t* client_addr, char* dest_ap, uint32_t duration);
|
||||
int wnm_disassoc_imminent(uint32_t id, const struct dawn_mac client_addr, char* dest_ap, uint32_t duration);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -3,19 +3,12 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* Convert char to binary.
|
||||
* @param ch
|
||||
* @return
|
||||
*/
|
||||
int hex_to_dec(char ch);
|
||||
|
||||
/**
|
||||
* Check if a string is greater than another one.
|
||||
* @param str
|
||||
* @param str_2
|
||||
* @return
|
||||
*/
|
||||
int string_is_greater(uint8_t *str, uint8_t *str_2);
|
||||
int string_is_greater(char *str, char *str_2);
|
||||
|
||||
#endif
|
|
@ -92,4 +92,4 @@ int main(int argc, char **argv) {
|
|||
dawn_init_ubus(ubus_socket, hostapd_dir_glob);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
420
src/test/kick_deep.script
Normal file
420
src/test/kick_deep.script
Normal file
|
@ -0,0 +1,420 @@
|
|||
elapsed
|
||||
|
||||
# DAWN mertics to help testing output review
|
||||
dawn default
|
||||
dawn ht_support=8
|
||||
dawn vht_support=16
|
||||
dawn max_chan_util=0
|
||||
dawn ap_weight=4
|
||||
dawn rssi=32
|
||||
dawn low_rssi=0
|
||||
dawn min_kick_count=1
|
||||
|
||||
|
||||
#AP
|
||||
ap bssid=0A:7B:AA:00:01:00 ht_sup=1 vht_sup=1 util=156 stations=13 ssid=aTestSSID weight=10 neighbors=0A:7B:AA:00:01:00
|
||||
ap bssid=02:67:AA:00:02:00 ht_sup=1 vht_sup=1 util=195 stations=13 ssid=aTestSSID weight=10 neighbors=02:67:AA:00:02:00
|
||||
ap bssid=14:02:AA:00:03:00 ht_sup=1 vht_sup=1 util=126 stations=9 ssid=aTestSSID weight=10 neighbors=14:02:AA:00:03:00
|
||||
ap bssid=1F:36:AA:00:04:00 ht_sup=0 vht_sup=0 util=120 stations=8 ssid=aTestSSID weight=10 neighbors=1F:36:AA:00:04:00
|
||||
ap bssid=69:E9:AA:00:05:00 ht_sup=0 vht_sup=0 util=44 stations=4 ssid=aTestSSID weight=10 neighbors=69:E9:AA:00:05:00
|
||||
ap bssid=6A:97:AA:00:06:00 ht_sup=0 vht_sup=0 util=110 stations=11 ssid=aTestSSID weight=10 neighbors=6A:97:AA:00:06:00
|
||||
ap bssid=45:63:AA:00:07:00 ht_sup=0 vht_sup=0 util=55 stations=5 ssid=aTestSSID weight=10 neighbors=45:63:AA:00:07:00
|
||||
ap bssid=07:1E:AA:00:08:00 ht_sup=1 vht_sup=1 util=88 stations=8 ssid=aTestSSID weight=10 neighbors=07:1E:AA:00:08:00
|
||||
ap bssid=45:A2:AA:00:09:00 ht_sup=0 vht_sup=0 util=120 stations=12 ssid=aTestSSID weight=10 neighbors=45:A2:AA:00:09:00
|
||||
ap bssid=4C:4D:AA:00:0A:00 ht_sup=1 vht_sup=1 util=195 stations=13 ssid=aTestSSID weight=10 neighbors=4C:4D:AA:00:0A:00
|
||||
|
||||
#Client
|
||||
client client=50:7B:DD:00:01:00 bssid=45:A2:AA:00:09:00 freq=2500 ht_cap=1 vht_cap=1
|
||||
client client=22:87:DD:00:02:00 bssid=4C:4D:AA:00:0A:00 freq=5500 ht_cap=0 vht_cap=0
|
||||
client client=54:1A:DD:00:03:00 bssid=14:02:AA:00:03:00 freq=5500 ht_cap=1 vht_cap=0
|
||||
client client=60:79:DD:00:04:00 bssid=0A:7B:AA:00:01:00 freq=5500 ht_cap=1 vht_cap=0
|
||||
client client=20:EE:DD:00:05:00 bssid=07:1E:AA:00:08:00 freq=2500 ht_cap=0 vht_cap=0
|
||||
client client=33:D2:DD:00:06:00 bssid=45:63:AA:00:07:00 freq=5500 ht_cap=1 vht_cap=1
|
||||
client client=44:B6:DD:00:07:00 bssid=69:E9:AA:00:05:00 freq=2500 ht_cap=1 vht_cap=1
|
||||
client client=3A:D6:DD:00:08:00 bssid=1F:36:AA:00:04:00 freq=2500 ht_cap=0 vht_cap=0
|
||||
client client=3C:BB:DD:00:09:00 bssid=69:E9:AA:00:05:00 freq=5500 ht_cap=1 vht_cap=0
|
||||
client client=2D:3F:DD:00:0A:00 bssid=14:02:AA:00:03:00 freq=5500 ht_cap=1 vht_cap=1
|
||||
client client=00:08:DD:00:0B:00 bssid=45:A2:AA:00:09:00 freq=5500 ht_cap=0 vht_cap=0
|
||||
client client=64:5A:DD:00:0C:00 bssid=45:A2:AA:00:09:00 freq=2500 ht_cap=0 vht_cap=0
|
||||
client client=13:ED:DD:00:0D:00 bssid=14:02:AA:00:03:00 freq=2500 ht_cap=1 vht_cap=0
|
||||
client client=3B:43:DD:00:0E:00 bssid=1F:36:AA:00:04:00 freq=2500 ht_cap=0 vht_cap=0
|
||||
client client=10:6A:DD:00:0F:00 bssid=14:02:AA:00:03:00 freq=2500 ht_cap=0 vht_cap=0
|
||||
client client=0D:BE:DD:00:10:00 bssid=6A:97:AA:00:06:00 freq=5500 ht_cap=1 vht_cap=0
|
||||
client client=3E:B5:DD:00:11:00 bssid=07:1E:AA:00:08:00 freq=2500 ht_cap=0 vht_cap=0
|
||||
client client=41:C2:DD:00:12:00 bssid=0A:7B:AA:00:01:00 freq=5500 ht_cap=0 vht_cap=0
|
||||
client client=2A:75:DD:00:13:00 bssid=6A:97:AA:00:06:00 freq=5500 ht_cap=0 vht_cap=0
|
||||
client client=31:FB:DD:00:14:00 bssid=02:67:AA:00:02:00 freq=2500 ht_cap=1 vht_cap=0
|
||||
client client=2E:B8:DD:00:15:00 bssid=14:02:AA:00:03:00 freq=5500 ht_cap=0 vht_cap=0
|
||||
client client=40:50:DD:00:16:00 bssid=69:E9:AA:00:05:00 freq=5500 ht_cap=0 vht_cap=0
|
||||
client client=0D:7F:DD:00:17:00 bssid=1F:36:AA:00:04:00 freq=5500 ht_cap=1 vht_cap=0
|
||||
client client=40:C7:DD:00:18:00 bssid=1F:36:AA:00:04:00 freq=5500 ht_cap=1 vht_cap=1
|
||||
client client=31:F5:DD:00:19:00 bssid=14:02:AA:00:03:00 freq=5500 ht_cap=1 vht_cap=0
|
||||
client client=56:C7:DD:00:1A:00 bssid=07:1E:AA:00:08:00 freq=2500 ht_cap=0 vht_cap=0
|
||||
client client=09:77:DD:00:1B:00 bssid=69:E9:AA:00:05:00 freq=5500 ht_cap=0 vht_cap=0
|
||||
client client=53:C7:DD:00:1C:00 bssid=14:02:AA:00:03:00 freq=5500 ht_cap=0 vht_cap=0
|
||||
client client=07:CC:DD:00:1D:00 bssid=02:67:AA:00:02:00 freq=2500 ht_cap=1 vht_cap=1
|
||||
client client=37:13:DD:00:1E:00 bssid=45:63:AA:00:07:00 freq=2500 ht_cap=1 vht_cap=0
|
||||
client client=1A:ED:DD:00:1F:00 bssid=4C:4D:AA:00:0A:00 freq=2500 ht_cap=0 vht_cap=0
|
||||
client client=78:22:DD:00:20:00 bssid=0A:7B:AA:00:01:00 freq=5500 ht_cap=0 vht_cap=0
|
||||
client client=7D:52:DD:00:21:00 bssid=45:A2:AA:00:09:00 freq=2500 ht_cap=0 vht_cap=0
|
||||
client client=75:45:DD:00:22:00 bssid=07:1E:AA:00:08:00 freq=2500 ht_cap=0 vht_cap=0
|
||||
|
||||
#Probe
|
||||
probe bssid=0A:7B:AA:00:01:00 client=50:7B:DD:00:01:00 signal=-65 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=0A:7B:AA:00:01:00 client=22:87:DD:00:02:00 signal=-71 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=0A:7B:AA:00:01:00 client=54:1A:DD:00:03:00 signal=-76 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=0A:7B:AA:00:01:00 client=60:79:DD:00:04:00 signal=-84 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=0A:7B:AA:00:01:00 client=20:EE:DD:00:05:00 signal=-65 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=0A:7B:AA:00:01:00 client=33:D2:DD:00:06:00 signal=-77 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=0A:7B:AA:00:01:00 client=44:B6:DD:00:07:00 signal=-79 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=0A:7B:AA:00:01:00 client=3A:D6:DD:00:08:00 signal=-82 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=0A:7B:AA:00:01:00 client=3C:BB:DD:00:09:00 signal=-91 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=0A:7B:AA:00:01:00 client=2D:3F:DD:00:0A:00 signal=-82 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=0A:7B:AA:00:01:00 client=00:08:DD:00:0B:00 signal=-85 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=0A:7B:AA:00:01:00 client=64:5A:DD:00:0C:00 signal=-80 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=0A:7B:AA:00:01:00 client=13:ED:DD:00:0D:00 signal=-78 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=0A:7B:AA:00:01:00 client=3B:43:DD:00:0E:00 signal=-69 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=0A:7B:AA:00:01:00 client=10:6A:DD:00:0F:00 signal=-83 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=0A:7B:AA:00:01:00 client=0D:BE:DD:00:10:00 signal=-81 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=0A:7B:AA:00:01:00 client=3E:B5:DD:00:11:00 signal=-86 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=0A:7B:AA:00:01:00 client=41:C2:DD:00:12:00 signal=-78 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=0A:7B:AA:00:01:00 client=2A:75:DD:00:13:00 signal=-91 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=0A:7B:AA:00:01:00 client=31:FB:DD:00:14:00 signal=-69 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=0A:7B:AA:00:01:00 client=2E:B8:DD:00:15:00 signal=-78 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=0A:7B:AA:00:01:00 client=40:50:DD:00:16:00 signal=-81 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=0A:7B:AA:00:01:00 client=0D:7F:DD:00:17:00 signal=-86 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=0A:7B:AA:00:01:00 client=40:C7:DD:00:18:00 signal=-91 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=0A:7B:AA:00:01:00 client=31:F5:DD:00:19:00 signal=-84 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=0A:7B:AA:00:01:00 client=56:C7:DD:00:1A:00 signal=-84 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=0A:7B:AA:00:01:00 client=09:77:DD:00:1B:00 signal=-87 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=0A:7B:AA:00:01:00 client=53:C7:DD:00:1C:00 signal=-75 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=0A:7B:AA:00:01:00 client=07:CC:DD:00:1D:00 signal=-88 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=0A:7B:AA:00:01:00 client=37:13:DD:00:1E:00 signal=-79 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=0A:7B:AA:00:01:00 client=1A:ED:DD:00:1F:00 signal=-81 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=0A:7B:AA:00:01:00 client=78:22:DD:00:20:00 signal=-89 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=0A:7B:AA:00:01:00 client=7D:52:DD:00:21:00 signal=-89 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=0A:7B:AA:00:01:00 client=75:45:DD:00:22:00 signal=-79 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=02:67:AA:00:02:00 client=50:7B:DD:00:01:00 signal=-82 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=02:67:AA:00:02:00 client=22:87:DD:00:02:00 signal=-81 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=02:67:AA:00:02:00 client=54:1A:DD:00:03:00 signal=-86 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=02:67:AA:00:02:00 client=60:79:DD:00:04:00 signal=-72 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=02:67:AA:00:02:00 client=20:EE:DD:00:05:00 signal=-84 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=02:67:AA:00:02:00 client=33:D2:DD:00:06:00 signal=-84 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=02:67:AA:00:02:00 client=44:B6:DD:00:07:00 signal=-73 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=02:67:AA:00:02:00 client=3A:D6:DD:00:08:00 signal=-86 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=02:67:AA:00:02:00 client=3C:BB:DD:00:09:00 signal=-88 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=02:67:AA:00:02:00 client=2D:3F:DD:00:0A:00 signal=-83 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=02:67:AA:00:02:00 client=00:08:DD:00:0B:00 signal=-76 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=02:67:AA:00:02:00 client=64:5A:DD:00:0C:00 signal=-87 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=02:67:AA:00:02:00 client=13:ED:DD:00:0D:00 signal=-84 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=02:67:AA:00:02:00 client=3B:43:DD:00:0E:00 signal=-84 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=02:67:AA:00:02:00 client=10:6A:DD:00:0F:00 signal=-91 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=02:67:AA:00:02:00 client=0D:BE:DD:00:10:00 signal=-76 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=02:67:AA:00:02:00 client=3E:B5:DD:00:11:00 signal=-74 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=02:67:AA:00:02:00 client=41:C2:DD:00:12:00 signal=-84 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=02:67:AA:00:02:00 client=2A:75:DD:00:13:00 signal=-88 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=02:67:AA:00:02:00 client=31:FB:DD:00:14:00 signal=-80 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=02:67:AA:00:02:00 client=2E:B8:DD:00:15:00 signal=-84 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=02:67:AA:00:02:00 client=40:50:DD:00:16:00 signal=-89 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=02:67:AA:00:02:00 client=0D:7F:DD:00:17:00 signal=-71 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=02:67:AA:00:02:00 client=40:C7:DD:00:18:00 signal=-86 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=02:67:AA:00:02:00 client=31:F5:DD:00:19:00 signal=-62 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=02:67:AA:00:02:00 client=56:C7:DD:00:1A:00 signal=-78 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=02:67:AA:00:02:00 client=09:77:DD:00:1B:00 signal=-79 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=02:67:AA:00:02:00 client=53:C7:DD:00:1C:00 signal=-83 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=02:67:AA:00:02:00 client=07:CC:DD:00:1D:00 signal=-89 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=02:67:AA:00:02:00 client=37:13:DD:00:1E:00 signal=-78 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=02:67:AA:00:02:00 client=1A:ED:DD:00:1F:00 signal=-74 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=02:67:AA:00:02:00 client=78:22:DD:00:20:00 signal=-87 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=02:67:AA:00:02:00 client=7D:52:DD:00:21:00 signal=-86 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=02:67:AA:00:02:00 client=75:45:DD:00:22:00 signal=-71 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=14:02:AA:00:03:00 client=50:7B:DD:00:01:00 signal=-65 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=14:02:AA:00:03:00 client=22:87:DD:00:02:00 signal=-83 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=14:02:AA:00:03:00 client=54:1A:DD:00:03:00 signal=-84 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=14:02:AA:00:03:00 client=60:79:DD:00:04:00 signal=-90 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=14:02:AA:00:03:00 client=20:EE:DD:00:05:00 signal=-62 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=14:02:AA:00:03:00 client=33:D2:DD:00:06:00 signal=-86 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=14:02:AA:00:03:00 client=44:B6:DD:00:07:00 signal=-87 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=14:02:AA:00:03:00 client=3A:D6:DD:00:08:00 signal=-89 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=14:02:AA:00:03:00 client=3C:BB:DD:00:09:00 signal=-95 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=14:02:AA:00:03:00 client=2D:3F:DD:00:0A:00 signal=-89 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=14:02:AA:00:03:00 client=00:08:DD:00:0B:00 signal=-86 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=14:02:AA:00:03:00 client=64:5A:DD:00:0C:00 signal=-87 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=14:02:AA:00:03:00 client=13:ED:DD:00:0D:00 signal=-71 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=14:02:AA:00:03:00 client=3B:43:DD:00:0E:00 signal=-60 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=14:02:AA:00:03:00 client=10:6A:DD:00:0F:00 signal=-87 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=14:02:AA:00:03:00 client=0D:BE:DD:00:10:00 signal=-89 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=14:02:AA:00:03:00 client=3E:B5:DD:00:11:00 signal=-91 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=14:02:AA:00:03:00 client=41:C2:DD:00:12:00 signal=-69 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=14:02:AA:00:03:00 client=2A:75:DD:00:13:00 signal=-95 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=14:02:AA:00:03:00 client=31:FB:DD:00:14:00 signal=-70 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=14:02:AA:00:03:00 client=2E:B8:DD:00:15:00 signal=-86 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=14:02:AA:00:03:00 client=40:50:DD:00:16:00 signal=-67 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=14:02:AA:00:03:00 client=0D:7F:DD:00:17:00 signal=-89 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=14:02:AA:00:03:00 client=40:C7:DD:00:18:00 signal=-95 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=14:02:AA:00:03:00 client=31:F5:DD:00:19:00 signal=-88 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=14:02:AA:00:03:00 client=56:C7:DD:00:1A:00 signal=-84 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=14:02:AA:00:03:00 client=09:77:DD:00:1B:00 signal=-92 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=14:02:AA:00:03:00 client=53:C7:DD:00:1C:00 signal=-68 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=14:02:AA:00:03:00 client=07:CC:DD:00:1D:00 signal=-92 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=14:02:AA:00:03:00 client=37:13:DD:00:1E:00 signal=-78 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=14:02:AA:00:03:00 client=1A:ED:DD:00:1F:00 signal=-88 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=14:02:AA:00:03:00 client=78:22:DD:00:20:00 signal=-94 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=14:02:AA:00:03:00 client=7D:52:DD:00:21:00 signal=-94 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=14:02:AA:00:03:00 client=75:45:DD:00:22:00 signal=-87 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=1F:36:AA:00:04:00 client=50:7B:DD:00:01:00 signal=-80 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=1F:36:AA:00:04:00 client=22:87:DD:00:02:00 signal=-87 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=1F:36:AA:00:04:00 client=54:1A:DD:00:03:00 signal=-90 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=1F:36:AA:00:04:00 client=60:79:DD:00:04:00 signal=-86 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=1F:36:AA:00:04:00 client=20:EE:DD:00:05:00 signal=-83 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=1F:36:AA:00:04:00 client=33:D2:DD:00:06:00 signal=-89 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=1F:36:AA:00:04:00 client=44:B6:DD:00:07:00 signal=-86 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=1F:36:AA:00:04:00 client=3A:D6:DD:00:08:00 signal=-91 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=1F:36:AA:00:04:00 client=3C:BB:DD:00:09:00 signal=-95 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=1F:36:AA:00:04:00 client=2D:3F:DD:00:0A:00 signal=-91 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=1F:36:AA:00:04:00 client=00:08:DD:00:0B:00 signal=-67 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=1F:36:AA:00:04:00 client=64:5A:DD:00:0C:00 signal=-91 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=1F:36:AA:00:04:00 client=13:ED:DD:00:0D:00 signal=-75 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=1F:36:AA:00:04:00 client=3B:43:DD:00:0E:00 signal=-81 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=1F:36:AA:00:04:00 client=10:6A:DD:00:0F:00 signal=-94 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=1F:36:AA:00:04:00 client=0D:BE:DD:00:10:00 signal=-88 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=1F:36:AA:00:04:00 client=3E:B5:DD:00:11:00 signal=-87 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=1F:36:AA:00:04:00 client=41:C2:DD:00:12:00 signal=-76 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=1F:36:AA:00:04:00 client=2A:75:DD:00:13:00 signal=-94 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=1F:36:AA:00:04:00 client=31:FB:DD:00:14:00 signal=-77 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=1F:36:AA:00:04:00 client=2E:B8:DD:00:15:00 signal=-90 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=1F:36:AA:00:04:00 client=40:50:DD:00:16:00 signal=-84 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=1F:36:AA:00:04:00 client=0D:7F:DD:00:17:00 signal=-77 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=1F:36:AA:00:04:00 client=40:C7:DD:00:18:00 signal=-93 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=1F:36:AA:00:04:00 client=31:F5:DD:00:19:00 signal=-77 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=1F:36:AA:00:04:00 client=56:C7:DD:00:1A:00 signal=-50 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=1F:36:AA:00:04:00 client=09:77:DD:00:1B:00 signal=-89 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=1F:36:AA:00:04:00 client=53:C7:DD:00:1C:00 signal=-76 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=1F:36:AA:00:04:00 client=07:CC:DD:00:1D:00 signal=-94 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=1F:36:AA:00:04:00 client=37:13:DD:00:1E:00 signal=-64 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=1F:36:AA:00:04:00 client=1A:ED:DD:00:1F:00 signal=-86 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=1F:36:AA:00:04:00 client=78:22:DD:00:20:00 signal=-93 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=1F:36:AA:00:04:00 client=7D:52:DD:00:21:00 signal=-93 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=1F:36:AA:00:04:00 client=75:45:DD:00:22:00 signal=-85 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=69:E9:AA:00:05:00 client=50:7B:DD:00:01:00 signal=-69 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=69:E9:AA:00:05:00 client=22:87:DD:00:02:00 signal=-74 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=69:E9:AA:00:05:00 client=54:1A:DD:00:03:00 signal=-75 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=69:E9:AA:00:05:00 client=60:79:DD:00:04:00 signal=-87 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=69:E9:AA:00:05:00 client=20:EE:DD:00:05:00 signal=-64 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=69:E9:AA:00:05:00 client=33:D2:DD:00:06:00 signal=-78 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=69:E9:AA:00:05:00 client=44:B6:DD:00:07:00 signal=-83 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=69:E9:AA:00:05:00 client=3A:D6:DD:00:08:00 signal=-83 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=69:E9:AA:00:05:00 client=3C:BB:DD:00:09:00 signal=-92 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=69:E9:AA:00:05:00 client=2D:3F:DD:00:0A:00 signal=-84 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=69:E9:AA:00:05:00 client=00:08:DD:00:0B:00 signal=-88 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=69:E9:AA:00:05:00 client=64:5A:DD:00:0C:00 signal=-80 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=69:E9:AA:00:05:00 client=13:ED:DD:00:0D:00 signal=-79 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=69:E9:AA:00:05:00 client=3B:43:DD:00:0E:00 signal=-69 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=69:E9:AA:00:05:00 client=10:6A:DD:00:0F:00 signal=-81 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=69:E9:AA:00:05:00 client=0D:BE:DD:00:10:00 signal=-84 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=69:E9:AA:00:05:00 client=3E:B5:DD:00:11:00 signal=-89 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=69:E9:AA:00:05:00 client=41:C2:DD:00:12:00 signal=-79 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=69:E9:AA:00:05:00 client=2A:75:DD:00:13:00 signal=-92 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=69:E9:AA:00:05:00 client=31:FB:DD:00:14:00 signal=-74 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=69:E9:AA:00:05:00 client=2E:B8:DD:00:15:00 signal=-79 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=69:E9:AA:00:05:00 client=40:50:DD:00:16:00 signal=-80 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=69:E9:AA:00:05:00 client=0D:7F:DD:00:17:00 signal=-89 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=69:E9:AA:00:05:00 client=40:C7:DD:00:18:00 signal=-92 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=69:E9:AA:00:05:00 client=31:F5:DD:00:19:00 signal=-87 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=69:E9:AA:00:05:00 client=56:C7:DD:00:1A:00 signal=-86 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=69:E9:AA:00:05:00 client=09:77:DD:00:1B:00 signal=-89 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=69:E9:AA:00:05:00 client=53:C7:DD:00:1C:00 signal=-77 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=69:E9:AA:00:05:00 client=07:CC:DD:00:1D:00 signal=-88 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=69:E9:AA:00:05:00 client=37:13:DD:00:1E:00 signal=-82 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=69:E9:AA:00:05:00 client=1A:ED:DD:00:1F:00 signal=-85 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=69:E9:AA:00:05:00 client=78:22:DD:00:20:00 signal=-90 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=69:E9:AA:00:05:00 client=7D:52:DD:00:21:00 signal=-90 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=69:E9:AA:00:05:00 client=75:45:DD:00:22:00 signal=-83 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=6A:97:AA:00:06:00 client=50:7B:DD:00:01:00 signal=-70 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=6A:97:AA:00:06:00 client=22:87:DD:00:02:00 signal=-79 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=6A:97:AA:00:06:00 client=54:1A:DD:00:03:00 signal=-79 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=6A:97:AA:00:06:00 client=60:79:DD:00:04:00 signal=-89 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=6A:97:AA:00:06:00 client=20:EE:DD:00:05:00 signal=-64 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=6A:97:AA:00:06:00 client=33:D2:DD:00:06:00 signal=-82 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=6A:97:AA:00:06:00 client=44:B6:DD:00:07:00 signal=-86 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=6A:97:AA:00:06:00 client=3A:D6:DD:00:08:00 signal=-86 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=6A:97:AA:00:06:00 client=3C:BB:DD:00:09:00 signal=-94 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=6A:97:AA:00:06:00 client=2D:3F:DD:00:0A:00 signal=-87 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=6A:97:AA:00:06:00 client=00:08:DD:00:0B:00 signal=-89 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=6A:97:AA:00:06:00 client=64:5A:DD:00:0C:00 signal=-83 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=6A:97:AA:00:06:00 client=13:ED:DD:00:0D:00 signal=-79 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=6A:97:AA:00:06:00 client=3B:43:DD:00:0E:00 signal=-69 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=6A:97:AA:00:06:00 client=10:6A:DD:00:0F:00 signal=-82 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=6A:97:AA:00:06:00 client=0D:BE:DD:00:10:00 signal=-87 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=6A:97:AA:00:06:00 client=3E:B5:DD:00:11:00 signal=-90 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=6A:97:AA:00:06:00 client=41:C2:DD:00:12:00 signal=-79 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=6A:97:AA:00:06:00 client=2A:75:DD:00:13:00 signal=-94 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=6A:97:AA:00:06:00 client=31:FB:DD:00:14:00 signal=-75 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=6A:97:AA:00:06:00 client=2E:B8:DD:00:15:00 signal=-82 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=6A:97:AA:00:06:00 client=40:50:DD:00:16:00 signal=-78 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=6A:97:AA:00:06:00 client=0D:7F:DD:00:17:00 signal=-90 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=6A:97:AA:00:06:00 client=40:C7:DD:00:18:00 signal=-94 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=6A:97:AA:00:06:00 client=31:F5:DD:00:19:00 signal=-89 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=6A:97:AA:00:06:00 client=56:C7:DD:00:1A:00 signal=-87 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=6A:97:AA:00:06:00 client=09:77:DD:00:1B:00 signal=-91 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=6A:97:AA:00:06:00 client=53:C7:DD:00:1C:00 signal=-77 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=6A:97:AA:00:06:00 client=07:CC:DD:00:1D:00 signal=-90 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=6A:97:AA:00:06:00 client=37:13:DD:00:1E:00 signal=-83 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=6A:97:AA:00:06:00 client=1A:ED:DD:00:1F:00 signal=-87 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=6A:97:AA:00:06:00 client=78:22:DD:00:20:00 signal=-92 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=6A:97:AA:00:06:00 client=7D:52:DD:00:21:00 signal=-92 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=6A:97:AA:00:06:00 client=75:45:DD:00:22:00 signal=-86 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:63:AA:00:07:00 client=50:7B:DD:00:01:00 signal=-69 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=45:63:AA:00:07:00 client=22:87:DD:00:02:00 signal=-83 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:63:AA:00:07:00 client=54:1A:DD:00:03:00 signal=-86 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=45:63:AA:00:07:00 client=60:79:DD:00:04:00 signal=-86 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=45:63:AA:00:07:00 client=20:EE:DD:00:05:00 signal=-74 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:63:AA:00:07:00 client=33:D2:DD:00:06:00 signal=-86 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=45:63:AA:00:07:00 client=44:B6:DD:00:07:00 signal=-84 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=45:63:AA:00:07:00 client=3A:D6:DD:00:08:00 signal=-89 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:63:AA:00:07:00 client=3C:BB:DD:00:09:00 signal=-94 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=45:63:AA:00:07:00 client=2D:3F:DD:00:0A:00 signal=-88 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=45:63:AA:00:07:00 client=00:08:DD:00:0B:00 signal=-78 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:63:AA:00:07:00 client=64:5A:DD:00:0C:00 signal=-88 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:63:AA:00:07:00 client=13:ED:DD:00:0D:00 signal=-60 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=45:63:AA:00:07:00 client=3B:43:DD:00:0E:00 signal=-70 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:63:AA:00:07:00 client=10:6A:DD:00:0F:00 signal=-90 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:63:AA:00:07:00 client=0D:BE:DD:00:10:00 signal=-86 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=45:63:AA:00:07:00 client=3E:B5:DD:00:11:00 signal=-88 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:63:AA:00:07:00 client=41:C2:DD:00:12:00 signal=-64 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:63:AA:00:07:00 client=2A:75:DD:00:13:00 signal=-94 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:63:AA:00:07:00 client=31:FB:DD:00:14:00 signal=-62 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=45:63:AA:00:07:00 client=2E:B8:DD:00:15:00 signal=-87 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:63:AA:00:07:00 client=40:50:DD:00:16:00 signal=-77 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:63:AA:00:07:00 client=0D:7F:DD:00:17:00 signal=-82 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=45:63:AA:00:07:00 client=40:C7:DD:00:18:00 signal=-93 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=45:63:AA:00:07:00 client=31:F5:DD:00:19:00 signal=-81 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=45:63:AA:00:07:00 client=56:C7:DD:00:1A:00 signal=-74 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:63:AA:00:07:00 client=09:77:DD:00:1B:00 signal=-89 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:63:AA:00:07:00 client=53:C7:DD:00:1C:00 signal=-58 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:63:AA:00:07:00 client=07:CC:DD:00:1D:00 signal=-93 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=45:63:AA:00:07:00 client=37:13:DD:00:1E:00 signal=-60 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=45:63:AA:00:07:00 client=1A:ED:DD:00:1F:00 signal=-85 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:63:AA:00:07:00 client=78:22:DD:00:20:00 signal=-92 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:63:AA:00:07:00 client=7D:52:DD:00:21:00 signal=-92 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:63:AA:00:07:00 client=75:45:DD:00:22:00 signal=-83 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=07:1E:AA:00:08:00 client=50:7B:DD:00:01:00 signal=-76 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=07:1E:AA:00:08:00 client=22:87:DD:00:02:00 signal=-83 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=07:1E:AA:00:08:00 client=54:1A:DD:00:03:00 signal=-87 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=07:1E:AA:00:08:00 client=60:79:DD:00:04:00 signal=-82 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=07:1E:AA:00:08:00 client=20:EE:DD:00:05:00 signal=-79 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=07:1E:AA:00:08:00 client=33:D2:DD:00:06:00 signal=-86 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=07:1E:AA:00:08:00 client=44:B6:DD:00:07:00 signal=-80 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=07:1E:AA:00:08:00 client=3A:D6:DD:00:08:00 signal=-88 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=07:1E:AA:00:08:00 client=3C:BB:DD:00:09:00 signal=-92 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=07:1E:AA:00:08:00 client=2D:3F:DD:00:0A:00 signal=-87 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=07:1E:AA:00:08:00 client=00:08:DD:00:0B:00 signal=-71 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=07:1E:AA:00:08:00 client=64:5A:DD:00:0C:00 signal=-88 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=07:1E:AA:00:08:00 client=13:ED:DD:00:0D:00 signal=-75 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=07:1E:AA:00:08:00 client=3B:43:DD:00:0E:00 signal=-78 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=07:1E:AA:00:08:00 client=10:6A:DD:00:0F:00 signal=-91 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=07:1E:AA:00:08:00 client=0D:BE:DD:00:10:00 signal=-83 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=07:1E:AA:00:08:00 client=3E:B5:DD:00:11:00 signal=-84 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=07:1E:AA:00:08:00 client=41:C2:DD:00:12:00 signal=-76 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=07:1E:AA:00:08:00 client=2A:75:DD:00:13:00 signal=-92 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=07:1E:AA:00:08:00 client=31:FB:DD:00:14:00 signal=-72 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=07:1E:AA:00:08:00 client=2E:B8:DD:00:15:00 signal=-86 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=07:1E:AA:00:08:00 client=40:50:DD:00:16:00 signal=-83 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=07:1E:AA:00:08:00 client=0D:7F:DD:00:17:00 signal=-76 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=07:1E:AA:00:08:00 client=40:C7:DD:00:18:00 signal=-91 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=07:1E:AA:00:08:00 client=31:F5:DD:00:19:00 signal=-74 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=07:1E:AA:00:08:00 client=56:C7:DD:00:1A:00 signal=-69 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=07:1E:AA:00:08:00 client=09:77:DD:00:1B:00 signal=-86 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=07:1E:AA:00:08:00 client=53:C7:DD:00:1C:00 signal=-74 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=07:1E:AA:00:08:00 client=07:CC:DD:00:1D:00 signal=-92 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=07:1E:AA:00:08:00 client=37:13:DD:00:1E:00 signal=-60 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=07:1E:AA:00:08:00 client=1A:ED:DD:00:1F:00 signal=-82 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=07:1E:AA:00:08:00 client=78:22:DD:00:20:00 signal=-91 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=07:1E:AA:00:08:00 client=7D:52:DD:00:21:00 signal=-91 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=07:1E:AA:00:08:00 client=75:45:DD:00:22:00 signal=-79 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:A2:AA:00:09:00 client=50:7B:DD:00:01:00 signal=-84 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=45:A2:AA:00:09:00 client=22:87:DD:00:02:00 signal=-86 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:A2:AA:00:09:00 client=54:1A:DD:00:03:00 signal=-90 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=45:A2:AA:00:09:00 client=60:79:DD:00:04:00 signal=-80 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=45:A2:AA:00:09:00 client=20:EE:DD:00:05:00 signal=-86 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:A2:AA:00:09:00 client=33:D2:DD:00:06:00 signal=-88 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=45:A2:AA:00:09:00 client=44:B6:DD:00:07:00 signal=-81 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=45:A2:AA:00:09:00 client=3A:D6:DD:00:08:00 signal=-90 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:A2:AA:00:09:00 client=3C:BB:DD:00:09:00 signal=-92 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=45:A2:AA:00:09:00 client=2D:3F:DD:00:0A:00 signal=-88 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=45:A2:AA:00:09:00 client=00:08:DD:00:0B:00 signal=-62 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:A2:AA:00:09:00 client=64:5A:DD:00:0C:00 signal=-90 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:A2:AA:00:09:00 client=13:ED:DD:00:0D:00 signal=-83 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=45:A2:AA:00:09:00 client=3B:43:DD:00:0E:00 signal=-85 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:A2:AA:00:09:00 client=10:6A:DD:00:0F:00 signal=-94 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:A2:AA:00:09:00 client=0D:BE:DD:00:10:00 signal=-84 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=45:A2:AA:00:09:00 client=3E:B5:DD:00:11:00 signal=-81 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:A2:AA:00:09:00 client=41:C2:DD:00:12:00 signal=-84 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:A2:AA:00:09:00 client=2A:75:DD:00:13:00 signal=-91 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:A2:AA:00:09:00 client=31:FB:DD:00:14:00 signal=-82 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=45:A2:AA:00:09:00 client=2E:B8:DD:00:15:00 signal=-89 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:A2:AA:00:09:00 client=40:50:DD:00:16:00 signal=-89 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:A2:AA:00:09:00 client=0D:7F:DD:00:17:00 signal=-56 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=45:A2:AA:00:09:00 client=40:C7:DD:00:18:00 signal=-89 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=45:A2:AA:00:09:00 client=31:F5:DD:00:19:00 signal=-58 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=45:A2:AA:00:09:00 client=56:C7:DD:00:1A:00 signal=-72 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:A2:AA:00:09:00 client=09:77:DD:00:1B:00 signal=-84 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:A2:AA:00:09:00 client=53:C7:DD:00:1C:00 signal=-83 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:A2:AA:00:09:00 client=07:CC:DD:00:1D:00 signal=-93 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=45:A2:AA:00:09:00 client=37:13:DD:00:1E:00 signal=-76 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=45:A2:AA:00:09:00 client=1A:ED:DD:00:1F:00 signal=-81 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:A2:AA:00:09:00 client=78:22:DD:00:20:00 signal=-91 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:A2:AA:00:09:00 client=7D:52:DD:00:21:00 signal=-90 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=45:A2:AA:00:09:00 client=75:45:DD:00:22:00 signal=-80 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=50:7B:DD:00:01:00 signal=-81 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=22:87:DD:00:02:00 signal=-87 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=54:1A:DD:00:03:00 signal=-90 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=60:79:DD:00:04:00 signal=-86 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=20:EE:DD:00:05:00 signal=-84 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=33:D2:DD:00:06:00 signal=-90 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=44:B6:DD:00:07:00 signal=-85 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=3A:D6:DD:00:08:00 signal=-91 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=3C:BB:DD:00:09:00 signal=-94 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=2D:3F:DD:00:0A:00 signal=-90 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=00:08:DD:00:0B:00 signal=-60 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=64:5A:DD:00:0C:00 signal=-91 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=13:ED:DD:00:0D:00 signal=-78 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=3B:43:DD:00:0E:00 signal=-82 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=10:6A:DD:00:0F:00 signal=-94 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=0D:BE:DD:00:10:00 signal=-87 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=3E:B5:DD:00:11:00 signal=-87 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=41:C2:DD:00:12:00 signal=-79 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=2A:75:DD:00:13:00 signal=-94 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=31:FB:DD:00:14:00 signal=-79 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=2E:B8:DD:00:15:00 signal=-90 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=40:50:DD:00:16:00 signal=-85 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=0D:7F:DD:00:17:00 signal=-74 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=40:C7:DD:00:18:00 signal=-93 freq=5500 ht_cap=1 vht_cap=1
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=31:F5:DD:00:19:00 signal=-75 freq=5500 ht_cap=1 vht_cap=0
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=56:C7:DD:00:1A:00 signal=-39 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=09:77:DD:00:1B:00 signal=-89 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=53:C7:DD:00:1C:00 signal=-78 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=07:CC:DD:00:1D:00 signal=-94 freq=2500 ht_cap=1 vht_cap=1
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=37:13:DD:00:1E:00 signal=-68 freq=2500 ht_cap=1 vht_cap=0
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=1A:ED:DD:00:1F:00 signal=-86 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=78:22:DD:00:20:00 signal=-93 freq=5500 ht_cap=0 vht_cap=0
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=7D:52:DD:00:21:00 signal=-93 freq=2500 ht_cap=0 vht_cap=0
|
||||
probe bssid=4C:4D:AA:00:0A:00 client=75:45:DD:00:22:00 signal=-84 freq=2500 ht_cap=0 vht_cap=0
|
||||
|
||||
|
||||
client_show
|
||||
|
||||
kick 0A:7B:AA:00:01:00 0
|
||||
kick 02:67:AA:00:02:00 0
|
||||
kick 14:02:AA:00:03:00 0
|
||||
kick 1F:36:AA:00:04:00 0
|
||||
kick 69:E9:AA:00:05:00 0
|
||||
kick 6A:97:AA:00:06:00 0
|
||||
kick 45:63:AA:00:07:00 0
|
||||
kick 07:1E:AA:00:08:00 0
|
||||
kick 45:A2:AA:00:09:00 0
|
||||
kick 4C:4D:AA:00:0A:00 0
|
||||
|
||||
client_show
|
||||
|
||||
elapsed
|
|
@ -1,3 +1,3 @@
|
|||
client_show
|
||||
client bssid=00:11:22:33:44:55 client=ff:ee:dd:cc:bb:aa freq=1 ht_sup=2 vht_sup=3 ht=4 vht=5 kick=6
|
||||
client bssid=00:11:22:33:44:55 client=ff:ee:dd:cc:bb:aa freq=1 ht_sup=2 vht_sup=3 ht_cap=4 vht_cap=5 kick=6
|
||||
client_show
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# Basic test of array entry handling
|
||||
probe_add_auto 10 20
|
||||
probe_add_auto 50 40
|
||||
probe_show
|
||||
probe_del_auto 10 20
|
||||
probe_del_auto 41 49
|
||||
probe_show
|
||||
|
|
75230
src/test/scale_kick_100_3000_b.script
Normal file
75230
src/test/scale_kick_100_3000_b.script
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,15 @@
|
|||
dawn default
|
||||
dawn min_kick_count=2
|
||||
ap bssid=11:22:33:44:55:66
|
||||
ap bssid=11:22:33:44:55:66 neighbors=11:22:33:44:55:66
|
||||
ap bssid=22:33:44:55:66:77 neighbors=22:33:44:55:66:77
|
||||
client bssid=11:22:33:44:55:66 client=ff:ee:dd:cc:bb:aa
|
||||
ap_show
|
||||
client_show
|
||||
kick 11:22:33:44:55:66 0
|
||||
probe bssid=11:22:33:44:55:66 client=ff:ee:dd:cc:bb:aa signal=-60
|
||||
probe bssid=22:33:44:55:66:77 client=ff:ee:dd:cc:bb:aa signal=-70
|
||||
kick 11:22:33:44:55:66 0
|
||||
kick 11:22:33:44:55:66 0
|
||||
probe bssid=11:22:33:44:55:66 client=ff:ee:dd:cc:bb:aa signal=-85
|
||||
kick 11:22:33:44:55:66 0
|
||||
kick 11:22:33:44:55:66 0
|
||||
|
|
|
@ -4,35 +4,24 @@
|
|||
#include "dawn_iwinfo.h"
|
||||
|
||||
#include "datastorage.h"
|
||||
#include "mac_utils.h"
|
||||
#include "msghandler.h"
|
||||
#include "ubus.h"
|
||||
#include "test_storage.h"
|
||||
|
||||
/*** Testing structures, etc ***/
|
||||
// pac_a_mac allows a 6-byte (48-bit) MAC address to be efficiently handled as a 64-bit integer
|
||||
#define MAC_MASK_PACKED_U64 0xFFFFFFFFFFFF0000
|
||||
union __attribute__((__packed__)) pac_a_mac
|
||||
{
|
||||
struct {
|
||||
uint8_t u8[6];
|
||||
uint8_t packing[2]; // Not strictly needed as compiler will allocated space for largest member of union
|
||||
} unpacked;
|
||||
uint64_t packed_u64;
|
||||
};
|
||||
|
||||
/*** Test Stub Functions - Called by SUT ***/
|
||||
void ubus_send_beacon_report(uint8_t client[], int id)
|
||||
void ubus_send_beacon_report(struct dawn_mac client, int id)
|
||||
{
|
||||
printf("send_beacon_report() was called...\n");
|
||||
}
|
||||
|
||||
int send_set_probe(uint8_t client_addr[])
|
||||
int send_set_probe(struct dawn_mac client_addr)
|
||||
{
|
||||
printf("send_set_probe() was called...\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wnm_disassoc_imminent(uint32_t id, const uint8_t* client_addr, char* dest_ap, uint32_t duration)
|
||||
int wnm_disassoc_imminent(uint32_t id, const struct dawn_mac client_addr, char* dest_ap, uint32_t duration)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
|
@ -41,10 +30,10 @@ int ret = 0;
|
|||
if (dest_ap != NULL)
|
||||
{
|
||||
// Fake a client being disassociated and then rejoining on the recommended neoghbor
|
||||
client mc = client_array_get_client(client_addr);
|
||||
mc = client_array_delete(mc);
|
||||
hwaddr_aton(dest_ap, mc.bssid_addr);
|
||||
client_array_insert(mc);
|
||||
client *mc = client_array_get_client(client_addr);
|
||||
mc = client_array_delete(mc, true);
|
||||
hwaddr_aton(dest_ap, mc->bssid_addr.u8);
|
||||
insert_client_to_array(mc);
|
||||
printf("BSS TRANSITION TO %s\n", dest_ap);
|
||||
|
||||
// Tell caller not to change the arrays any further
|
||||
|
@ -59,30 +48,30 @@ void add_client_update_timer(time_t time)
|
|||
printf("add_client_update_timer() was called...\n");
|
||||
}
|
||||
|
||||
void del_client_interface(uint32_t id, const uint8_t* client_addr, uint32_t reason, uint8_t deauth, uint32_t ban_time)
|
||||
void del_client_interface(uint32_t id, const struct dawn_mac client_addr, uint32_t reason, uint8_t deauth, uint32_t ban_time)
|
||||
{
|
||||
printf("del_client_interface() was called...\n");
|
||||
}
|
||||
|
||||
int ubus_send_probe_via_network(struct probe_entry_s probe_entry)
|
||||
int ubus_send_probe_via_network(struct probe_entry_s *probe_entry)
|
||||
{
|
||||
printf("send_probe_via_network() was called...\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_rssi_iwinfo(uint8_t* client_addr)
|
||||
int get_rssi_iwinfo(struct dawn_mac client_addr)
|
||||
{
|
||||
printf("get_rssi_iwinfo() was called...\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_expected_throughput_iwinfo(uint8_t* client_addr)
|
||||
int get_expected_throughput_iwinfo(struct dawn_mac client_addr)
|
||||
{
|
||||
printf("get_expected_throughput_iwinfo() was called...\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_bandwidth_iwinfo(uint8_t* client_addr, float* rx_rate, float* tx_rate)
|
||||
int get_bandwidth_iwinfo(struct dawn_mac client_addr, float* rx_rate, float* tx_rate)
|
||||
{
|
||||
*rx_rate = 0.0;
|
||||
*tx_rate = 0.0;
|
||||
|
@ -122,53 +111,82 @@ static int array_auto_helper(int action, int i0, int i1)
|
|||
|
||||
int cont = 1;
|
||||
while (cont) {
|
||||
union pac_a_mac this_mac;
|
||||
struct dawn_mac this_mac;
|
||||
|
||||
*((uint64_t*)(&this_mac.u8)) = m;
|
||||
|
||||
this_mac.packed_u64 = m;
|
||||
switch (action & ~HELPER_ACTION_MASK)
|
||||
{
|
||||
case HELPER_AP:
|
||||
; // Empty statement to allow label before declaration
|
||||
ap ap0;
|
||||
memcpy(ap0.bssid_addr, &this_mac.unpacked.u8[0], sizeof(ap0.bssid_addr));
|
||||
|
||||
if ((action & HELPER_ACTION_MASK) == HELPER_ACTION_ADD)
|
||||
{
|
||||
ap* ap0 = malloc(sizeof(struct ap_s));
|
||||
ap0->bssid_addr = this_mac;
|
||||
|
||||
insert_to_ap_array(ap0);
|
||||
}
|
||||
else
|
||||
ap_array_delete(ap0);
|
||||
ap_array_delete(ap_array_get_ap(this_mac));
|
||||
break;
|
||||
case HELPER_CLIENT:
|
||||
; // Empty statement to allow label before declaration
|
||||
client client0;
|
||||
memcpy(client0.bssid_addr, &this_mac.unpacked.u8[0], sizeof(client0.bssid_addr));
|
||||
memcpy(client0.client_addr, &this_mac.unpacked.u8[0], sizeof(client0.client_addr));
|
||||
|
||||
if ((action & HELPER_ACTION_MASK) == HELPER_ACTION_ADD)
|
||||
{
|
||||
client* client0 = malloc(sizeof(struct client_s));
|
||||
client0->bssid_addr = this_mac;
|
||||
client0->client_addr = this_mac;
|
||||
|
||||
insert_client_to_array(client0);
|
||||
}
|
||||
else
|
||||
client_array_delete(client0);
|
||||
{
|
||||
client* client0 = client_array_get_client(this_mac);
|
||||
|
||||
if (client0 != NULL && mac_is_equal_bb(this_mac, client0->client_addr))
|
||||
client_array_delete(client0, false);
|
||||
}
|
||||
break;
|
||||
case HELPER_PROBE_ARRAY:
|
||||
; // Empty statement to allow label before declaration
|
||||
probe_entry probe0;
|
||||
memcpy(probe0.bssid_addr, &this_mac.unpacked.u8[0], sizeof(probe0.bssid_addr));
|
||||
memcpy(probe0.client_addr, &this_mac.unpacked.u8[0], sizeof(probe0.client_addr));
|
||||
probe_entry* probe0 = NULL;
|
||||
|
||||
if ((action & HELPER_ACTION_MASK) == HELPER_ACTION_ADD) {
|
||||
probe0 = malloc(sizeof(probe_entry));
|
||||
probe0->client_addr = this_mac;
|
||||
probe0->bssid_addr = this_mac;
|
||||
|
||||
if ((action & HELPER_ACTION_MASK) == HELPER_ACTION_ADD)
|
||||
insert_to_array(probe0, true, true, true); // TODO: Check bool flags
|
||||
}
|
||||
else
|
||||
probe_array_delete(probe0);
|
||||
{
|
||||
probe0 = probe_array_get_entry(this_mac, this_mac);
|
||||
if (probe0 == NULL)
|
||||
{
|
||||
printf("Can't find entry to delete!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
probe_array_delete(probe0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case HELPER_AUTH_ENTRY:
|
||||
; // Empty statement to allow label before declaration
|
||||
auth_entry auth_entry0;
|
||||
memcpy(auth_entry0.bssid_addr, &this_mac.unpacked.u8[0], sizeof(auth_entry0.bssid_addr));
|
||||
memcpy(auth_entry0.client_addr, &this_mac.unpacked.u8[0], sizeof(auth_entry0.client_addr));
|
||||
|
||||
if ((action & HELPER_ACTION_MASK) == HELPER_ACTION_ADD)
|
||||
{
|
||||
auth_entry* auth_entry0 = malloc(sizeof(struct auth_entry_s));
|
||||
auth_entry0->bssid_addr = this_mac;
|
||||
auth_entry0->client_addr = this_mac;
|
||||
|
||||
insert_to_denied_req_array(auth_entry0, true); // TODO: Check bool flags
|
||||
}
|
||||
else
|
||||
denied_req_array_delete(auth_entry0);
|
||||
{
|
||||
auth_entry* auth_entry0 = *auth_entry_find_first_entry(this_mac, this_mac);
|
||||
if (auth_entry0 != NULL && mac_is_equal_bb(this_mac, auth_entry0->bssid_addr) && mac_is_equal_bb(this_mac, auth_entry0->client_addr))
|
||||
denied_req_array_delete(auth_entry0);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
printf("HELPER error - which entity?\n");
|
||||
|
@ -232,19 +250,9 @@ static int load_time(time_t* v, char* s)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int load_mac(uint8_t* v, char* s);
|
||||
static int load_mac(uint8_t* v, char* s)
|
||||
{
|
||||
int ret = 0;
|
||||
//printf("Loading mac from: %s\n", s);
|
||||
sscanf(s, "%" SCNx8 ":%" SCNx8 ":%" SCNx8 ":%" SCNx8 ":%" SCNx8 ":%" SCNx8, &v[0], &v[1], &v[2], &v[3], &v[4], &v[5]);
|
||||
return ret;
|
||||
}
|
||||
static int consume_actions(int argc, char* argv[], int harness_verbosity);
|
||||
|
||||
|
||||
static int consume_actions(int argc, char* argv[]);
|
||||
|
||||
static int consume_actions(int argc, char* argv[])
|
||||
static int consume_actions(int argc, char* argv[], int harness_verbosity)
|
||||
{
|
||||
int ret = 0;
|
||||
int args_required = 0; // Suppress compiler warming by assigning initial value
|
||||
|
@ -253,29 +261,53 @@ static int consume_actions(int argc, char* argv[])
|
|||
|
||||
while (curr_arg < argc && ret == 0)
|
||||
{
|
||||
if ((strcmp(*argv, "time") == 0) || (strcmp(*argv, "elapsed") == 0)) // "time" is deprecated to avoid confusion with "faketime" commands
|
||||
if ((strcmp(*argv, "time") == 0) || (strcmp(*argv, "elapsed") == 0) || (strcmp(*argv, "elapsed_msg") == 0)) // "time" is deprecated to avoid confusion with "faketime" commands
|
||||
{
|
||||
struct timespec spec;
|
||||
double curr_time;
|
||||
|
||||
args_required = 1;
|
||||
|
||||
//TODO: Check portability for SoC devices when benchmarking?
|
||||
clock_gettime(CLOCK_REALTIME, &spec);
|
||||
curr_time = spec.tv_sec * 1000.0 + spec.tv_nsec / 1000000.0;
|
||||
|
||||
// First call sets base time for script
|
||||
// Later calls report elapsed time since base, and from previous call
|
||||
if (first_time)
|
||||
if (strcmp(*argv, "elapsed_msg") == 0)
|
||||
{
|
||||
first_time = false;
|
||||
base_time = curr_time;
|
||||
last_time = curr_time;
|
||||
args_required = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
args_required = 1;
|
||||
}
|
||||
|
||||
printf("Elapsed time: base=%fms, last=%fms\n", curr_time - base_time, curr_time - last_time);
|
||||
if (curr_arg + args_required <= argc)
|
||||
{
|
||||
struct timespec spec;
|
||||
double curr_time;
|
||||
|
||||
last_time = curr_time;
|
||||
//TODO: Check portability for SoC devices when benchmarking?
|
||||
clock_gettime(CLOCK_REALTIME, &spec);
|
||||
curr_time = spec.tv_sec * 1000.0 + spec.tv_nsec / 1000000.0;
|
||||
|
||||
// First call sets base time for script
|
||||
// Later calls report elapsed time since base, and from previous call
|
||||
if (first_time)
|
||||
{
|
||||
first_time = false;
|
||||
base_time = curr_time;
|
||||
last_time = curr_time;
|
||||
}
|
||||
|
||||
if (strcmp(*argv, "elapsed_msg") == 0)
|
||||
{
|
||||
printf("Elapsed time (%s): base=%fms, last=%fms\n", *(argv + 1), curr_time - base_time, curr_time - last_time);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Elapsed time: base=%fms, last=%fms\n", curr_time - base_time, curr_time - last_time);
|
||||
}
|
||||
|
||||
last_time = curr_time;
|
||||
}
|
||||
}
|
||||
else if (strcmp(*argv, "memleak") == 0)
|
||||
{
|
||||
args_required = 1;
|
||||
|
||||
char *leaky = malloc(10);
|
||||
strcpy(leaky, "LEAKED"); // Force use of memory to avoid unused error
|
||||
}
|
||||
else if (strcmp(*argv, "probe_sort") == 0)
|
||||
{
|
||||
|
@ -346,8 +378,8 @@ static int consume_actions(int argc, char* argv[])
|
|||
args_required = 1;
|
||||
|
||||
printf("--------APs------\n");
|
||||
for (int i = 0; i <= denied_req_last; i++) {
|
||||
print_auth_entry(denied_req_array[i]);
|
||||
for (auth_entry *i = denied_req_set; i != NULL; i = i->next_auth) {
|
||||
print_auth_entry(i);
|
||||
}
|
||||
printf("------------------\n");
|
||||
}
|
||||
|
@ -528,9 +560,9 @@ static int consume_actions(int argc, char* argv[])
|
|||
args_required = 2;
|
||||
if (curr_arg + args_required <= argc)
|
||||
{
|
||||
uint8_t mac0[ETH_ALEN];
|
||||
struct dawn_mac mac0;
|
||||
|
||||
load_mac(mac0, argv[1]);
|
||||
hwaddr_aton(argv[1], mac0.u8);
|
||||
insert_to_maclist(mac0);
|
||||
}
|
||||
}
|
||||
|
@ -540,29 +572,28 @@ static int consume_actions(int argc, char* argv[])
|
|||
args_required = 2;
|
||||
if (curr_arg + args_required <= argc)
|
||||
{
|
||||
uint8_t mac0[ETH_ALEN];
|
||||
struct dawn_mac mac0;
|
||||
|
||||
load_mac(mac0, argv[1]);
|
||||
hwaddr_aton(argv[1], mac0.u8);
|
||||
printf("Looking for MAC %s - result %d\n", argv[1], mac_in_maclist(mac0));
|
||||
}
|
||||
}
|
||||
else if (strcmp(*argv, "ap") == 0)
|
||||
{
|
||||
ap ap0;
|
||||
ap *ap0 = malloc(sizeof(struct ap_s));
|
||||
|
||||
memset(ap0.bssid_addr, 0, ETH_ALEN);
|
||||
ap0.freq = 0;
|
||||
ap0.ht_support = 0;
|
||||
ap0.vht_support = 0;
|
||||
ap0.channel_utilization = 0;
|
||||
ap0.time = faketime;
|
||||
ap0.station_count = 0;
|
||||
memset(ap0.ssid, '*', SSID_MAX_LEN);
|
||||
ap0.ssid[SSID_MAX_LEN - 1] = '\0';
|
||||
ap0.neighbor_report[0] = 0;
|
||||
ap0.collision_domain = 0;
|
||||
ap0.bandwidth = 0;
|
||||
ap0.ap_weight = 0;
|
||||
ap0->freq = 0;
|
||||
ap0->ht_support = 0;
|
||||
ap0->vht_support = 0;
|
||||
ap0->channel_utilization = 0;
|
||||
ap0->time = faketime;
|
||||
ap0->station_count = 0;
|
||||
memset(ap0->ssid, '*', SSID_MAX_LEN);
|
||||
ap0->ssid[SSID_MAX_LEN - 1] = '\0';
|
||||
ap0->neighbor_report[0] = 0;
|
||||
ap0->collision_domain = 0;
|
||||
ap0->bandwidth = 0;
|
||||
ap0->ap_weight = 0;
|
||||
|
||||
args_required = 1;
|
||||
while (ret == 0 && curr_arg + args_required < argc)
|
||||
|
@ -571,18 +602,18 @@ static int consume_actions(int argc, char* argv[])
|
|||
|
||||
//TODO: Somehwat hacky parsing of value strings to get us going...
|
||||
if (false); // Hack to allow easy paste of generated code
|
||||
else if (!strncmp(fn, "bssid=", 6)) load_mac(ap0.bssid_addr, fn + 6);
|
||||
else if (!strncmp(fn, "freq=", 5)) load_u32(&ap0.freq, fn + 5);
|
||||
else if (!strncmp(fn, "ht_sup=", 7)) load_u8(&ap0.ht_support, fn + 7);
|
||||
else if (!strncmp(fn, "vht_sup=", 8)) load_u8(&ap0.vht_support, fn + 8);
|
||||
else if (!strncmp(fn, "util=", 5)) load_u32(&ap0.channel_utilization, fn + 5);
|
||||
else if (!strncmp(fn, "time=", 5)) load_time(&ap0.time, fn + 5);
|
||||
else if (!strncmp(fn, "stations=", 9)) load_u32(&ap0.station_count, fn + 9);
|
||||
else if (!strncmp(fn, "ssid=", 5)) load_ssid(ap0.ssid, fn + 5);
|
||||
else if (!strncmp(fn, "neighbors=", 10)) load_string(NEIGHBOR_REPORT_LEN, ap0.neighbor_report, fn + 10);
|
||||
else if (!strncmp(fn, "col_d=", 6)) load_u32(&ap0.collision_domain, fn + 6);
|
||||
else if (!strncmp(fn, "bandwidth=", 10)) load_u32(&ap0.bandwidth, fn + 10);
|
||||
else if (!strncmp(fn, "weight=", 7)) load_u32(&ap0.ap_weight, fn + 7);
|
||||
else if (!strncmp(fn, "bssid=", 6)) hwaddr_aton(fn + 6, ap0->bssid_addr.u8);
|
||||
else if (!strncmp(fn, "freq=", 5)) load_u32(&ap0->freq, fn + 5);
|
||||
else if (!strncmp(fn, "ht_sup=", 7)) load_u8(&ap0->ht_support, fn + 7);
|
||||
else if (!strncmp(fn, "vht_sup=", 8)) load_u8(&ap0->vht_support, fn + 8);
|
||||
else if (!strncmp(fn, "util=", 5)) load_u32(&ap0->channel_utilization, fn + 5);
|
||||
else if (!strncmp(fn, "time=", 5)) load_time(&ap0->time, fn + 5);
|
||||
else if (!strncmp(fn, "stations=", 9)) load_u32(&ap0->station_count, fn + 9);
|
||||
else if (!strncmp(fn, "ssid=", 5)) load_ssid(ap0->ssid, fn + 5);
|
||||
else if (!strncmp(fn, "neighbors=", 10)) load_string(NEIGHBOR_REPORT_LEN, ap0->neighbor_report, fn + 10);
|
||||
else if (!strncmp(fn, "col_d=", 6)) load_u32(&ap0->collision_domain, fn + 6);
|
||||
else if (!strncmp(fn, "bandwidth=", 10)) load_u32(&ap0->bandwidth, fn + 10);
|
||||
else if (!strncmp(fn, "weight=", 7)) load_u32(&ap0->ap_weight, fn + 7);
|
||||
else {
|
||||
printf("ERROR: Loading AP, but don't recognise assignment \"%s\"\n", fn);
|
||||
ret = 1;
|
||||
|
@ -595,33 +626,32 @@ static int consume_actions(int argc, char* argv[])
|
|||
}
|
||||
|
||||
if (ret == 0)
|
||||
{
|
||||
insert_to_ap_array(ap0);
|
||||
}
|
||||
else
|
||||
free(ap0);
|
||||
}
|
||||
else if (strcmp(*argv, "client") == 0)
|
||||
{
|
||||
client cl0;
|
||||
client *cl0 = malloc(sizeof(struct client_s));
|
||||
//TODO: NULL test
|
||||
|
||||
memset(cl0.bssid_addr, 0, ETH_ALEN);
|
||||
memset(cl0.client_addr, 0, ETH_ALEN);
|
||||
memset(cl0.signature, 0, SIGNATURE_LEN);
|
||||
cl0.ht_supported = 0;
|
||||
cl0.vht_supported = 0;
|
||||
cl0.freq = 0;
|
||||
cl0.auth = 0;
|
||||
cl0.assoc = 0;
|
||||
cl0.authorized = 0;
|
||||
cl0.preauth = 0;
|
||||
cl0.wds = 0;
|
||||
cl0.wmm = 0;
|
||||
cl0.ht = 0;
|
||||
cl0.vht = 0;
|
||||
cl0.wps = 0;
|
||||
cl0.mfp = 0;
|
||||
cl0.time = faketime;
|
||||
cl0.aid = 0;
|
||||
cl0.kick_count = 0;
|
||||
memset(cl0->signature, 0, SIGNATURE_LEN);
|
||||
cl0->ht_supported = 0;
|
||||
cl0->vht_supported = 0;
|
||||
cl0->freq = 0;
|
||||
cl0->auth = 0;
|
||||
cl0->assoc = 0;
|
||||
cl0->authorized = 0;
|
||||
cl0->preauth = 0;
|
||||
cl0->wds = 0;
|
||||
cl0->wmm = 0;
|
||||
cl0->ht = 0;
|
||||
cl0->vht = 0;
|
||||
cl0->wps = 0;
|
||||
cl0->mfp = 0;
|
||||
cl0->time = faketime;
|
||||
cl0->aid = 0;
|
||||
cl0->kick_count = 0;
|
||||
|
||||
args_required = 1;
|
||||
while (ret == 0 && curr_arg + args_required < argc)
|
||||
|
@ -630,25 +660,25 @@ static int consume_actions(int argc, char* argv[])
|
|||
|
||||
//TODO: Somewhat hacky parsing of value strings to get us going...
|
||||
if (false); // Hack to allow easy paste of generated code
|
||||
else if (!strncmp(fn, "bssid=", 6)) load_mac(cl0.bssid_addr, fn + 6);
|
||||
else if (!strncmp(fn, "client=", 7)) load_mac(cl0.client_addr, fn + 7);
|
||||
else if (!strncmp(fn, "sig=", 4)) load_string(SIGNATURE_LEN, cl0.signature, fn + 4);
|
||||
else if (!strncmp(fn, "ht_sup=", 7)) load_u8(&cl0.ht_supported, fn + 7);
|
||||
else if (!strncmp(fn, "vht_sup=", 8)) load_u8(&cl0.vht_supported, fn + 8);
|
||||
else if (!strncmp(fn, "freq=", 5)) load_u32(&cl0.freq, fn + 5);
|
||||
else if (!strncmp(fn, "auth=", 5)) load_u8(&cl0.auth, fn + 5);
|
||||
else if (!strncmp(fn, "assoc=", 6)) load_u8(&cl0.assoc, fn + 6);
|
||||
else if (!strncmp(fn, "authz=", 6)) load_u8(&cl0.authorized, fn + 6);
|
||||
else if (!strncmp(fn, "preauth=", 8)) load_u8(&cl0.preauth, fn + 8);
|
||||
else if (!strncmp(fn, "wds=", 4)) load_u8(&cl0.wds, fn + 4);
|
||||
else if (!strncmp(fn, "wmm=", 4)) load_u8(&cl0.wmm, fn + 4);
|
||||
else if (!strncmp(fn, "ht_cap=", 3)) load_u8(&cl0.ht, fn + 3);
|
||||
else if (!strncmp(fn, "vht_cap=", 4)) load_u8(&cl0.vht, fn + 4);
|
||||
else if (!strncmp(fn, "wps=", 4)) load_u8(&cl0.wps, fn + 4);
|
||||
else if (!strncmp(fn, "mfp=", 4)) load_u8(&cl0.mfp, fn + 4);
|
||||
else if (!strncmp(fn, "time=", 5)) load_time(&cl0.time, fn + 5);
|
||||
else if (!strncmp(fn, "aid=", 4)) load_u32(&cl0.aid, fn + 4);
|
||||
else if (!strncmp(fn, "kick=", 5)) load_u32(&cl0.kick_count, fn + 5);
|
||||
else if (!strncmp(fn, "bssid=", 6)) hwaddr_aton(fn + 6, cl0->bssid_addr.u8);
|
||||
else if (!strncmp(fn, "client=", 7)) hwaddr_aton(fn + 7, cl0->client_addr.u8);
|
||||
else if (!strncmp(fn, "sig=", 4)) load_string(SIGNATURE_LEN, cl0->signature, fn + 4);
|
||||
else if (!strncmp(fn, "ht_sup=", 7)) load_u8(&cl0->ht_supported, fn + 7);
|
||||
else if (!strncmp(fn, "vht_sup=", 8)) load_u8(&cl0->vht_supported, fn + 8);
|
||||
else if (!strncmp(fn, "freq=", 5)) load_u32(&cl0->freq, fn + 5);
|
||||
else if (!strncmp(fn, "auth=", 5)) load_u8(&cl0->auth, fn + 5);
|
||||
else if (!strncmp(fn, "assoc=", 6)) load_u8(&cl0->assoc, fn + 6);
|
||||
else if (!strncmp(fn, "authz=", 6)) load_u8(&cl0->authorized, fn + 6);
|
||||
else if (!strncmp(fn, "preauth=", 8)) load_u8(&cl0->preauth, fn + 8);
|
||||
else if (!strncmp(fn, "wds=", 4)) load_u8(&cl0->wds, fn + 4);
|
||||
else if (!strncmp(fn, "wmm=", 4)) load_u8(&cl0->wmm, fn + 4);
|
||||
else if (!strncmp(fn, "ht_cap=", 3)) load_u8(&cl0->ht, fn + 3);
|
||||
else if (!strncmp(fn, "vht_cap=", 4)) load_u8(&cl0->vht, fn + 4);
|
||||
else if (!strncmp(fn, "wps=", 4)) load_u8(&cl0->wps, fn + 4);
|
||||
else if (!strncmp(fn, "mfp=", 4)) load_u8(&cl0->mfp, fn + 4);
|
||||
else if (!strncmp(fn, "time=", 5)) load_time(&cl0->time, fn + 5);
|
||||
else if (!strncmp(fn, "aid=", 4)) load_u32(&cl0->aid, fn + 4);
|
||||
else if (!strncmp(fn, "kick=", 5)) load_u32(&cl0->kick_count, fn + 5);
|
||||
else {
|
||||
printf("ERROR: Loading CLIENT, but don't recognise assignment \"%s\"\n", fn);
|
||||
ret = 1;
|
||||
|
@ -665,24 +695,11 @@ static int consume_actions(int argc, char* argv[])
|
|||
}
|
||||
else if (strcmp(*argv, "probe") == 0)
|
||||
{
|
||||
probe_entry pr0;
|
||||
probe_entry* pr0 = NULL;
|
||||
|
||||
memset(pr0.bssid_addr, 0, ETH_ALEN);
|
||||
memset(pr0.client_addr, 0, ETH_ALEN);
|
||||
memset(pr0.target_addr, 0, ETH_ALEN);
|
||||
pr0.signal = 0;
|
||||
pr0.freq = 0;
|
||||
pr0.ht_capabilities = 0;
|
||||
pr0.vht_capabilities = 0;
|
||||
pr0.time = faketime;
|
||||
pr0.counter = 0;
|
||||
#ifndef DAWN_NO_OUTPUT
|
||||
pr0.deny_counter = 0;
|
||||
pr0.max_supp_datarate = 0;
|
||||
pr0.min_supp_datarate = 0;
|
||||
#endif
|
||||
pr0.rcpi = 0;
|
||||
pr0.rsni = 0;
|
||||
struct dawn_mac bmac;
|
||||
struct dawn_mac cmac;
|
||||
int key_check = 1 | 2;
|
||||
|
||||
args_required = 1;
|
||||
while (ret == 0 && curr_arg + args_required < argc)
|
||||
|
@ -690,48 +707,87 @@ static int consume_actions(int argc, char* argv[])
|
|||
char* fn = *(argv + args_required);
|
||||
|
||||
//TODO: Somewhat hacky parsing of value strings to get us going...
|
||||
// bssid and client must be specified first so we can work out if we need a new entry or update an old one
|
||||
if (false); // Hack to allow easy paste of generated code
|
||||
else if (!strncmp(fn, "bssid=", 6)) load_mac(pr0.bssid_addr, fn + 6);
|
||||
else if (!strncmp(fn, "client=", 7)) load_mac(pr0.client_addr, fn + 7);
|
||||
else if (!strncmp(fn, "target=", 7)) load_mac(pr0.target_addr, fn + 7);
|
||||
else if (!strncmp(fn, "signal=", 7)) load_u32(&pr0.signal, fn + 7);
|
||||
else if (!strncmp(fn, "freq=", 5)) load_u32(&pr0.freq, fn + 5);
|
||||
else if (!strncmp(fn, "ht_cap=", 7)) load_u8(&pr0.ht_capabilities, fn + 7);
|
||||
else if (!strncmp(fn, "vht_cap=", 8)) load_u8(&pr0.vht_capabilities, fn + 8);
|
||||
else if (!strncmp(fn, "time=", 5)) load_time(&pr0.time, fn + 5);
|
||||
else if (!strncmp(fn, "counter=", 8)) load_int(&pr0.counter, fn + 8);
|
||||
else if (!strncmp(fn, "bssid=", 6)) { hwaddr_aton(fn + 6, bmac.u8); key_check ^= ~1; }
|
||||
else if (!strncmp(fn, "client=", 7)) { hwaddr_aton(fn + 7, cmac.u8); key_check ^= ~2; }
|
||||
else if (!strncmp(fn, "target=", 7)) hwaddr_aton(fn + 7, pr0->target_addr.u8);
|
||||
else if (!strncmp(fn, "signal=", 7)) load_u32(&pr0->signal, fn + 7);
|
||||
else if (!strncmp(fn, "freq=", 5)) load_u32(&pr0->freq, fn + 5);
|
||||
else if (!strncmp(fn, "ht_cap=", 7)) load_u8(&pr0->ht_capabilities, fn + 7);
|
||||
else if (!strncmp(fn, "vht_cap=", 8)) load_u8(&pr0->vht_capabilities, fn + 8);
|
||||
else if (!strncmp(fn, "time=", 5)) load_time(&pr0->time, fn + 5);
|
||||
else if (!strncmp(fn, "counter=", 8)) load_int(&pr0->counter, fn + 8);
|
||||
#ifndef DAWN_NO_OUTPUT
|
||||
else if (!strncmp(fn, "deny=", 5)) load_int(&pr0.deny_counter, fn + 5);
|
||||
else if (!strncmp(fn, "max_rate=", 9)) load_u8(&pr0.max_supp_datarate, fn + 9);
|
||||
else if (!strncmp(fn, "min_rate=", 9)) load_u8(&pr0.min_supp_datarate, fn + 9);
|
||||
else if (!strncmp(fn, "deny=", 5)) load_int(&pr0->deny_counter, fn + 5);
|
||||
else if (!strncmp(fn, "max_rate=", 9)) load_u8(&pr0->max_supp_datarate, fn + 9);
|
||||
else if (!strncmp(fn, "min_rate=", 9)) load_u8(&pr0->min_supp_datarate, fn + 9);
|
||||
#endif
|
||||
else if (!strncmp(fn, "rcpi=", 5)) load_u32(&pr0.rcpi, fn + 5);
|
||||
else if (!strncmp(fn, "rsni=", 5)) load_u32(&pr0.rsni, fn + 5);
|
||||
else if (!strncmp(fn, "rcpi=", 5)) load_u32(&pr0->rcpi, fn + 5);
|
||||
else if (!strncmp(fn, "rsni=", 5)) load_u32(&pr0->rsni, fn + 5);
|
||||
else {
|
||||
printf("ERROR: Loading PROBE, but don't recognise assignment \"%s\"\n", fn);
|
||||
ret = 1;
|
||||
}
|
||||
|
||||
if (key_check == 0)
|
||||
{
|
||||
key_check = -1;
|
||||
|
||||
// See if this entry already exists
|
||||
pr0 = probe_array_get_entry(bmac, cmac);
|
||||
|
||||
// If not, create and initialise it
|
||||
if (pr0 != NULL)
|
||||
{
|
||||
if (harness_verbosity > 1)
|
||||
printf("probe: updating existing entry...\n");
|
||||
pr0->counter++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (harness_verbosity > 1)
|
||||
printf("probe: creating new entry...\n");
|
||||
// MUSTDO: Check all new malloc() returns
|
||||
pr0 = malloc(sizeof(probe_entry));
|
||||
|
||||
pr0->bssid_addr = bmac;
|
||||
pr0->client_addr = cmac;
|
||||
|
||||
memset(pr0->target_addr.u8, 0, ETH_ALEN);
|
||||
pr0->signal = 0;
|
||||
pr0->freq = 0;
|
||||
pr0->ht_capabilities = 0;
|
||||
pr0->vht_capabilities = 0;
|
||||
pr0->time = faketime;
|
||||
pr0->counter = 0;
|
||||
#ifndef DAWN_NO_OUTPUT
|
||||
pr0->deny_counter = 0;
|
||||
pr0->max_supp_datarate = 0;
|
||||
pr0->min_supp_datarate = 0;
|
||||
#endif
|
||||
pr0->rcpi = 0;
|
||||
pr0->rsni = 0;
|
||||
|
||||
insert_to_array(pr0, true, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (ret == 0)
|
||||
args_required++;
|
||||
}
|
||||
|
||||
if (ret == 0)
|
||||
{
|
||||
insert_to_array(pr0, true, true, true);
|
||||
}
|
||||
}
|
||||
else if (strcmp(*argv, "auth_entry") == 0)
|
||||
{
|
||||
auth_entry au0;
|
||||
auth_entry *au0 = malloc(sizeof(struct auth_entry_s));
|
||||
|
||||
memset(au0.bssid_addr, 0, ETH_ALEN);
|
||||
memset(au0.client_addr, 0, ETH_ALEN);
|
||||
memset(au0.target_addr, 0, ETH_ALEN);
|
||||
au0.signal = 0;
|
||||
au0.freq = 0;
|
||||
au0.time = faketime;
|
||||
au0.counter = 0;
|
||||
memset(au0->bssid_addr.u8, 0, ETH_ALEN);
|
||||
memset(au0->client_addr.u8, 0, ETH_ALEN);
|
||||
memset(au0->target_addr.u8, 0, ETH_ALEN);
|
||||
au0->signal = 0;
|
||||
au0->freq = 0;
|
||||
au0->time = faketime;
|
||||
au0->counter = 0;
|
||||
|
||||
args_required = 1;
|
||||
while (ret == 0 && curr_arg + args_required < argc)
|
||||
|
@ -740,13 +796,13 @@ static int consume_actions(int argc, char* argv[])
|
|||
|
||||
//TODO: Somewhat hacky parsing of value strings to get us going...
|
||||
if (false); // Hack to allow easy paste of generated code
|
||||
else if (!strncmp(fn, "bssid=", 6)) load_mac(au0.bssid_addr, fn + 6);
|
||||
else if (!strncmp(fn, "client=", 7)) load_mac(au0.client_addr, fn + 7);
|
||||
else if (!strncmp(fn, "target=", 7)) load_mac(au0.target_addr, fn + 7);
|
||||
else if (!strncmp(fn, "signal=", 7)) load_u32(&au0.signal, fn + 7);
|
||||
else if (!strncmp(fn, "freq=", 5)) load_u32(&au0.freq, fn + 5);
|
||||
else if (!strncmp(fn, "time=", 5)) load_time(&au0.time, fn + 5);
|
||||
else if (!strncmp(fn, "counter=", 8)) load_int(&au0.counter, fn + 8);
|
||||
else if (!strncmp(fn, "bssid=", 6)) hwaddr_aton(fn + 6, au0->bssid_addr.u8);
|
||||
else if (!strncmp(fn, "client=", 7)) hwaddr_aton(fn + 7, au0->client_addr.u8);
|
||||
else if (!strncmp(fn, "target=", 7)) hwaddr_aton(fn + 7, au0->target_addr.u8);
|
||||
else if (!strncmp(fn, "signal=", 7)) load_u32(&au0->signal, fn + 7);
|
||||
else if (!strncmp(fn, "freq=", 5)) load_u32(&au0->freq, fn + 5);
|
||||
else if (!strncmp(fn, "time=", 5)) load_time(&au0->time, fn + 5);
|
||||
else if (!strncmp(fn, "counter=", 8)) load_int(&au0->counter, fn + 8);
|
||||
else {
|
||||
printf("ERROR: Loading AUTH, but don't recognise assignment \"%s\"\n", fn);
|
||||
ret = 1;
|
||||
|
@ -768,13 +824,13 @@ static int consume_actions(int argc, char* argv[])
|
|||
{
|
||||
int safety_count = 1000;
|
||||
|
||||
struct dawn_mac kick_mac;
|
||||
uint32_t kick_id;
|
||||
uint8_t kick_mac[ETH_ALEN];
|
||||
|
||||
load_mac(kick_mac, argv[1]);
|
||||
hwaddr_aton(argv[1], kick_mac.u8);
|
||||
load_u32(&kick_id, argv[2]);
|
||||
|
||||
while ((kick_clients(kick_mac, kick_id) != 0) && safety_count--);
|
||||
while ((kick_clients(ap_array_get_ap(kick_mac), kick_id) != 0) && safety_count--);
|
||||
}
|
||||
}
|
||||
else if (strcmp(*argv, "better_ap_available") == 0)
|
||||
|
@ -782,14 +838,14 @@ static int consume_actions(int argc, char* argv[])
|
|||
args_required = 4;
|
||||
if (curr_arg + args_required <= argc)
|
||||
{
|
||||
uint8_t bssid_mac[ETH_ALEN];
|
||||
uint8_t client_mac[ETH_ALEN];
|
||||
struct dawn_mac bssid_mac;
|
||||
struct dawn_mac client_mac;
|
||||
uint32_t autokick;
|
||||
|
||||
int tr = 9999; // Tamper evident value
|
||||
|
||||
load_mac(bssid_mac, argv[1]);
|
||||
load_mac(client_mac, argv[2]);
|
||||
hwaddr_aton(argv[1], bssid_mac.u8);
|
||||
hwaddr_aton(argv[2], client_mac.u8);
|
||||
load_u32(&autokick, argv[3]);
|
||||
|
||||
char nb[NEIGHBOR_REPORT_LEN] = "TAMPER EVIDENT NEIGHBOR REPORT INITIALISATION STRING";
|
||||
|
@ -807,11 +863,11 @@ static int consume_actions(int argc, char* argv[])
|
|||
strcpy(nb, argv[4]);
|
||||
}
|
||||
|
||||
tr = better_ap_available(bssid_mac, client_mac, nb, autokick);
|
||||
tr = better_ap_available(ap_array_get_ap(bssid_mac), client_mac, nb);
|
||||
}
|
||||
else
|
||||
{
|
||||
tr = better_ap_available(bssid_mac, client_mac, NULL, autokick);
|
||||
tr = better_ap_available(ap_array_get_ap(bssid_mac), client_mac, NULL);
|
||||
}
|
||||
|
||||
printf("better_ap_available returned %d (with neighbour report %s)\n", tr, nb);
|
||||
|
@ -822,24 +878,23 @@ static int consume_actions(int argc, char* argv[])
|
|||
args_required = 3;
|
||||
if (curr_arg + args_required <= argc)
|
||||
{
|
||||
uint8_t bssid_mac[ETH_ALEN];
|
||||
uint8_t client_mac[ETH_ALEN];
|
||||
struct dawn_mac client_mac;
|
||||
struct dawn_mac bssid_mac;
|
||||
|
||||
load_mac(bssid_mac, argv[1]);
|
||||
load_mac(client_mac, argv[2]);
|
||||
hwaddr_aton(argv[2], client_mac.u8);
|
||||
hwaddr_aton(argv[1], bssid_mac.u8);
|
||||
|
||||
probe_entry probe0 = probe_array_get_entry(bssid_mac, client_mac);
|
||||
probe_entry *pr0 = probe_array_get_entry(bssid_mac, client_mac);
|
||||
|
||||
union pac_a_mac test_mac;
|
||||
memcpy(test_mac.unpacked.u8, probe0.bssid_addr, sizeof(probe0.bssid_addr));
|
||||
|
||||
if ((test_mac.packed_u64 & MAC_MASK_PACKED_U64) == 0 )
|
||||
if (pr0 == NULL )
|
||||
{
|
||||
printf("eval_probe_metric: Can't find probe entry!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
int this_metric = eval_probe_metric(probe0);
|
||||
ap* ap_entry = ap_array_get_ap(pr0->bssid_addr);
|
||||
|
||||
int this_metric = eval_probe_metric(pr0, ap_entry);
|
||||
printf("eval_probe_metric: Returned %d\n", this_metric);
|
||||
}
|
||||
|
||||
|
@ -864,10 +919,13 @@ static int consume_actions(int argc, char* argv[])
|
|||
{
|
||||
faketime += 1;
|
||||
|
||||
if (!(faketime & 1))
|
||||
printf("Faketime: tick %" PRId64 "...\n", (int64_t)faketime);
|
||||
else
|
||||
printf("Faketime: tock %" PRId64 "...\n", (int64_t)faketime);
|
||||
if (harness_verbosity > 0)
|
||||
{
|
||||
if (!(faketime & 1))
|
||||
printf("Faketime: tick %" PRId64 "...\n", (int64_t)faketime);
|
||||
else
|
||||
printf("Faketime: tock %" PRId64 "...\n", (int64_t)faketime);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -882,8 +940,8 @@ static int consume_actions(int argc, char* argv[])
|
|||
}
|
||||
|
||||
#define MAX_LINE_ARGS 20
|
||||
static int process_script_line(char* line, size_t len);
|
||||
static int process_script_line(char* line, size_t len)
|
||||
static int process_script_line(char* line, size_t len, int harness_verbosity);
|
||||
static int process_script_line(char* line, size_t len, int harness_verbosity)
|
||||
{
|
||||
int argc = 0;
|
||||
char* argv[MAX_LINE_ARGS];
|
||||
|
@ -935,7 +993,7 @@ static int process_script_line(char* line, size_t len)
|
|||
}
|
||||
|
||||
if (!ret)
|
||||
ret = consume_actions(argc, argv);
|
||||
ret = consume_actions(argc, argv, harness_verbosity);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -948,6 +1006,7 @@ int main(int argc, char* argv[])
|
|||
ssize_t read;
|
||||
|
||||
int ret = 0;
|
||||
int harness_verbosity = 1;
|
||||
|
||||
printf("DAWN datastorage.c test harness...\n\n");
|
||||
|
||||
|
@ -971,6 +1030,22 @@ int main(int argc, char* argv[])
|
|||
argc--;
|
||||
argv++;
|
||||
|
||||
if (!strcmp(*argv, "--quiet") || !strcmp(*argv, "-q"))
|
||||
{
|
||||
harness_verbosity = 0;
|
||||
|
||||
argc--;
|
||||
argv++;
|
||||
}
|
||||
|
||||
if (!strcmp(*argv, "--verbose") || !strcmp(*argv, "-v"))
|
||||
{
|
||||
harness_verbosity = 2;
|
||||
|
||||
argc--;
|
||||
argv++;
|
||||
}
|
||||
|
||||
if (!strcmp(*argv, "--script") || !strcmp(*argv, "-s") || !strcmp(*argv, "-"))
|
||||
{
|
||||
if (!strcmp(*argv, "--script") || !strcmp(*argv, "-s"))
|
||||
|
@ -985,7 +1060,8 @@ int main(int argc, char* argv[])
|
|||
if (!strcmp(*argv, "-"))
|
||||
{
|
||||
fp = stdin;
|
||||
printf("Consuming script from STDIN\n");
|
||||
if (harness_verbosity > 0)
|
||||
printf("Consuming script from STDIN\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -997,7 +1073,8 @@ int main(int argc, char* argv[])
|
|||
}
|
||||
else
|
||||
{
|
||||
printf("Consuming script file: %s\n", *argv);
|
||||
if (harness_verbosity > 0)
|
||||
printf("Consuming script file: %s\n", *argv);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1006,8 +1083,9 @@ int main(int argc, char* argv[])
|
|||
read = getline(&line, &len, fp);
|
||||
while (!ret && read != -1)
|
||||
{
|
||||
printf("Processing: %s\n", line);
|
||||
ret = process_script_line(line, read);
|
||||
if (harness_verbosity > 0)
|
||||
printf("Processing: %s\n", line);
|
||||
ret = process_script_line(line, read, harness_verbosity);
|
||||
if (!ret)
|
||||
read = getline(&line, &len, fp);
|
||||
}
|
||||
|
@ -1032,12 +1110,14 @@ int main(int argc, char* argv[])
|
|||
else
|
||||
{
|
||||
// Take direct input on command line
|
||||
ret = consume_actions(argc, argv);
|
||||
ret = consume_actions(argc, argv, harness_verbosity);
|
||||
}
|
||||
|
||||
destroy_mutex();
|
||||
}
|
||||
printf("\nDAWN datastorage.c test harness - finshed. \n");
|
||||
|
||||
if (harness_verbosity > 0)
|
||||
printf("\nDAWN datastorage.c test harness - finshed. \n");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -13,21 +13,21 @@ int call_iwinfo(char *client_addr);
|
|||
|
||||
int parse_rssi(char *iwinfo_string);
|
||||
|
||||
int get_rssi(const char *ifname, uint8_t *client_addr);
|
||||
int get_rssi(const char *ifname, struct dawn_mac client_addr);
|
||||
|
||||
int get_bandwidth(const char *ifname, uint8_t *client_addr, float *rx_rate, float *tx_rate);
|
||||
int get_bandwidth(const char *ifname, struct dawn_mac client_addr, float *rx_rate, float *tx_rate);
|
||||
|
||||
#define IWINFO_BUFSIZE 24 * 1024
|
||||
|
||||
#define IWINFO_ESSID_MAX_SIZE 32
|
||||
|
||||
int compare_essid_iwinfo(uint8_t *bssid_addr, uint8_t *bssid_addr_to_compare) {
|
||||
int compare_essid_iwinfo(struct dawn_mac bssid_addr, struct dawn_mac bssid_addr_to_compare) {
|
||||
const struct iwinfo_ops *iw;
|
||||
|
||||
char mac_buf[20];
|
||||
char mac_buf_to_compare[20];
|
||||
sprintf(mac_buf, MACSTR, MAC2STR(bssid_addr));
|
||||
sprintf(mac_buf_to_compare, MACSTR, MAC2STR(bssid_addr_to_compare));
|
||||
sprintf(mac_buf, MACSTR, MAC2STR(bssid_addr.u8));
|
||||
sprintf(mac_buf_to_compare, MACSTR, MAC2STR(bssid_addr_to_compare.u8));
|
||||
|
||||
DIR *dirp;
|
||||
struct dirent *entry;
|
||||
|
@ -84,7 +84,7 @@ int compare_essid_iwinfo(uint8_t *bssid_addr, uint8_t *bssid_addr_to_compare) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
int get_bandwidth_iwinfo(uint8_t *client_addr, float *rx_rate, float *tx_rate) {
|
||||
int get_bandwidth_iwinfo(struct dawn_mac client_addr, float *rx_rate, float *tx_rate) {
|
||||
|
||||
DIR *dirp;
|
||||
struct dirent *entry;
|
||||
|
@ -108,7 +108,7 @@ int get_bandwidth_iwinfo(uint8_t *client_addr, float *rx_rate, float *tx_rate) {
|
|||
return sucess;
|
||||
}
|
||||
|
||||
int get_bandwidth(const char *ifname, uint8_t *client_addr, float *rx_rate, float *tx_rate) {
|
||||
int get_bandwidth(const char *ifname, struct dawn_mac client_addr, float *rx_rate, float *tx_rate) {
|
||||
|
||||
int i, len;
|
||||
char buf[IWINFO_BUFSIZE];
|
||||
|
@ -131,7 +131,7 @@ int get_bandwidth(const char *ifname, uint8_t *client_addr, float *rx_rate, floa
|
|||
for (i = 0; i < len; i += sizeof(struct iwinfo_assoclist_entry)) {
|
||||
e = (struct iwinfo_assoclist_entry *) &buf[i];
|
||||
|
||||
if (mac_is_equal(client_addr, e->mac)) {
|
||||
if (mac_is_equal(client_addr.u8, e->mac)) {
|
||||
*rx_rate = e->rx_rate.rate / 1000;
|
||||
*tx_rate = e->tx_rate.rate / 1000;
|
||||
iwinfo_finish();
|
||||
|
@ -142,7 +142,7 @@ int get_bandwidth(const char *ifname, uint8_t *client_addr, float *rx_rate, floa
|
|||
return 0;
|
||||
}
|
||||
|
||||
int get_rssi_iwinfo(uint8_t *client_addr) {
|
||||
int get_rssi_iwinfo(struct dawn_mac client_addr) {
|
||||
|
||||
DIR *dirp;
|
||||
struct dirent *entry;
|
||||
|
@ -165,7 +165,7 @@ int get_rssi_iwinfo(uint8_t *client_addr) {
|
|||
return rssi;
|
||||
}
|
||||
|
||||
int get_rssi(const char *ifname, uint8_t *client_addr) {
|
||||
int get_rssi(const char *ifname, struct dawn_mac client_addr) {
|
||||
|
||||
int i, len;
|
||||
char buf[IWINFO_BUFSIZE];
|
||||
|
@ -188,7 +188,7 @@ int get_rssi(const char *ifname, uint8_t *client_addr) {
|
|||
for (i = 0; i < len; i += sizeof(struct iwinfo_assoclist_entry)) {
|
||||
e = (struct iwinfo_assoclist_entry *) &buf[i];
|
||||
|
||||
if (mac_is_equal(client_addr, e->mac)) {
|
||||
if (mac_is_equal(client_addr.u8, e->mac)) {
|
||||
iwinfo_finish();
|
||||
return e->signal;
|
||||
}
|
||||
|
@ -198,7 +198,7 @@ int get_rssi(const char *ifname, uint8_t *client_addr) {
|
|||
return INT_MIN;
|
||||
}
|
||||
|
||||
int get_expected_throughput_iwinfo(uint8_t *client_addr) {
|
||||
int get_expected_throughput_iwinfo(struct dawn_mac client_addr) {
|
||||
|
||||
DIR *dirp;
|
||||
struct dirent *entry;
|
||||
|
@ -221,7 +221,7 @@ int get_expected_throughput_iwinfo(uint8_t *client_addr) {
|
|||
return exp_thr;
|
||||
}
|
||||
|
||||
int get_expected_throughput(const char *ifname, uint8_t *client_addr) {
|
||||
int get_expected_throughput(const char *ifname, struct dawn_mac client_addr) {
|
||||
|
||||
int i, len;
|
||||
char buf[IWINFO_BUFSIZE];
|
||||
|
@ -244,7 +244,7 @@ int get_expected_throughput(const char *ifname, uint8_t *client_addr) {
|
|||
for (i = 0; i < len; i += sizeof(struct iwinfo_assoclist_entry)) {
|
||||
e = (struct iwinfo_assoclist_entry *) &buf[i];
|
||||
|
||||
if (mac_is_equal(client_addr, e->mac)) {
|
||||
if (mac_is_equal(client_addr.u8, e->mac)) {
|
||||
iwinfo_finish();
|
||||
return e->thr;
|
||||
}
|
||||
|
@ -254,7 +254,7 @@ int get_expected_throughput(const char *ifname, uint8_t *client_addr) {
|
|||
return INT_MIN;
|
||||
}
|
||||
|
||||
int get_bssid(const char *ifname, uint8_t *bssid_addr) {
|
||||
int get_bssid(const char *ifname, uint8_t bssid_addr[]) {
|
||||
const struct iwinfo_ops *iw;
|
||||
if (strcmp(ifname, "global") == 0)
|
||||
return 0;
|
||||
|
|
|
@ -1,73 +1,52 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "utils.h"
|
||||
#include "mac_utils.h"
|
||||
|
||||
// source: https://elixir.bootlin.com/linux/v4.9/source/lib/hexdump.c#L28
|
||||
// based on: hostapd src/utils/common.c
|
||||
int hwaddr_aton(const char* txt, uint8_t* addr) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ETH_ALEN; i++) {
|
||||
int a, b;
|
||||
int a = 0;
|
||||
char ch = *txt++;
|
||||
|
||||
if ((ch >= '0') && (ch <= '9'))
|
||||
a = ch - '0';
|
||||
else if ((ch >= 'a') && (ch <= 'f'))
|
||||
a = ch - 'a' + 10;
|
||||
else if ((ch >= 'A') && (ch <= 'F'))
|
||||
a = ch - 'A' + 10;
|
||||
else
|
||||
return -1;
|
||||
|
||||
ch = *txt++;
|
||||
a *= 16;
|
||||
|
||||
if ((ch >= '0') && (ch <= '9'))
|
||||
a += ch - '0';
|
||||
else if ((ch >= 'a') && (ch <= 'f'))
|
||||
a += ch - 'a' + 10;
|
||||
else if ((ch >= 'A') && (ch <= 'F'))
|
||||
a += ch - 'A' + 10;
|
||||
else
|
||||
return -1;
|
||||
|
||||
*addr++ = a;
|
||||
|
||||
a = hex_to_dec(*txt++);
|
||||
if (a < 0) return -1;
|
||||
b = hex_to_dec(*txt++);
|
||||
if (b < 0) return -1;
|
||||
*addr++ = (a << 4) | b;
|
||||
// TODO: Should NUL terminator be checked for? Is aa:bb:cc:dd:ee:ff00 valid input?
|
||||
if (i < (ETH_ALEN - 1) && *txt++ != ':') return -1;
|
||||
if (i != (ETH_ALEN - 1) && *txt++ != ':')
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int mac_is_equal(const uint8_t addr1[], const uint8_t addr2[]) {
|
||||
return memcmp(addr1, addr2, ETH_ALEN * sizeof(uint8_t)) == 0;
|
||||
}
|
||||
|
||||
int mac_is_greater(const uint8_t addr1[], const uint8_t addr2[]) {
|
||||
for (int i = 0; i < ETH_ALEN; i++) {
|
||||
if (addr1[i] > addr2[i]) {
|
||||
return 1;
|
||||
}
|
||||
if (addr1[i] < addr2[i]) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// if equal continue...
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
// TODO: Never called in DAWN code. Remove?
|
||||
#if 0
|
||||
/* Convert badly formed MAC addresses with single digit element to double digit
|
||||
** eg 11:2:33:4:55:6 to 11:02:33:04:55:06 */`
|
||||
int convert_mac(char* in, char* out) {
|
||||
int i, j = 0;
|
||||
|
||||
for (i = 0; i < ETH_ALEN; i++) {
|
||||
/* Do we have a single-digit element? */
|
||||
if (in[j + 1] == ':' || in[j + 1] == '\0') {
|
||||
out[3 * i] = '0';
|
||||
out[(3 * i) + 1] = toupper(in[j]);
|
||||
out[(3 * i) + 2] = toupper(in[j + 1]);
|
||||
j += 2;
|
||||
}
|
||||
else {
|
||||
out[3 * i] = toupper(in[j]);
|
||||
out[(3 * i) + 1] = toupper(in[j + 1]);
|
||||
out[(3 * i) + 2] = in[j + 2];
|
||||
j += 3;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
void write_mac_to_file(char* path, uint8_t addr[]) {
|
||||
void write_mac_to_file(char* path, struct dawn_mac addr) {
|
||||
FILE* f = fopen(path, "a");
|
||||
if (f == NULL) {
|
||||
fprintf(stderr, "Error opening mac file!\n");
|
||||
|
@ -75,7 +54,7 @@ void write_mac_to_file(char* path, uint8_t addr[]) {
|
|||
}
|
||||
|
||||
char mac_buf[20];
|
||||
sprintf(mac_buf, MACSTR, MAC2STR(addr));
|
||||
sprintf(mac_buf, MACSTR, MAC2STR(addr.u8));
|
||||
|
||||
fprintf(f, "%s\n", mac_buf);
|
||||
|
||||
|
|
|
@ -134,28 +134,44 @@ int parse_to_hostapd_notify(struct blob_attr* msg, hostapd_notify_entry* notify_
|
|||
|
||||
blobmsg_parse(hostapd_notify_policy, __HOSTAPD_NOTIFY_MAX, tb, blob_data(msg), blob_len(msg));
|
||||
|
||||
if (hwaddr_aton(blobmsg_data(tb[HOSTAPD_NOTIFY_BSSID_ADDR]), notify_req->bssid_addr))
|
||||
if (hwaddr_aton(blobmsg_data(tb[HOSTAPD_NOTIFY_BSSID_ADDR]), notify_req->bssid_addr.u8))
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
|
||||
if (hwaddr_aton(blobmsg_data(tb[HOSTAPD_NOTIFY_CLIENT_ADDR]), notify_req->client_addr))
|
||||
if (hwaddr_aton(blobmsg_data(tb[HOSTAPD_NOTIFY_CLIENT_ADDR]), notify_req->client_addr.u8))
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int parse_to_probe_req(struct blob_attr* msg, probe_entry* prob_req) {
|
||||
probe_entry *parse_to_probe_req(struct blob_attr* msg) {
|
||||
struct blob_attr* tb[__PROB_MAX];
|
||||
|
||||
probe_entry* prob_req = malloc(sizeof(probe_entry));
|
||||
if (prob_req == NULL)
|
||||
{
|
||||
fprintf(stderr, "malloc of probe_entry failed!\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
blobmsg_parse(prob_policy, __PROB_MAX, tb, blob_data(msg), blob_len(msg));
|
||||
|
||||
if (hwaddr_aton(blobmsg_data(tb[PROB_BSSID_ADDR]), prob_req->bssid_addr))
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
if (hwaddr_aton(blobmsg_data(tb[PROB_BSSID_ADDR]), prob_req->bssid_addr.u8))
|
||||
{
|
||||
free(prob_req);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (hwaddr_aton(blobmsg_data(tb[PROB_CLIENT_ADDR]), prob_req->client_addr))
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
if (hwaddr_aton(blobmsg_data(tb[PROB_CLIENT_ADDR]), prob_req->client_addr.u8))
|
||||
{
|
||||
free(prob_req);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (hwaddr_aton(blobmsg_data(tb[PROB_TARGET_ADDR]), prob_req->target_addr))
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
if (hwaddr_aton(blobmsg_data(tb[PROB_TARGET_ADDR]), prob_req->target_addr.u8))
|
||||
{
|
||||
free(prob_req);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (tb[PROB_SIGNAL]) {
|
||||
prob_req->signal = blobmsg_get_u32(tb[PROB_SIGNAL]);
|
||||
|
@ -195,7 +211,7 @@ int parse_to_probe_req(struct blob_attr* msg, probe_entry* prob_req) {
|
|||
prob_req->vht_capabilities = false;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return prob_req;
|
||||
}
|
||||
|
||||
int handle_deauth_req(struct blob_attr* msg) {
|
||||
|
@ -203,12 +219,12 @@ int handle_deauth_req(struct blob_attr* msg) {
|
|||
hostapd_notify_entry notify_req;
|
||||
parse_to_hostapd_notify(msg, ¬ify_req);
|
||||
|
||||
client client_entry;
|
||||
memcpy(client_entry.bssid_addr, notify_req.bssid_addr, sizeof(uint8_t) * ETH_ALEN);
|
||||
memcpy(client_entry.client_addr, notify_req.client_addr, sizeof(uint8_t) * ETH_ALEN);
|
||||
|
||||
pthread_mutex_lock(&client_array_mutex);
|
||||
client_array_delete(client_entry);
|
||||
|
||||
client* client_entry = client_array_get_client(notify_req.client_addr);
|
||||
if (client_entry != NULL)
|
||||
client_array_delete(client_entry, false);
|
||||
|
||||
pthread_mutex_unlock(&client_array_mutex);
|
||||
|
||||
printf("[WC] Deauth: %s\n", "deauth");
|
||||
|
@ -221,12 +237,7 @@ static int handle_set_probe(struct blob_attr* msg) {
|
|||
hostapd_notify_entry notify_req;
|
||||
parse_to_hostapd_notify(msg, ¬ify_req);
|
||||
|
||||
// TODO: Is a client struct needed nere, ir just a uint8[ETH_ALEN]?
|
||||
client client_entry;
|
||||
memcpy(client_entry.bssid_addr, notify_req.bssid_addr, sizeof(uint8_t) * ETH_ALEN);
|
||||
memcpy(client_entry.client_addr, notify_req.client_addr, sizeof(uint8_t) * ETH_ALEN);
|
||||
|
||||
probe_array_set_all_probe_count(client_entry.client_addr, dawn_metric.min_probe_count);
|
||||
probe_array_set_all_probe_count(notify_req.client_addr, dawn_metric.min_probe_count);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -269,10 +280,14 @@ int handle_network_msg(char* msg) {
|
|||
|
||||
// TODO: strncmp() look wrong - should all tests be for n = 5 characters? Shorthand checks?
|
||||
if (strncmp(method, "probe", 5) == 0) {
|
||||
probe_entry entry;
|
||||
if (parse_to_probe_req(data_buf.head, &entry) == 0) {
|
||||
entry.time = time(0);
|
||||
insert_to_array(entry, 0, false, false); // use 802.11k values // TODO: Change 0 to false?
|
||||
probe_entry *entry = parse_to_probe_req(data_buf.head);
|
||||
if (entry != NULL) {
|
||||
entry->time = time(0);
|
||||
if (entry != insert_to_array(entry, false, false, false)) // use 802.11k values
|
||||
{
|
||||
// insert found an existing entry, rather than linking in our new one
|
||||
free(entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (strncmp(method, "clients", 5) == 0) {
|
||||
|
@ -341,71 +356,79 @@ dump_rrm_table(struct blob_attr* head, int len) //modify from examples/blobmsg-e
|
|||
|
||||
// TOOD: Refactor this!
|
||||
static void
|
||||
dump_client(struct blob_attr** tb, uint8_t client_addr[], const char* bssid_addr, uint32_t freq, uint8_t ht_supported,
|
||||
dump_client(struct blob_attr** tb, struct dawn_mac client_addr, const char* bssid_addr, uint32_t freq, uint8_t ht_supported,
|
||||
uint8_t vht_supported) {
|
||||
client client_entry;
|
||||
client *client_entry = malloc(sizeof(struct client_s));
|
||||
if (client_entry == NULL)
|
||||
{
|
||||
// MUSTDO: Error handling?
|
||||
return;
|
||||
}
|
||||
|
||||
hwaddr_aton(bssid_addr, client_entry.bssid_addr);
|
||||
memcpy(client_entry.client_addr, client_addr, ETH_ALEN * sizeof(uint8_t));
|
||||
client_entry.freq = freq;
|
||||
client_entry.ht_supported = ht_supported;
|
||||
client_entry.vht_supported = vht_supported;
|
||||
hwaddr_aton(bssid_addr, client_entry->bssid_addr.u8);
|
||||
client_entry->client_addr = client_addr;
|
||||
client_entry->freq = freq;
|
||||
client_entry->ht_supported = ht_supported;
|
||||
client_entry->vht_supported = vht_supported;
|
||||
|
||||
if (tb[CLIENT_AUTH]) {
|
||||
client_entry.auth = blobmsg_get_u8(tb[CLIENT_AUTH]);
|
||||
client_entry->auth = blobmsg_get_u8(tb[CLIENT_AUTH]);
|
||||
}
|
||||
if (tb[CLIENT_ASSOC]) {
|
||||
client_entry.assoc = blobmsg_get_u8(tb[CLIENT_ASSOC]);
|
||||
client_entry->assoc = blobmsg_get_u8(tb[CLIENT_ASSOC]);
|
||||
}
|
||||
if (tb[CLIENT_AUTHORIZED]) {
|
||||
client_entry.authorized = blobmsg_get_u8(tb[CLIENT_AUTHORIZED]);
|
||||
client_entry->authorized = blobmsg_get_u8(tb[CLIENT_AUTHORIZED]);
|
||||
}
|
||||
if (tb[CLIENT_PREAUTH]) {
|
||||
client_entry.preauth = blobmsg_get_u8(tb[CLIENT_PREAUTH]);
|
||||
client_entry->preauth = blobmsg_get_u8(tb[CLIENT_PREAUTH]);
|
||||
}
|
||||
if (tb[CLIENT_WDS]) {
|
||||
client_entry.wds = blobmsg_get_u8(tb[CLIENT_WDS]);
|
||||
client_entry->wds = blobmsg_get_u8(tb[CLIENT_WDS]);
|
||||
}
|
||||
if (tb[CLIENT_WMM]) {
|
||||
client_entry.wmm = blobmsg_get_u8(tb[CLIENT_WMM]);
|
||||
client_entry->wmm = blobmsg_get_u8(tb[CLIENT_WMM]);
|
||||
}
|
||||
if (tb[CLIENT_HT]) {
|
||||
client_entry.ht = blobmsg_get_u8(tb[CLIENT_HT]);
|
||||
client_entry->ht = blobmsg_get_u8(tb[CLIENT_HT]);
|
||||
}
|
||||
if (tb[CLIENT_VHT]) {
|
||||
client_entry.vht = blobmsg_get_u8(tb[CLIENT_VHT]);
|
||||
client_entry->vht = blobmsg_get_u8(tb[CLIENT_VHT]);
|
||||
}
|
||||
if (tb[CLIENT_WPS]) {
|
||||
client_entry.wps = blobmsg_get_u8(tb[CLIENT_WPS]);
|
||||
client_entry->wps = blobmsg_get_u8(tb[CLIENT_WPS]);
|
||||
}
|
||||
if (tb[CLIENT_MFP]) {
|
||||
client_entry.mfp = blobmsg_get_u8(tb[CLIENT_MFP]);
|
||||
client_entry->mfp = blobmsg_get_u8(tb[CLIENT_MFP]);
|
||||
}
|
||||
if (tb[CLIENT_AID]) {
|
||||
client_entry.aid = blobmsg_get_u32(tb[CLIENT_AID]);
|
||||
client_entry->aid = blobmsg_get_u32(tb[CLIENT_AID]);
|
||||
}
|
||||
/* RRM Caps */
|
||||
if (tb[CLIENT_RRM]) {
|
||||
client_entry.rrm_enabled_capa = dump_rrm_table(blobmsg_data(tb[CLIENT_RRM]),
|
||||
client_entry->rrm_enabled_capa = dump_rrm_table(blobmsg_data(tb[CLIENT_RRM]),
|
||||
blobmsg_data_len(tb[CLIENT_RRM]));// get the first byte from rrm array
|
||||
//ap_entry.ap_weight = blobmsg_get_u32(tb[CLIENT_TABLE_RRM]);
|
||||
}
|
||||
else {
|
||||
client_entry.rrm_enabled_capa = 0;
|
||||
client_entry->rrm_enabled_capa = 0;
|
||||
//ap_entry.ap_weight = 0;
|
||||
}
|
||||
|
||||
// copy signature
|
||||
if (tb[CLIENT_SIGNATURE]) {
|
||||
strncpy(client_entry.signature, blobmsg_data(tb[CLIENT_SIGNATURE]), SIGNATURE_LEN * sizeof(char));
|
||||
strncpy(client_entry->signature, blobmsg_data(tb[CLIENT_SIGNATURE]), SIGNATURE_LEN * sizeof(char));
|
||||
}
|
||||
else
|
||||
{
|
||||
memset(client_entry.signature, 0, 1024);
|
||||
memset(client_entry->signature, 0, SIGNATURE_LEN);
|
||||
}
|
||||
|
||||
client_entry.time = time(0);
|
||||
client_entry->time = time(0);
|
||||
|
||||
pthread_mutex_lock(&client_array_mutex);
|
||||
insert_client_to_array(client_entry);
|
||||
pthread_mutex_unlock(&client_array_mutex);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -424,10 +447,10 @@ dump_client_table(struct blob_attr* head, int len, const char* bssid_addr, uint3
|
|||
//char* str = blobmsg_format_json_indent(attr, true, -1);
|
||||
|
||||
int tmp_int_mac[ETH_ALEN];
|
||||
uint8_t tmp_mac[ETH_ALEN];
|
||||
struct dawn_mac tmp_mac;
|
||||
sscanf((char*)hdr->name, MACSTR, STR2MAC(tmp_int_mac));
|
||||
for (int i = 0; i < ETH_ALEN; ++i)
|
||||
tmp_mac[i] = (uint8_t)tmp_int_mac[i];
|
||||
tmp_mac.u8[i] = (uint8_t)tmp_int_mac[i];
|
||||
|
||||
dump_client(tb, tmp_mac, bssid_addr, freq, ht_supported, vht_supported);
|
||||
station_count++;
|
||||
|
@ -457,88 +480,88 @@ int parse_to_clients(struct blob_attr* msg, int do_kick, uint32_t id) {
|
|||
num_stations = dump_client_table(blobmsg_data(tb[CLIENT_TABLE]), blobmsg_data_len(tb[CLIENT_TABLE]),
|
||||
blobmsg_data(tb[CLIENT_TABLE_BSSID]), blobmsg_get_u32(tb[CLIENT_TABLE_FREQ]),
|
||||
blobmsg_get_u8(tb[CLIENT_TABLE_HT]), blobmsg_get_u8(tb[CLIENT_TABLE_VHT]));
|
||||
ap ap_entry;
|
||||
hwaddr_aton(blobmsg_data(tb[CLIENT_TABLE_BSSID]), ap_entry.bssid_addr);
|
||||
ap_entry.freq = blobmsg_get_u32(tb[CLIENT_TABLE_FREQ]);
|
||||
ap *ap_entry = malloc(sizeof(struct ap_s));
|
||||
hwaddr_aton(blobmsg_data(tb[CLIENT_TABLE_BSSID]), ap_entry->bssid_addr.u8);
|
||||
ap_entry->freq = blobmsg_get_u32(tb[CLIENT_TABLE_FREQ]);
|
||||
|
||||
if (tb[CLIENT_TABLE_HT]) {
|
||||
ap_entry.ht_support = blobmsg_get_u8(tb[CLIENT_TABLE_HT]);
|
||||
ap_entry->ht_support = blobmsg_get_u8(tb[CLIENT_TABLE_HT]);
|
||||
}
|
||||
else {
|
||||
ap_entry.ht_support = false;
|
||||
ap_entry->ht_support = false;
|
||||
}
|
||||
|
||||
if (tb[CLIENT_TABLE_VHT]) {
|
||||
ap_entry.vht_support = blobmsg_get_u8(tb[CLIENT_TABLE_VHT]);
|
||||
ap_entry->vht_support = blobmsg_get_u8(tb[CLIENT_TABLE_VHT]);
|
||||
}
|
||||
else
|
||||
{
|
||||
ap_entry.vht_support = false;
|
||||
ap_entry->vht_support = false;
|
||||
}
|
||||
|
||||
if (tb[CLIENT_TABLE_CHAN_UTIL]) {
|
||||
ap_entry.channel_utilization = blobmsg_get_u32(tb[CLIENT_TABLE_CHAN_UTIL]);
|
||||
ap_entry->channel_utilization = blobmsg_get_u32(tb[CLIENT_TABLE_CHAN_UTIL]);
|
||||
}
|
||||
else // if this is not existing set to 0? //TODO: Consider setting to a value that will not mislead eval_probe_metric(), eg dawn_metric.chan_util_val?
|
||||
{
|
||||
ap_entry.channel_utilization = 0;
|
||||
ap_entry->channel_utilization = 0;
|
||||
}
|
||||
|
||||
if (tb[CLIENT_TABLE_SSID]) {
|
||||
strcpy((char*)ap_entry.ssid, blobmsg_get_string(tb[CLIENT_TABLE_SSID]));
|
||||
strcpy((char*)ap_entry->ssid, blobmsg_get_string(tb[CLIENT_TABLE_SSID]));
|
||||
}
|
||||
|
||||
if (tb[CLIENT_TABLE_COL_DOMAIN]) {
|
||||
ap_entry.collision_domain = blobmsg_get_u32(tb[CLIENT_TABLE_COL_DOMAIN]);
|
||||
ap_entry->collision_domain = blobmsg_get_u32(tb[CLIENT_TABLE_COL_DOMAIN]);
|
||||
}
|
||||
else {
|
||||
ap_entry.collision_domain = -1;
|
||||
ap_entry->collision_domain = -1;
|
||||
}
|
||||
|
||||
if (tb[CLIENT_TABLE_BANDWIDTH]) {
|
||||
ap_entry.bandwidth = blobmsg_get_u32(tb[CLIENT_TABLE_BANDWIDTH]);
|
||||
ap_entry->bandwidth = blobmsg_get_u32(tb[CLIENT_TABLE_BANDWIDTH]);
|
||||
}
|
||||
else {
|
||||
ap_entry.bandwidth = -1;
|
||||
ap_entry->bandwidth = -1;
|
||||
}
|
||||
|
||||
ap_entry.station_count = num_stations;
|
||||
ap_entry->station_count = num_stations;
|
||||
|
||||
if (tb[CLIENT_TABLE_WEIGHT]) {
|
||||
ap_entry.ap_weight = blobmsg_get_u32(tb[CLIENT_TABLE_WEIGHT]);
|
||||
ap_entry->ap_weight = blobmsg_get_u32(tb[CLIENT_TABLE_WEIGHT]);
|
||||
}
|
||||
else {
|
||||
ap_entry.ap_weight = 0;
|
||||
ap_entry->ap_weight = 0;
|
||||
}
|
||||
|
||||
|
||||
if (tb[CLIENT_TABLE_NEIGHBOR]) {
|
||||
strncpy(ap_entry.neighbor_report, blobmsg_get_string(tb[CLIENT_TABLE_NEIGHBOR]), NEIGHBOR_REPORT_LEN);
|
||||
strncpy(ap_entry->neighbor_report, blobmsg_get_string(tb[CLIENT_TABLE_NEIGHBOR]), NEIGHBOR_REPORT_LEN);
|
||||
}
|
||||
else {
|
||||
ap_entry.neighbor_report[0] = '\0';
|
||||
ap_entry->neighbor_report[0] = '\0';
|
||||
}
|
||||
|
||||
if (tb[CLIENT_TABLE_IFACE]) {
|
||||
strncpy(ap_entry.iface, blobmsg_get_string(tb[CLIENT_TABLE_IFACE]), MAX_INTERFACE_NAME);
|
||||
strncpy(ap_entry->iface, blobmsg_get_string(tb[CLIENT_TABLE_IFACE]), MAX_INTERFACE_NAME);
|
||||
}
|
||||
else {
|
||||
ap_entry.iface[0] = '\0';
|
||||
ap_entry->iface[0] = '\0';
|
||||
}
|
||||
|
||||
if (tb[CLIENT_TABLE_HOSTNAME]) {
|
||||
strncpy(ap_entry.hostname, blobmsg_get_string(tb[CLIENT_TABLE_HOSTNAME]), HOST_NAME_MAX);
|
||||
strncpy(ap_entry->hostname, blobmsg_get_string(tb[CLIENT_TABLE_HOSTNAME]), HOST_NAME_MAX);
|
||||
}
|
||||
else {
|
||||
ap_entry.hostname[0] = '\0';
|
||||
ap_entry->hostname[0] = '\0';
|
||||
}
|
||||
|
||||
ap_entry.time = time(0);
|
||||
ap_entry->time = time(0);
|
||||
insert_to_ap_array(ap_entry);
|
||||
|
||||
if (do_kick && dawn_metric.kicking) {
|
||||
update_iw_info(ap_entry.bssid_addr);
|
||||
kick_clients(ap_entry.bssid_addr, id);
|
||||
update_iw_info(ap_entry->bssid_addr);
|
||||
kick_clients(ap_entry, id);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
@ -657,6 +680,7 @@ static int handle_uci_config(struct blob_attr* msg) {
|
|||
struct blob_attr* tb_metric[__UCI_METIC_MAX];
|
||||
blobmsg_parse(uci_metric_policy, __UCI_METIC_MAX, tb_metric, blobmsg_data(tb[UCI_TABLE_METRIC]), blobmsg_len(tb[UCI_TABLE_METRIC]));
|
||||
|
||||
// TODO: Magic number?
|
||||
char cmd_buffer[1024];
|
||||
sprintf(cmd_buffer, "dawn.@metric[0].ht_support=%d", blobmsg_get_u32(tb_metric[UCI_HT_SUPPORT]));
|
||||
uci_set_network(cmd_buffer);
|
||||
|
@ -787,6 +811,3 @@ static int handle_uci_config(struct blob_attr* msg) {
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
459
src/utils/ubus.c
459
src/utils/ubus.c
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include "networksocket.h"
|
||||
#include "tcpsocket.h"
|
||||
#include "mac_utils.h"
|
||||
#include "dawn_uci.h"
|
||||
#include "dawn_iwinfo.h"
|
||||
#include "datastorage.h"
|
||||
|
@ -93,7 +94,7 @@ struct hostapd_sock_entry {
|
|||
uint32_t id;
|
||||
char iface_name[MAX_INTERFACE_NAME];
|
||||
char hostname[HOST_NAME_MAX];
|
||||
uint8_t bssid_addr[ETH_ALEN];
|
||||
struct dawn_mac bssid_addr;
|
||||
char ssid[SSID_MAX_LEN];
|
||||
uint8_t ht_support;
|
||||
uint8_t vht_support;
|
||||
|
@ -114,9 +115,6 @@ struct hostapd_sock_entry {
|
|||
bool subscribed;
|
||||
};
|
||||
|
||||
struct hostapd_sock_entry* hostapd_sock_arr[MAX_HOSTAPD_SOCKETS];
|
||||
int hostapd_sock_last = -1;
|
||||
|
||||
enum {
|
||||
AUTH_BSSID_ADDR,
|
||||
AUTH_CLIENT_ADDR,
|
||||
|
@ -228,7 +226,7 @@ bool subscriber_to_interface(const char *ifname);
|
|||
|
||||
bool subscribe(struct hostapd_sock_entry *hostapd_entry);
|
||||
|
||||
int parse_to_beacon_rep(struct blob_attr *msg, probe_entry *beacon_rep);
|
||||
int parse_to_beacon_rep(struct blob_attr *msg);
|
||||
|
||||
void ubus_set_nr();
|
||||
|
||||
|
@ -241,14 +239,15 @@ subscription_wait(struct ubus_event_handler *handler) {
|
|||
return ubus_register_event_handler(ctx, handler, "ubus.object.add");
|
||||
}
|
||||
|
||||
void blobmsg_add_macaddr(struct blob_buf *buf, const char *name, const uint8_t *addr) {
|
||||
void blobmsg_add_macaddr(struct blob_buf *buf, const char *name, const struct dawn_mac addr) {
|
||||
char *s;
|
||||
|
||||
s = blobmsg_alloc_string_buffer(buf, name, 20);
|
||||
sprintf(s, MACSTR, MAC2STR(addr));
|
||||
sprintf(s, MACSTR, MAC2STR(addr.u8));
|
||||
blobmsg_add_string_buffer(buf);
|
||||
}
|
||||
|
||||
// TODO: Is it worth having this function? Just inline the right bits at each caller?
|
||||
static int decide_function(probe_entry *prob_req, int req_type) {
|
||||
if (mac_in_maclist(prob_req->client_addr)) {
|
||||
return 1;
|
||||
|
@ -270,7 +269,10 @@ static int decide_function(probe_entry *prob_req, int req_type) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (better_ap_available(prob_req->bssid_addr, prob_req->client_addr, NULL, 0)) {
|
||||
// TODO: Bug? This results in copious "Neigbor-Report is NULL" messages!
|
||||
// find own probe entry and calculate score
|
||||
ap* this_ap = ap_array_get_ap(prob_req->bssid_addr);
|
||||
if (this_ap != NULL && better_ap_available(this_ap, prob_req->client_addr, NULL)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -282,13 +284,13 @@ int parse_to_auth_req(struct blob_attr *msg, auth_entry *auth_req) {
|
|||
|
||||
blobmsg_parse(auth_policy, __AUTH_MAX, tb, blob_data(msg), blob_len(msg));
|
||||
|
||||
if (hwaddr_aton(blobmsg_data(tb[AUTH_BSSID_ADDR]), auth_req->bssid_addr))
|
||||
if (hwaddr_aton(blobmsg_data(tb[AUTH_BSSID_ADDR]), auth_req->bssid_addr.u8))
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
|
||||
if (hwaddr_aton(blobmsg_data(tb[AUTH_CLIENT_ADDR]), auth_req->client_addr))
|
||||
if (hwaddr_aton(blobmsg_data(tb[AUTH_CLIENT_ADDR]), auth_req->client_addr.u8))
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
|
||||
if (hwaddr_aton(blobmsg_data(tb[AUTH_TARGET_ADDR]), auth_req->target_addr))
|
||||
if (hwaddr_aton(blobmsg_data(tb[AUTH_TARGET_ADDR]), auth_req->target_addr.u8))
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
|
||||
if (tb[AUTH_SIGNAL]) {
|
||||
|
@ -306,8 +308,10 @@ int parse_to_assoc_req(struct blob_attr *msg, assoc_entry *assoc_req) {
|
|||
return (parse_to_auth_req(msg, assoc_req));
|
||||
}
|
||||
|
||||
int parse_to_beacon_rep(struct blob_attr *msg, probe_entry *beacon_rep) {
|
||||
int parse_to_beacon_rep(struct blob_attr *msg) {
|
||||
struct blob_attr *tb[__BEACON_REP_MAX];
|
||||
struct dawn_mac msg_bssid;
|
||||
struct dawn_mac msg_client;
|
||||
|
||||
blobmsg_parse(beacon_rep_policy, __BEACON_REP_MAX, tb, blob_data(msg), blob_len(msg));
|
||||
|
||||
|
@ -316,41 +320,49 @@ int parse_to_beacon_rep(struct blob_attr *msg, probe_entry *beacon_rep) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (hwaddr_aton(blobmsg_data(tb[BEACON_REP_BSSID]), beacon_rep->bssid_addr))
|
||||
if (hwaddr_aton(blobmsg_data(tb[BEACON_REP_BSSID]), msg_bssid.u8))
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
|
||||
ap check_null = {.bssid_addr = {0, 0, 0, 0, 0, 0}};
|
||||
if(mac_is_equal(check_null.bssid_addr,beacon_rep->bssid_addr))
|
||||
if(mac_is_null(msg_bssid.u8))
|
||||
{
|
||||
fprintf(stderr, "Received NULL MAC! Client is strange!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
ap ap_entry_rep = ap_array_get_ap(beacon_rep->bssid_addr);
|
||||
ap *ap_entry_rep = ap_array_get_ap(msg_bssid);
|
||||
|
||||
// no client from network!!
|
||||
if (!mac_is_equal(ap_entry_rep.bssid_addr, beacon_rep->bssid_addr)) {
|
||||
if (ap_entry_rep == NULL) {
|
||||
return -1; //TODO: Check this
|
||||
}
|
||||
|
||||
if (hwaddr_aton(blobmsg_data(tb[BEACON_REP_ADDR]), beacon_rep->client_addr))
|
||||
if (hwaddr_aton(blobmsg_data(tb[BEACON_REP_ADDR]), msg_client.u8))
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
|
||||
int rcpi = 0;
|
||||
int rsni = 0;
|
||||
rcpi = blobmsg_get_u16(tb[BEACON_REP_RCPI]);
|
||||
rsni = blobmsg_get_u16(tb[BEACON_REP_RSNI]);
|
||||
int rcpi = blobmsg_get_u16(tb[BEACON_REP_RCPI]);
|
||||
int rsni = blobmsg_get_u16(tb[BEACON_REP_RSNI]);
|
||||
|
||||
|
||||
// HACKY WORKAROUND!
|
||||
printf("Try update RCPI and RSNI for beacon report!\n");
|
||||
if(!probe_array_update_rcpi_rsni(beacon_rep->bssid_addr, beacon_rep->client_addr, rcpi, rsni, true))
|
||||
if(!probe_array_update_rcpi_rsni(msg_bssid, msg_client, rcpi, rsni, true))
|
||||
{
|
||||
printf("Beacon: No Probe Entry Existing!\n");
|
||||
|
||||
probe_entry* beacon_rep = malloc(sizeof(probe_entry));
|
||||
if (beacon_rep == NULL)
|
||||
{
|
||||
fprintf(stderr, "malloc of probe_entry failed!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
beacon_rep->next_probe = NULL;
|
||||
beacon_rep->bssid_addr = msg_bssid;
|
||||
beacon_rep->client_addr = msg_client;
|
||||
beacon_rep->counter = dawn_metric.min_probe_count;
|
||||
hwaddr_aton(blobmsg_data(tb[BEACON_REP_ADDR]), beacon_rep->target_addr); // TODO: Should this be ->bssid_addr?
|
||||
hwaddr_aton(blobmsg_data(tb[BEACON_REP_ADDR]), beacon_rep->target_addr.u8); // TODO: What is this for?
|
||||
beacon_rep->signal = 0;
|
||||
beacon_rep->freq = ap_entry_rep.freq;
|
||||
beacon_rep->freq = ap_entry_rep->freq;
|
||||
beacon_rep->rcpi = rcpi;
|
||||
beacon_rep->rsni = rsni;
|
||||
|
||||
|
@ -358,116 +370,141 @@ int parse_to_beacon_rep(struct blob_attr *msg, probe_entry *beacon_rep) {
|
|||
beacon_rep->vht_capabilities = false; // that is very problematic!!!
|
||||
printf("Inserting to array!\n");
|
||||
beacon_rep->time = time(0);
|
||||
insert_to_array(*beacon_rep, false, false, true);
|
||||
ubus_send_probe_via_network(*beacon_rep);
|
||||
|
||||
// TODO: kept original code order here - send on network first to simplify?
|
||||
if (beacon_rep != insert_to_array(beacon_rep, false, false, true)) // use 802.11k values // TODO: Change 0 to false?
|
||||
{
|
||||
// insert found an existing entry, rather than linking in our new one
|
||||
ubus_send_probe_via_network(beacon_rep);
|
||||
free(beacon_rep);
|
||||
}
|
||||
else
|
||||
ubus_send_probe_via_network(beacon_rep);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int handle_auth_req(struct blob_attr* msg) {
|
||||
int ret = WLAN_STATUS_SUCCESS;
|
||||
bool discard_entry = true;
|
||||
|
||||
print_probe_array();
|
||||
auth_entry auth_req;
|
||||
parse_to_auth_req(msg, &auth_req);
|
||||
auth_entry *auth_req = malloc(sizeof(struct auth_entry_s));
|
||||
if (auth_req == NULL)
|
||||
return -1;
|
||||
|
||||
parse_to_auth_req(msg, auth_req);
|
||||
|
||||
printf("Auth entry: ");
|
||||
print_auth_entry(auth_req);
|
||||
|
||||
if (mac_in_maclist(auth_req.client_addr)) {
|
||||
return WLAN_STATUS_SUCCESS;
|
||||
}
|
||||
if (!mac_in_maclist(auth_req->client_addr)) {
|
||||
pthread_mutex_lock(&probe_array_mutex);
|
||||
|
||||
probe_entry tmp = probe_array_get_entry(auth_req.bssid_addr, auth_req.client_addr);
|
||||
probe_entry *tmp = probe_array_get_entry(auth_req->bssid_addr, auth_req->client_addr);
|
||||
|
||||
printf("Entry found\n");
|
||||
print_probe_entry(tmp);
|
||||
pthread_mutex_unlock(&probe_array_mutex);
|
||||
|
||||
// block if entry was not already found in probe database
|
||||
if (!(mac_is_equal(tmp.bssid_addr, auth_req.bssid_addr) && mac_is_equal(tmp.client_addr, auth_req.client_addr))) {
|
||||
printf("Deny authentication!\n");
|
||||
// block if entry was not already found in probe database
|
||||
if (tmp == NULL || !decide_function(tmp, REQ_TYPE_AUTH)) {
|
||||
if (tmp != NULL)
|
||||
{
|
||||
printf("Entry found\n");
|
||||
printf("Deny authentication!\n");
|
||||
}
|
||||
|
||||
if (dawn_metric.use_driver_recog) {
|
||||
auth_req.time = time(0);
|
||||
insert_to_denied_req_array(auth_req, 1);
|
||||
if (dawn_metric.use_driver_recog) {
|
||||
auth_req->time = time(0);
|
||||
if (auth_req == insert_to_denied_req_array(auth_req, 1))
|
||||
discard_entry = false;
|
||||
}
|
||||
ret = dawn_metric.deny_auth_reason;
|
||||
}
|
||||
return dawn_metric.deny_auth_reason;
|
||||
else
|
||||
// maybe send here that the client is connected?
|
||||
printf("Allow authentication!\n");
|
||||
}
|
||||
|
||||
if (!decide_function(&tmp, REQ_TYPE_AUTH)) {
|
||||
printf("Deny authentication\n");
|
||||
if (dawn_metric.use_driver_recog) {
|
||||
auth_req.time = time(0);
|
||||
insert_to_denied_req_array(auth_req, 1);
|
||||
}
|
||||
return dawn_metric.deny_auth_reason;
|
||||
}
|
||||
if (discard_entry)
|
||||
free(auth_req);
|
||||
|
||||
// maybe send here that the client is connected?
|
||||
printf("Allow authentication!\n");
|
||||
return WLAN_STATUS_SUCCESS;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int handle_assoc_req(struct blob_attr *msg) {
|
||||
int ret = WLAN_STATUS_SUCCESS;
|
||||
int discard_entry = true;
|
||||
|
||||
print_probe_array();
|
||||
auth_entry auth_req;
|
||||
parse_to_assoc_req(msg, &auth_req);
|
||||
auth_entry* auth_req = malloc(sizeof(struct auth_entry_s));
|
||||
if (auth_req == NULL)
|
||||
return -1;
|
||||
|
||||
parse_to_assoc_req(msg, auth_req);
|
||||
printf("Association entry: ");
|
||||
print_auth_entry(auth_req);
|
||||
|
||||
if (mac_in_maclist(auth_req.client_addr)) {
|
||||
return WLAN_STATUS_SUCCESS;
|
||||
}
|
||||
if (!mac_in_maclist(auth_req->client_addr)) {
|
||||
pthread_mutex_lock(&probe_array_mutex);
|
||||
|
||||
probe_entry tmp = probe_array_get_entry(auth_req.bssid_addr, auth_req.client_addr);
|
||||
probe_entry *tmp = probe_array_get_entry(auth_req->bssid_addr, auth_req->client_addr);
|
||||
|
||||
printf("Entry found\n");
|
||||
print_probe_entry(tmp);
|
||||
pthread_mutex_unlock(&probe_array_mutex);
|
||||
|
||||
// block if entry was not already found in probe database
|
||||
if (!(mac_is_equal(tmp.bssid_addr, auth_req.bssid_addr) && mac_is_equal(tmp.client_addr, auth_req.client_addr))) {
|
||||
printf("Deny associtation!\n");
|
||||
if (dawn_metric.use_driver_recog) {
|
||||
auth_req.time = time(0);
|
||||
insert_to_denied_req_array(auth_req, 1);
|
||||
// block if entry was not already found in probe database
|
||||
if (tmp == NULL || !decide_function(tmp, REQ_TYPE_ASSOC)) {
|
||||
if (tmp != NULL)
|
||||
{
|
||||
printf("Entry found\n");
|
||||
print_probe_entry(tmp);
|
||||
}
|
||||
|
||||
printf("Deny associtation!\n");
|
||||
if (dawn_metric.use_driver_recog) {
|
||||
auth_req->time = time(0);
|
||||
if (auth_req == insert_to_denied_req_array(auth_req, 1))
|
||||
discard_entry = false;
|
||||
}
|
||||
return dawn_metric.deny_assoc_reason;
|
||||
}
|
||||
return dawn_metric.deny_assoc_reason;
|
||||
else
|
||||
printf("Allow association!\n");
|
||||
}
|
||||
|
||||
if (!decide_function(&tmp, REQ_TYPE_ASSOC)) {
|
||||
printf("Deny association\n");
|
||||
if (dawn_metric.use_driver_recog) {
|
||||
auth_req.time = time(0);
|
||||
insert_to_denied_req_array(auth_req, 1);
|
||||
}
|
||||
return dawn_metric.deny_assoc_reason;
|
||||
}
|
||||
if (discard_entry)
|
||||
free(auth_req);
|
||||
|
||||
printf("Allow association!\n");
|
||||
return WLAN_STATUS_SUCCESS;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int handle_probe_req(struct blob_attr *msg) {
|
||||
probe_entry prob_req;
|
||||
probe_entry tmp_prob_req;
|
||||
// MUSTDO: Untangle malloc() and linking of probe_entry
|
||||
probe_entry* probe_req = parse_to_probe_req(msg);
|
||||
|
||||
if (probe_req != NULL) {
|
||||
probe_req->time = time(0);
|
||||
if (probe_req != insert_to_array(probe_req, true, true, false))
|
||||
{
|
||||
// insert found an existing entry, rather than linking in our new one
|
||||
ubus_send_probe_via_network(probe_req);
|
||||
free(probe_req);
|
||||
}
|
||||
else
|
||||
ubus_send_probe_via_network(probe_req);
|
||||
|
||||
if (parse_to_probe_req(msg, &prob_req) == 0) {
|
||||
prob_req.time = time(0);
|
||||
tmp_prob_req = insert_to_array(prob_req, 1, true, false); // TODO: Chnage 1 to true?
|
||||
ubus_send_probe_via_network(tmp_prob_req);
|
||||
//send_blob_attr_via_network(msg, "probe");
|
||||
|
||||
if (!decide_function(probe_req, REQ_TYPE_PROBE)) {
|
||||
return WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA; // no reason needed...
|
||||
}
|
||||
}
|
||||
|
||||
if (!decide_function(&tmp_prob_req, REQ_TYPE_PROBE)) {
|
||||
return WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA; // no reason needed...
|
||||
}
|
||||
// TODO: Retrun for malloc() failure?
|
||||
return WLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static int handle_beacon_rep(struct blob_attr *msg) {
|
||||
probe_entry beacon_rep;
|
||||
|
||||
if (parse_to_beacon_rep(msg, &beacon_rep) == 0) {
|
||||
if (parse_to_beacon_rep(msg) == 0) {
|
||||
printf("Inserting beacon Report!\n");
|
||||
// insert_to_array(beacon_rep, 1);
|
||||
printf("Sending via network!\n");
|
||||
|
@ -749,7 +786,7 @@ void update_channel_utilization(struct uloop_timeout *t) {
|
|||
uloop_timeout_set(&channel_utilization_timer, timeout_config.update_chan_util * 1000);
|
||||
}
|
||||
|
||||
void ubus_send_beacon_report(uint8_t client[], int id)
|
||||
void ubus_send_beacon_report(struct dawn_mac client, int id)
|
||||
{
|
||||
printf("Crafting Beacon Report\n");
|
||||
int timeout = 1;
|
||||
|
@ -813,7 +850,7 @@ void ubus_set_nr(){
|
|||
}
|
||||
}
|
||||
|
||||
void del_client_all_interfaces(const uint8_t *client_addr, uint32_t reason, uint8_t deauth, uint32_t ban_time) {
|
||||
void del_client_all_interfaces(const struct dawn_mac client_addr, uint32_t reason, uint8_t deauth, uint32_t ban_time) {
|
||||
struct hostapd_sock_entry *sub;
|
||||
|
||||
blob_buf_init(&b, 0);
|
||||
|
@ -831,7 +868,7 @@ void del_client_all_interfaces(const uint8_t *client_addr, uint32_t reason, uint
|
|||
}
|
||||
}
|
||||
|
||||
void del_client_interface(uint32_t id, const uint8_t *client_addr, uint32_t reason, uint8_t deauth, uint32_t ban_time) {
|
||||
void del_client_interface(uint32_t id, const struct dawn_mac client_addr, uint32_t reason, uint8_t deauth, uint32_t ban_time) {
|
||||
struct hostapd_sock_entry *sub;
|
||||
|
||||
blob_buf_init(&b, 0);
|
||||
|
@ -851,7 +888,7 @@ void del_client_interface(uint32_t id, const uint8_t *client_addr, uint32_t reas
|
|||
|
||||
}
|
||||
|
||||
int wnm_disassoc_imminent(uint32_t id, const uint8_t *client_addr, char *dest_ap, uint32_t duration) {
|
||||
int wnm_disassoc_imminent(uint32_t id, const struct dawn_mac client_addr, char *dest_ap, uint32_t duration) {
|
||||
struct hostapd_sock_entry *sub;
|
||||
|
||||
blob_buf_init(&b, 0);
|
||||
|
@ -929,24 +966,24 @@ int ubus_call_umdns() {
|
|||
}
|
||||
|
||||
//TODO: ADD STUFF HERE!!!!
|
||||
int ubus_send_probe_via_network(struct probe_entry_s probe_entry) {
|
||||
int ubus_send_probe_via_network(struct probe_entry_s *probe_entry) { // TODO: probe_entry is also a typedef - fix?
|
||||
blob_buf_init(&b_probe, 0);
|
||||
blobmsg_add_macaddr(&b_probe, "bssid", probe_entry.bssid_addr);
|
||||
blobmsg_add_macaddr(&b_probe, "address", probe_entry.client_addr);
|
||||
blobmsg_add_macaddr(&b_probe, "target", probe_entry.target_addr);
|
||||
blobmsg_add_u32(&b_probe, "signal", probe_entry.signal);
|
||||
blobmsg_add_u32(&b_probe, "freq", probe_entry.freq);
|
||||
blobmsg_add_macaddr(&b_probe, "bssid", probe_entry->bssid_addr);
|
||||
blobmsg_add_macaddr(&b_probe, "address", probe_entry->client_addr);
|
||||
blobmsg_add_macaddr(&b_probe, "target", probe_entry->target_addr);
|
||||
blobmsg_add_u32(&b_probe, "signal", probe_entry->signal);
|
||||
blobmsg_add_u32(&b_probe, "freq", probe_entry->freq);
|
||||
|
||||
blobmsg_add_u32(&b_probe, "rcpi", probe_entry.rcpi);
|
||||
blobmsg_add_u32(&b_probe, "rsni", probe_entry.rsni);
|
||||
blobmsg_add_u32(&b_probe, "rcpi", probe_entry->rcpi);
|
||||
blobmsg_add_u32(&b_probe, "rsni", probe_entry->rsni);
|
||||
|
||||
if (probe_entry.ht_capabilities)
|
||||
if (probe_entry->ht_capabilities)
|
||||
{
|
||||
void *ht_cap = blobmsg_open_table(&b, "ht_capabilities");
|
||||
blobmsg_close_table(&b, ht_cap);
|
||||
}
|
||||
|
||||
if (probe_entry.vht_capabilities) {
|
||||
if (probe_entry->vht_capabilities) {
|
||||
void *vht_cap = blobmsg_open_table(&b, "vht_capabilities");
|
||||
blobmsg_close_table(&b, vht_cap);
|
||||
}
|
||||
|
@ -956,7 +993,7 @@ int ubus_send_probe_via_network(struct probe_entry_s probe_entry) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int send_set_probe(uint8_t client_addr[]) {
|
||||
int send_set_probe(struct dawn_mac client_addr) {
|
||||
blob_buf_init(&b_probe, 0);
|
||||
blobmsg_add_macaddr(&b_probe, "bssid", client_addr);
|
||||
blobmsg_add_macaddr(&b_probe, "address", client_addr);
|
||||
|
@ -1009,8 +1046,8 @@ int parse_add_mac_to_file(struct blob_attr *msg) {
|
|||
__blob_for_each_attr(attr, blobmsg_data(tb[MAC_ADDR]), len)
|
||||
{
|
||||
printf("Iteration through MAC-list\n");
|
||||
uint8_t addr[ETH_ALEN];
|
||||
hwaddr_aton(blobmsg_data(attr), addr);
|
||||
struct dawn_mac addr;
|
||||
hwaddr_aton(blobmsg_data(attr), addr.u8);
|
||||
|
||||
if (insert_to_maclist(addr) == 0) {
|
||||
// TODO: File can grow arbitarily large. Resource consumption risk.
|
||||
|
@ -1033,7 +1070,7 @@ static int add_mac(struct ubus_context *ctx, struct ubus_object *obj,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int send_add_mac(uint8_t *client_addr) {
|
||||
int send_add_mac(struct dawn_mac client_addr) {
|
||||
blob_buf_init(&b, 0);
|
||||
blobmsg_add_macaddr(&b, "addr", client_addr);
|
||||
send_blob_attr_via_network(b.head, "addmac");
|
||||
|
@ -1161,7 +1198,7 @@ bool subscribe(struct hostapd_sock_entry *hostapd_entry) {
|
|||
|
||||
hostapd_entry->subscribed = true;
|
||||
|
||||
get_bssid(hostapd_entry->iface_name, hostapd_entry->bssid_addr);
|
||||
get_bssid(hostapd_entry->iface_name, hostapd_entry->bssid_addr.u8);
|
||||
get_ssid(hostapd_entry->iface_name, hostapd_entry->ssid, (SSID_MAX_LEN) * sizeof(char));
|
||||
|
||||
hostapd_entry->ht_support = (uint8_t) support_ht(hostapd_entry->iface_name);
|
||||
|
@ -1333,77 +1370,94 @@ int build_hearing_map_sort_client(struct blob_buf *b) {
|
|||
void *client_list, *ap_list, *ssid_list;
|
||||
char ap_mac_buf[20];
|
||||
char client_mac_buf[20];
|
||||
bool new_ssid = false;
|
||||
|
||||
blob_buf_init(b, 0);
|
||||
int m;
|
||||
for (m = 0; m <= ap_entry_last; m++) {
|
||||
if (m > 0) {
|
||||
if (strcmp((char *) ap_array[m].ssid, (char *) ap_array[m - 1].ssid) == 0) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
ssid_list = blobmsg_open_table(b, (char *) ap_array[m].ssid);
|
||||
|
||||
int i;
|
||||
for (i = 0; i <= probe_entry_last; i++) {
|
||||
for (ap* m = ap_set; m != NULL; m = m->next_ap) {
|
||||
// MUSTDO: Not sure this has translated to pointers correclty. What are we trying to do with SSID check???
|
||||
// Looks like it is trying to make sure we only handle the first SSID found in the list, ingoring any others?
|
||||
if (new_ssid) {
|
||||
new_ssid = false;
|
||||
continue;
|
||||
}
|
||||
ssid_list = blobmsg_open_table(b, (char*)m->ssid);
|
||||
probe_entry* i = probe_set;
|
||||
while (i != NULL) {
|
||||
/*if(!mac_is_equal(ap_array[m].bssid_addr, probe_array[i].bssid_addr))
|
||||
{
|
||||
continue;
|
||||
}*/
|
||||
|
||||
ap ap_entry_i = ap_array_get_ap(probe_array[i].bssid_addr);
|
||||
// TODO: Can we do this only when the BSSID changes in the probe list
|
||||
ap *ap_entry_i = ap_array_get_ap(i->bssid_addr);
|
||||
|
||||
if (!mac_is_equal(ap_entry_i.bssid_addr, probe_array[i].bssid_addr)) {
|
||||
if (ap_entry_i == NULL) {
|
||||
i = i->next_probe;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (strcmp((char *) ap_entry_i.ssid, (char *) ap_array[m].ssid) != 0) {
|
||||
if (strcmp((char*)ap_entry_i->ssid, (char*)m->ssid) != 0) {
|
||||
i = i->next_probe;
|
||||
continue;
|
||||
}
|
||||
|
||||
int k;
|
||||
sprintf(client_mac_buf, MACSTR, MAC2STR(probe_array[i].client_addr));
|
||||
sprintf(client_mac_buf, MACSTR, MAC2STR(i->client_addr.u8));
|
||||
client_list = blobmsg_open_table(b, client_mac_buf);
|
||||
for (k = i; k <= probe_entry_last; k++) {
|
||||
ap ap_entry = ap_array_get_ap(probe_array[k].bssid_addr);
|
||||
probe_entry *k;
|
||||
for (k = i; k != NULL; k = k->next_probe) {
|
||||
ap *ap_k = ap_array_get_ap(k->bssid_addr);
|
||||
|
||||
if (!mac_is_equal(ap_entry.bssid_addr, probe_array[k].bssid_addr)) {
|
||||
if (ap_k == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (strcmp((char *) ap_entry.ssid, (char *) ap_array[m].ssid) != 0) {
|
||||
if (strcmp((char*)ap_k->ssid, (char*)m->ssid) != 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!mac_is_equal(probe_array[k].client_addr, probe_array[i].client_addr)) {
|
||||
i = k - 1;
|
||||
break;
|
||||
} else if (k == probe_entry_last) {
|
||||
// TODO: Change this so that i and k are single loop?
|
||||
if (!mac_is_equal_bb(k->client_addr, i->client_addr)) {
|
||||
i = k;
|
||||
break;
|
||||
}
|
||||
else if (k->next_probe == NULL) {
|
||||
i = NULL;
|
||||
}
|
||||
else
|
||||
i = i->next_probe;
|
||||
|
||||
sprintf(ap_mac_buf, MACSTR, MAC2STR(probe_array[k].bssid_addr));
|
||||
sprintf(ap_mac_buf, MACSTR, MAC2STR(k->bssid_addr.u8));
|
||||
ap_list = blobmsg_open_table(b, ap_mac_buf);
|
||||
blobmsg_add_u32(b, "signal", probe_array[k].signal);
|
||||
blobmsg_add_u32(b, "rcpi", probe_array[k].rcpi);
|
||||
blobmsg_add_u32(b, "rsni", probe_array[k].rsni);
|
||||
blobmsg_add_u32(b, "freq", probe_array[k].freq);
|
||||
blobmsg_add_u8(b, "ht_capabilities", probe_array[k].ht_capabilities);
|
||||
blobmsg_add_u8(b, "vht_capabilities", probe_array[k].vht_capabilities);
|
||||
blobmsg_add_u32(b, "signal", k->signal);
|
||||
blobmsg_add_u32(b, "rcpi", k->rcpi);
|
||||
blobmsg_add_u32(b, "rsni", k->rsni);
|
||||
blobmsg_add_u32(b, "freq", k->freq);
|
||||
blobmsg_add_u8(b, "ht_capabilities", k->ht_capabilities);
|
||||
blobmsg_add_u8(b, "vht_capabilities", k->vht_capabilities);
|
||||
|
||||
|
||||
// check if ap entry is available
|
||||
blobmsg_add_u32(b, "channel_utilization", ap_entry.channel_utilization);
|
||||
blobmsg_add_u32(b, "num_sta", ap_entry.station_count);
|
||||
blobmsg_add_u8(b, "ht_support", ap_entry.ht_support);
|
||||
blobmsg_add_u8(b, "vht_support", ap_entry.vht_support);
|
||||
blobmsg_add_u32(b, "channel_utilization", ap_k->channel_utilization);
|
||||
blobmsg_add_u32(b, "num_sta", ap_k->station_count);
|
||||
blobmsg_add_u8(b, "ht_support", ap_k->ht_support);
|
||||
blobmsg_add_u8(b, "vht_support", ap_k->vht_support);
|
||||
|
||||
blobmsg_add_u32(b, "score", eval_probe_metric(probe_array[k]));
|
||||
blobmsg_add_u32(b, "score", eval_probe_metric(k, ap_k));
|
||||
blobmsg_close_table(b, ap_list);
|
||||
}
|
||||
blobmsg_close_table(b, client_list);
|
||||
|
||||
if (k == NULL) {
|
||||
i = NULL;
|
||||
}
|
||||
}
|
||||
blobmsg_close_table(b, ssid_list);
|
||||
|
||||
if ((m->next_ap != NULL) && strcmp((char*)m->ssid, (char*)((m->next_ap)->ssid)) == 0)
|
||||
{
|
||||
new_ssid = true;
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&probe_array_mutex);
|
||||
return 0;
|
||||
|
@ -1416,36 +1470,27 @@ int build_network_overview(struct blob_buf *b) {
|
|||
struct hostapd_sock_entry *sub;
|
||||
|
||||
blob_buf_init(b, 0);
|
||||
int m;
|
||||
for (m = 0; m <= ap_entry_last; m++) {
|
||||
bool add_ssid = false;
|
||||
bool close_ssid = false;
|
||||
|
||||
if (m == 0 || strcmp((char *) ap_array[m].ssid, (char *) ap_array[m - 1].ssid) != 0) {
|
||||
add_ssid = true;
|
||||
}
|
||||
|
||||
if (m >= ap_entry_last || strcmp((char *) ap_array[m].ssid, (char *) ap_array[m + 1].ssid) != 0) {
|
||||
close_ssid = true;
|
||||
}
|
||||
|
||||
bool add_ssid = true;
|
||||
for (ap* m = ap_set; m != NULL; m = m->next_ap) {
|
||||
if(add_ssid)
|
||||
{
|
||||
ssid_list = blobmsg_open_table(b, (char *) ap_array[m].ssid);
|
||||
ssid_list = blobmsg_open_table(b, (char *) m->ssid);
|
||||
add_ssid = false;
|
||||
}
|
||||
sprintf(ap_mac_buf, MACSTR, MAC2STR(ap_array[m].bssid_addr));
|
||||
sprintf(ap_mac_buf, MACSTR, MAC2STR(m->bssid_addr.u8));
|
||||
ap_list = blobmsg_open_table(b, ap_mac_buf);
|
||||
|
||||
blobmsg_add_u32(b, "freq", ap_array[m].freq);
|
||||
blobmsg_add_u32(b, "channel_utilization", ap_array[m].channel_utilization);
|
||||
blobmsg_add_u32(b, "num_sta", ap_array[m].station_count);
|
||||
blobmsg_add_u8(b, "ht_support", ap_array[m].ht_support);
|
||||
blobmsg_add_u8(b, "vht_support", ap_array[m].vht_support);
|
||||
blobmsg_add_u32(b, "freq", m->freq);
|
||||
blobmsg_add_u32(b, "channel_utilization", m->channel_utilization);
|
||||
blobmsg_add_u32(b, "num_sta", m->station_count);
|
||||
blobmsg_add_u8(b, "ht_support", m->ht_support);
|
||||
blobmsg_add_u8(b, "vht_support", m->vht_support);
|
||||
|
||||
bool local_ap = false;
|
||||
list_for_each_entry(sub, &hostapd_sock_list, list)
|
||||
{
|
||||
if (mac_is_equal(ap_array[m].bssid_addr, sub->bssid_addr)) {
|
||||
if (mac_is_equal_bb(m->bssid_addr, sub->bssid_addr)) {
|
||||
local_ap = true;
|
||||
}
|
||||
}
|
||||
|
@ -1453,78 +1498,87 @@ int build_network_overview(struct blob_buf *b) {
|
|||
|
||||
char *nr;
|
||||
nr = blobmsg_alloc_string_buffer(b, "neighbor_report", NEIGHBOR_REPORT_LEN);
|
||||
sprintf(nr, "%s", ap_array[m].neighbor_report); // TODO: Why not strcpy()
|
||||
sprintf(nr, "%s", m->neighbor_report); // TODO: Why not strcpy()
|
||||
blobmsg_add_string_buffer(b);
|
||||
|
||||
char *iface;
|
||||
iface = blobmsg_alloc_string_buffer(b, "iface", MAX_INTERFACE_NAME);
|
||||
sprintf(iface, "%s", ap_array[m].iface);
|
||||
sprintf(iface, "%s", m->iface);
|
||||
blobmsg_add_string_buffer(b);
|
||||
|
||||
char *hostname;
|
||||
hostname = blobmsg_alloc_string_buffer(b, "hostname", HOST_NAME_MAX);
|
||||
sprintf(hostname, "%s", ap_array[m].hostname);
|
||||
sprintf(hostname, "%s", m->hostname);
|
||||
blobmsg_add_string_buffer(b);
|
||||
|
||||
int k;
|
||||
for (k = 0; k <= client_entry_last; k++) {
|
||||
// TODO: Could optimise this by exporting search func, but not a core process
|
||||
client *k = client_set_bc;
|
||||
while (k != NULL) {
|
||||
|
||||
if (mac_is_equal(ap_array[m].bssid_addr, client_array[k].bssid_addr)) {
|
||||
sprintf(client_mac_buf, MACSTR, MAC2STR(client_array[k].client_addr));
|
||||
if (mac_is_equal_bb(m->bssid_addr, k->bssid_addr)) {
|
||||
sprintf(client_mac_buf, MACSTR, MAC2STR(k->client_addr.u8));
|
||||
client_list = blobmsg_open_table(b, client_mac_buf);
|
||||
|
||||
if(strlen(client_array[k].signature) != 0)
|
||||
if(strlen(k->signature) != 0)
|
||||
{
|
||||
char *s;
|
||||
s = blobmsg_alloc_string_buffer(b, "signature", 1024);
|
||||
sprintf(s, "%s", client_array[k].signature);
|
||||
sprintf(s, "%s", k->signature);
|
||||
blobmsg_add_string_buffer(b);
|
||||
}
|
||||
blobmsg_add_u8(b, "ht", client_array[k].ht);
|
||||
blobmsg_add_u8(b, "vht", client_array[k].vht);
|
||||
blobmsg_add_u32(b, "collision_count", ap_get_collision_count(ap_array[m].collision_domain));
|
||||
blobmsg_add_u8(b, "ht", k->ht);
|
||||
blobmsg_add_u8(b, "vht", k->vht);
|
||||
blobmsg_add_u32(b, "collision_count", ap_get_collision_count(m->collision_domain));
|
||||
|
||||
int n;
|
||||
for(n = 0; n <= probe_entry_last; n++)
|
||||
{
|
||||
if (mac_is_equal(client_array[k].client_addr, probe_array[n].client_addr) &&
|
||||
mac_is_equal(client_array[k].bssid_addr, probe_array[n].bssid_addr)) {
|
||||
blobmsg_add_u32(b, "signal", probe_array[n].signal);
|
||||
break;
|
||||
}
|
||||
pthread_mutex_lock(&probe_array_mutex);
|
||||
|
||||
probe_entry* n = probe_array_get_entry(k->bssid_addr, k->client_addr);
|
||||
pthread_mutex_unlock(&probe_array_mutex);
|
||||
|
||||
if (n != NULL) {
|
||||
blobmsg_add_u32(b, "signal", n->signal);
|
||||
}
|
||||
blobmsg_close_table(b, client_list);
|
||||
}
|
||||
k = k->next_entry_bc;
|
||||
}
|
||||
blobmsg_close_table(b, ap_list);
|
||||
if(close_ssid)
|
||||
{
|
||||
|
||||
// Rely on short-circuit of OR to protect NULL reference in 2nd clause
|
||||
if ((m->next_ap == NULL) || strcmp((char*)m->ssid, (char*)(m->next_ap)->ssid) != 0) {
|
||||
blobmsg_close_table(b, ssid_list);
|
||||
}
|
||||
|
||||
if ((m->next_ap != NULL) && strcmp((char*)m->ssid, (char*)(m->next_ap)->ssid) != 0) {
|
||||
add_ssid = true;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ap_get_nr(struct blob_buf *b_local, uint8_t own_bssid_addr[]) {
|
||||
|
||||
// TODO: Does all APs constitute neighbor report? How about using list of AP connected
|
||||
// clients can also see (from probe_set) to give more (physically) local set?
|
||||
int ap_get_nr(struct blob_buf *b_local, struct dawn_mac own_bssid_addr) {
|
||||
|
||||
pthread_mutex_lock(&ap_array_mutex);
|
||||
int i;
|
||||
ap *i;
|
||||
|
||||
void* nbs = blobmsg_open_array(b_local, "list");
|
||||
|
||||
for (i = 0; i <= ap_entry_last; i++) {
|
||||
if (mac_is_equal(own_bssid_addr, ap_array[i].bssid_addr)) {
|
||||
for (i = ap_set; i != NULL; i = i->next_ap) {
|
||||
if (mac_is_equal_bb(own_bssid_addr, i->bssid_addr)) {
|
||||
continue; //TODO: Skip own entry?!
|
||||
}
|
||||
|
||||
void* nr_entry = blobmsg_open_array(b_local, NULL);
|
||||
|
||||
char mac_buf[20];
|
||||
sprintf(mac_buf, MACSTRLOWER, MAC2STR(ap_array[i].bssid_addr));
|
||||
sprintf(mac_buf, MACSTRLOWER, MAC2STR(i->bssid_addr.u8));
|
||||
blobmsg_add_string(b_local, NULL, mac_buf);
|
||||
|
||||
blobmsg_add_string(b_local, NULL, (char *) ap_array[i].ssid);
|
||||
blobmsg_add_string(b_local, NULL, ap_array[i].neighbor_report);
|
||||
blobmsg_add_string(b_local, NULL, (char *) i->ssid);
|
||||
blobmsg_add_string(b_local, NULL, i->neighbor_report);
|
||||
blobmsg_close_array(b_local, nr_entry);
|
||||
|
||||
}
|
||||
|
@ -1584,31 +1638,32 @@ void denied_req_array_cb(struct uloop_timeout* t) {
|
|||
|
||||
time_t current_time = time(0);
|
||||
|
||||
int i = 0;
|
||||
while (i <= denied_req_last) {
|
||||
auth_entry** i = &denied_req_set;
|
||||
while (*i != NULL) {
|
||||
// check counter
|
||||
|
||||
//check timer
|
||||
if (denied_req_array[i].time < current_time - timeout_config.denied_req_threshold) {
|
||||
if ((*i)->time < (current_time - timeout_config.denied_req_threshold)) {
|
||||
|
||||
// client is not connected for a given time threshold!
|
||||
if (!is_connected_somehwere(denied_req_array[i].client_addr)) {
|
||||
if (!is_connected_somehwere((*i)->client_addr)) {
|
||||
printf("Client has probably a bad driver!\n");
|
||||
|
||||
// problem that somehow station will land into this list
|
||||
// maybe delete again?
|
||||
if (insert_to_maclist(denied_req_array[i].client_addr) == 0) {
|
||||
send_add_mac(denied_req_array[i].client_addr);
|
||||
if (insert_to_maclist((*i)->client_addr) == 0) {
|
||||
send_add_mac((*i)->client_addr);
|
||||
// TODO: File can grow arbitarily large. Resource consumption risk.
|
||||
// TODO: Consolidate use of file across source: shared resource for name, single point of access?
|
||||
write_mac_to_file("/tmp/dawn_mac_list", denied_req_array[i].client_addr);
|
||||
write_mac_to_file("/tmp/dawn_mac_list", (*i)->client_addr);
|
||||
}
|
||||
}
|
||||
denied_req_array_delete(denied_req_array[i]);
|
||||
// TODO: Add unlink function to save rescan to find element
|
||||
denied_req_array_delete(*i);
|
||||
}
|
||||
else
|
||||
{
|
||||
i++;
|
||||
i = &((*i)->next_auth);
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&denied_array_mutex);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include "utils.h"
|
||||
|
||||
int string_is_greater(uint8_t *str, uint8_t *str_2) {
|
||||
int string_is_greater(char *str, char *str_2) {
|
||||
|
||||
int length_1 = strlen((char *) str);
|
||||
int length_2 = strlen((char *) str_2);
|
||||
|
@ -20,11 +20,3 @@ int string_is_greater(uint8_t *str, uint8_t *str_2) {
|
|||
}
|
||||
return length_1 > length_2;
|
||||
}
|
||||
|
||||
// source: https://elixir.bootlin.com/linux/v4.9/source/lib/hexdump.c#L28
|
||||
int hex_to_dec(char ch) {
|
||||
if ((ch >= '0') && (ch <= '9')) return ch - '0';
|
||||
ch = tolower(ch);
|
||||
if ((ch >= 'a') && (ch <= 'f')) return ch - 'a' + 10;
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue