Byte - in has now valguard
FossilOrigin-Name: 7926e93ff40c6f5f6b34190ed6591339025f1a23c93469370c1fa160176571e5
This commit is contained in:
@ -37,10 +37,10 @@ int capwap_in_capwap_control_ip_address(struct cw_ElemHandler *eh,
|
||||
/* printf("SKEY is %s , idx: %d\n",key,idx);*/
|
||||
|
||||
sprintf(key,"%s/address.%d",eh->key,idx+1);
|
||||
cw_ktv_add(params->conn->remote_cfg,key,CW_TYPE_IPADDRESS,data,len-2);
|
||||
cw_ktv_add(params->conn->remote_cfg,key,CW_TYPE_IPADDRESS,NULL,data,len-2);
|
||||
|
||||
sprintf(key,"%s/wtps.%d",eh->key,idx+1);
|
||||
cw_ktv_add(params->conn->remote_cfg,key,CW_TYPE_WORD,data+len-2,2);
|
||||
cw_ktv_add(params->conn->remote_cfg,key,CW_TYPE_WORD,NULL,data+len-2,2);
|
||||
|
||||
/* if (handler-id == CW_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS) {
|
||||
struct sockaddr_in addr;
|
||||
|
@ -102,7 +102,7 @@ static void readsubelems_wtp_board_data(mavl_t cfg, uint8_t * msgelem,
|
||||
if (key != NULL){
|
||||
char add_key[256];
|
||||
sprintf(add_key,"wtp-board-data/%s",key);
|
||||
cw_ktv_add(cfg,add_key,CW_TYPE_BSTR16,msgelem+i,sublen);
|
||||
cw_ktv_add(cfg,add_key,CW_TYPE_BSTR16,NULL,msgelem+i,sublen);
|
||||
|
||||
}
|
||||
|
||||
@ -137,7 +137,7 @@ int capwap_in_wtp_board_data(struct cw_ElemHandler *eh, struct cw_ElemHandlerPar
|
||||
|
||||
sprintf(vendor_key,"%s/%s",eh->key,CW_SKEY_VENDOR);
|
||||
|
||||
cw_ktv_add(cfg,vendor_key,CW_TYPE_DWORD,data,len);
|
||||
cw_ktv_add(cfg,vendor_key,CW_TYPE_DWORD,NULL,data,len);
|
||||
|
||||
/*
|
||||
mbag_t itemstore = conn->incomming;
|
||||
|
@ -17,14 +17,14 @@ static int init(struct cw_Mod * mod, mavl_t global_cfg, int role)
|
||||
cw_dbg(DBG_MOD, "CAPWAP: Initialiazing mod_capwap in AC mode");
|
||||
cw_ktv_add_from_str(global_cfg,
|
||||
"capwap/ac-descriptor/hardware/version",
|
||||
CW_TYPE_BSTR16,"0.0.0.1");
|
||||
CW_TYPE_BSTR16,NULL,"0.0.0.1");
|
||||
cw_ktv_add_from_str(global_cfg,
|
||||
"capwap/ac-descriptor/hardware/vendor",CW_TYPE_DWORD,"0");
|
||||
"capwap/ac-descriptor/hardware/vendor",CW_TYPE_DWORD,NULL,"0");
|
||||
cw_ktv_add_from_str(global_cfg,
|
||||
"capwap/ac-descriptor/software/version",
|
||||
CW_TYPE_BSTR16,"0.0.0.1");
|
||||
CW_TYPE_BSTR16, NULL, "0.0.0.1");
|
||||
cw_ktv_add_from_str(global_cfg,
|
||||
"capwap/ac-descriptor/software/vendor",CW_TYPE_DWORD,"0");
|
||||
"capwap/ac-descriptor/software/vendor",CW_TYPE_DWORD, NULL, "0");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -473,6 +473,27 @@ static cw_KTVStruct_t cisco_add_lwwlan[]={
|
||||
{NULL,NULL,0,0}
|
||||
};
|
||||
|
||||
static cw_KTVValRange_t oper_val_state[]={
|
||||
{1,1,"disabled"},
|
||||
{2,2,"enabled"},
|
||||
{0,0,NULL}
|
||||
};
|
||||
|
||||
static cw_KTVValRange_t oper_val_cause[]={
|
||||
{0,0,"Normal"},
|
||||
{1,1,"Radio Failure"},
|
||||
{2,2,"Software Failure"},
|
||||
{3,3,"Administratively Set"},
|
||||
{0,0,NULL}
|
||||
};
|
||||
|
||||
static cw_KTVStruct_t cisco_radio_oper_state[]={
|
||||
{CW_TYPE_BYTE, "state", 1, -1, oper_val_state},
|
||||
{CW_TYPE_BYTE, "cause", 1, -1,oper_val_cause},
|
||||
{NULL,NULL,0,0}
|
||||
};
|
||||
|
||||
|
||||
static int cisoc_add_lwwlan_mkkey(const char *pkey, uint8_t*data, int len, char *dst)
|
||||
{
|
||||
int wlan_id,radio_id;
|
||||
@ -515,40 +536,10 @@ static cw_KTVValRange_t range_cause[] = {
|
||||
|
||||
};
|
||||
|
||||
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,
|
||||
@ -566,7 +557,7 @@ static int cisco_data(struct cw_ElemHandler *eh,
|
||||
cw_dbg(DBG_INFO,"Del WLAN rid=%d, id=%d",wlan_id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
static struct cw_ElemHandler handlers73[] = {
|
||||
|
||||
@ -1221,22 +1212,21 @@ static struct cw_ElemHandler handlers73[] = {
|
||||
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 */
|
||||
cisco_radio_oper_state, /* type */
|
||||
"operational-state", /* Key */
|
||||
cw_in_radio_generic_struct, /* get */
|
||||
NULL, /* put */
|
||||
NULL
|
||||
NULL /* mkkey */
|
||||
}
|
||||
,
|
||||
|
||||
{
|
||||
"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, /* type */
|
||||
"radio-admin-state", /* Key */
|
||||
NULL, /* get */
|
||||
NULL, /* put */
|
||||
NULL
|
||||
}
|
||||
@ -1570,7 +1560,7 @@ static void set_ac_version(struct conn * conn)
|
||||
cw_dbg(DBG_INFO, "Cisco - Setting AC software version to: %s", verstr);
|
||||
|
||||
mavl_del(conn->local_cfg,&wtpver);
|
||||
cw_ktv_add(conn->local_cfg,"ac-descriptor/software/version",CW_TYPE_BSTR16,
|
||||
cw_ktv_add(conn->local_cfg,"ac-descriptor/software/version",CW_TYPE_BSTR16, NULL,
|
||||
wtpver->type->data(wtpver),wtpver->type->len(wtpver));
|
||||
|
||||
if(wtpver->type->len(wtpver)==4){
|
||||
@ -1605,7 +1595,7 @@ static int preprocess_join_request(struct conn *conn)
|
||||
|
||||
if (use_ac_version){
|
||||
ver = cw_ktv_get(conn->remote_cfg,"ac-descriptor/software/version", CW_TYPE_BSTR16);
|
||||
cw_ktv_replace(conn->local_cfg,"wtp-descriptor/software/version",CW_TYPE_BSTR16,
|
||||
cw_ktv_replace(conn->local_cfg,"wtp-descriptor/software/version",CW_TYPE_BSTR16, NULL,
|
||||
ver->type->data(ver),ver->type->len(ver));
|
||||
|
||||
cw_format_version(verstr,ver->type->data(ver),ver->type->len(ver));
|
||||
|
Reference in New Issue
Block a user