cisco_in_wtp_radio_cofniguration mostly completed.

FossilOrigin-Name: d6429b618eff398c654ae935a822fc37f5cb066247abb33415324aef972ccad6
This commit is contained in:
7u83@mail.ru 2016-04-02 16:44:56 +00:00
parent 99ce56872c
commit 63608bb031
11 changed files with 74 additions and 3 deletions

View File

@ -15,10 +15,10 @@ CFLAGS += -Wall -g -O0 -D_REENTRANT -DIPV6 -I/usr/local/include -I../ -DSYS_ARCH
LIBS+=-lcapwap
LIBS+=-lcapwap80211
LIBS+=-lcipwap
LIBS+=-lcisco
LIBS+=-lfortinet
LIBS+=-lcapwap80211
LIBS+=-lcw
LIBS+=-lrt
LIBS+=-lpthread

View File

@ -19,6 +19,8 @@ const char CW_RADIOITEM80211_RX_MSDU_LIFETIME[]="rx_msdu_lifetime";
/* Radio Config Items */
const char CW_RADIOITEM80211_SHORT_PREAMBLE[]="short_preamble";
const char CW_RADIOITEM80211_NUM_BSS_IDS[]="num_bss_ids";
const char CW_RADIOITEM80211_DTIM_PERIOD[]="dtim_period";
const char CW_RADIOITEM80211_BSSID[]="bssid";
const char CW_RADIOITEM80211_BEACON_PERIOD[]="beacon_period";
const char CW_RADIOITEM80211_COUNTRY_STRING[]="country_string";
@ -51,6 +53,8 @@ struct cw_itemdef capwap80211_radioitemdefs[] = {
/* Radio Config Items */
{CW_RADIOITEM80211_SHORT_PREAMBLE,CW_ITEM_NONE,MBAG_BYTE},
{CW_RADIOITEM80211_NUM_BSS_IDS,CW_ITEM_NONE,MBAG_BYTE},
{CW_RADIOITEM80211_DTIM_PERIOD,CW_ITEM_NONE,MBAG_BYTE},
{CW_RADIOITEM80211_BSSID,CW_ITEM_NONE,MBAG_BYTE},
{CW_RADIOITEM80211_BEACON_PERIOD,CW_ITEM_NONE,MBAG_WORD},
{CW_RADIOITEM80211_COUNTRY_STRING,CW_ITEM_NONE,MBAG_BSTR16},

View File

@ -19,6 +19,14 @@ extern const char CW_RADIOITEM80211_LONG_RETRY[];
extern const char CW_RADIOITEM80211_TX_MSDU_LIFETIME[];
extern const char CW_RADIOITEM80211_RX_MSDU_LIFETIME[];
/* Radio Config Items */
extern const char CW_RADIOITEM80211_SHORT_PREAMBLE[];
extern const char CW_RADIOITEM80211_NUM_BSS_IDS[];
extern const char CW_RADIOITEM80211_DTIM_PERIOD[];
extern const char CW_RADIOITEM80211_BSSID[];
extern const char CW_RADIOITEM80211_BEACON_PERIOD[];
extern const char CW_RADIOITEM80211_COUNTRY_STRING[];
#endif

View File

@ -36,8 +36,32 @@ static struct mbag_item * from_str(const char *src)
}
static struct mbag_item * get(const uint8_t *src,int len)
{
mbag_item_t * item = mbag_item_new(MBAG_DATA);
if (!item)
return NULL;
uint8_t *data = malloc(len+1);
if (!data){
free (item);
return NULL;
}
*data=len;
memcpy(data+1,src,len);
item->data=data;
return item;
}
const struct mbag_typedef mbag_type_data = {
"Data",free,to_str,from_str
.name = "Binary Data",
.del = free,
.from_str = from_str,
.to_str = to_str,
.get = get
};

View File

