2016-02-05 17:38:49 +01:00
|
|
|
#include "ac.h"
|
|
|
|
#include "ac_json.h"
|
|
|
|
|
|
|
|
/* */
|
|
|
|
static void* ac_json_80211_miccountermeasures_createmessageelement(struct json_object* jsonparent, uint16_t radioid) {
|
|
|
|
return NULL; /* TODO */
|
|
|
|
}
|
|
|
|
|
|
|
|
/* */
|
|
|
|
static int ac_json_80211_miccountermeasures_addmessageelement(struct ac_json_ieee80211_wtpradio* wtpradio, void* data, int overwrite) {
|
|
|
|
struct capwap_80211_miccountermeasures_element* miccountermeasures = (struct capwap_80211_miccountermeasures_element*)data;
|
|
|
|
struct ac_json_ieee80211_item* item = &wtpradio->items[miccountermeasures->radioid - 1];
|
2016-03-14 10:41:30 +01:00
|
|
|
const struct capwap_message_elements_ops *ops = capwap_get_message_element_ops(CAPWAP_ELEMENT_80211_MIC_COUNTERMEASURES);
|
2016-02-05 17:38:49 +01:00
|
|
|
|
|
|
|
if (item->miccountermeasures) {
|
|
|
|
if (!overwrite) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-03-07 17:12:48 +01:00
|
|
|
ops->free(item->miccountermeasures);
|
2016-02-05 17:38:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
item->valid = 1;
|
2016-03-07 17:12:48 +01:00
|
|
|
item->miccountermeasures = (struct capwap_80211_miccountermeasures_element*)ops->clone(miccountermeasures);
|
2016-02-05 17:38:49 +01:00
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* */
|
|
|
|
static void ac_json_80211_miccountermeasures_createjson(struct json_object* jsonparent, void* data) {
|
|
|
|
/* TODO */
|
|
|
|
}
|
|
|
|
|
|
|
|
/* */
|
|
|
|
struct ac_json_ieee80211_ops ac_json_80211_miccountermeasures_ops = {
|
|
|
|
.type = CAPWAP_ELEMENT_80211_MIC_COUNTERMEASURES,
|
|
|
|
.json_type = "IEEE80211MicCounterMeasures",
|
2016-03-07 17:12:48 +01:00
|
|
|
.create = ac_json_80211_miccountermeasures_createmessageelement,
|
2016-02-05 17:38:49 +01:00
|
|
|
.add_message_element = ac_json_80211_miccountermeasures_addmessageelement,
|
|
|
|
.create_json = ac_json_80211_miccountermeasures_createjson
|
|
|
|
};
|