Add 80211 message elements
This commit is contained in:
parent
cd9fc8b54d
commit
214fa54535
@ -62,6 +62,7 @@ capwap_SOURCES = \
|
||||
$(top_srcdir)/src/common/capwap_element_idletimeout.c \
|
||||
$(top_srcdir)/src/common/capwap_element_wtpfallback.c \
|
||||
$(top_srcdir)/src/common/capwap_element_radiooprstate.c \
|
||||
$(top_srcdir)/src/common/capwap_element_80211_addwlan.c \
|
||||
$(top_srcdir)/src/common/capwap_element_80211_antenna.c \
|
||||
$(top_srcdir)/src/common/capwap_element_80211_assignbssid.c \
|
||||
$(top_srcdir)/src/common/capwap_element_80211_deletewlan.c \
|
||||
@ -76,6 +77,7 @@ capwap_SOURCES = \
|
||||
$(top_srcdir)/src/common/capwap_element_80211_station.c \
|
||||
$(top_srcdir)/src/common/capwap_element_80211_stationqos.c \
|
||||
$(top_srcdir)/src/common/capwap_element_80211_stationkey.c \
|
||||
$(top_srcdir)/src/common/capwap_element_80211_statistics.c \
|
||||
$(top_srcdir)/src/common/capwap_element_80211_supportedrates.c \
|
||||
$(top_srcdir)/src/common/capwap_element_80211_txpower.c \
|
||||
$(top_srcdir)/src/common/capwap_element_80211_txpowerlevel.c \
|
||||
|
@ -92,7 +92,7 @@ static struct capwap_message_elements_ops* capwap_message_elements[CAPWAP_MESSAG
|
||||
|
||||
/* */
|
||||
static struct capwap_message_elements_ops* capwap_80211_message_elements[CAPWAP_MESSAGE_ELEMENTS_COUNT] = {
|
||||
/* */ NULL,
|
||||
/* CAPWAP_ELEMENT_80211_ADD_WLAN */ &capwap_element_80211_addwlan_ops,
|
||||
/* CAPWAP_ELEMENT_80211_ANTENNA */ &capwap_element_80211_antenna_ops,
|
||||
/* CAPWAP_ELEMENT_80211_ASSIGN_BSSID */ &capwap_element_80211_assignbssid_ops,
|
||||
/* CAPWAP_ELEMENT_80211_DELETE_WLAN */ &capwap_element_80211_deletewlan_ops,
|
||||
@ -107,7 +107,7 @@ static struct capwap_message_elements_ops* capwap_80211_message_elements[CAPWAP_
|
||||
/* CAPWAP_ELEMENT_80211_STATION */ &capwap_element_80211_station_ops,
|
||||
/* CAPWAP_ELEMENT_80211_STATION_QOS_PROFILE */ &capwap_element_80211_stationqos_ops,
|
||||
/* CAPWAP_ELEMENT_80211_STATION_SESSION_KEY_PROFILE */ &capwap_element_80211_stationkey_ops,
|
||||
/* */ NULL,
|
||||
/* CAPWAP_ELEMENT_80211_STATISTICS */ &capwap_element_80211_statistics_ops,
|
||||
/* CAPWAP_ELEMENT_80211_SUPPORTEDRATES */ &capwap_element_80211_supportedrates_ops,
|
||||
/* CAPWAP_ELEMENT_80211_TXPOWER */ &capwap_element_80211_txpower_ops,
|
||||
/* CAPWAP_ELEMENT_80211_TXPOWERLEVEL */ &capwap_element_80211_txpowerlevel_ops,
|
||||
|
@ -102,6 +102,7 @@ struct capwap_message_elements_ops* capwap_get_message_element_ops(unsigned shor
|
||||
#include "capwap_element_ecnsupport.h" /* 00053 */
|
||||
|
||||
/* IEEE 802.11 message elements */
|
||||
#include "capwap_element_80211_addwlan.h" /* 01024 */
|
||||
#include "capwap_element_80211_antenna.h" /* 01025 */
|
||||
#include "capwap_element_80211_assignbssid.h" /* 01026 */
|
||||
#include "capwap_element_80211_deletewlan.h" /* 01027 */
|
||||
@ -116,7 +117,7 @@ struct capwap_message_elements_ops* capwap_get_message_element_ops(unsigned shor
|
||||
#include "capwap_element_80211_station.h" /* 01036 */
|
||||
#include "capwap_element_80211_stationqos.h" /* 01037 */
|
||||
#include "capwap_element_80211_stationkey.h" /* 01038 */
|
||||
|
||||
#include "capwap_element_80211_statistics.h" /* 01039 */
|
||||
#include "capwap_element_80211_supportedrates.h" /* 01040 */
|
||||
#include "capwap_element_80211_txpower.h" /* 01041 */
|
||||
#include "capwap_element_80211_txpowerlevel.h" /* 01042 */
|
||||
|
134
src/common/capwap_element_80211_addwlan.c
Normal file
134
src/common/capwap_element_80211_addwlan.c
Normal file
@ -0,0 +1,134 @@
|
||||
#include "capwap.h"
|
||||
#include "capwap_element.h"
|
||||
|
||||
/********************************************************************
|
||||
|
||||
0 1 2 3
|
||||
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| Radio ID | WLAN ID | Capability |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| Key Index | Key Status | Key Length |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| Key... |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| Group TSC |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| Group TSC | QoS | Auth Type |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| MAC Mode | Tunnel Mode | Suppress SSID | SSID ...
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|
||||
Type: 1024 for IEEE 802.11 Add WLAN
|
||||
|
||||
Length: >= 20
|
||||
|
||||
********************************************************************/
|
||||
|
||||
/* */
|
||||
static void capwap_80211_addwlan_element_create(void* data, capwap_message_elements_handle handle, struct capwap_write_message_elements_ops* func) {
|
||||
struct capwap_80211_addwlan_element* element = (struct capwap_80211_addwlan_element*)data;
|
||||
|
||||
ASSERT(data != NULL);
|
||||
|
||||
func->write_u8(handle, element->radioid);
|
||||
func->write_u8(handle, element->wlanid);
|
||||
func->write_u16(handle, element->capability);
|
||||
func->write_u8(handle, element->keyindex);
|
||||
func->write_u8(handle, element->keystatus);
|
||||
func->write_u16(handle, element->keylength);
|
||||
if ((element->keylength > 0) && element->key) {
|
||||
func->write_block(handle, element->key, element->keylength);
|
||||
}
|
||||
func->write_block(handle, element->grouptsc, CAPWAP_ADD_WLAN_GROUPTSC_LENGTH);
|
||||
func->write_u8(handle, element->qos);
|
||||
func->write_u8(handle, element->authmode);
|
||||
func->write_u8(handle, element->macmode);
|
||||
func->write_u8(handle, element->tunnelmode);
|
||||
func->write_u8(handle, element->suppressssid);
|
||||
func->write_block(handle, element->ssid, element->ssidlength);
|
||||
}
|
||||
|
||||
/* */
|
||||
static void capwap_80211_addwlan_element_free(void* data) {
|
||||
struct capwap_80211_addwlan_element* element = (struct capwap_80211_addwlan_element*)data;
|
||||
|
||||
ASSERT(data != NULL);
|
||||
|
||||
if (element->ssid) {
|
||||
capwap_free(element->ssid);
|
||||
}
|
||||
|
||||
if (element->key) {
|
||||
capwap_free(element->key);
|
||||
}
|
||||
|
||||
capwap_free(element);
|
||||
}
|
||||
|
||||
/* */
|
||||
static void* capwap_80211_addwlan_element_parsing(capwap_message_elements_handle handle, struct capwap_read_message_elements_ops* func) {
|
||||
unsigned short length;
|
||||
struct capwap_80211_addwlan_element* data;
|
||||
|
||||
ASSERT(handle != NULL);
|
||||
ASSERT(func != NULL);
|
||||
|
||||
length = func->read_ready(handle);
|
||||
if (length < 20) {
|
||||
capwap_logging_debug("Invalid IEEE 802.11 Add WLAN element");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_addwlan_element*)capwap_alloc(sizeof(struct capwap_80211_addwlan_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_addwlan_element));
|
||||
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_u8(handle, &data->wlanid);
|
||||
func->read_u16(handle, &data->capability);
|
||||
func->read_u8(handle, &data->keyindex);
|
||||
func->read_u8(handle, &data->keystatus);
|
||||
func->read_u16(handle, &data->keylength);
|
||||
|
||||
if (data->keylength > 0) {
|
||||
data->key = (uint8_t*)capwap_alloc(data->keylength);
|
||||
if (!data->key) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
func->read_block(handle, data->key, data->keylength);
|
||||
}
|
||||
|
||||
func->read_block(handle, data->grouptsc, CAPWAP_ADD_WLAN_GROUPTSC_LENGTH);
|
||||
func->read_u8(handle, &data->qos);
|
||||
func->read_u8(handle, &data->authmode);
|
||||
func->read_u8(handle, &data->macmode);
|
||||
func->read_u8(handle, &data->tunnelmode);
|
||||
func->read_u8(handle, &data->suppressssid);
|
||||
|
||||
data->ssidlength = length - (19 + data->keylength);
|
||||
if (data->ssidlength > CAPWAP_ADD_WLAN_SSID_LENGTH) {
|
||||
capwap_80211_addwlan_element_free((void*)data);
|
||||
capwap_logging_debug("Invalid IEEE 802.11 Add WLAN element");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
data->ssid = (uint8_t*)capwap_alloc(data->ssidlength + 1);
|
||||
func->read_block(handle, data->ssid, data->ssidlength);
|
||||
data->ssid[data->ssidlength] = 0;
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/* */
|
||||
struct capwap_message_elements_ops capwap_element_80211_addwlan_ops = {
|
||||
.create_message_element = capwap_80211_addwlan_element_create,
|
||||
.parsing_message_element = capwap_80211_addwlan_element_parsing,
|
||||
.free_parsed_message_element = capwap_80211_addwlan_element_free
|
||||
};
|
65
src/common/capwap_element_80211_addwlan.h
Normal file
65
src/common/capwap_element_80211_addwlan.h
Normal file
@ -0,0 +1,65 @@
|
||||
#ifndef __CAPWAP_ELEMENT_80211_ADD_WLAN_HEADER__
|
||||
#define __CAPWAP_ELEMENT_80211_ADD_WLAN_HEADER__
|
||||
|
||||
#define CAPWAP_ELEMENT_80211_ADD_WLAN 1024
|
||||
|
||||
#define CAPWAP_ADD_WLAN_GROUPTSC_LENGTH 4
|
||||
#define CAPWAP_ADD_WLAN_SSID_LENGTH 32
|
||||
|
||||
#define CAPWAP_ADD_WLAN_CAPABILITY_ESS 0x8000
|
||||
#define CAPWAP_ADD_WLAN_CAPABILITY_IBSS 0x4000
|
||||
#define CAPWAP_ADD_WLAN_CAPABILITY_CFPOLLABLE 0x2000
|
||||
#define CAPWAP_ADD_WLAN_CAPABILITY_CFPOLLREQUEST 0x1000
|
||||
#define CAPWAP_ADD_WLAN_CAPABILITY_PRIVACY 0x0800
|
||||
#define CAPWAP_ADD_WLAN_CAPABILITY_SHORTPREAMBLE 0x0400
|
||||
#define CAPWAP_ADD_WLAN_CAPABILITY_PBCC 0x0200
|
||||
#define CAPWAP_ADD_WLAN_CAPABILITY_CHANNELAGILITY 0x0100
|
||||
#define CAPWAP_ADD_WLAN_CAPABILITY_SPECTRUMMAN 0x0080
|
||||
#define CAPWAP_ADD_WLAN_CAPABILITY_QOS 0x0040
|
||||
#define CAPWAP_ADD_WLAN_CAPABILITY_SHORTSLOTTIME 0x0020
|
||||
#define CAPWAP_ADD_WLAN_CAPABILITY_APSD 0x0010
|
||||
#define CAPWAP_ADD_WLAN_CAPABILITY_DSSS_OFDM 0x0004
|
||||
#define CAPWAP_ADD_WLAN_CAPABILITY_DELAYEDACK 0x0002
|
||||
#define CAPWAP_ADD_WLAN_CAPABILITY_IMMEDIATEACK 0x0001
|
||||
|
||||
#define CAPWAP_ADD_WLAN_KEY_STATUS_MULTICASTKEY 0
|
||||
#define CAPWAP_ADD_WLAN_KEY_STATUS_WEP 1
|
||||
#define CAPWAP_ADD_WLAN_KEY_STATUS_REKEYINGGTK 2
|
||||
#define CAPWAP_ADD_WLAN_KEY_STATUS_COMPLETEGTK 3
|
||||
|
||||
#define CAPWAP_ADD_WLAN_QOS_BESTEFFORT 0
|
||||
#define CAPWAP_ADD_WLAN_QOS_VIDEO 1
|
||||
#define CAPWAP_ADD_WLAN_QOS_VOICE 2
|
||||
#define CAPWAP_ADD_WLAN_QOS_BACKGROUND 3
|
||||
|
||||
#define CAPWAP_ADD_WLAN_AUTHTYPE_OPEN 0
|
||||
#define CAPWAP_ADD_WLAN_AUTHTYPE_WEP 1
|
||||
|
||||
#define CAPWAP_ADD_WLAN_MACMODE_LOCAL 0
|
||||
#define CAPWAP_ADD_WLAN_MACMODE_SPLIT 1
|
||||
|
||||
#define CAPWAP_ADD_WLAN_TUNNELMODE_LOCAL 0
|
||||
#define CAPWAP_ADD_WLAN_TUNNELMODE_8023 1
|
||||
#define CAPWAP_ADD_WLAN_TUNNELMODE_80211 2
|
||||
|
||||
struct capwap_80211_addwlan_element {
|
||||
uint8_t radioid;
|
||||
uint8_t wlanid;
|
||||
uint16_t capability;
|
||||
uint8_t keyindex;
|
||||
uint8_t keystatus;
|
||||
uint16_t keylength;
|
||||
uint8_t* key;
|
||||
uint8_t grouptsc[CAPWAP_ADD_WLAN_GROUPTSC_LENGTH];
|
||||
uint8_t qos;
|
||||
uint8_t authmode;
|
||||
uint8_t macmode;
|
||||
uint8_t tunnelmode;
|
||||
uint8_t suppressssid;
|
||||
uint16_t ssidlength;
|
||||
uint8_t* ssid;
|
||||
};
|
||||
|
||||
extern struct capwap_message_elements_ops capwap_element_80211_addwlan_ops;
|
||||
|
||||
#endif /* __CAPWAP_ELEMENT_80211_ADD_WLAN_HEADER__ */
|
@ -52,25 +52,24 @@ static void* capwap_80211_stationkey_element_parsing(capwap_message_elements_han
|
||||
return NULL;
|
||||
}
|
||||
|
||||
length -= 20;
|
||||
if (length > CAPWAP_STATION_SESSION_KEY_KEY_LENGTH) {
|
||||
capwap_logging_debug("Invalid IEEE 802.11 Station Session Key element");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_stationkey_element*)capwap_alloc(sizeof(struct capwap_80211_stationkey_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
data->keylength = length - 20;
|
||||
data->key = (uint8_t*)capwap_alloc(data->keylength);
|
||||
if (!data->key) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_stationkey_element));
|
||||
func->read_block(handle, data->address, CAPWAP_STATION_SESSION_KEY_ADDRESS_LENGTH);
|
||||
func->read_u16(handle, &data->flags);
|
||||
func->read_block(handle, data->pairwisetsc, CAPWAP_STATION_SESSION_KEY_PAIRWISE_TSC_LENGTH);
|
||||
func->read_block(handle, data->pairwisersc, CAPWAP_STATION_SESSION_KEY_PAIRWISE_RSC_LENGTH);
|
||||
data->keylength = length;
|
||||
func->read_block(handle, data->key, data->keylength);
|
||||
|
||||
return data;
|
||||
@ -78,9 +77,15 @@ static void* capwap_80211_stationkey_element_parsing(capwap_message_elements_han
|
||||
|
||||
/* */
|
||||
static void capwap_80211_stationkey_element_free(void* data) {
|
||||
struct capwap_80211_stationkey_element* element = (struct capwap_80211_stationkey_element*)data;
|
||||
|
||||
ASSERT(data != NULL);
|
||||
|
||||
capwap_free(data);
|
||||
|
||||
if (element->key) {
|
||||
capwap_free(element->key);
|
||||
}
|
||||
|
||||
capwap_free(element);
|
||||
}
|
||||
|
||||
/* */
|
||||
|
@ -6,7 +6,6 @@
|
||||
#define CAPWAP_STATION_SESSION_KEY_ADDRESS_LENGTH 6
|
||||
#define CAPWAP_STATION_SESSION_KEY_PAIRWISE_TSC_LENGTH 6
|
||||
#define CAPWAP_STATION_SESSION_KEY_PAIRWISE_RSC_LENGTH 6
|
||||
#define CAPWAP_STATION_SESSION_KEY_KEY_LENGTH 32
|
||||
|
||||
#define CAPWAP_STATION_SESSION_KEY_AKM_ONLY 0x8000
|
||||
#define CAPWAP_STATION_SESSION_KEY_AC_ENCRYPT 0x4000
|
||||
@ -17,7 +16,7 @@ struct capwap_80211_stationkey_element {
|
||||
uint8_t pairwisetsc[CAPWAP_STATION_SESSION_KEY_PAIRWISE_TSC_LENGTH];
|
||||
uint8_t pairwisersc[CAPWAP_STATION_SESSION_KEY_PAIRWISE_RSC_LENGTH];
|
||||
uint16_t keylength;
|
||||
uint8_t key[CAPWAP_STATION_SESSION_KEY_KEY_LENGTH];
|
||||
uint8_t* key;
|
||||
};
|
||||
|
||||
extern struct capwap_message_elements_ops capwap_element_80211_stationkey_ops;
|
||||
|
143
src/common/capwap_element_80211_statistics.c
Normal file
143
src/common/capwap_element_80211_statistics.c
Normal file
@ -0,0 +1,143 @@
|
||||
#include "capwap.h"
|
||||
#include "capwap_element.h"
|
||||
|
||||
/********************************************************************
|
||||
|
||||
0 1 2 3
|
||||
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| Radio ID | Reserved |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| Tx Fragment Count |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| Multicast Tx Count |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| Failed Count |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| Retry Count |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| Multiple Retry Count |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| Frame Duplicate Count |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| RTS Success Count |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| RTS Failure Count |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| ACK Failure Count |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| Rx Fragment Count |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| Multicast RX Count |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| FCS Error Count |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| Tx Frame Count |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| Decryption Errors |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| Discarded QoS Fragment Count |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| Associated Station Count |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| QoS CF Polls Received Count |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| QoS CF Polls Unused Count |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| QoS CF Polls Unusable Count |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|
||||
Type: 1039 for IEEE 802.11 Statistics
|
||||
|
||||
Length: 80
|
||||
|
||||
********************************************************************/
|
||||
|
||||
/* */
|
||||
static void capwap_80211_statistics_element_create(void* data, capwap_message_elements_handle handle, struct capwap_write_message_elements_ops* func) {
|
||||
struct capwap_80211_statistics_element* element = (struct capwap_80211_statistics_element*)data;
|
||||
|
||||
ASSERT(data != NULL);
|
||||
|
||||
/* */
|
||||
func->write_u8(handle, element->radioid);
|
||||
func->write_block(handle, NULL, 3);
|
||||
func->write_u32(handle, element->txfragment);
|
||||
func->write_u32(handle, element->multicasttx);
|
||||
func->write_u32(handle, element->failed);
|
||||
func->write_u32(handle, element->retry);
|
||||
func->write_u32(handle, element->multipleretry);
|
||||
func->write_u32(handle, element->frameduplicate);
|
||||
func->write_u32(handle, element->rtssuccess);
|
||||
func->write_u32(handle, element->rtsfailure);
|
||||
func->write_u32(handle, element->ackfailure);
|
||||
func->write_u32(handle, element->rxfragment);
|
||||
func->write_u32(handle, element->multicastrx);
|
||||
func->write_u32(handle, element->fcserror);
|
||||
func->write_u32(handle, element->txframe);
|
||||
func->write_u32(handle, element->decryptionerror);
|
||||
func->write_u32(handle, element->discardedqosfragment);
|
||||
func->write_u32(handle, element->associatedstation);
|
||||
func->write_u32(handle, element->qoscfpollsreceived);
|
||||
func->write_u32(handle, element->qoscfpollsunused);
|
||||
func->write_u32(handle, element->qoscfpollsunusable);
|
||||
}
|
||||
|
||||
/* */
|
||||
static void* capwap_80211_statistics_element_parsing(capwap_message_elements_handle handle, struct capwap_read_message_elements_ops* func) {
|
||||
struct capwap_80211_statistics_element* data;
|
||||
|
||||
ASSERT(handle != NULL);
|
||||
ASSERT(func != NULL);
|
||||
|
||||
if (func->read_ready(handle) != 80) {
|
||||
capwap_logging_debug("Invalid IEEE 802.11 Statistics element");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_statistics_element*)capwap_alloc(sizeof(struct capwap_80211_statistics_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_statistics_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_block(handle, NULL, 3);
|
||||
func->read_u32(handle, &data->txfragment);
|
||||
func->read_u32(handle, &data->multicasttx);
|
||||
func->read_u32(handle, &data->failed);
|
||||
func->read_u32(handle, &data->retry);
|
||||
func->read_u32(handle, &data->multipleretry);
|
||||
func->read_u32(handle, &data->frameduplicate);
|
||||
func->read_u32(handle, &data->rtssuccess);
|
||||
func->read_u32(handle, &data->rtsfailure);
|
||||
func->read_u32(handle, &data->ackfailure);
|
||||
func->read_u32(handle, &data->rxfragment);
|
||||
func->read_u32(handle, &data->multicastrx);
|
||||
func->read_u32(handle, &data->fcserror);
|
||||
func->read_u32(handle, &data->txframe);
|
||||
func->read_u32(handle, &data->decryptionerror);
|
||||
func->read_u32(handle, &data->discardedqosfragment);
|
||||
func->read_u32(handle, &data->associatedstation);
|
||||
func->read_u32(handle, &data->qoscfpollsreceived);
|
||||
func->read_u32(handle, &data->qoscfpollsunused);
|
||||
func->read_u32(handle, &data->qoscfpollsunusable);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/* */
|
||||
static void capwap_80211_statistics_element_free(void* data) {
|
||||
ASSERT(data != NULL);
|
||||
|
||||
capwap_free(data);
|
||||
}
|
||||
|
||||
/* */
|
||||
struct capwap_message_elements_ops capwap_element_80211_statistics_ops = {
|
||||
.create_message_element = capwap_80211_statistics_element_create,
|
||||
.parsing_message_element = capwap_80211_statistics_element_parsing,
|
||||
.free_parsed_message_element = capwap_80211_statistics_element_free
|
||||
};
|
31
src/common/capwap_element_80211_statistics.h
Normal file
31
src/common/capwap_element_80211_statistics.h
Normal file
@ -0,0 +1,31 @@
|
||||
#ifndef __CAPWAP_ELEMENT_80211_STATISTICS_HEADER__
|
||||
#define __CAPWAP_ELEMENT_80211_STATISTICS_HEADER__
|
||||
|
||||
#define CAPWAP_ELEMENT_80211_STATISTICS 1039
|
||||
|
||||
struct capwap_80211_statistics_element {
|
||||
uint8_t radioid;
|
||||
uint32_t txfragment;
|
||||
uint32_t multicasttx;
|
||||
uint32_t failed;
|
||||
uint32_t retry;
|
||||
uint32_t multipleretry;
|
||||
uint32_t frameduplicate;
|
||||
uint32_t rtssuccess;
|
||||
uint32_t rtsfailure;
|
||||
uint32_t ackfailure;
|
||||
uint32_t rxfragment;
|
||||
uint32_t multicastrx;
|
||||
uint32_t fcserror;
|
||||
uint32_t txframe;
|
||||
uint32_t decryptionerror;
|
||||
uint32_t discardedqosfragment;
|
||||
uint32_t associatedstation;
|
||||
uint32_t qoscfpollsreceived;
|
||||
uint32_t qoscfpollsunused;
|
||||
uint32_t qoscfpollsunusable;
|
||||
};
|
||||
|
||||
extern struct capwap_message_elements_ops capwap_element_80211_statistics_ops;
|
||||
|
||||
#endif /* __CAPWAP_ELEMENT_80211_STATISTICS_HEADER__ */
|
Loading…
Reference in New Issue
Block a user