mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-03-09 15:40:12 +00:00
Format code
This commit is contained in:
parent
88ca87c654
commit
7ba1f28f6b
9 changed files with 77 additions and 73 deletions
|
|
@ -4,7 +4,11 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
void gcrypt_init();
|
||||
|
||||
void gcrypt_set_key_and_iv(char *key, char *iv);
|
||||
char* gcrypt_encrypt_msg(char* msg, size_t msg_length);
|
||||
char* gcrypt_decrypt_msg(char* msg, size_t msg_length);
|
||||
|
||||
char *gcrypt_encrypt_msg(char *msg, size_t msg_length);
|
||||
|
||||
char *gcrypt_decrypt_msg(char *msg, size_t msg_length);
|
||||
|
||||
#endif //DAWN_CRYPTO_H
|
||||
|
|
|
|||
|
|
@ -15,8 +15,7 @@
|
|||
|
||||
struct probe_metric_s dawn_metric;
|
||||
|
||||
struct probe_metric_s
|
||||
{
|
||||
struct probe_metric_s {
|
||||
int ht_support;
|
||||
int vht_support;
|
||||
int n_ht_support;
|
||||
|
|
|
|||
|
|
@ -6,8 +6,11 @@
|
|||
pthread_mutex_t send_mutex;
|
||||
|
||||
int init_socket_runopts(char *_ip, char *_port, int broadcast_socket);
|
||||
|
||||
int send_string(char *msg);
|
||||
|
||||
int send_string_enc(char *msg);
|
||||
|
||||
void close_socket();
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -7,14 +7,20 @@
|
|||
#define MIN_PROBE_REQ 5 // TODO: Parse from config file...
|
||||
|
||||
int dawn_init_ubus(const char *ubus_socket, char *hostapd_dir);
|
||||
|
||||
int parse_to_probe_req(struct blob_attr *msg, probe_entry *prob_req);
|
||||
|
||||
int parse_to_clients(struct blob_attr *msg, int do_kick, uint32_t id);
|
||||
|
||||
void del_client_interface(uint32_t id, const uint8_t *client_addr, uint32_t reason, uint8_t deauth, uint32_t ban_time);
|
||||
|
||||
void del_client_all_interfaces(const uint8_t *client_addr, uint32_t reason, uint8_t deauth, uint32_t ban_time);
|
||||
|
||||
void *update_clients_thread(void *arg);
|
||||
|
||||
void *kick_clients_thread(void *arg);
|
||||
|
||||
char* hostapd_dir_glob;
|
||||
char *hostapd_dir_glob;
|
||||
|
||||
/* Metrik
|
||||
|
||||
|
|
|
|||
|
|
@ -6,27 +6,27 @@
|
|||
|
||||
|
||||
static int hex_to_bin(char ch) {
|
||||
if ((ch >= '0') && (ch <= '9')) return ch - '0';
|
||||
ch = tolower(ch);
|
||||
if ((ch >= 'a') && (ch <= 'f')) return ch - 'a' + 10;
|
||||
return -1;
|
||||
if ((ch >= '0') && (ch <= '9')) return ch - '0';
|
||||
ch = tolower(ch);
|
||||
if ((ch >= 'a') && (ch <= 'f')) return ch - 'a' + 10;
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int hwaddr_aton(const char *txt, uint8_t *addr) {
|
||||
int i;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ETH_ALEN; i++) {
|
||||
int a, b;
|
||||
for (i = 0; i < ETH_ALEN; i++) {
|
||||
int a, b;
|
||||
|
||||
a = hex_to_bin(*txt++);
|
||||
if (a < 0) return -1;
|
||||
b = hex_to_bin(*txt++);
|
||||
if (b < 0) return -1;
|
||||
*addr++ = (a << 4) | b;
|
||||
if (i < 5 && *txt++ != ':') return -1;
|
||||
}
|
||||
a = hex_to_bin(*txt++);
|
||||
if (a < 0) return -1;
|
||||
b = hex_to_bin(*txt++);
|
||||
if (b < 0) return -1;
|
||||
*addr++ = (a << 4) | b;
|
||||
if (i < 5 && *txt++ != ':') return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue