Add insert and delete function

This commit is contained in:
PolynomialDivision 2017-07-15 23:20:16 +02:00
parent ecb6c6b80f
commit 454e44cf5d
4 changed files with 167 additions and 11 deletions

View file

@ -17,7 +17,7 @@
#define TIME_THRESHOLD 60 // every minute
// Probe entrys
typedef struct {
typedef struct probe_entry_s {
uint8_t bssid_addr[ETH_ALEN];
uint8_t client_addr[ETH_ALEN];
uint8_t target_addr[ETH_ALEN];
@ -27,6 +27,39 @@ typedef struct {
int counter;
} probe_entry;
// Array
#define ARRAY_LEN 1000
struct probe_entry_s probe_array[ARRAY_LEN];
void insert_to_array(probe_entry entry, int inc_counter);
void probe_array_insert(probe_entry entry);
probe_entry* probe_array_delete(probe_entry entry);
void print_array();
pthread_mutex_t probe_array_mutex;
// List
typedef struct node {
probe_entry data;