mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-03-09 15:40:12 +00:00
utils/storage: cleanup
- New skipping linked list structure - possible bug in previous version - Adjust some function names to better reflect what actually happens - Remove redundant configurable sort elements - Remove probe structure SSID field which is not set via BEACON, so is unreliable - Adjust way the different fields from BEACON and PROBE reports are handled / merged - Made client / BSSID paramater order consistent for probe / beacon functions to help avoid cut/ paste bugs - Add RRM capability, RCPI and RSNI to client in hearing map (which is a summary of probe / beacon entries) [cleanup commit message] Signed-off-by: Nick Hainke <vincent@systemli.org>
This commit is contained in:
parent
6bf3cd7754
commit
5d7f99dded
9 changed files with 369 additions and 420 deletions
|
|
@ -153,7 +153,7 @@ typedef struct probe_entry_s {
|
|||
struct probe_entry_s* next_probe_skip;
|
||||
struct dawn_mac client_addr;
|
||||
struct dawn_mac bssid_addr;
|
||||
uint8_t ssid[SSID_MAX_LEN + 1]; // parse_to_beacon_rep()
|
||||
//uint8_t ssid[SSID_MAX_LEN + 1]; // parse_to_beacon_rep()
|
||||
struct dawn_mac target_addr; // TODO: Never evaluated?
|
||||
uint32_t signal; // eval_probe_metric()
|
||||
uint32_t freq; // eval_probe_metric()
|
||||
|
|
@ -204,8 +204,16 @@ typedef struct hostapd_notify_entry_s {
|
|||
#define NR_PHY 24
|
||||
|
||||
// ---------------- Global variables ----------------
|
||||
struct probe_head_s {
|
||||
int node_count;
|
||||
int skip_count;
|
||||
int skip_ratio;
|
||||
|
||||
extern struct probe_entry_s *probe_set;
|
||||
struct probe_entry_s* first_probe;
|
||||
struct probe_entry_s* first_probe_skip;
|
||||
};
|
||||
|
||||
extern struct probe_head_s probe_set;
|
||||
extern pthread_mutex_t probe_array_mutex;
|
||||
|
||||
/* AP, Client */
|
||||
|
|
@ -283,11 +291,13 @@ 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, time_t expiry);
|
||||
probe_entry *insert_to_probe_array(probe_entry *entry, int is_local, int save_80211k, int is_beacon, time_t expiry);
|
||||
|
||||
int probe_array_delete(probe_entry *entry);
|
||||
int probe_array_delete(struct dawn_mac client_addr, struct dawn_mac bssid_addr);
|
||||
|
||||
probe_entry *probe_array_get_entry(struct dawn_mac bssid_addr, struct dawn_mac client_addr);
|
||||
probe_entry* probe_array_find_first_entry(struct dawn_mac client_mac, struct dawn_mac bssid_mac, int do_bssid);
|
||||
|
||||
probe_entry *probe_array_get_entry(struct dawn_mac client_addr, struct dawn_mac bssid_addr);
|
||||
|
||||
void remove_old_probe_entries(time_t current_time, long long int threshold);
|
||||
|
||||
|
|
@ -301,9 +311,9 @@ void print_client_req_entry(int level, client_req_entry *entry);
|
|||
|
||||
// ---------------- Functions ----------------
|
||||
|
||||
int probe_array_update_rssi(struct dawn_mac bssid_addr, struct dawn_mac client_addr, uint32_t rssi, int send_network);
|
||||
probe_entry* probe_array_update_rssi(struct dawn_mac client_addr, struct dawn_mac bssid_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);
|
||||
probe_entry* probe_array_update_rcpi_rsni(struct dawn_mac client_addr, struct dawn_mac bssid_addr, uint32_t rcpi, uint32_t rsni, int send_network);
|
||||
|
||||
void remove_old_client_entries(time_t current_time, long long int threshold);
|
||||
|
||||
|
|
@ -313,6 +323,8 @@ int kick_clients(struct dawn_mac bssid, uint32_t id);
|
|||
|
||||
void update_iw_info(struct dawn_mac bssid);
|
||||
|
||||
client** client_find_first_bc_entry(struct dawn_mac bssid_mac, struct dawn_mac client_mac, int do_client);
|
||||
|
||||
void client_array_insert(client *entry, client ** insert_pos);
|
||||
|
||||
client *client_array_get_client(const struct dawn_mac client_addr);
|
||||
|
|
@ -336,14 +348,9 @@ ap *ap_array_get_ap(struct dawn_mac bssid_mac);
|
|||
int probe_array_set_all_probe_count(struct dawn_mac client_addr, uint32_t probe_count);
|
||||
|
||||
//int ap_get_collision_count(int col_domain);
|
||||
|
||||
void send_beacon_reports(ap *a, int id);
|
||||
void send_beacon_requests(ap *a, int id);
|
||||
|
||||
/* Utils */
|
||||
// deprecate use of this - it makes things slow
|
||||
#define SORT_LENGTH 5
|
||||
extern char sort_string[];
|
||||
|
||||
struct kicking_nr {
|
||||
char nr[NEIGHBOR_REPORT_LEN];
|
||||
int score;
|
||||
|
|
|
|||
|
|
@ -46,12 +46,6 @@ struct network_config_s uci_get_dawn_network();
|
|||
*/
|
||||
bool uci_get_dawn_hostapd_dir();
|
||||
|
||||
/**
|
||||
* Function that returns the sort order.
|
||||
* @return the sort order.
|
||||
*/
|
||||
bool uci_get_dawn_sort_order();
|
||||
|
||||
int uci_set_network(char* uci_cmd);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ void del_client_all_interfaces(const struct dawn_mac client_addr, uint32_t reaso
|
|||
*/
|
||||
void update_hostapd_sockets(struct uloop_timeout *t);
|
||||
|
||||
void ubus_send_beacon_report(client *c, ap *a, int id);
|
||||
void ubus_send_beacon_request(client *c, ap *a, int id);
|
||||
|
||||
void uloop_add_data_cbs();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue