mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-03-09 15:40:12 +00:00
datastorage: refactor to support scalability testing
This commit is contained in:
parent
3a6ef89998
commit
50d347c233
11 changed files with 609 additions and 378 deletions
|
@ -8,7 +8,6 @@
|
|||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <libubox/blobmsg_json.h>
|
||||
|
||||
#ifndef ETH_ALEN
|
||||
#define ETH_ALEN 6
|
||||
|
@ -19,7 +18,7 @@
|
|||
// ---------------- Defines -------------------
|
||||
#define MAC_LIST_LENGTH 100
|
||||
|
||||
// ---------------- Structs ----------------
|
||||
// ---------------- Global variables ----------------
|
||||
uint8_t mac_list[MAC_LIST_LENGTH][ETH_ALEN];
|
||||
|
||||
// ---------------- Functions ----------
|
||||
|
@ -29,11 +28,12 @@ int insert_to_maclist(uint8_t mac[]);
|
|||
|
||||
int mac_in_maclist(uint8_t mac[]);
|
||||
|
||||
int mac_is_equal(uint8_t addr1[], uint8_t addr2[]);
|
||||
|
||||
int mac_is_greater(uint8_t addr1[], uint8_t addr2[]);
|
||||
|
||||
/* Metric */
|
||||
|
||||
struct probe_metric_s dawn_metric;
|
||||
|
||||
// ---------------- Structs ----------------
|
||||
struct probe_metric_s {
|
||||
int ap_weight;
|
||||
|
@ -96,12 +96,12 @@ struct network_config_s {
|
|||
int bandwidth;
|
||||
};
|
||||
|
||||
// ---------------- Global variables ----------------
|
||||
struct network_config_s network_config;
|
||||
struct time_config_s timeout_config;
|
||||
|
||||
// ---------------- Global variables ----------------
|
||||
struct probe_metric_s dawn_metric;
|
||||
|
||||
extern int probe_entry_last;
|
||||
|
||||
/* Probe, Auth, Assoc */
|
||||
|
||||
|
@ -140,20 +140,20 @@ typedef struct hostapd_notify_entry_s {
|
|||
|
||||
typedef struct auth_entry_s assoc_entry;
|
||||
|
||||
#define DENY_REQ_ARRAY_LEN 100
|
||||
struct auth_entry_s denied_req_array[DENY_REQ_ARRAY_LEN];
|
||||
pthread_mutex_t denied_array_mutex;
|
||||
|
||||
auth_entry insert_to_denied_req_array(auth_entry entry, int inc_counter);
|
||||
|
||||
// ---------------- Defines ----------------
|
||||
#define DENY_REQ_ARRAY_LEN 100
|
||||
#define PROBE_ARRAY_LEN 1000
|
||||
|
||||
#define SSID_MAX_LEN 32
|
||||
#define NEIGHBOR_REPORT_LEN 200
|
||||
|
||||
// ---------------- Global variables ----------------
|
||||
struct auth_entry_s denied_req_array[DENY_REQ_ARRAY_LEN];
|
||||
extern int denied_req_last;
|
||||
pthread_mutex_t denied_array_mutex;
|
||||
|
||||
struct probe_entry_s probe_array[PROBE_ARRAY_LEN];
|
||||
extern int probe_entry_last;
|
||||
pthread_mutex_t probe_array_mutex;
|
||||
|
||||
// ---------------- Functions ----------------
|
||||
|
@ -165,17 +165,22 @@ 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);
|
||||
|
||||
void print_auth_entry(auth_entry entry);
|
||||
int eval_probe_metric(struct probe_entry_s probe_entry);
|
||||
|
||||
void uloop_add_data_cbs();
|
||||
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 */
|
||||
|
||||
// blobmsg_alloc_string_buffer(&b, "signature", 1024);
|
||||
#define SIGNATURE_LEN 1024
|
||||
|
||||
// ---------------- Structs ----------------
|
||||
|
@ -225,14 +230,13 @@ typedef struct ap_s {
|
|||
#define TIME_THRESHOLD_CLIENT_KICK 60
|
||||
|
||||
// ---------------- Global variables ----------------
|
||||
struct client_s client_array[ARRAY_CLIENT_LEN];
|
||||
pthread_mutex_t client_array_mutex;
|
||||
struct ap_s ap_array[ARRAY_AP_LEN];
|
||||
extern int ap_entry_last;
|
||||
pthread_mutex_t ap_array_mutex;
|
||||
|
||||
int mac_is_equal(uint8_t addr1[], uint8_t addr2[]);
|
||||
|
||||
int mac_is_greater(uint8_t addr1[], uint8_t addr2[]);
|
||||
struct client_s client_array[ARRAY_CLIENT_LEN];
|
||||
extern int client_entry_last;
|
||||
pthread_mutex_t client_array_mutex;
|
||||
|
||||
// ---------------- Functions ----------------
|
||||
|
||||
|
@ -240,6 +244,8 @@ int probe_array_update_rssi(uint8_t bssid_addr[], uint8_t client_addr[], uint32_
|
|||
|
||||
int probe_array_update_rcpi_rsni(uint8_t bssid_addr[], uint8_t 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 kick_clients(uint8_t bssid[], uint32_t id);
|
||||
|
@ -252,24 +258,22 @@ void print_client_array();
|
|||
|
||||
void print_client_entry(client entry);
|
||||
|
||||
int is_connected_somehwere(uint8_t client_addr[]);
|
||||
|
||||
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[]);
|
||||
|
||||
int build_hearing_map_sort_client(struct blob_buf *b);
|
||||
|
||||
int build_network_overview(struct blob_buf *b);
|
||||
|
||||
int probe_array_set_all_probe_count(uint8_t client_addr[], uint32_t probe_count);
|
||||
|
||||
int ap_get_collision_count(int col_domain);
|
||||
|
||||
void send_beacon_reports(uint8_t bssid[], int id);
|
||||
|
||||
int ap_get_nr(struct blob_buf *b, uint8_t own_bssid_addr[]);
|
||||
|
||||
/* Utils */
|
||||
|
||||
// ---------------- Defines -------------------
|
||||
|
@ -281,4 +285,4 @@ char *sort_string;
|
|||
// ---------------- Functions -------------------
|
||||
int better_ap_available(uint8_t bssid_addr[], uint8_t client_addr[], char* neighbor_report, int automatic_kick);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue