Configuration Request and Reponse

FossilOrigin-Name: 7ee0e857269b188cb3b1b720d5f9ea4be45c211ea8ccccb7abadcb74587b3870
This commit is contained in:
7u83@mail.ru
2018-04-17 05:46:09 +00:00
parent 7968096687
commit 36905beefd
26 changed files with 438 additions and 99 deletions

View File

@ -2,6 +2,7 @@
#include "cw/capwap.h"
#include "cw/cw.h"
#include "cw/dbg.h"
#include "cw/dot11.h"
#include "cw/capwap80211.h"
@ -9,7 +10,9 @@
#include "mod_capwap80211.h"
static int capwap80211_in_crate_set(struct cw_ElemHandler *eh,
struct cw_ElemHandlerParams *params,
uint8_t * data, int len);
static struct cw_ElemHandler handlers[] = {
{
@ -23,6 +26,17 @@ static struct cw_ElemHandler handlers[] = {
cw_out_radio_generic /* put */
}
,
{
"IEEE 802.11 Rate Set", /* name */
CAPWAP80211_ELEM_RATE_SET, /* Element ID */
0, 0, /* Vendor / Proto */
3, 0, /* min/max length */
NULL, /* type */
"rate_set", /* Key */
capwap80211_in_crate_set, /* get */
NULL /* put */
}
,
{NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL}
@ -45,35 +59,48 @@ static struct cw_ElemDef join_request_elements[] = {
static int join_response_states[] = { CAPWAP_STATE_JOIN, 0 };
static struct cw_ElemDef join_response_elements[] = {
{0, 0, CAPWAP80211_ELEM_WTP_RADIO_INFORMATION, 1, 0},
{0, 0, CAPWAP80211_ELEM_WTP_RADIO_INFORMATION, 1, 0},
{0, 0, 0, 0, 0}
};
static int configuration_status_response_states[] = { CAPWAP_STATE_JOIN, 0 };
static struct cw_ElemDef configuration_status_response_elements[] = {
{0, 0, CAPWAP80211_ELEM_RATE_SET , 1, 0},
{0, 0, 0, 0, 0}
};
static struct cw_MsgDef messages[] = {
{
NULL,
CAPWAP_MSG_DISCOVERY_REQUEST,
CW_ROLE_AC,
discovery_request_states,
discovery_request_elements
NULL,
CAPWAP_MSG_DISCOVERY_REQUEST,
CW_ROLE_AC,
discovery_request_states,
discovery_request_elements
}
,
{
NULL,
CAPWAP_MSG_JOIN_REQUEST,
CW_ROLE_AC,
join_request_states,
join_request_elements
NULL,
CAPWAP_MSG_JOIN_REQUEST,
CW_ROLE_AC,
join_request_states,
join_request_elements
}
,
{
NULL,
CAPWAP_MSG_JOIN_RESPONSE,
CW_ROLE_AC,
join_response_states,
join_response_elements
NULL,
CAPWAP_MSG_JOIN_RESPONSE,
CW_ROLE_AC,
join_response_states,
join_response_elements
}
,
{
NULL,
CAPWAP_MSG_CONFIGURATION_STATUS_RESPONSE,
CW_ROLE_WTP,
configuration_status_response_states,
configuration_status_response_elements
}
,
{0, 0, 0, 0, 0}
@ -92,3 +119,21 @@ int mode;
return set;
}
static int capwap80211_in_crate_set(struct cw_ElemHandler *eh,
struct cw_ElemHandlerParams *params,
uint8_t * data, int len)
{
int radio;
int i;
radio = cw_get_byte(data);
for (i=0; i<len-1; i++){
int rate = (data+1)[i];
}
}