@ -23,11 +23,13 @@ struct cw_itemdef cipwap_itemdefs[] = {
const char CIPWAP_RADIOITEM80211_OCCUPANCY_LIMIT[]="occupancy_limit";
const char CIPWAP_RADIOITEM80211_CFP_PERIOD[]="cfp_period";
const char CIPWAP_RADIOITEM80211_CFP_MAXIMUM_DURATION[]="cfp_max_duration";
struct cw_itemdef cipwap_radioitemdefs[] = {
{CIPWAP_RADIOITEM80211_OCCUPANCY_LIMIT,CW_ITEM_NONE,MBAG_WORD},
{CIPWAP_RADIOITEM80211_CFP_PERIOD,CW_ITEM_NONE,MBAG_BYTE},
{CIPWAP_RADIOITEM80211_CFP_MAXIMUM_DURATION,CW_ITEM_NONE,MBAG_WORD},
{CW_ITEM_NONE}

View File

@ -7,6 +7,7 @@ extern const char CIPWAP_ITEM_AP_HASH_VALUE[];
extern const char CIPWAP_RADIOITEM80211_OCCUPANCY_LIMIT[];
extern const char CIPWAP_RADIOITEM80211_CFP_PERIOD[];
extern const char CIPWAP_RADIOITEM80211_CFP_MAXIMUM_DURATION[];
extern struct cw_itemdef cipwap_itemdefs[];
extern struct cw_itemdef cipwap_radioitemdefs[];

View File

@ -36,5 +36,7 @@ int cisco_out_radio_administrative_states(struct conn *conn, struct cw_action_ou
int cisco80211_in_mac_operation(struct conn *conn, struct cw_action_in *a, uint8_t * data,
int len, struct sockaddr *from);
int cisco80211_in_wtp_radio_configuration(struct conn *conn, struct cw_action_in *a, uint8_t * data,
int len, struct sockaddr *from);
#endif

View File

@ -5,6 +5,7 @@
#include "cw/dbg.h"
#include "include/cipwap_items.h"
#include "cw/capwap80211_items.h"
#include "cisco_items.h"
@ -21,7 +22,16 @@ int cisco80211_in_wtp_radio_configuration(struct conn *conn, struct cw_action_in
mbag_set_byte(r,CISCO_RADIOITEM80211_CFG_TYPE,cw_get_byte(data+1));
mbag_set_word(r,CIPWAP_RADIOITEM80211_OCCUPANCY_LIMIT,cw_get_word(data+2));
mbag_set_byte(r,CIPWAP_RADIOITEM80211_CFP_PERIOD,cw_get_byte(data+4));
mbag_set_word(r,CIPWAP_RADIOITEM80211_CFP_MAXIMUM_DURATION,cw_get_word(data+5));
struct mbag_item * bssid = MBAG_DATA->get(data+7,6);
bssid->id=CW_RADIOITEM80211_BSSID;
mbag_set(r,bssid);
mbag_set_word(r,CW_RADIOITEM80211_BEACON_PERIOD,cw_get_word(data+13));
mbag_set_bstr16n(r,CW_RADIOITEM80211_COUNTRY_STRING,data+15,3);
mbag_set_bstr16n(r,CISCO_RADIOITEM80211_COUNTRY_STR1,data+15,3);
mbag_set_bstr16n(r,CISCO_RADIOITEM80211_COUNTRY_STR2,data+18,3);
return 1;

View File

@ -141,6 +141,20 @@ static cw_action_in_t actions_in[] = {
*/
/* Element Cisco 802.11 Radio Conffig - Config Status Resp */
{
.capwap_state = CW_STATE_CONFIGURE,
.msg_id = CW_MSG_CONFIGURATION_STATUS_RESPONSE,
.vendor_id = CW_VENDOR_ID_CISCO,
.elem_id = CW_CISCO_WTP_RADIO_CFG,
.start=cisco80211_in_wtp_radio_configuration,
.item_id = "cisco_radio_cfg",
}
,
{
/* Cisco's Vendor specific encapsulation
* of LWAPP elements */

View File

@ -13,10 +13,14 @@ struct cw_itemdef cisco_itemdefs[] = {
const char CISCO_RADIOITEM80211_CFG_TYPE[]="cisco_radio_cfg_type";
const char CISCO_RADIOITEM80211_COUNTRY_STR1[]="cisco_country_str1";
const char CISCO_RADIOITEM80211_COUNTRY_STR2[]="cisco_country_str2";
struct cw_itemdef cisco_iradioitemdefs[] = {
struct cw_itemdef cisco_radioitemdefs[] = {
{CISCO_RADIOITEM80211_CFG_TYPE,CW_ITEM_NONE,MBAG_BYTE},
{CISCO_RADIOITEM80211_COUNTRY_STR1,CW_ITEM_NONE,MBAG_BSTR},
{CISCO_RADIOITEM80211_COUNTRY_STR2,CW_ITEM_NONE,MBAG_BSTR},
{CW_ITEM_NONE}
};

View File

@ -6,6 +6,8 @@ extern const char CISCO_ITEM_AP_MODE_AND_TYPE[];
extern struct cw_itemdef cisco_itemdefs[];
extern const char CISCO_RADIOITEM80211_CFG_TYPE[];
extern const char CISCO_RADIOITEM80211_COUNTRY_STR1[];
extern const char CISCO_RADIOITEM80211_COUNTRY_STR2[];
extern struct cw_itemdef cisco_radioitemdefs[];