Dump Client Json String

This commit is contained in:
PolynomialDivision 2017-07-16 14:32:58 +02:00
parent ae6965e5d9
commit fa132d4acc
4 changed files with 161 additions and 50 deletions

View file

@ -27,49 +27,43 @@ typedef struct probe_entry_s {
int counter;
} probe_entry;
/*
static const struct {
const char *name;
uint32_t flag;
} sta_flags[] = {
{ "auth", WLAN_STA_AUTH },
{ "assoc", WLAN_STA_ASSOC },
{ "authorized", WLAN_STA_AUTHORIZED },
{ "preauth", WLAN_STA_PREAUTH },
{ "wds", WLAN_STA_WDS },
{ "wmm", WLAN_STA_WMM },
{ "ht", WLAN_STA_HT },
{ "vht", WLAN_STA_VHT },
{ "wps", WLAN_STA_WPS },
{ "mfp", WLAN_STA_MFP },
};
*/
typedef struct {
uint32_t freq;
} client_request;
typedef struct {
uint8_t mac[ETH_ALEN];
uint32_t freq;
uint32_t auth;
uint32_t assoc;
uint32_t authorized;
uint32_t preauth;
uint32_t wds;
uint32_t wmm;
uint32_t ht;
uint32_t vht;
uint32_t wps;
uint32_t mfp;
typedef struct client_s {
uint8_t bssid_addr[ETH_ALEN];
uint8_t client_addr[ETH_ALEN];
uint8_t freq;
uint8_t auth;
uint8_t assoc;
uint8_t authorized;
uint8_t preauth;
uint8_t wds;
uint8_t wmm;
uint8_t ht;
uint8_t vht;
uint8_t wps;
uint8_t mfp;
uint32_t aid;
} client;
// Array
#define ARRAY_CLIENT_LEN 1000
struct probe_entry_s client_array[ARRAY_CLIENT_LEN];
pthread_mutex_t client_array_mutex;
void client_array_insert(client entry);
client* client_array_delete(client entry);
#define ARRAY_LEN 1000
struct probe_entry_s probe_array[ARRAY_LEN];
pthread_mutex_t probe_array_mutex;
void insert_to_array(probe_entry entry, int inc_counter);
void probe_array_insert(probe_entry entry);
@ -77,9 +71,6 @@ probe_entry* probe_array_delete(probe_entry entry);
void print_array();
void *remove_array_thread(void *arg);
pthread_mutex_t probe_array_mutex;

View file

@ -2,6 +2,8 @@
#define __DAWN_UTILS_H
#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
#define STR2MAC(a) &(a)[0], &(a)[1], &(a)[2], &(a)[3], &(a)[4], &(a)[5]
static int hex_to_bin(char ch) {
if ((ch >= '0') && (ch <= '9')) return ch - '0';