Separating cipwap/capwap/...
FossilOrigin-Name: b1ce08cd3e7e9389bef7f6f2b038cd5fc95c31150341b17b78b8a116594cb4cb
This commit is contained in:
@ -514,6 +514,10 @@ enum cw_reboot_failure_types {
|
||||
|
||||
|
||||
|
||||
#define CW_RADIO_ADMIN_STATE_DISABLED 1
|
||||
#define CW_RADIO_ADMIN_STATE_ENABLED 2
|
||||
|
||||
|
||||
extern void cw_read_image_data_request(struct cwimage_data *, uint8_t * msg, int len);
|
||||
|
||||
//extern int cw_readelem_ac_descriptor(struct ac_info *acinfo, int type, uint8_t * msgelem,
|
||||
|
@ -4,16 +4,25 @@
|
||||
|
||||
|
||||
|
||||
const char CW_ITEM80211_SUPPORTED_RATES[]="802.11 supported_rates";
|
||||
const char CW_ITEM80211_WTP_RADIO_INFORMATION[]="802.11 radio_info";
|
||||
|
||||
|
||||
struct cw_itemdef capwap80211_itemdefs[] = {
|
||||
|
||||
{CW_ITEM80211_SUPPORTED_RATES,CW_ITEM_NONE,CAPWAP80211_TYPE_RATESET},
|
||||
{CW_ITEM80211_WTP_RADIO_INFORMATION,CW_ITEM_NONE,MBAG_DWORD},
|
||||
{CW_ITEM_NONE}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
const char CW_RADIOITEM80211_SUPPORTED_RATES[]="802.11 supported_rates";
|
||||
const char CW_RADIOITEM80211_WTP_RADIO_INFORMATION[]="802.11 radio_info";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
struct cw_itemdef capwap80211_radioitemdefs[] = {
|
||||
|
||||
{CW_RADIOITEM80211_SUPPORTED_RATES,CW_ITEM_NONE,CAPWAP80211_TYPE_RATESET},
|
||||
{CW_RADIOITEM80211_WTP_RADIO_INFORMATION,CW_ITEM_NONE,MBAG_DWORD},
|
||||
{CW_ITEM_NONE}
|
||||
};
|
||||
|
@ -3,10 +3,12 @@
|
||||
|
||||
#include "item.h"
|
||||
|
||||
extern const char CW_ITEM80211_SUPPORTED_RATES[];
|
||||
extern const char CW_ITEM80211_WTP_RADIO_INFORMATION[];
|
||||
extern const char CW_RADIOITEM80211_SUPPORTED_RATES[];
|
||||
extern const char CW_RADIOITEM80211_WTP_RADIO_INFORMATION[];
|
||||
|
||||
extern struct cw_itemdef capwap80211_itemdefs[];
|
||||
extern struct cw_itemdef capwap80211_radioitemdefs[];
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -15,9 +15,6 @@ const char CW_ITEM_WTP_FRAME_TUNNEL_MODE[]="wtp_frame_tunnel_mode";
|
||||
const char CW_ITEM_WTP_RADIOS_IN_USE[]="max_radios";
|
||||
const char CW_ITEM_WTP_MAX_RADIOS[]="radios_in_use";
|
||||
|
||||
const char CW_ITEM_SSH_ENABLE[]="ssh_enable";
|
||||
const char CW_ITEM_TELNET_ENABLE[]="telnet_enable";
|
||||
|
||||
/*
|
||||
const char CW_ITEM_WTP_HARDWARE_VENDOR=
|
||||
*/
|
||||
@ -42,7 +39,7 @@ const char CW_ITEM_WTP_OTHERSOFTWARE_VERSION,
|
||||
const char CW_ITEM_WTP_BOARD_DATA[]="wtp_board_data";
|
||||
const char CW_ITEM_WTP_DESCRIPTOR[]="0wtp_descriptor";
|
||||
const char CW_ITEM_CAPWAP_TIMERS[]="capwap_timers";
|
||||
const char CW_ITEM_RADIO_ADMINISTRATIVE_STATE[]="radio_admin_state";
|
||||
//const char CW_ITEM_RADIO_ADMINISTRATIVE_STATE[]="radio_admin_state";
|
||||
|
||||
const char CW_ITEM_AC_NAME[]="ac_name";
|
||||
const char CW_ITEM_AC_DESCRIPTOR[]="ac_descriptor";
|
||||
@ -104,10 +101,6 @@ struct cw_itemdef capwap_itemdefs[] = {
|
||||
|
||||
{CW_ITEM_CAPWAP_TRANSPORT_PROTOCOL,CW_ITEM_NONE,MBAG_BYTE},
|
||||
|
||||
{CW_ITEM_TELNET_ENABLE,CW_ITEM_NONE,MBAG_BYTE},
|
||||
{CW_ITEM_SSH_ENABLE,CW_ITEM_NONE,MBAG_BYTE},
|
||||
|
||||
|
||||
{CW_ITEM_WTP_NAME,CW_ITEM_NONE,MBAG_STR},
|
||||
{CW_ITEM_WTP_MAC_TYPE,CW_ITEM_NONE,MBAG_BYTE},
|
||||
{CW_ITEM_WTP_FRAME_TUNNEL_MODE,CW_ITEM_NONE,MBAG_BYTE},
|
||||
@ -158,10 +151,13 @@ cisco_items or so */
|
||||
};
|
||||
|
||||
|
||||
const char CW_RADIOITEM_ADMIN_STATE[]="admin_state";
|
||||
const char CW_RADIOITEM_OPER_STATE[]="oper_state";
|
||||
|
||||
|
||||
struct cw_itemdef capwap_radiodefs[] = {
|
||||
{CW_RADIOITEM_ADMIN_STATE,CW_ITEM_NONE,MBAG_BYTE},
|
||||
{CW_RADIOITEM_OPER_STATE,CW_ITEM_NONE,MBAG_WORD},
|
||||
|
||||
|
||||
{CW_ITEM_NONE}
|
||||
{CW_ITEM_NONE}
|
||||
};
|
||||
|
@ -176,8 +176,8 @@ extern const char CW_ITEM_RADIO_INFOS[];
|
||||
extern const char CW_ITEM_ECN_SUPPORT[];
|
||||
|
||||
|
||||
extern const char CW_ITEM_SSH_ENABLE[];
|
||||
extern const char CW_ITEM_TELNET_ENABLE[];
|
||||
//extern const char CW_ITEM_SSH_ENABLE[];
|
||||
//extern const char CW_ITEM_TELNET_ENABLE[];
|
||||
|
||||
|
||||
|
||||
@ -192,7 +192,12 @@ extern const char CW_ITEM_TELNET_ENABLE[];
|
||||
#define CW_ITEM_REBOOT_LAST_FAILURE_TYPE "last_failure"
|
||||
|
||||
|
||||
extern const char CW_RADIOITEM_ADMIN_STATE[];
|
||||
extern const char CW_RADIOITEM_OPER_STATE[];
|
||||
|
||||
|
||||
extern struct cw_itemdef capwap_itemdefs[];
|
||||
extern struct cw_itemdef capwap_radiodefs[];
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -63,8 +63,11 @@ struct conn {
|
||||
mbag_t incomming;
|
||||
mbag_t remote;
|
||||
mbag_t local;
|
||||
|
||||
mbag_t radios;
|
||||
mbag_t radios_upd;
|
||||
mbag_t config;
|
||||
mbag_t config_upd;
|
||||
|
||||
|
||||
/** base_mac */
|
||||
|
14
src/cw/cw.h
14
src/cw/cw.h
@ -524,6 +524,20 @@ extern int cw_put_radio_operational_states(mbag_t radios, uint8_t * dst, int *ne
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @defgroup CAPWAP_RADIO Radio Operations
|
||||
* @{
|
||||
*/
|
||||
extern int cw_radio_set_admin_state(mbag_t radios,int rid, int state, int cause);
|
||||
extern int cw_put_elem_radio_administrative_state(uint8_t *dst,int radio_id,mbag_t radio);
|
||||
extern int cw_put_elem_radio_operational_state(uint8_t * dst, int rid, int os, int d7mode);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
@ -15,7 +15,7 @@ int cw_in_radio_generic(struct conn *conn, struct cw_action_in *a, uint8_t * dat
|
||||
int len, struct sockaddr *from)
|
||||
{
|
||||
|
||||
const cw_itemdef_t * idef = cw_itemdef_get(conn->actions->items,a->item_id,CW_ITEM_NONE);
|
||||
const cw_itemdef_t * idef = cw_itemdef_get(conn->actions->radioitems,a->item_id,CW_ITEM_NONE);
|
||||
if (!idef){
|
||||
cw_log(LOG_ERR,"No definition found for %s",a->item_id);
|
||||
return 0;
|
||||
|
@ -16,19 +16,12 @@
|
||||
int cw_put_elem_radio_info(uint8_t*dst,int radio_id,mbag_t radio)
|
||||
{
|
||||
cw_put_byte(dst+4,radio_id);
|
||||
cw_put_dword(dst+5,mbag_get_dword(radio,CW_ITEM80211_WTP_RADIO_INFORMATION,0));
|
||||
cw_put_dword(dst+5,mbag_get_dword(radio,CW_RADIOITEM80211_WTP_RADIO_INFORMATION,0));
|
||||
return 5 + cw_put_elem_hdr(dst,CW_ELEM80211_WTP_RADIO_INFORMATION,5);
|
||||
|
||||
}
|
||||
|
||||
|
||||
int cw_put_elem_radio_administrative_state(uint8_t *dst,int radio_id,mbag_t radio)
|
||||
{
|
||||
cw_put_byte(dst+4,radio_id);
|
||||
cw_put_byte(dst+5,mbag_get_byte(radio,CW_RADIO_ADMIN_STATE,9));
|
||||
return 2 + cw_put_elem_hdr(dst,CW_ELEM_RADIO_ADMINISTRATIVE_STATE,2);
|
||||
}
|
||||
|
||||
int cw_out_radio_infos(struct conn *conn, struct cw_action_out *a, uint8_t * dst)
|
||||
{
|
||||
|
||||
@ -46,21 +39,6 @@ int cw_out_radio_infos(struct conn *conn, struct cw_action_out *a, uint8_t * dst
|
||||
}
|
||||
|
||||
|
||||
int cw_out_radio_administrative_states(struct conn *conn, struct cw_action_out *a, uint8_t * dst)
|
||||
{
|
||||
int l=0;
|
||||
MAVLITER_DEFINE(it,conn->radios);
|
||||
mavliter_foreach(&it){
|
||||
struct mbag_item *i = mavliter_get(&it);
|
||||
if ( i->type != MBAG_MBAG ) {
|
||||
continue;
|
||||
}
|
||||
l+=cw_put_elem_radio_administrative_state(dst+l,i->iid,i->data);
|
||||
|
||||
}
|
||||
return l;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -46,7 +46,7 @@ int cw_put_radio_operational_states(mbag_t radios, uint8_t * dst, int *nerror, i
|
||||
mavliter_foreach(&it){
|
||||
|
||||
mbag_item_t * radioitem = mavliter_get(&it);
|
||||
mbag_item_t *ositem = mbag_get(radioitem->data,CW_RADIO_OPER_STATE);
|
||||
mbag_item_t *ositem = mbag_get(radioitem->data,CW_RADIOITEM_OPER_STATE);
|
||||
if (!ositem){
|
||||
(*nerror)++;
|
||||
continue;
|
||||
@ -77,7 +77,7 @@ int cw_put_radio_operational_states(mbag_t radios, uint8_t * dst, int *nerror, i
|
||||
/* delete the operational state item, so it won't be
|
||||
sent again, until it is set by a change through
|
||||
Set Radio Admin State */
|
||||
mbag_del(radioitem->data,CW_RADIO_OPER_STATE);
|
||||
mbag_del(radioitem->data,CW_RADIOITEM_OPER_STATE);
|
||||
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,8 @@ struct cw_itemdef {
|
||||
/** Type */
|
||||
mbagtype_t type;
|
||||
|
||||
const char *meta_id;
|
||||
|
||||
};
|
||||
typedef struct cw_itemdef cw_itemdef_t;
|
||||
|
||||
|
@ -63,26 +63,6 @@ int cw_radio_update_oper_states(mbag_t radios,int cause)
|
||||
|
||||
|
||||
|
||||
int cw_radio_set_admin_state(mbag_t radios,int rid, int state, int cause)
|
||||
{
|
||||
mbag_t radio = mbag_i_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_radio_set_all_admin_states(mbag_t radios,int state, int cause)
|
||||
{
|
||||
|
@ -8,8 +8,8 @@
|
||||
|
||||
|
||||
|
||||
extern const char CW_RADIO_ADMIN_STATE[];
|
||||
extern const char CW_RADIO_OPER_STATE[];
|
||||
//extern const char CW_RADIO_ADMIN_STATE[];
|
||||
//extern const char CW_RADIO_OPER_STATE[];
|
||||
|
||||
extern const char CW_RADIO_SUPPORTED_RATES[];
|
||||
|
||||
|
Reference in New Issue
Block a user