mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-03-09 15:40:12 +00:00
Fix loading metric
This commit is contained in:
parent
9280a2db85
commit
43f8d8af12
5 changed files with 15 additions and 15 deletions
|
@ -11,8 +11,11 @@ config settings hostapd
|
|||
option hostapd_dir '/var/run/hostapd'
|
||||
|
||||
config settings metric
|
||||
option ht_support '10'
|
||||
option vht_support '10'
|
||||
option rssi '10'
|
||||
option freq '10'
|
||||
option ht_support '10'
|
||||
option vht_support '10'
|
||||
option no_ht_support '0'
|
||||
option no_vht_support '0'
|
||||
option rssi '10'
|
||||
option freq '50'
|
||||
option chan_util '0'
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ struct probe_metric_s {
|
|||
int no_vht_support;
|
||||
int rssi;
|
||||
int freq;
|
||||
int chan_util;
|
||||
};
|
||||
|
||||
#define SORT_NUM 5
|
||||
|
|
|
@ -48,7 +48,6 @@ int eval_probe_metric(struct probe_entry_s probe_entry) {
|
|||
score += !probe_entry.ht_support && !ap_entry.ht ? dawn_metric.no_ht_support : 0;
|
||||
score += probe_entry.vht_support ? dawn_metric.vht_support : 0;
|
||||
score += !probe_entry.vht_support && !ap_entry.vht ? dawn_metric.no_vht_support : 0;
|
||||
|
||||
}
|
||||
|
||||
//score += probe_entry.ht_support ? dawn_metric.ht_support : 0;
|
||||
|
|
|
@ -47,7 +47,7 @@ struct probe_metric_s uci_get_dawn_metric()
|
|||
ret.no_ht_support = atoi(ptr.o->v.string);
|
||||
|
||||
char tmp_no_vht_support[] = "dawn.metric.no_vht_support";
|
||||
if (uci_lookup_ptr (c, &ptr, tmp_vht_support, 1) != UCI_OK) {
|
||||
if (uci_lookup_ptr (c, &ptr, tmp_no_vht_support, 1) != UCI_OK) {
|
||||
uci_perror(c, "uci_get_daw_metric Error");
|
||||
return ret;
|
||||
}
|
||||
|
@ -70,14 +70,13 @@ struct probe_metric_s uci_get_dawn_metric()
|
|||
if(ptr.o->type == UCI_TYPE_STRING)
|
||||
ret.freq = atoi(ptr.o->v.string);
|
||||
|
||||
char tmp_freq[] = "dawn.metric.chan_util";
|
||||
if (uci_lookup_ptr (c, &ptr, tmp_freq, 1) != UCI_OK) {
|
||||
char tmp_util[] = "dawn.metric.chan_util";
|
||||
if (uci_lookup_ptr (c, &ptr, tmp_util, 1) != UCI_OK) {
|
||||
uci_perror(c, "uci_get_daw_metric Error");
|
||||
return ret;
|
||||
}
|
||||
if(ptr.o->type == UCI_TYPE_STRING)
|
||||
ret.freq = atoi(ptr.o->v.string);
|
||||
|
||||
ret.chan_util = atoi(ptr.o->v.string);
|
||||
|
||||
uci_free_context (c);
|
||||
|
||||
|
|
|
@ -140,10 +140,10 @@ static int decide_function(probe_entry *prob_req) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*if(better_ap_available(prob_req->bssid_addr, prob_req->client_addr))
|
||||
if(better_ap_available(prob_req->bssid_addr, prob_req->client_addr))
|
||||
{
|
||||
return 0;
|
||||
}*/
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ int parse_to_probe_req(struct blob_attr *msg, probe_entry *prob_req) {
|
|||
|
||||
static int handle_auth_req(struct blob_attr *msg) {
|
||||
|
||||
print_array();
|
||||
//print_array();
|
||||
auth_entry auth_req;
|
||||
parse_to_auth_req(msg, &auth_req);
|
||||
printf("AUTH Entry: ");
|
||||
|
@ -472,8 +472,6 @@ int parse_to_clients(struct blob_attr *msg, int do_kick, uint32_t id) {
|
|||
|
||||
static void ubus_get_clients_cb(struct ubus_request *req, int type, struct blob_attr *msg) {
|
||||
|
||||
//printf("[GET CLIENTS] Peer: %08x \n", req->peer);
|
||||
|
||||
if (!msg)
|
||||
return;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue