use uci context

This commit is contained in:
PolynomialDivision 2017-12-22 10:56:03 +01:00
parent 7e46afec1c
commit 8eb7d68e65
12 changed files with 183 additions and 320 deletions

View file

@ -9,7 +9,7 @@ char *unbase_64(unsigned char *input, int length);
void gcrypt_init();
void gcrypt_set_key_and_iv(char *key, char *iv);
void gcrypt_set_key_and_iv(const char *key, const char *iv);
//char *gcrypt_encrypt_msg(char *msg, size_t msg_length);
char *gcrypt_encrypt_msg(char *msg, size_t msg_length, int *out_length);

View file

@ -45,6 +45,15 @@ struct time_config_s {
time_t update_hostapd;
};
struct network_config_s {
const char* broadcast_ip;
int broadcast_port;
const char* multicast;
const char* shared_key;
const char* iv;
int bool_multicast;
};
struct time_config_s timeout_config;
// ---------------- Global variables ----------------
@ -173,7 +182,7 @@ ap ap_array_get_ap(uint8_t bssid_addr[]);
#define TIME_THRESHOLD 120 // every minute
// ---------------- Global variables ----------------
char sort_string[SORT_NUM];
char* sort_string;
// ---------------- Functions -------------------
int mac_is_equal(uint8_t addr1[], uint8_t addr2[]);

View file

@ -5,4 +5,14 @@ struct probe_metric_s uci_get_dawn_metric();
struct time_config_s uci_get_time_config();
struct network_config_s uci_get_dawn_network();
const char* uci_get_dawn_hostapd_dir();
const char* uci_get_dawn_sort_order();
int uci_init();
int uci_clear();
#endif //DAWN_UCI_H_H

View file

@ -5,7 +5,7 @@
pthread_mutex_t send_mutex;
int init_socket_runopts(char *_ip, char *_port, int _multicast_socket);
int init_socket_runopts(const char *_ip, int _port, int _multicast_socket);
int send_string(char *msg);

View file

@ -8,7 +8,7 @@
#define MIN_PROBE_REQ 2 // TODO: Parse from config file...
int dawn_init_ubus(const char *ubus_socket, char *hostapd_dir);
int dawn_init_ubus(const char *ubus_socket, const char *hostapd_dir);
int parse_to_probe_req(struct blob_attr *msg, probe_entry *prob_req);
@ -24,7 +24,7 @@ void del_client_all_interfaces(const uint8_t *client_addr, uint32_t reason, uint
void *update_clients_thread(void *arg);
char *hostapd_dir_glob;
const char *hostapd_dir_glob;
int ubus_call_umdns();