datastorage: fixes to linked list handling

general: fixed whitespace and typos
memory audit: on by default in build
memory audit: enhanced audit info
ubus: refactor denied_req expiry to assist datastorage testing
datastorage: fixed performance bug in handling of linked list entry expiry
datastorage: fixed SEGV in skip list handling
test_storage: added linked list memory allocation stress tests
This commit is contained in:
Ian Clowes 2020-08-05 11:03:06 +01:00 committed by Polynomialdivision
parent 34da5328f6
commit 117a340b9d
11 changed files with 395 additions and 275 deletions

View file

@ -250,7 +250,7 @@ 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);
probe_entry *insert_to_array(probe_entry *entry, int inc_counter, int save_80211k, int is_beacon, time_t expiry);
int probe_array_delete(probe_entry *entry);
@ -266,7 +266,9 @@ 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);
auth_entry *insert_to_denied_req_array(auth_entry*entry, int inc_counter, time_t expiry);
void remove_old_denied_req_entries(time_t current_time, long long int threshold, int logmac);
void print_auth_entry(auth_entry *entry);
@ -278,7 +280,7 @@ int probe_array_update_rcpi_rsni(struct dawn_mac bssid_addr, struct dawn_mac cli
void remove_old_client_entries(time_t current_time, long long int threshold);
client *insert_client_to_array(client *entry);
client *insert_client_to_array(client *entry, time_t expiry);
int kick_clients(ap* kicking_ap, uint32_t id);
@ -296,7 +298,7 @@ void print_client_entry(client *entry);
int is_connected_somehwere(struct dawn_mac client_addr);
ap *insert_to_ap_array(ap *entry);
ap *insert_to_ap_array(ap *entry, time_t expiry);
void remove_old_ap_entries(time_t current_time, long long int threshold);

View file

@ -5,15 +5,15 @@
enum dawn_memop
{
DAWN_MALLOC,
DAWN_CALLOC,
DAWN_REALLOC,
DAWN_MEMREG,
DAWN_MEMUNREG,
DAWN_FREE
DAWN_MALLOC,
DAWN_CALLOC,
DAWN_REALLOC,
DAWN_MEMREG,
DAWN_MEMUNREG,
DAWN_FREE
};
//#define DAWN_MEMORY_AUDITING
#define DAWN_MEMORY_AUDITING
#ifdef DAWN_MEMORY_AUDITING
#define dawn_malloc(size) dawn_memory_alloc(DAWN_MALLOC, __FILE__, __LINE__, 1, size, NULL)

View file

@ -68,13 +68,6 @@ void del_client_all_interfaces(const struct dawn_mac client_addr, uint32_t reaso
*/
void update_hostapd_sockets(struct uloop_timeout *t);
/**
* Send control message to all hosts to add the mac to a don't control list.
* @param client_addr
* @return
*/
int send_add_mac(struct dawn_mac client_addr);
void ubus_send_beacon_report(struct dawn_mac client, int id);
void uloop_add_data_cbs();
@ -148,4 +141,11 @@ int send_set_probe(struct dawn_mac client_addr);
*/
int wnm_disassoc_imminent(uint32_t id, const struct dawn_mac client_addr, char* dest_ap, uint32_t duration);
/**
* Send control message to all hosts to add the mac to a don't control list.
* @param client_addr
* @return
*/
int send_add_mac(struct dawn_mac client_addr);
#endif