mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-03-09 15:40:12 +00:00
Merge pull request #26 from berlin-open-wireless-lab/feature/deny_probe_requests
Feature/deny probe requests
This commit is contained in:
commit
79b2b029d3
4 changed files with 20 additions and 4 deletions
|
@ -35,3 +35,4 @@ config settings metric
|
|||
option min_probe_count '4'
|
||||
option bandwith_threshold '6'
|
||||
option use_station_count '1'
|
||||
option eval_probe_req '1'
|
|
@ -34,6 +34,7 @@ struct probe_metric_s {
|
|||
int min_probe_count;
|
||||
int bandwith_threshold;
|
||||
int use_station_count;
|
||||
int eval_probe_req;
|
||||
};
|
||||
|
||||
struct time_config_s {
|
||||
|
|
|
@ -217,6 +217,14 @@ struct probe_metric_s uci_get_dawn_metric() {
|
|||
if (ptr.o->type == UCI_TYPE_STRING)
|
||||
ret.use_station_count = atoi(ptr.o->v.string);
|
||||
|
||||
char tmp_eval_probe_req[] = "dawn.metric.eval_probe_req";
|
||||
if (uci_lookup_ptr(c, &ptr, tmp_eval_probe_req, 1) != UCI_OK) {
|
||||
uci_perror(c, "uci_get_daw_metric Error");
|
||||
return ret;
|
||||
}
|
||||
if (ptr.o->type == UCI_TYPE_STRING)
|
||||
ret.eval_probe_req = atoi(ptr.o->v.string);
|
||||
|
||||
printf("Loaded metric: %d\n", ret.min_probe_count);
|
||||
|
||||
uci_free_context(c);
|
||||
|
|
|
@ -337,7 +337,7 @@ static int handle_probe_req(struct blob_attr *msg) {
|
|||
parse_to_probe_req(msg, &prob_req);
|
||||
//insert_to_list(prob_req, 1);
|
||||
//probe_entry tmp_probe =
|
||||
insert_to_array(prob_req, 1);
|
||||
probe_entry tmp_prob_req = insert_to_array(prob_req, 1);
|
||||
|
||||
|
||||
// send probe via network
|
||||
|
@ -348,12 +348,18 @@ static int handle_probe_req(struct blob_attr *msg) {
|
|||
printf("[WC] Hostapd-Probe: %s : %s\n", "probe", str);
|
||||
|
||||
//print_probe_array();
|
||||
/*
|
||||
|
||||
// deny access
|
||||
if (!decide_function(&tmp_probe)) {
|
||||
|
||||
if(!dawn_metric.eval_probe_req)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!decide_function(&tmp_prob_req)) {
|
||||
//printf("MAC WILL BE DECLINED!!!\n");
|
||||
return UBUS_STATUS_UNKNOWN_ERROR;
|
||||
}*/
|
||||
}
|
||||
//printf("MAC WILL BE ACCEPDTED!!!\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue