ubus/datastorage: cleanup

- Remove the linked list of rejected auth / assoc as it was not used for any decision making
- Rename auth_req to client_req as it is also used by association requests

[cleanup commit message]
Signed-off-by: Nick Hainke <vincent@systemli.org>
This commit is contained in:
Ian Clowes 2022-01-31 10:50:39 +00:00 committed by Nick Hainke
parent 8bae43c811
commit 160ccf8917
6 changed files with 20 additions and 307 deletions

View file

@ -174,8 +174,8 @@ typedef struct probe_entry_s {
// struct probe_entry_s* entry;
//};
typedef struct auth_entry_s {
struct auth_entry_s* next_auth;
typedef struct client_req_entry_s {
// struct client_req_entry_s* next_deny;
struct dawn_mac bssid_addr;
struct dawn_mac client_addr;
struct dawn_mac target_addr; // TODO: Never evaluated?
@ -183,15 +183,13 @@ typedef struct auth_entry_s {
uint32_t freq; // TODO: Never evaluated?
time_t time; // Never used for removal?
int counter;
} auth_entry;
} client_req_entry;
typedef struct hostapd_notify_entry_s {
struct dawn_mac bssid_addr;
struct dawn_mac client_addr;
} hostapd_notify_entry;
typedef struct auth_entry_s assoc_entry;
// ---------------- Defines ----------------
#define NEIGHBOR_REPORT_LEN 200
@ -206,8 +204,6 @@ typedef struct auth_entry_s assoc_entry;
#define NR_PHY 24
// ---------------- Global variables ----------------
extern struct auth_entry_s *denied_req_set;
extern pthread_mutex_t denied_array_mutex;
extern struct probe_entry_s *probe_set;
extern pthread_mutex_t probe_array_mutex;
@ -299,13 +295,7 @@ void print_probe_entry(int level, 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, time_t expiry);
void remove_old_denied_req_entries(time_t current_time, long long int threshold, int logmac);
void print_auth_entry(int level, auth_entry *entry);
void print_client_req_entry(int level, client_req_entry *entry);
// ---------------- Functions ----------------

View file

@ -11,6 +11,5 @@ void ap_array_insert(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

View file

@ -38,20 +38,12 @@ void start_tcp_con_update();
int ubus_call_umdns();
/**
* Parse to authentication request.
* Parse to client request.
* @param msg
* @param auth_req
* @return
*/
int parse_to_auth_req(struct blob_attr *msg, auth_entry *auth_req);
/**
* Parse to association request.
* @param msg
* @param assoc_req
* @return
*/
int parse_to_assoc_req(struct blob_attr *msg, assoc_entry *assoc_req);
int parse_to_client_req(struct blob_attr *msg, client_req_entry *client_req);
/**
* Kick client from all hostapd interfaces.