Work on val guards

FossilOrigin-Name: 69426308a4a2eea0651e3ce9ae81e01ae283cb271ec61f5386b04a686bed9fae
This commit is contained in:
7u83@mail.ru
2018-04-25 05:54:09 +00:00
parent 06ff52d5e3
commit 98c682e7e6
4 changed files with 146 additions and 29 deletions

View File

@ -494,6 +494,80 @@ static cw_KTVStruct_t cisco_ssc_hash[]={
};
static cw_KTVValRange_t range_bool[] = {
{0,0,"false"},
{1,65536, "true"},
{0,0,NULL}
};
static cw_KTVValRange_t range_operstate[] = {
{1,1,"Disabled"},
{2,2,"Enabled"},
{0,0,NULL}
};
static cw_KTVValRange_t range_cause[] = {
{0,0,"Normal"},
{1,1,"Radio Failure"},
{2,2,"Software Failure"},
{3,3,"Administratively Set"},
{0,0,NULL}
};
static cw_KTVData_t radio_operational_state[] = {
{0, CW_BYTE, "state", 1, range_operstate},
{0, CW_BYTE, "cause", 1, range_cause},
{0,0,NULL,0}
};
static cw_KTVData_t radio_admin_state[] = {
{0, CW_BYTE, "state", 1, range_operstate},
{0, CW_BYTE, "cause", 1, range_cause},
{0,0,NULL,0}
};
static const char * get_name(cw_KTVValRange_t *range,int x)
{
}
static int read_struct(cw_KTVData_t *stru, const char *parentkey)
{
char key[CW_KTV_MAX_KEY_LEN];
int pos;
pos = 0;
while (stru->key != NULL){
if (stru->position!=-1)
pos = stru->position;
}
return 0;
}
static int cisco_data(struct cw_ElemHandler *eh,
struct cw_ElemHandlerParams *params,
uint8_t * data, int len)
{
int wlan_id, radio_id;
char key[CW_KTV_MAX_KEY_LEN];
radio_id=cw_get_byte(data);
wlan_id=cw_get_word(data+1);
sprintf(key,"radio.%d/wlan.%d",radio_id,wlan_id);
read_struct(eh->type,key);
cw_dbg(DBG_INFO,"Del WLAN rid=%d, id=%d",wlan_id);
return 0;
}
static struct cw_ElemHandler handlers73[] = {
{
@ -1140,7 +1214,33 @@ static struct cw_ElemHandler handlers73[] = {
NULL
}
,
{
"Radio Operational State Cisco", /* name */
CAPWAP_ELEM_RADIO_OPERATIONAL_STATE, /* Element ID */
0,0, /* Vendor / Proto */
3,3, /* min/max length */
radio_operational_state, /* type */
"radio_operational_state", /* Key */
cisco_data, /* get */
NULL, /* put */
NULL
}
,
{
"Radio Administrative State Cisco", /* name */
CAPWAP_ELEM_RADIO_ADMINISTRATIVE_STATE, /* Element ID */
0,0, /* Vendor / Proto */
2,2, /* min/max length */
radio_admin_state, /* type */
"radio_admin_state", /* Key */
cisco_data, /* get */
NULL, /* put */
NULL
}
,
{0,0,0,0,0,0,0,0}