Complete 802.11 message elements
This commit is contained in:
parent
214fa54535
commit
ad666966e1
@ -81,6 +81,11 @@ capwap_SOURCES = \
|
||||
$(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 \
|
||||
$(top_srcdir)/src/common/capwap_element_80211_updatestationqos.c \
|
||||
$(top_srcdir)/src/common/capwap_element_80211_updatewlan.c \
|
||||
$(top_srcdir)/src/common/capwap_element_80211_wtpqos.c \
|
||||
$(top_srcdir)/src/common/capwap_element_80211_wtpradioconf.c \
|
||||
$(top_srcdir)/src/common/capwap_element_80211_wtpradiofailalarm.c \
|
||||
$(top_srcdir)/src/common/capwap_element_80211_wtpradioinformation.c
|
||||
|
||||
if DEBUG_BUILD
|
||||
|
@ -111,11 +111,11 @@ static struct capwap_message_elements_ops* capwap_80211_message_elements[CAPWAP_
|
||||
/* 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,
|
||||
/* */ NULL,
|
||||
/* */ NULL,
|
||||
/* */ NULL,
|
||||
/* */ NULL,
|
||||
/* */ NULL,
|
||||
/* CAPWAP_ELEMENT_80211_UPDATE_STATION_QOS */ &capwap_element_80211_updatestationqos_ops,
|
||||
/* CAPWAP_ELEMENT_80211_UPDATE_WLAN */ &capwap_element_80211_updatewlan_ops,
|
||||
/* CAPWAP_ELEMENT_80211_WTP_QOS */ &capwap_element_80211_wtpqos_ops,
|
||||
/* CAPWAP_ELEMENT_80211_WTP_RADIO_CONF */ &capwap_element_80211_wtpradioconf_ops,
|
||||
/* CAPWAP_ELEMENT_80211_WTP_RADIO_FAIL_ALARM */ &capwap_element_80211_wtpradiofailalarm_ops,
|
||||
/* CAPWAP_ELEMENT_80211_WTPRADIOINFORMATION */ &capwap_element_80211_wtpradioinformation_ops
|
||||
};
|
||||
|
||||
|
@ -121,6 +121,11 @@ struct capwap_message_elements_ops* capwap_get_message_element_ops(unsigned shor
|
||||
#include "capwap_element_80211_supportedrates.h" /* 01040 */
|
||||
#include "capwap_element_80211_txpower.h" /* 01041 */
|
||||
#include "capwap_element_80211_txpowerlevel.h" /* 01042 */
|
||||
#include "capwap_element_80211_updatestationqos.h" /* 01043 */
|
||||
#include "capwap_element_80211_updatewlan.h" /* 01044 */
|
||||
#include "capwap_element_80211_wtpqos.h" /* 01045 */
|
||||
#include "capwap_element_80211_wtpradioconf.h" /* 01046 */
|
||||
#include "capwap_element_80211_wtpradiofailalarm.h" /* 01047 */
|
||||
#include "capwap_element_80211_wtpradioinformation.h" /* 01048 */
|
||||
|
||||
/*********************************************************************************************************************/
|
||||
|
86
src/common/capwap_element_80211_updatestationqos.c
Normal file
86
src/common/capwap_element_80211_updatestationqos.c
Normal file
@ -0,0 +1,86 @@
|
||||
#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 2
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| Radio ID | MAC Address |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| MAC Address | QoS Sub-Element... |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|
||||
0 1
|
||||
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| Reserved|8021p|RSV| DSCP Tag |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|
||||
Type: 1043 for IEEE 802.11 Update Station QoS
|
||||
|
||||
Length: 14
|
||||
|
||||
********************************************************************/
|
||||
|
||||
/* */
|
||||
static void capwap_80211_updatestationqos_element_create(void* data, capwap_message_elements_handle handle, struct capwap_write_message_elements_ops* func) {
|
||||
int i;
|
||||
struct capwap_80211_updatestationqos_element* element = (struct capwap_80211_updatestationqos_element*)data;
|
||||
|
||||
ASSERT(data != NULL);
|
||||
|
||||
func->write_u8(handle, element->radioid);
|
||||
func->write_block(handle, element->address, CAPWAP_UPDATE_STATION_QOS_ADDRESS_LENGTH);
|
||||
for (i = 0; i < CAPWAP_UPDATE_STATION_QOS_SUBELEMENTS; i++) {
|
||||
func->write_u8(handle, element->qos[i].priority8021p & CAPWAP_UPDATE_STATION_QOS_PRIORIY_MASK);
|
||||
func->write_u8(handle, element->qos[i].dscp & CAPWAP_UPDATE_STATION_QOS_DSCP_MASK);
|
||||
}
|
||||
}
|
||||
|
||||
/* */
|
||||
static void* capwap_80211_updatestationqos_element_parsing(capwap_message_elements_handle handle, struct capwap_read_message_elements_ops* func) {
|
||||
int i;
|
||||
struct capwap_80211_updatestationqos_element* data;
|
||||
|
||||
ASSERT(handle != NULL);
|
||||
ASSERT(func != NULL);
|
||||
|
||||
if (func->read_ready(handle) != 14) {
|
||||
capwap_logging_debug("Invalid IEEE 802.11 Update Station QoS element");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_updatestationqos_element*)capwap_alloc(sizeof(struct capwap_80211_updatestationqos_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_updatestationqos_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_block(handle, data->address, CAPWAP_ASSIGN_BSSID_LENGTH);
|
||||
for (i = 0; i < CAPWAP_UPDATE_STATION_QOS_SUBELEMENTS; i++) {
|
||||
func->read_u8(handle, &data->qos[i].priority8021p);
|
||||
data->qos[i].priority8021p &= CAPWAP_UPDATE_STATION_QOS_PRIORIY_MASK;
|
||||
func->read_u8(handle, &data->qos[i].dscp);
|
||||
data->qos[i].dscp &= CAPWAP_UPDATE_STATION_QOS_DSCP_MASK;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/* */
|
||||
static void capwap_80211_updatestationqos_element_free(void* data) {
|
||||
ASSERT(data != NULL);
|
||||
|
||||
capwap_free(data);
|
||||
}
|
||||
|
||||
/* */
|
||||
struct capwap_message_elements_ops capwap_element_80211_updatestationqos_ops = {
|
||||
.create_message_element = capwap_80211_updatestationqos_element_create,
|
||||
.parsing_message_element = capwap_80211_updatestationqos_element_parsing,
|
||||
.free_parsed_message_element = capwap_80211_updatestationqos_element_free
|
||||
};
|
25
src/common/capwap_element_80211_updatestationqos.h
Normal file
25
src/common/capwap_element_80211_updatestationqos.h
Normal file
@ -0,0 +1,25 @@
|
||||
#ifndef __CAPWAP_ELEMENT_80211_UPDATE_STATION_QOS_HEADER__
|
||||
#define __CAPWAP_ELEMENT_80211_UPDATE_STATION_QOS_HEADER__
|
||||
|
||||
#define CAPWAP_ELEMENT_80211_UPDATE_STATION_QOS 1042
|
||||
|
||||
#define CAPWAP_UPDATE_STATION_QOS_ADDRESS_LENGTH 6
|
||||
#define CAPWAP_UPDATE_STATION_QOS_SUBELEMENTS 4
|
||||
|
||||
#define CAPWAP_UPDATE_STATION_QOS_PRIORIY_MASK 0x07
|
||||
#define CAPWAP_UPDATE_STATION_QOS_DSCP_MASK 0x3f
|
||||
|
||||
struct capwap_80211_updatestationqos_subelement {
|
||||
uint8_t priority8021p;
|
||||
uint8_t dscp;
|
||||
};
|
||||
|
||||
struct capwap_80211_updatestationqos_element {
|
||||
uint8_t radioid;
|
||||
uint8_t address[CAPWAP_UPDATE_STATION_QOS_ADDRESS_LENGTH];
|
||||
struct capwap_80211_updatestationqos_subelement qos[CAPWAP_UPDATE_STATION_QOS_SUBELEMENTS];
|
||||
};
|
||||
|
||||
extern struct capwap_message_elements_ops capwap_element_80211_updatestationqos_ops;
|
||||
|
||||
#endif /* __CAPWAP_ELEMENT_80211_UPDATE_STATION_QOS_HEADER__ */
|
105
src/common/capwap_element_80211_updatewlan.c
Normal file
105
src/common/capwap_element_80211_updatewlan.c
Normal file
@ -0,0 +1,105 @@
|
||||
#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... |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|
||||
Type: 1044 for IEEE 802.11 Update WLAN
|
||||
|
||||
Length: >= 8
|
||||
|
||||
********************************************************************/
|
||||
|
||||
/* */
|
||||
static void capwap_80211_updatewlan_element_create(void* data, capwap_message_elements_handle handle, struct capwap_write_message_elements_ops* func) {
|
||||
struct capwap_80211_updatewlan_element* element = (struct capwap_80211_updatewlan_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);
|
||||
}
|
||||
}
|
||||
|
||||
/* */
|
||||
static void capwap_80211_updatewlan_element_free(void* data) {
|
||||
struct capwap_80211_updatewlan_element* element = (struct capwap_80211_updatewlan_element*)data;
|
||||
|
||||
ASSERT(data != NULL);
|
||||
|
||||
if (element->key) {
|
||||
capwap_free(element->key);
|
||||
}
|
||||
|
||||
capwap_free(element);
|
||||
}
|
||||
|
||||
/* */
|
||||
static void* capwap_80211_updatewlan_element_parsing(capwap_message_elements_handle handle, struct capwap_read_message_elements_ops* func) {
|
||||
unsigned short length;
|
||||
struct capwap_80211_updatewlan_element* data;
|
||||
|
||||
ASSERT(handle != NULL);
|
||||
ASSERT(func != NULL);
|
||||
|
||||
length = func->read_ready(handle);
|
||||
if (length < 8) {
|
||||
capwap_logging_debug("Invalid IEEE 802.11 Update WLAN element");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
length -= 8;
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_updatewlan_element*)capwap_alloc(sizeof(struct capwap_80211_updatewlan_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_updatewlan_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 (length != data->keylength) {
|
||||
capwap_80211_updatewlan_element_free((void*)data);
|
||||
capwap_logging_debug("Invalid IEEE 802.11 Update WLAN element");
|
||||
return NULL;
|
||||
} else 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);
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/* */
|
||||
struct capwap_message_elements_ops capwap_element_80211_updatewlan_ops = {
|
||||
.create_message_element = capwap_80211_updatewlan_element_create,
|
||||
.parsing_message_element = capwap_80211_updatewlan_element_parsing,
|
||||
.free_parsed_message_element = capwap_80211_updatewlan_element_free
|
||||
};
|
39
src/common/capwap_element_80211_updatewlan.h
Normal file
39
src/common/capwap_element_80211_updatewlan.h
Normal file
@ -0,0 +1,39 @@
|
||||
#ifndef __CAPWAP_ELEMENT_80211_UPDATE_WLAN_HEADER__
|
||||
#define __CAPWAP_ELEMENT_80211_UPDATE_WLAN_HEADER__
|
||||
|
||||
#define CAPWAP_ELEMENT_80211_UPDATE_WLAN 1044
|
||||
|
||||
#define CAPWAP_UPDATE_WLAN_CAPABILITY_ESS 0x8000
|
||||
#define CAPWAP_UPDATE_WLAN_CAPABILITY_IBSS 0x4000
|
||||
#define CAPWAP_UPDATE_WLAN_CAPABILITY_CFPOLLABLE 0x2000
|
||||
#define CAPWAP_UPDATE_WLAN_CAPABILITY_CFPOLLREQUEST 0x1000
|
||||
#define CAPWAP_UPDATE_WLAN_CAPABILITY_PRIVACY 0x0800
|
||||
#define CAPWAP_UPDATE_WLAN_CAPABILITY_SHORTPREAMBLE 0x0400
|
||||
#define CAPWAP_UPDATE_WLAN_CAPABILITY_PBCC 0x0200
|
||||
#define CAPWAP_UPDATE_WLAN_CAPABILITY_CHANNELAGILITY 0x0100
|
||||
#define CAPWAP_UPDATE_WLAN_CAPABILITY_SPECTRUMMAN 0x0080
|
||||
#define CAPWAP_UPDATE_WLAN_CAPABILITY_QOS 0x0040
|
||||
#define CAPWAP_UPDATE_WLAN_CAPABILITY_SHORTSLOTTIME 0x0020
|
||||
#define CAPWAP_UPDATE_WLAN_CAPABILITY_APSD 0x0010
|
||||
#define CAPWAP_UPDATE_WLAN_CAPABILITY_DSSS_OFDM 0x0004
|
||||
#define CAPWAP_UPDATE_WLAN_CAPABILITY_DELAYEDACK 0x0002
|
||||
#define CAPWAP_UPDATE_WLAN_CAPABILITY_IMMEDIATEACK 0x0001
|
||||
|
||||
#define CAPWAP_UPDATE_WLAN_KEY_STATUS_MULTICASTKEY 0
|
||||
#define CAPWAP_UPDATE_WLAN_KEY_STATUS_WEP 1
|
||||
#define CAPWAP_UPDATE_WLAN_KEY_STATUS_REKEYINGGTK 2
|
||||
#define CAPWAP_UPDATE_WLAN_KEY_STATUS_COMPLETEGTK 3
|
||||
|
||||
struct capwap_80211_updatewlan_element {
|
||||
uint8_t radioid;
|
||||
uint8_t wlanid;
|
||||
uint16_t capability;
|
||||
uint8_t keyindex;
|
||||
uint8_t keystatus;
|
||||
uint16_t keylength;
|
||||
uint8_t* key;
|
||||
};
|
||||
|
||||
extern struct capwap_message_elements_ops capwap_element_80211_updatewlan_ops;
|
||||
|
||||
#endif /* __CAPWAP_ELEMENT_80211_UPDATE_WLAN_HEADER__ */
|
94
src/common/capwap_element_80211_wtpqos.c
Normal file
94
src/common/capwap_element_80211_wtpqos.c
Normal file
@ -0,0 +1,94 @@
|
||||
#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 |Tagging Policy | QoS Sub-Element ...
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|
||||
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
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| Queue Depth | CWMin | CWMax |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| CWMax | AIFS | Reserved|8021p|RSV| DSCP Tag |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|
||||
Type: 1045 for IEEE 802.11 WTP Quality of Service
|
||||
|
||||
Length: 34
|
||||
|
||||
********************************************************************/
|
||||
|
||||
/* */
|
||||
static void capwap_80211_wtpqos_element_create(void* data, capwap_message_elements_handle handle, struct capwap_write_message_elements_ops* func) {
|
||||
int i;
|
||||
struct capwap_80211_wtpqos_element* element = (struct capwap_80211_wtpqos_element*)data;
|
||||
|
||||
ASSERT(data != NULL);
|
||||
|
||||
func->write_u8(handle, element->radioid);
|
||||
func->write_u8(handle, element->taggingpolicy);
|
||||
for (i = 0; i < CAPWAP_UPDATE_STATION_QOS_SUBELEMENTS; i++) {
|
||||
func->write_u8(handle, element->qos[i].queuedepth);
|
||||
func->write_u16(handle, element->qos[i].cwmin);
|
||||
func->write_u16(handle, element->qos[i].cwmax);
|
||||
func->write_u8(handle, element->qos[i].aifs);
|
||||
func->write_u8(handle, element->qos[i].priority8021p & CAPWAP_WTP_QOS_PRIORIY_MASK);
|
||||
func->write_u8(handle, element->qos[i].dscp & CAPWAP_WTP_QOS_DSCP_MASK);
|
||||
}
|
||||
}
|
||||
|
||||
/* */
|
||||
static void* capwap_80211_wtpqos_element_parsing(capwap_message_elements_handle handle, struct capwap_read_message_elements_ops* func) {
|
||||
int i;
|
||||
struct capwap_80211_wtpqos_element* data;
|
||||
|
||||
ASSERT(handle != NULL);
|
||||
ASSERT(func != NULL);
|
||||
|
||||
if (func->read_ready(handle) != 34) {
|
||||
capwap_logging_debug("Invalid IEEE 802.11 WTP QoS element");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_wtpqos_element*)capwap_alloc(sizeof(struct capwap_80211_wtpqos_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_wtpqos_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_u8(handle, &data->taggingpolicy);
|
||||
for (i = 0; i < CAPWAP_UPDATE_STATION_QOS_SUBELEMENTS; i++) {
|
||||
func->read_u8(handle, &data->qos[i].queuedepth);
|
||||
func->read_u16(handle, &data->qos[i].cwmin);
|
||||
func->read_u16(handle, &data->qos[i].cwmax);
|
||||
func->read_u8(handle, &data->qos[i].aifs);
|
||||
func->read_u8(handle, &data->qos[i].priority8021p);
|
||||
data->qos[i].priority8021p &= CAPWAP_UPDATE_STATION_QOS_PRIORIY_MASK;
|
||||
func->read_u8(handle, &data->qos[i].dscp);
|
||||
data->qos[i].dscp &= CAPWAP_UPDATE_STATION_QOS_DSCP_MASK;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/* */
|
||||
static void capwap_80211_wtpqos_element_free(void* data) {
|
||||
ASSERT(data != NULL);
|
||||
|
||||
capwap_free(data);
|
||||
}
|
||||
|
||||
/* */
|
||||
struct capwap_message_elements_ops capwap_element_80211_wtpqos_ops = {
|
||||
.create_message_element = capwap_80211_wtpqos_element_create,
|
||||
.parsing_message_element = capwap_80211_wtpqos_element_parsing,
|
||||
.free_parsed_message_element = capwap_80211_wtpqos_element_free
|
||||
};
|
34
src/common/capwap_element_80211_wtpqos.h
Normal file
34
src/common/capwap_element_80211_wtpqos.h
Normal file
@ -0,0 +1,34 @@
|
||||
#ifndef __CAPWAP_ELEMENT_80211_WTP_QOS_HEADER__
|
||||
#define __CAPWAP_ELEMENT_80211_WTP_QOS_HEADER__
|
||||
|
||||
#define CAPWAP_ELEMENT_80211_WTP_QOS 1045
|
||||
|
||||
#define CAPWAP_WTP_QOS_SUBELEMENT_VOICE 0
|
||||
#define CAPWAP_WTP_QOS_SUBELEMENT_VIDEO 1
|
||||
#define CAPWAP_WTP_QOS_SUBELEMENT_BESTEFFORT 2
|
||||
#define CAPWAP_WTP_QOS_SUBELEMENT_BACKGROUND 3
|
||||
#define CAPWAP_WTP_QOS_SUBELEMENTS 4
|
||||
|
||||
#define CAPWAP_WTP_QOS_POLICY_MASK 0x1f
|
||||
|
||||
#define CAPWAP_WTP_QOS_PRIORIY_MASK 0x07
|
||||
#define CAPWAP_WTP_QOS_DSCP_MASK 0x3f
|
||||
|
||||
struct capwap_80211_wtpqos_subelement {
|
||||
uint8_t queuedepth;
|
||||
uint16_t cwmin;
|
||||
uint16_t cwmax;
|
||||
uint8_t aifs;
|
||||
uint8_t priority8021p;
|
||||
uint8_t dscp;
|
||||
};
|
||||
|
||||
struct capwap_80211_wtpqos_element {
|
||||
uint8_t radioid;
|
||||
uint8_t taggingpolicy;
|
||||
struct capwap_80211_wtpqos_subelement qos[CAPWAP_WTP_QOS_SUBELEMENTS];
|
||||
};
|
||||
|
||||
extern struct capwap_message_elements_ops capwap_element_80211_wtpqos_ops;
|
||||
|
||||
#endif /* __CAPWAP_ELEMENT_80211_WTP_QOS_HEADER__ */
|
82
src/common/capwap_element_80211_wtpradioconf.c
Normal file
82
src/common/capwap_element_80211_wtpradioconf.c
Normal file
@ -0,0 +1,82 @@
|
||||
#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 |Short Preamble| Num of BSSIDs | DTIM Period |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| BSSID |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| BSSID | Beacon Period |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| Country String |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|
||||
Type: 1046 for IEEE 802.11 WTP WLAN Radio Configuration
|
||||
|
||||
Length: 16
|
||||
|
||||
********************************************************************/
|
||||
|
||||
/* */
|
||||
static void capwap_80211_wtpradioconf_element_create(void* data, capwap_message_elements_handle handle, struct capwap_write_message_elements_ops* func) {
|
||||
struct capwap_80211_wtpradioconf_element* element = (struct capwap_80211_wtpradioconf_element*)data;
|
||||
|
||||
ASSERT(data != NULL);
|
||||
|
||||
func->write_u8(handle, element->radioid);
|
||||
func->write_u8(handle, element->shortpreamble);
|
||||
func->write_u8(handle, element->maxbssid);
|
||||
func->write_u8(handle, element->dtimperiod);
|
||||
func->write_block(handle, element->bssid, CAPWAP_WTP_RADIO_CONF_BSSID_LENGTH);
|
||||
func->write_u16(handle, element->beaconperiod);
|
||||
func->write_block(handle, element->country, CAPWAP_WTP_RADIO_CONF_COUNTRY_LENGTH);
|
||||
}
|
||||
|
||||
/* */
|
||||
static void* capwap_80211_wtpradioconf_element_parsing(capwap_message_elements_handle handle, struct capwap_read_message_elements_ops* func) {
|
||||
struct capwap_80211_wtpradioconf_element* data;
|
||||
|
||||
ASSERT(handle != NULL);
|
||||
ASSERT(func != NULL);
|
||||
|
||||
if (func->read_ready(handle) != 16) {
|
||||
capwap_logging_debug("Invalid IEEE 802.11 WTP WLAN Radio Configuration element");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_wtpradioconf_element*)capwap_alloc(sizeof(struct capwap_80211_wtpradioconf_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_wtpradioconf_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_u8(handle, &data->shortpreamble);
|
||||
func->read_u8(handle, &data->maxbssid);
|
||||
func->read_u8(handle, &data->dtimperiod);
|
||||
func->read_block(handle, data->bssid, CAPWAP_WTP_RADIO_CONF_BSSID_LENGTH);
|
||||
func->read_u16(handle, &data->beaconperiod);
|
||||
func->read_block(handle, data->country, CAPWAP_WTP_RADIO_CONF_COUNTRY_LENGTH);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/* */
|
||||
static void capwap_80211_wtpradioconf_element_free(void* data) {
|
||||
ASSERT(data != NULL);
|
||||
|
||||
capwap_free(data);
|
||||
}
|
||||
|
||||
/* */
|
||||
struct capwap_message_elements_ops capwap_element_80211_wtpradioconf_ops = {
|
||||
.create_message_element = capwap_80211_wtpradioconf_element_create,
|
||||
.parsing_message_element = capwap_80211_wtpradioconf_element_parsing,
|
||||
.free_parsed_message_element = capwap_80211_wtpradioconf_element_free
|
||||
};
|
24
src/common/capwap_element_80211_wtpradioconf.h
Normal file
24
src/common/capwap_element_80211_wtpradioconf.h
Normal file
@ -0,0 +1,24 @@
|
||||
#ifndef __CAPWAP_ELEMENT_80211_WTP_RADIO_CONF_HEADER__
|
||||
#define __CAPWAP_ELEMENT_80211_WTP_RADIO_CONF_HEADER__
|
||||
|
||||
#define CAPWAP_ELEMENT_80211_WTP_RADIO_CONF 1046
|
||||
|
||||
#define CAPWAP_WTP_RADIO_CONF_BSSID_LENGTH 6
|
||||
#define CAPWAP_WTP_RADIO_CONF_COUNTRY_LENGTH 6
|
||||
|
||||
#define CAPWAP_WTP_RADIO_CONF_SHORTPREAMBLE_DISABLE 0
|
||||
#define CAPWAP_WTP_RADIO_CONF_SHORTPREAMBLE_ENABLE 1
|
||||
|
||||
struct capwap_80211_wtpradioconf_element {
|
||||
uint8_t radioid;
|
||||
uint8_t shortpreamble;
|
||||
uint8_t maxbssid;
|
||||
uint8_t dtimperiod;
|
||||
uint8_t bssid[CAPWAP_WTP_RADIO_CONF_BSSID_LENGTH];
|
||||
uint16_t beaconperiod;
|
||||
uint8_t country[CAPWAP_WTP_RADIO_CONF_COUNTRY_LENGTH];
|
||||
};
|
||||
|
||||
extern struct capwap_message_elements_ops capwap_element_80211_wtpradioconf_ops;
|
||||
|
||||
#endif /* __CAPWAP_ELEMENT_80211_WTP_RADIO_CONF_HEADER__ */
|
70
src/common/capwap_element_80211_wtpradiofailalarm.c
Normal file
70
src/common/capwap_element_80211_wtpradiofailalarm.c
Normal file
@ -0,0 +1,70 @@
|
||||
#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 | Type | Status | Pad |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|
||||
Type: 1047 for IEEE 802.11 WTP Radio Fail Alarm Indication
|
||||
|
||||
Length: 4
|
||||
|
||||
********************************************************************/
|
||||
|
||||
/* */
|
||||
static void capwap_80211_wtpradiofailalarm_element_create(void* data, capwap_message_elements_handle handle, struct capwap_write_message_elements_ops* func) {
|
||||
struct capwap_80211_wtpradiofailalarm_element* element = (struct capwap_80211_wtpradiofailalarm_element*)data;
|
||||
|
||||
ASSERT(data != NULL);
|
||||
|
||||
func->write_u8(handle, element->radioid);
|
||||
func->write_u8(handle, element->type);
|
||||
func->write_u8(handle, element->status);
|
||||
func->write_u8(handle, element->pad);
|
||||
}
|
||||
|
||||
/* */
|
||||
static void* capwap_80211_wtpradiofailalarm_element_parsing(capwap_message_elements_handle handle, struct capwap_read_message_elements_ops* func) {
|
||||
struct capwap_80211_wtpradiofailalarm_element* data;
|
||||
|
||||
ASSERT(handle != NULL);
|
||||
ASSERT(func != NULL);
|
||||
|
||||
if (func->read_ready(handle) != 4) {
|
||||
capwap_logging_debug("Invalid IEEE 802.11 WTP Radio Fail Alarm Indication element");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* */
|
||||
data = (struct capwap_80211_wtpradiofailalarm_element*)capwap_alloc(sizeof(struct capwap_80211_wtpradiofailalarm_element));
|
||||
if (!data) {
|
||||
capwap_outofmemory();
|
||||
}
|
||||
|
||||
/* Retrieve data */
|
||||
memset(data, 0, sizeof(struct capwap_80211_wtpradiofailalarm_element));
|
||||
func->read_u8(handle, &data->radioid);
|
||||
func->read_u8(handle, &data->type);
|
||||
func->read_u8(handle, &data->status);
|
||||
func->read_u8(handle, &data->pad);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/* */
|
||||
static void capwap_80211_wtpradiofailalarm_element_free(void* data) {
|
||||
ASSERT(data != NULL);
|
||||
|
||||
capwap_free(data);
|
||||
}
|
||||
|
||||
/* */
|
||||
struct capwap_message_elements_ops capwap_element_80211_wtpradiofailalarm_ops = {
|
||||
.create_message_element = capwap_80211_wtpradiofailalarm_element_create,
|
||||
.parsing_message_element = capwap_80211_wtpradiofailalarm_element_parsing,
|
||||
.free_parsed_message_element = capwap_80211_wtpradiofailalarm_element_free
|
||||
};
|
18
src/common/capwap_element_80211_wtpradiofailalarm.h
Normal file
18
src/common/capwap_element_80211_wtpradiofailalarm.h
Normal file
@ -0,0 +1,18 @@
|
||||
#ifndef __CAPWAP_ELEMENT_80211_WTP_RADIO_FAIL_ALARM_HEADER__
|
||||
#define __CAPWAP_ELEMENT_80211_WTP_RADIO_FAIL_ALARM_HEADER__
|
||||
|
||||
#define CAPWAP_ELEMENT_80211_WTP_RADIO_FAIL_ALARM 1047
|
||||
|
||||
#define CAPWAP_WTP_RADIO_FAIL_ALARM_TYPE_RECEIVER 1
|
||||
#define CAPWAP_WTP_RADIO_FAIL_ALARM_TYPE_TRANSMITTER 2
|
||||
|
||||
struct capwap_80211_wtpradiofailalarm_element {
|
||||
uint8_t radioid;
|
||||
uint8_t type;
|
||||
uint8_t status;
|
||||
uint8_t pad;
|
||||
};
|
||||
|
||||
extern struct capwap_message_elements_ops capwap_element_80211_wtpradiofailalarm_ops;
|
||||
|
||||
#endif /* __CAPWAP_ELEMENT_80211_WTP_RADIO_FAIL_ALARM_HEADER__ */
|
Loading…
Reference in New Issue
Block a user