mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-03-09 15:40:12 +00:00
add collision domain
This commit is contained in:
parent
008187d3c9
commit
1240f57299
3 changed files with 19 additions and 1 deletions
|
@ -81,6 +81,7 @@ struct network_config_s {
|
||||||
const char *iv;
|
const char *iv;
|
||||||
int bool_multicast;
|
int bool_multicast;
|
||||||
int use_symm_enc;
|
int use_symm_enc;
|
||||||
|
int collision_domain;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct network_config_s network_config;
|
struct network_config_s network_config;
|
||||||
|
@ -186,7 +187,7 @@ typedef struct ap_s {
|
||||||
time_t time;
|
time_t time;
|
||||||
uint32_t station_count;
|
uint32_t station_count;
|
||||||
uint8_t ssid[SSID_MAX_LEN];
|
uint8_t ssid[SSID_MAX_LEN];
|
||||||
uint32_t collision_domain;
|
int collision_domain;
|
||||||
} ap;
|
} ap;
|
||||||
|
|
||||||
// ---------------- Defines ----------------
|
// ---------------- Defines ----------------
|
||||||
|
|
|
@ -98,6 +98,7 @@ struct network_config_s uci_get_dawn_network() {
|
||||||
ret.network_option = uci_lookup_option_int(uci_ctx, s, "network_option");
|
ret.network_option = uci_lookup_option_int(uci_ctx, s, "network_option");
|
||||||
ret.tcp_port = uci_lookup_option_int(uci_ctx, s, "tcp_port");
|
ret.tcp_port = uci_lookup_option_int(uci_ctx, s, "tcp_port");
|
||||||
ret.use_symm_enc = uci_lookup_option_int(uci_ctx, s, "use_symm_enc");
|
ret.use_symm_enc = uci_lookup_option_int(uci_ctx, s, "use_symm_enc");
|
||||||
|
ret.collision_domain = uci_lookup_option_int(uci_ctx, s, "collision_domain");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,7 @@ static struct blob_buf b_send_network;
|
||||||
static struct blob_buf network_buf;
|
static struct blob_buf network_buf;
|
||||||
static struct blob_buf data_buf;
|
static struct blob_buf data_buf;
|
||||||
static struct blob_buf b_probe;
|
static struct blob_buf b_probe;
|
||||||
|
static struct blob_buf b_domain;
|
||||||
|
|
||||||
void update_clients(struct uloop_timeout *t);
|
void update_clients(struct uloop_timeout *t);
|
||||||
|
|
||||||
|
@ -855,6 +856,12 @@ int parse_to_clients(struct blob_attr *msg, int do_kick, uint32_t id) {
|
||||||
ap_entry.channel_utilization = blobmsg_get_u32(tb[CLIENT_TABLE_CHAN_UTIL]);
|
ap_entry.channel_utilization = blobmsg_get_u32(tb[CLIENT_TABLE_CHAN_UTIL]);
|
||||||
strcpy((char *) ap_entry.ssid, blobmsg_get_string(tb[CLIENT_TABLE_SSID]));
|
strcpy((char *) ap_entry.ssid, blobmsg_get_string(tb[CLIENT_TABLE_SSID]));
|
||||||
|
|
||||||
|
// ap is own ap
|
||||||
|
if(id != 0)
|
||||||
|
{
|
||||||
|
ap_entry.collision_domain = network_config.collision_domain;
|
||||||
|
}
|
||||||
|
|
||||||
if (tb[CLIENT_TABLE_NUM_STA]) {
|
if (tb[CLIENT_TABLE_NUM_STA]) {
|
||||||
ap_entry.station_count = blobmsg_get_u32(tb[CLIENT_TABLE_NUM_STA]);
|
ap_entry.station_count = blobmsg_get_u32(tb[CLIENT_TABLE_NUM_STA]);
|
||||||
} else {
|
} else {
|
||||||
|
@ -875,6 +882,15 @@ static void ubus_get_clients_cb(struct ubus_request *req, int type, struct blob_
|
||||||
if (!msg)
|
if (!msg)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
char* data_str = blobmsg_format_json(msg, 1);
|
||||||
|
blob_buf_init(&b_domain, 0);
|
||||||
|
blobmsg_add_json_from_string(&b_domain, data_str);
|
||||||
|
blobmsg_add_u32(&b_domain, "collision_domain", network_config.collision_domain);
|
||||||
|
char* collision_string = blobmsg_format_json(b_domain.head, 1);
|
||||||
|
printf("ADDED COLLISION DOMAIN: %s\n", collision_string);
|
||||||
|
|
||||||
send_blob_attr_via_network(msg, "clients");
|
send_blob_attr_via_network(msg, "clients");
|
||||||
parse_to_clients(msg, 1, req->peer);
|
parse_to_clients(msg, 1, req->peer);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue