Work on radio admin state ...
FossilOrigin-Name: dd3899fd9ec453e8722f0e927878ddef7b3e2aaca717b32866cedf07e1167f4e
This commit is contained in:
@ -174,6 +174,22 @@
|
||||
0, /* ID to use store */ \
|
||||
4, 4 /* min/max length */
|
||||
|
||||
#define CW_ACTION_IN_RADIO_ADMINISTRATIVE_STATE_WTP \
|
||||
CW_ELEM_RADIO_ADMINISTRATIVE_STATE, /* Element ID*/ \
|
||||
cw_in_radio_administrative_state_wtp, 0, /* start/end callback */ \
|
||||
MBAG_DWORD, /* Type of element */ \
|
||||
0, /* ID to use store */ \
|
||||
4, 4 /* min/max length */
|
||||
|
||||
|
||||
|
||||
|
||||
#define CW_ACTION_IN_MAXIMUM_MESSAGE_LENGTH \
|
||||
CW_ELEM_MAXIMUM_MESSAGE_LENGTH, /* Element ID*/ \
|
||||
cw_in_generic, 0, /* start/end callback */ \
|
||||
MBAG_WORD, /* Type of element */ \
|
||||
CW_ITEM_MAXIMUM_MESSAGE_LENGTH /* ID to use store */ \
|
||||
2, 2 /* min/max length */
|
||||
|
||||
|
||||
|
||||
|
@ -68,6 +68,11 @@ cw_action_in_t capwap_actions_wtp_in[] = {
|
||||
0, cw_in_check_join_resp }
|
||||
,
|
||||
|
||||
/* Result Code */
|
||||
{0, 0, CW_STATE_JOIN, CW_MSG_JOIN_RESPONSE,
|
||||
CW_ACTION_IN_RESULT_CODE, 1}
|
||||
,
|
||||
|
||||
/* AC Descriptor */
|
||||
{0, 0, CW_STATE_JOIN, CW_MSG_JOIN_RESPONSE,
|
||||
CW_ACTION_IN_AC_DESCRIPTOR, 1}
|
||||
@ -78,13 +83,14 @@ cw_action_in_t capwap_actions_wtp_in[] = {
|
||||
CW_ACTION_IN_AC_NAME, 1}
|
||||
,
|
||||
|
||||
/* Vendor Specific */
|
||||
|
||||
/* CAPWAP Control IPv4 Address */
|
||||
{0, 0, CW_STATE_JOIN, CW_MSG_JOIN_RESPONSE,
|
||||
CW_ACTION_IN_RESULT_CODE, 1}
|
||||
CW_ACTION_IN_CAPWAP_CONTROL_IPV4_ADDRESS, 1}
|
||||
,
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------------- */
|
||||
@ -102,7 +108,7 @@ cw_action_in_t capwap_actions_wtp_in[] = {
|
||||
|
||||
/* ------------------------------------------------------------------------------- */
|
||||
|
||||
/* Message Image Data Request */
|
||||
/* Message Image Data Request IN */
|
||||
{0, 0, CW_STATE_IMAGE_DATA, CW_MSG_IMAGE_DATA_REQUEST, 0,
|
||||
0, cw_in_check_img_data_req_wtp }
|
||||
,
|
||||
@ -133,13 +139,12 @@ cw_action_in_t capwap_actions_wtp_in[] = {
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------------- */
|
||||
|
||||
/* Message Change State Response IN */
|
||||
{0, 0, CW_STATE_CONFIGURE, CW_MSG_CHANGE_STATE_EVENT_RESPONSE, 0,
|
||||
0,0 }
|
||||
0, cw_in_check_cfg_update_req }
|
||||
,
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------------- */
|
||||
/* Message Configuration Update Request IN */
|
||||
{0, 0, CW_STATE_RUN, CW_MSG_CONFIGURATION_UPDATE_REQUEST,
|
||||
0, 0,0 }
|
||||
@ -151,7 +156,7 @@ cw_action_in_t capwap_actions_wtp_in[] = {
|
||||
|
||||
|
||||
{0, 0, CW_STATE_RUN, CW_MSG_CONFIGURATION_UPDATE_REQUEST,
|
||||
CW_ACTION_IN_RADIO_ADMINISTRATIVE_STATE, 0}
|
||||
CW_ACTION_IN_RADIO_ADMINISTRATIVE_STATE_WTP, 0}
|
||||
,
|
||||
|
||||
|
||||
@ -163,6 +168,7 @@ cw_action_in_t capwap_actions_wtp_in[] = {
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------------- */
|
||||
/* Echo Response Response IN */
|
||||
{0, 0, CW_STATE_RUN, CW_MSG_ECHO_RESPONSE, 0,
|
||||
0,0 }
|
||||
@ -316,6 +322,11 @@ cw_action_out_t capwap_actions_wtp_out[] = {
|
||||
{CW_MSG_CHANGE_STATE_EVENT_REQUEST, CW_ITEM_NONE}
|
||||
,
|
||||
|
||||
/* Radio Ooerational State */
|
||||
{CW_MSG_CHANGE_STATE_EVENT_REQUEST, CW_ITEM_RADIO_OPER_STATE, 0,
|
||||
0, NULL, cw_out_radio_operational_states, cw_out_get_config,1}
|
||||
,
|
||||
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------------------
|
||||
@ -325,10 +336,16 @@ cw_action_out_t capwap_actions_wtp_out[] = {
|
||||
,
|
||||
|
||||
/* -------------------------------------------------------------------------------
|
||||
* Echo Request Request OUT
|
||||
* Configuration Update Response
|
||||
*/
|
||||
{CW_MSG_CONFIGURATION_UPDATE_RESPONSE, CW_ITEM_NONE}
|
||||
,
|
||||
|
||||
/* Radio Oper State */
|
||||
{CW_MSG_CONFIGURATION_UPDATE_RESPONSE, CW_ITEM_RADIO_OPER_STATE, 0,
|
||||
0, NULL, cw_out_radio_operational_states, cw_out_get_config,1}
|
||||
,
|
||||
|
||||
|
||||
{0, 0}
|
||||
|
||||
|
@ -46,6 +46,8 @@
|
||||
#define CW_CISCO_DIRECT_SEQUENCE_CONTROL LW_ELEM_DIRECT_SEQUENCE_CONTROL /* 14 */
|
||||
#define CW_CISCO_SUPPORTED_RATES LW_ELEM_80211_RATE_SET /* 16 */
|
||||
|
||||
#define CW_CISCO_80211_DELETE_WLAN LW_ELEM_80211_DELETE_WLAN /* 28 */
|
||||
|
||||
#define CW_CISCO_MWAR_NAME LW_ELEM_AC_NAME /* 31 */
|
||||
|
||||
#define CW_CISCO_LOCATION_DATA LW_ELEM_LOCATION_DATA /* 35 */
|
||||
@ -61,6 +63,8 @@
|
||||
|
||||
|
||||
#define CW_CISCO_AP_STATIC_IP_ADDR 83
|
||||
#define CW_CISCO_SIG_PAYLOAD 84
|
||||
#define CW_CISCO_SIG_TOGGLE 87
|
||||
|
||||
#define CW_CISCO_AC_NAME_WITH_INDEX 91
|
||||
#define CW_CISCO_SPAM_DOMAIN_SECRET 96
|
||||
@ -212,41 +216,13 @@ int cw_out_cisco_wtp_radio_cfg(struct conn *conn, struct cw_action_out *a, uint8
|
||||
int cw_in_cisco_radio_administrative_state(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len,
|
||||
struct sockaddr *from);
|
||||
|
||||
int cw_in_cisco_radio_administrative_state_wtp(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len,
|
||||
struct sockaddr *from);
|
||||
|
||||
|
||||
/*
|
||||
#define cw_addelem_cisco_rad(dst,acinfo)\
|
||||
lw_put_ac_descriptor(dst+10,acinfo)
|
||||
cw_put_elem_vedor_hdr(dst,CW_VENDOR_ID_CISCO,CW_CISCO_RAD,
|
||||
*/
|
||||
int cw_in_cisco_radio_cfg(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len,
|
||||
struct sockaddr *from);
|
||||
|
||||
|
||||
|
||||
/* cwmsg methods */
|
||||
|
||||
/*
|
||||
#define cwmsg_addelem_cisco_ap_timesync(cwmsg,time,type)\
|
||||
(cwmsg)->pos+=cw_addelem_cisco_ap_timesync(((cwmsg)->msgelems+(cwmsg)->pos),time,type)
|
||||
|
||||
#define cwmsg_addelem_cisco_rad_name(cwmsg,name)\
|
||||
(cwmsg)->pos+=cw_addelem_cisco_rad_name(((cwmsg)->msgelems+(cwmsg)->pos),(name))
|
||||
|
||||
#define cwmsg_addelem_cisco_ap_grpoup_name(cwmsg,name)\
|
||||
(cwmsg)->pos+=cw_addelem_ap_group_name(((cwmsg)->msgelems+(cwmsg)->pos),(name))
|
||||
|
||||
#define cwmsg_addelem_cisco_mwar(cwmsg,acinfo)\
|
||||
(cwmsg)->pos+=cw_addelem_cisco_mwar(((cwmsg)->msgelems+(cwmsg)->pos),(acinfo))
|
||||
|
||||
#define cwmsg_addelem_cisco_certificate(cwmsg,crt,len)\
|
||||
(cwmsg)->pos+=cw_addelem_cisco_certificate(((cwmsg)->msgelems+(cwmsg)->pos),crt,len)
|
||||
|
||||
#define cwmsg_addelem_cisco_ap_regulatory_domain(cwmsg,radioinfo)\
|
||||
(cwmsg)->pos+=cw_addelem_cisco_ap_regulatory_domain(((cwmsg)->msgelems+(cwmsg)->pos),radioinfo)
|
||||
|
||||
#define cwmsg_addelem_cisco_wtp_radio_cfg(cwmsg,radioinfo)\
|
||||
(cwmsg)->pos+=cw_addelem_cisco_wtp_radio_cfg(((cwmsg)->msgelems+(cwmsg)->pos),radioinfo)
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -51,7 +51,7 @@ enum capwap_items {
|
||||
CW_ITEM_AC_HASH_VALUE,
|
||||
|
||||
CW_ITEM_AC_NAME_WITH_PRIORITY,
|
||||
|
||||
CW_ITEM_MAXIMUM_MESSAGE_LENGTH,
|
||||
|
||||
|
||||
/* CIPWAP and Cisco */
|
||||
@ -70,7 +70,9 @@ enum capwap_items {
|
||||
CW_ITEM_AP_MODE_AND_TYPE,
|
||||
|
||||
CW_ITEM_CISCO_BOARD_DATA_OPTIONS,
|
||||
CW_ITEM_RADIOS
|
||||
CW_ITEM_RADIOS,
|
||||
CW_ITEM_RADIO_OPER_STATE,
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
@ -17,3 +17,20 @@
|
||||
4, 4 /* min/max length */
|
||||
|
||||
|
||||
#define CW_ACTION_IN_CISCO_RADIO_ADMINISTRATIVE_STATE_WTP \
|
||||
CW_ELEM_RADIO_ADMINISTRATIVE_STATE, /* Element ID*/ \
|
||||
cw_in_cisco_radio_administrative_state_wtp, 0, /* start/end callback */ \
|
||||
MBAG_DWORD, /* Type of element */ \
|
||||
0, /* ID to use store */ \
|
||||
4, 4 /* min/max length */
|
||||
|
||||
|
||||
|
||||
#define CW_ACTION_IN_CISCO_RADIO_CFG\
|
||||
CW_CISCO_WTP_RADIO_CFG, /* Element ID*/ \
|
||||
cw_in_cisco_radio_cfg, 0, /* start/end callback */ \
|
||||
NULL, /* Type of element */ \
|
||||
0, /* ID to use store */ \
|
||||
0, 1114 /* min/max length */
|
||||
|
||||
|
||||
|
@ -45,14 +45,16 @@ cw_action_in_t cipwap_actions_wtp_in[] = {
|
||||
cw_in_ac_name_with_priority, 0, MBAG_BSTR16,CW_ITEM_AC_NAME_WITH_PRIORITY,0,512}
|
||||
,
|
||||
|
||||
|
||||
/* AP Mode an Type */
|
||||
{CW_VENDOR_ID_CISCO, 0, CW_STATE_RUN, CW_MSG_CONFIGURATION_UPDATE_REQUEST,
|
||||
CW_ACTION_IN_CISCO_AP_MODE_AND_TYPE,
|
||||
1}
|
||||
,
|
||||
|
||||
/* Radio Administrative State */
|
||||
/* Oveload CAPWAP action to handle a radio ID of 255 */
|
||||
{0, 0, CW_STATE_RUN, CW_MSG_CONFIGURATION_UPDATE_REQUEST,
|
||||
CW_ACTION_IN_CISCO_RADIO_ADMINISTRATIVE_STATE, 0}
|
||||
CW_ACTION_IN_CISCO_RADIO_ADMINISTRATIVE_STATE_WTP, 0}
|
||||
,
|
||||
|
||||
|
||||
@ -67,7 +69,11 @@ cw_action_in_t cipwap_actions_wtp_in[] = {
|
||||
* Configuration Status Response IN
|
||||
*/
|
||||
{0, 0, CW_STATE_CONFIGURE, CW_MSG_CONFIGURATION_STATUS_RESPONSE,
|
||||
CW_ACTION_IN_RADIO_ADMINISTRATIVE_STATE, 0}
|
||||
CW_ACTION_IN_RADIO_ADMINISTRATIVE_STATE_WTP, 0}
|
||||
,
|
||||
|
||||
{CW_VENDOR_ID_CISCO, 0, CW_STATE_CONFIGURE, CW_MSG_CONFIGURATION_STATUS_RESPONSE,
|
||||
CW_ACTION_IN_CISCO_RADIO_CFG, 0}
|
||||
,
|
||||
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include "mbag.h"
|
||||
#include "radio.h"
|
||||
#include "log.h"
|
||||
#include "dbg.h"
|
||||
|
||||
int cw_put_cisco_wtp_radio_cfg(uint8_t *dst, int rid, mbag_t radio)
|
||||
{
|
||||
@ -112,3 +113,59 @@ int cw_out_cisco_wtp_radio_cfg(struct conn *conn, struct cw_action_out *a, uint8
|
||||
// return l+cw_out_cisco_wtp_radio_cfg_(conn,a,dst+l,1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int cw_in_cisco_radio_cfg(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len,
|
||||
struct sockaddr *from)
|
||||
{
|
||||
|
||||
int rid = cw_get_byte(data);
|
||||
mbag_t radio = mbag_get_mbag(conn->radios,rid,NULL);
|
||||
if ( !radio){
|
||||
cw_dbg(DBG_ELEM_ERR,"Radio ID %d not defined",rid);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// printf("Here we are %d\n",rid);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int cw_radio_cisco_set_state(struct conn * conn, uint8_t *data, int len, int cause)
|
||||
{
|
||||
|
||||
int rid = cw_get_byte(data);
|
||||
int state = cw_get_byte(data+1);
|
||||
if (rid != 255)
|
||||
return cw_radio_set_admin_state(conn->radios,rid,state,cause);
|
||||
|
||||
|
||||
MAVLITER_DEFINE(it,conn->radios);
|
||||
mavliter_foreach(&it){
|
||||
mbag_item_t *i = mavliter_get(&it);
|
||||
cw_radio_set_admin_state(conn->radios,i->id,state,cause);
|
||||
|
||||
}
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
int cw_in_cisco_radio_administrative_state(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len,
|
||||
struct sockaddr *from)
|
||||
{
|
||||
return cw_radio_cisco_set_state(conn,data,len,-1);
|
||||
}
|
||||
|
||||
|
||||
int cw_in_cisco_radio_administrative_state_wtp(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len,
|
||||
struct sockaddr *from)
|
||||
{
|
||||
return cw_radio_cisco_set_state(conn,data,len,3);
|
||||
}
|
||||
|
||||
|
||||
|
@ -114,6 +114,12 @@ const char * cw_cisco_id_to_str(int elem_id)
|
||||
return "AP Retransmit Param";
|
||||
case CW_CISCO_AP_VENUE_SETTINGS:
|
||||
return "AP Venue Settings";
|
||||
case CW_CISCO_80211_DELETE_WLAN:
|
||||
return "Delete WLAN";
|
||||
case CW_CISCO_SIG_PAYLOAD:
|
||||
return "Signature Payload";
|
||||
case CW_CISCO_SIG_TOGGLE:
|
||||
return "Signature Toggle";
|
||||
|
||||
default:
|
||||
return "Unknown";
|
||||
|
@ -1,30 +0,0 @@
|
||||
|
||||
#include "capwap.h"
|
||||
#include "intavltree.h"
|
||||
#include "dbg.h"
|
||||
#include "log.h"
|
||||
#include "capwap_items.h"
|
||||
|
||||
int cw_in_check_cfg_update_req(struct conn *conn, struct cw_action_in *a, uint8_t * data,
|
||||
int len,struct sockaddr *from)
|
||||
{
|
||||
|
||||
cw_action_in_t * mlist[60];
|
||||
|
||||
/* Check for mandatory elements */
|
||||
int n = cw_check_missing_mand(mlist,conn,a);
|
||||
if (n) {
|
||||
if ( conn->strict_capwap ){
|
||||
cw_dbg_missing_mand(DBG_MSG_ERR,conn,mlist,n,a);
|
||||
conn->capwap_state=CW_STATE_JOIN;
|
||||
return CW_RESULT_MISSING_MAND_ELEM;
|
||||
}
|
||||
cw_dbg_missing_mand(DBG_RFC,conn,mlist,n,a);
|
||||
}
|
||||
|
||||
|
||||
/* set result code to ok and change to configure state */
|
||||
mbag_set_dword(conn->outgoing,CW_ITEM_RESULT_CODE,0);
|
||||
|
||||
return 0;
|
||||
}
|
@ -97,7 +97,6 @@ int cw_in_generic(struct conn *conn, struct cw_action_in *a, uint8_t * data, int
|
||||
|
||||
}
|
||||
|
||||
|
||||
int cw_in_radio_generic(struct conn *conn, struct cw_action_in *a, uint8_t * data,
|
||||
int len, struct sockaddr *from)
|
||||
{
|
||||
|
@ -4,6 +4,37 @@
|
||||
#include "log.h"
|
||||
#include "mbag.h"
|
||||
#include "capwap.h"
|
||||
#include "radio.h"
|
||||
|
||||
|
||||
int cw_radio_set_admin_state(mbag_t radios,int rid, int state, int cause)
|
||||
{
|
||||
mbag_t radio = mbag_get_mbag(radios,rid,NULL);
|
||||
if (!radio) {
|
||||
cw_dbg(DBG_ELEM_ERR,"Can't set radio administrative state for radio %d - radio does't exists",rid);
|
||||
return 0;
|
||||
}
|
||||
mbag_set_byte(radio,CW_RADIO_ADMIN_STATE,state);
|
||||
|
||||
if (cause < 0)
|
||||
return 1;
|
||||
|
||||
|
||||
/* Set operational state for next config update response. */
|
||||
|
||||
mbag_set_word(radio,CW_RADIO_OPER_STATE, (state<<8) | 3);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int cw_in_radio_administrative_state(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len,
|
||||
struct sockaddr *from)
|
||||
{
|
||||
int rid = cw_get_byte(data);
|
||||
int state = cw_get_byte(data+1);
|
||||
return cw_radio_set_admin_state(conn->radios,rid,state,-1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -91,3 +91,7 @@ int cw_out_generic(struct conn *conn, struct cw_action_out *a, uint8_t * dst) //
|
||||
|
||||
return len + cw_put_elem_hdr(dst, a->elem_id, len);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -60,43 +60,4 @@ int cw_out_radio_administrative_states(struct conn *conn, struct cw_action_out *
|
||||
|
||||
|
||||
|
||||
static int set_radio_admin_state(mbag_t radios,int rid,int state)
|
||||
{
|
||||
|
||||
mbag_t radio = mbag_get_mbag(radios,rid,NULL);
|
||||
if (!radio){
|
||||
cw_dbg(DBG_ELEM_ERR,"Can't set radio administrative state for radio %d - radio does't exists",rid);
|
||||
return 0;
|
||||
}
|
||||
|
||||
mbag_set_byte(radio,CW_RADIO_ADMIN_STATE,state);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int cw_in_radio_administrative_state(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len,
|
||||
struct sockaddr *from)
|
||||
{
|
||||
int rid = cw_get_byte(data);
|
||||
int state = cw_get_byte(data+1);
|
||||
return set_radio_admin_state(conn->radios,rid,state);
|
||||
}
|
||||
|
||||
|
||||
int cw_in_cisco_radio_administrative_state(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len,
|
||||
struct sockaddr *from)
|
||||
{
|
||||
|
||||
int rid = cw_get_byte(data);
|
||||
int state = cw_get_byte(data+1);
|
||||
if (rid != 255)
|
||||
return set_radio_admin_state(conn->radios,rid,state);
|
||||
|
||||
|
||||
MAVLITER_DEFINE(it,conn->radios);
|
||||
mavliter_foreach(&it){
|
||||
mbag_item_t *i = mavliter_get(&it);
|
||||
mbag_set_byte(i->data,CW_RADIO_ADMIN_STATE,state);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
@ -134,6 +134,8 @@
|
||||
#define LW_ELEM_TX_POWER_LEVELS 13
|
||||
#define LW_ELEM_DIRECT_SEQUENCE_CONTROL 14
|
||||
|
||||
#define LW_ELEM_80211_DELETE_WLAN 28
|
||||
|
||||
#define LW_ELEM_AC_NAME 31
|
||||
#define LW_ELEM_LOCATION_DATA 35
|
||||
#define LW_ELEM_STATISTICS_TIMER 37
|
||||
|
@ -5,6 +5,7 @@
|
||||
|
||||
enum radiodata{
|
||||
CW_RADIO_ADMIN_STATE=10000,
|
||||
CW_RADIO_OPER_STATE,
|
||||
CW_RADIO_TYPE,
|
||||
CW_RADIO_REG_DOMAIN,
|
||||
CW_RADIO_BSSID,
|
||||
|
Reference in New Issue
Block a user