mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-03-09 15:40:12 +00:00
add supp rates
This commit is contained in:
parent
5a128beb75
commit
80199e244f
5 changed files with 48 additions and 1 deletions
|
@ -39,7 +39,7 @@ SET(SOURCES
|
||||||
network/tcpsocket.c
|
network/tcpsocket.c
|
||||||
|
|
||||||
include/dawn_iwinfo.h
|
include/dawn_iwinfo.h
|
||||||
utils/dawn_iwinfo.c)
|
utils/dawn_iwinfo.c utils/ieee80211_utils.c include/ieee80211_utils.h)
|
||||||
|
|
||||||
SET(LIBS
|
SET(LIBS
|
||||||
ubox ubus json-c blobmsg_json config uci gcrypt iwinfo)
|
ubox ubus json-c blobmsg_json config uci gcrypt iwinfo)
|
||||||
|
|
|
@ -106,6 +106,7 @@ typedef struct probe_entry_s {
|
||||||
time_t time;
|
time_t time;
|
||||||
int counter;
|
int counter;
|
||||||
int deny_counter;
|
int deny_counter;
|
||||||
|
uint8_t max_supp_datarate;
|
||||||
} probe_entry;
|
} probe_entry;
|
||||||
|
|
||||||
typedef struct auth_entry_s {
|
typedef struct auth_entry_s {
|
||||||
|
|
12
src/include/ieee80211_utils.h
Normal file
12
src/include/ieee80211_utils.h
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
//
|
||||||
|
// Created by nick on 06.02.18.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef DAWN_IEEE80211_UTILS_H
|
||||||
|
#define DAWN_IEEE80211_UTILS_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
double iee80211_calculate_bitrate(uint8_t supp_rate_val);
|
||||||
|
|
||||||
|
#endif //DAWN_IEEE80211_UTILS_H
|
11
src/utils/ieee80211_utils.c
Normal file
11
src/utils/ieee80211_utils.c
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
//
|
||||||
|
// Created by nick on 06.02.18.
|
||||||
|
//
|
||||||
|
#include "ieee80211_utils.h"
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
double iee80211_calculate_bitrate(uint8_t supp_rate_val)
|
||||||
|
{
|
||||||
|
return ((double) supp_rate_val) / 2;
|
||||||
|
}
|
|
@ -97,6 +97,8 @@ enum {
|
||||||
PROB_FREQ,
|
PROB_FREQ,
|
||||||
PROB_HT_SUPPORT,
|
PROB_HT_SUPPORT,
|
||||||
PROB_VHT_SUPPORT,
|
PROB_VHT_SUPPORT,
|
||||||
|
PROB_SUPP_RATES,
|
||||||
|
PROB_EXT_SUPP_RATES,
|
||||||
__PROB_MAX,
|
__PROB_MAX,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -108,6 +110,8 @@ static const struct blobmsg_policy prob_policy[__PROB_MAX] = {
|
||||||
[PROB_FREQ] = {.name = "freq", .type = BLOBMSG_TYPE_INT32},
|
[PROB_FREQ] = {.name = "freq", .type = BLOBMSG_TYPE_INT32},
|
||||||
[PROB_HT_SUPPORT] = {.name = "ht_support", .type = BLOBMSG_TYPE_INT8},
|
[PROB_HT_SUPPORT] = {.name = "ht_support", .type = BLOBMSG_TYPE_INT8},
|
||||||
[PROB_VHT_SUPPORT] = {.name = "vht_support", .type = BLOBMSG_TYPE_INT8},
|
[PROB_VHT_SUPPORT] = {.name = "vht_support", .type = BLOBMSG_TYPE_INT8},
|
||||||
|
[PROB_SUPP_RATES] = {.name = "supp_rates", .type = BLOBMSG_TYPE_ARRAY},
|
||||||
|
[PROB_EXT_SUPP_RATES] = {.name = "ext_supp_rates", .type = BLOBMSG_TYPE_ARRAY},
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
@ -403,6 +407,25 @@ int parse_to_probe_req(struct blob_attr *msg, probe_entry *prob_req) {
|
||||||
prob_req->vht_support = blobmsg_get_u8(tb[PROB_VHT_SUPPORT]);
|
prob_req->vht_support = blobmsg_get_u8(tb[PROB_VHT_SUPPORT]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tb[PROB_EXT_SUPP_RATES]) {
|
||||||
|
struct blob_attr *attr;
|
||||||
|
int len = blobmsg_data_len(tb[PROB_EXT_SUPP_RATES]);
|
||||||
|
struct blob_attr *data = blobmsg_data(tb[PROB_EXT_SUPP_RATES]);
|
||||||
|
__blob_for_each_attr(attr, data, len)
|
||||||
|
{
|
||||||
|
printf("EXT Supp Rates: %d\n", blobmsg_get_u8(attr));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tb[PROB_SUPP_RATES]) {
|
||||||
|
struct blob_attr *attr;
|
||||||
|
//struct blobmsg_hdr *hdr;
|
||||||
|
int len = blobmsg_data_len(tb[PROB_SUPP_RATES]);
|
||||||
|
blobmsg_for_each_attr(attr, blobmsg_data(tb[PROB_SUPP_RATES]), len)
|
||||||
|
{
|
||||||
|
printf("Supp Rates: %d\n", blobmsg_get_u8(attr));
|
||||||
|
}
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue