Skip to content
Snippets Groups Projects
Commit 4ae4fdaf authored by Anjan Chanda's avatar Anjan Chanda
Browse files

read controller uci config

parent 3a55c1f4
Branches
No related tags found
No related merge requests found
......@@ -20,8 +20,8 @@ CNTLR_OBJS = \
core/cntlr_ubus.o \
core/cntlr.o \
core/cntlr_map.o \
core/config.o \
core/main.o
#core/config.o \
LIBS = -lubus -lubox -ljson-c -lblobmsg_json -luci -pthread
LIBS += -rdynamic -ldl
......
config wificntlr
option enabled '1'
list registrar '5 2' #bands on which wps registrar supported
option registrar '5 2' #bands on which wps registrar supported
config fh-credentials
option band '5'
......
This diff is collapsed.
......@@ -11,6 +11,7 @@
#define CONFIG_H
// TODO: use wifi.h definitions??
enum wifi_band {
WIFI_BAND_NONE,
WIFI_BAND_2 = 1 << 0, /**< 0x1 for 2.4Ghz band. */
......@@ -19,13 +20,28 @@ enum wifi_band {
WIFI_BAND_6 = 1 << 3, /**< 0x8 for 6Ghz */
};
// TODO: use wifi.h definitions??
enum wifi_security {
WIFI_SECURITY_NONE,
WIFI_SECURITY_WEP64,
WIFI_SECURITY_WEP128,
WIFI_SECURITY_WPAPSK,
WIFI_SECURITY_WPA2PSK,
WIFI_SECURITY_WPA3PSK,
WIFI_SECURITY_WPA3PSK_T,
WIFI_SECURITY_WPA,
WIFI_SECURITY_WPA2,
WIFI_SECURITY_WPA3,
};
struct iface_credential {
uint8_t band;
enum wifi_band band;
enum wifi_security sec;
uint8_t key[64];
uint8_t bssid[6];
uint8_t ssid[33];
char encryption[64];
uint8_t key[64];
uint16_t vlan_id;
uint16_t vlanid;
};
enum agent_steer_policy {
......@@ -35,7 +51,7 @@ enum agent_steer_policy {
};
struct agent_policy {
uint8_t alid[6]; /* ieee1905 AL macaddress */
uint8_t id[6]; /* ieee1905 AL macaddress */
enum agent_steer_policy policy; /* 0, 1, 2 - see MultiAP specs */
uint8_t util_threshold; /* utilization as in BSS load IE */
uint8_t rcpi_threshold; /* 0 - 220 */
......@@ -52,35 +68,29 @@ struct agent_policy {
bool disallow_bsta_p2; /* disallow profile2 bSTA link */
struct list_head list; /* link to next policy */
/* custom policies follow */
struct list_head steer_exlist; /* exclude stas from steering */
struct list_head btmsteer_exlist; /* exclude stas from BTM steering */
};
struct controller_config {
bool enabled;
uint8_t wps_supp_bands; /* WPS registrar supported bands */
struct iface_credential fh5;
struct iface_credential fh2;
struct iface_credential bk5;
struct iface_credential bk2;
struct list_head policylist; /* list of struct agent_policy */
bool has_registrar_5g;
bool has_registrar_2g;
int num_fh;
int num_bk;
struct iface_credential fh[2];
struct iface_credential bk[2];
struct agent_policy apolicy;
struct list_head policylist; /* custom list of agent_policy */
};
struct controller;
int cntlr_config_reload(const char *confname, struct controller_config *cfg);
int cntlr_config_reload(struct controller_config *cfg);
int cntlr_config_defaults(struct controller *c, struct controller_config *cfg);
void cntlr_config_dump(struct controller_config *cfg);
int config_update(const char *confname, struct controller_config *cfg,
const char *section, const char *option, int add,
void *value, int len);
int config_update2(const char *confname, struct controller_config *cfg,
const char *section_type,
const char *match_option, const char *match_option_value,
const char *option, int add, void *value, int len);
#endif
......@@ -20,6 +20,14 @@
#define hwaddr_hash(a) (a[0] ^ a[1] ^ a[2] ^ a[3] ^ a[4] ^ a[5])
#ifndef MACFMT
#define MACFMT "%02x:%02x:%02x:%02x:%02x:%02x"
#endif
#ifndef MAC2STR
#define MAC2STR(_m) (_m)[0], (_m)[1], (_m)[2], (_m)[3], (_m)[4], (_m)[5]
#endif
bool match_oui0(unsigned char *oui, unsigned char *hwaddr, int ouis);
unsigned char *hwaddr_aton(const char *macstr, unsigned char *mac);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment