mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-03-09 15:40:12 +00:00
add option for driver recognition
This commit is contained in:
parent
e083ae8e9d
commit
3d38b28500
5 changed files with 20 additions and 5 deletions
|
@ -44,3 +44,4 @@ config metric
|
||||||
option eval_assoc_req '1' # just deny assocs...
|
option eval_assoc_req '1' # just deny assocs...
|
||||||
option deny_auth_reason '1' # unspecified
|
option deny_auth_reason '1' # unspecified
|
||||||
option deny_assoc_reason '17' # assoc rejected can't handle new station
|
option deny_assoc_reason '17' # assoc rejected can't handle new station
|
||||||
|
option use_driver_recog '1'
|
||||||
|
|
|
@ -58,6 +58,7 @@ struct probe_metric_s {
|
||||||
int eval_assoc_req;
|
int eval_assoc_req;
|
||||||
int deny_auth_reason;
|
int deny_auth_reason;
|
||||||
int deny_assoc_reason;
|
int deny_assoc_reason;
|
||||||
|
int use_driver_recog;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct time_config_s {
|
struct time_config_s {
|
||||||
|
|
|
@ -866,8 +866,11 @@ void uloop_add_data_cbs() {
|
||||||
uloop_timeout_add(&probe_timeout);
|
uloop_timeout_add(&probe_timeout);
|
||||||
uloop_timeout_add(&client_timeout);
|
uloop_timeout_add(&client_timeout);
|
||||||
uloop_timeout_add(&ap_timeout);
|
uloop_timeout_add(&ap_timeout);
|
||||||
|
|
||||||
|
if(dawn_metric.use_driver_recog){
|
||||||
uloop_timeout_add(&denied_req_timeout);
|
uloop_timeout_add(&denied_req_timeout);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void remove_probe_array_cb(struct uloop_timeout *t) {
|
void remove_probe_array_cb(struct uloop_timeout *t) {
|
||||||
pthread_mutex_lock(&probe_array_mutex);
|
pthread_mutex_lock(&probe_array_mutex);
|
||||||
|
|
|
@ -72,6 +72,7 @@ struct probe_metric_s uci_get_dawn_metric() {
|
||||||
ret.deny_auth_reason = uci_lookup_option_int(uci_ctx, s, "deny_auth_reason");
|
ret.deny_auth_reason = uci_lookup_option_int(uci_ctx, s, "deny_auth_reason");
|
||||||
ret.deny_assoc_reason = uci_lookup_option_int(uci_ctx, s, "deny_assoc_reason");
|
ret.deny_assoc_reason = uci_lookup_option_int(uci_ctx, s, "deny_assoc_reason");
|
||||||
ret.max_station_diff = uci_lookup_option_int(uci_ctx, s, "max_station_diff");
|
ret.max_station_diff = uci_lookup_option_int(uci_ctx, s, "max_station_diff");
|
||||||
|
ret.use_driver_recog = uci_lookup_option_int(uci_ctx, s, "use_driver_recog");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -422,13 +422,18 @@ static int handle_auth_req(struct blob_attr *msg) {
|
||||||
// block if entry was not already found in probe database
|
// block if entry was not already found in probe database
|
||||||
if (!(mac_is_equal(tmp.bssid_addr, auth_req.bssid_addr) && mac_is_equal(tmp.client_addr, auth_req.client_addr))) {
|
if (!(mac_is_equal(tmp.bssid_addr, auth_req.bssid_addr) && mac_is_equal(tmp.client_addr, auth_req.client_addr))) {
|
||||||
printf("DENY AUTH!\n");
|
printf("DENY AUTH!\n");
|
||||||
|
|
||||||
|
if(dawn_metric.use_driver_recog){
|
||||||
insert_to_denied_req_array(auth_req, 1);
|
insert_to_denied_req_array(auth_req, 1);
|
||||||
|
}
|
||||||
return dawn_metric.deny_auth_reason;
|
return dawn_metric.deny_auth_reason;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!decide_function(&tmp, REQ_TYPE_AUTH)) {
|
if (!decide_function(&tmp, REQ_TYPE_AUTH)) {
|
||||||
printf("DENY AUTH\n");
|
printf("DENY AUTH\n");
|
||||||
|
if(dawn_metric.use_driver_recog) {
|
||||||
insert_to_denied_req_array(auth_req, 1);
|
insert_to_denied_req_array(auth_req, 1);
|
||||||
|
}
|
||||||
return dawn_metric.deny_auth_reason;
|
return dawn_metric.deny_auth_reason;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -459,13 +464,17 @@ static int handle_assoc_req(struct blob_attr *msg) {
|
||||||
// block if entry was not already found in probe database
|
// block if entry was not already found in probe database
|
||||||
if (!(mac_is_equal(tmp.bssid_addr, auth_req.bssid_addr) && mac_is_equal(tmp.client_addr, auth_req.client_addr))) {
|
if (!(mac_is_equal(tmp.bssid_addr, auth_req.bssid_addr) && mac_is_equal(tmp.client_addr, auth_req.client_addr))) {
|
||||||
printf("DENY ASSOC!\n");
|
printf("DENY ASSOC!\n");
|
||||||
|
if(dawn_metric.use_driver_recog) {
|
||||||
insert_to_denied_req_array(auth_req, 1);
|
insert_to_denied_req_array(auth_req, 1);
|
||||||
|
}
|
||||||
return dawn_metric.deny_assoc_reason;
|
return dawn_metric.deny_assoc_reason;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!decide_function(&tmp, REQ_TYPE_ASSOC)) {
|
if (!decide_function(&tmp, REQ_TYPE_ASSOC)) {
|
||||||
printf("DENY ASSOC\n");
|
printf("DENY ASSOC\n");
|
||||||
|
if(dawn_metric.use_driver_recog) {
|
||||||
insert_to_denied_req_array(auth_req, 1);
|
insert_to_denied_req_array(auth_req, 1);
|
||||||
|
}
|
||||||
return dawn_metric.deny_assoc_reason;
|
return dawn_metric.deny_assoc_reason;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue