diff --git a/files/dawn.config b/files/dawn.config index 31379f1..0721aa1 100644 --- a/files/dawn.config +++ b/files/dawn.config @@ -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' diff --git a/src/include/datastorage.h b/src/include/datastorage.h index f5221f1..a4f576d 100644 --- a/src/include/datastorage.h +++ b/src/include/datastorage.h @@ -22,6 +22,7 @@ struct probe_metric_s { int no_vht_support; int rssi; int freq; + int chan_util; }; #define SORT_NUM 5 diff --git a/src/storage/datastorage.c b/src/storage/datastorage.c index e7c94fa..e599c11 100644 --- a/src/storage/datastorage.c +++ b/src/storage/datastorage.c @@ -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; diff --git a/src/utils/dawn_uci.c b/src/utils/dawn_uci.c index 1127a12..277a862 100644 --- a/src/utils/dawn_uci.c +++ b/src/utils/dawn_uci.c @@ -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); diff --git a/src/utils/ubus.c b/src/utils/ubus.c index d8edd34..92f2872 100644 --- a/src/utils/ubus.c +++ b/src/utils/ubus.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;