cw_in_generic_struct works - see cisco ap time sync
FossilOrigin-Name: 3a33d8a0104938c2274c1c28dc284e50a3df308452e9147c704de9af2a1f9e69
This commit is contained in:
parent
5e86c52446
commit
4cedc04193
@ -263,6 +263,7 @@
|
|||||||
<File Name="src/cw/mavl_get_node_cmp..c"/>
|
<File Name="src/cw/mavl_get_node_cmp..c"/>
|
||||||
<File Name="src/cw/cw_ktv_read_struct.c"/>
|
<File Name="src/cw/cw_ktv_read_struct.c"/>
|
||||||
<File Name="src/cw/algos.h"/>
|
<File Name="src/cw/algos.h"/>
|
||||||
|
<File Name="src/cw/cw_in_generic_struct.c"/>
|
||||||
</VirtualDirectory>
|
</VirtualDirectory>
|
||||||
</VirtualDirectory>
|
</VirtualDirectory>
|
||||||
<Description/>
|
<Description/>
|
||||||
|
@ -381,6 +381,9 @@ int cw_in_generic(struct conn * conn, struct cw_ElemHandler * handler,
|
|||||||
int cw_in_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params,
|
int cw_in_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params,
|
||||||
uint8_t * elem_data, int elem_len);
|
uint8_t * elem_data, int elem_len);
|
||||||
|
|
||||||
|
int cw_in_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params,
|
||||||
|
uint8_t * elem_data, int elem_len);
|
||||||
|
|
||||||
int cw_out_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params
|
int cw_out_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params
|
||||||
, uint8_t * dst);
|
, uint8_t * dst);
|
||||||
|
|
||||||
|
25
src/cw/cw_in_generic_struct.c
Normal file
25
src/cw/cw_in_generic_struct.c
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
#include "capwap.h"
|
||||||
|
#include "msgset.h"
|
||||||
|
#include "ktv.h"
|
||||||
|
#include "log.h"
|
||||||
|
|
||||||
|
int cw_in_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params,
|
||||||
|
uint8_t * elem_data, int elem_len)
|
||||||
|
{
|
||||||
|
/*cw_KTV_t * result;*/
|
||||||
|
|
||||||
|
if (!handler->type){
|
||||||
|
cw_log(LOG_ERR,"Can't handle element: %s, no type defined",handler->name);
|
||||||
|
return CAPWAP_RESULT_UNRECOGNIZED_MESSAGE_ELEMENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* result = cw_ktv_add(params->conn->remote_cfg, handler->key,
|
||||||
|
handler->type, elem_data,elem_len);
|
||||||
|
*/
|
||||||
|
cw_ktv_read_struct(params->conn->remote_cfg,handler->type,handler->key,elem_data,elem_len);
|
||||||
|
|
||||||
|
/*params->elem=result;*/
|
||||||
|
|
||||||
|
return CAPWAP_RESULT_SUCCESS;
|
||||||
|
}
|
@ -1,7 +1,7 @@
|
|||||||
#include "ktv.h"
|
#include "ktv.h"
|
||||||
#include "dbg.h"
|
#include "dbg.h"
|
||||||
|
|
||||||
int cw_ktv_read_struct(mavl_t ktv,cw_KTVStruct_t * stru, const char *pkey,
|
int cw_ktv_read_struct(mavl_t ktv,const cw_KTVStruct_t * stru, const char *pkey,
|
||||||
uint8_t * data, int len)
|
uint8_t * data, int len)
|
||||||
{
|
{
|
||||||
char key[CW_KTV_MAX_KEY_LEN];
|
char key[CW_KTV_MAX_KEY_LEN];
|
||||||
|
@ -45,8 +45,6 @@ int cw_read_descriptor_subelems(mavl_t cfg, const char * parent_key,
|
|||||||
/* search sub-element */
|
/* search sub-element */
|
||||||
for (i = 0; elems[i].maxlen; i++) {
|
for (i = 0; elems[i].maxlen; i++) {
|
||||||
|
|
||||||
printf("subcmp: %d %d\n",elems[i].type,subtype);
|
|
||||||
|
|
||||||
if (elems[i].type == subtype /* && elems[i].vendor_id==vendor_id*/)
|
if (elems[i].type == subtype /* && elems[i].vendor_id==vendor_id*/)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ struct cw_KTVStruct {
|
|||||||
int position;
|
int position;
|
||||||
};
|
};
|
||||||
typedef struct cw_KTVStruct cw_KTVStruct_t;
|
typedef struct cw_KTVStruct cw_KTVStruct_t;
|
||||||
int cw_ktv_read_struct(mavl_t ktv,cw_KTVStruct_t * stru, const char *pkey,
|
int cw_ktv_read_struct(mavl_t ktv,const cw_KTVStruct_t * stru, const char *pkey,
|
||||||
uint8_t * data, int len);
|
uint8_t * data, int len);
|
||||||
|
|
||||||
extern const struct cw_Type cw_type_byte;
|
extern const struct cw_Type cw_type_byte;
|
||||||
|
@ -96,7 +96,7 @@
|
|||||||
|
|
||||||
#define CW_CISCO_AP_BACKUP_SOFTWARE_VERSION 183
|
#define CW_CISCO_AP_BACKUP_SOFTWARE_VERSION 183
|
||||||
#define CW_CISCO_BOARD_DATA_OPTIONS 207
|
#define CW_CISCO_BOARD_DATA_OPTIONS 207
|
||||||
#define CW_CISCO_MWAR_TYPE 208
|
#define CISCO_ELEM_MWAR_TYPE 208
|
||||||
#define CW_CISCO_80211_ASSOC_LIMIT 213
|
#define CW_CISCO_80211_ASSOC_LIMIT 213
|
||||||
#define CW_CISCO_TLV_PAYLOAD 215
|
#define CW_CISCO_TLV_PAYLOAD 215
|
||||||
#define CW_CISCO_AP_LOG_FACILITY 224
|
#define CW_CISCO_AP_LOG_FACILITY 224
|
||||||
|
@ -44,7 +44,8 @@
|
|||||||
|
|
||||||
static cw_KTVStruct_t ap_time_sync[] = {
|
static cw_KTVStruct_t ap_time_sync[] = {
|
||||||
{CW_TYPE_DWORD, "timestamp", 4,-1},
|
{CW_TYPE_DWORD, "timestamp", 4,-1},
|
||||||
{CW_TYPE_BYTE, "type", 1,-1}
|
{CW_TYPE_BYTE, "type", 1,-1},
|
||||||
|
{NULL,NULL,0,0}
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct cw_ElemHandler handlers[] = {
|
static struct cw_ElemHandler handlers[] = {
|
||||||
@ -99,11 +100,23 @@ static struct cw_ElemHandler handlers[] = {
|
|||||||
5,5, /* min/max length */
|
5,5, /* min/max length */
|
||||||
ap_time_sync, /* type */
|
ap_time_sync, /* type */
|
||||||
"cisco/ap-timesync", /* Key */
|
"cisco/ap-timesync", /* Key */
|
||||||
NULL, /* handler */
|
cw_in_generic_struct, /* handler */
|
||||||
NULL /* put */
|
NULL /* put */
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
|
|
||||||
|
{
|
||||||
|
"MWAR Type", /* name */
|
||||||
|
CISCO_ELEM_MWAR_TYPE, /* Element ID */
|
||||||
|
CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */
|
||||||
|
1,1, /* min/max length */
|
||||||
|
CW_TYPE_BYTE, /* type */
|
||||||
|
"cisco/mwar-type", /* Key */
|
||||||
|
cw_in_generic, /* handler */
|
||||||
|
cw_out_generic /* put */
|
||||||
|
}
|
||||||
|
,
|
||||||
|
|
||||||
{0,0,0,0,0,0,0,0}
|
{0,0,0,0,0,0,0,0}
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -111,8 +124,8 @@ static struct cw_ElemHandler handlers[] = {
|
|||||||
|
|
||||||
static int discovery_request_states[] = {CAPWAP_STATE_DISCOVERY,0};
|
static int discovery_request_states[] = {CAPWAP_STATE_DISCOVERY,0};
|
||||||
static struct cw_ElemDef discovery_request_elements[] ={
|
static struct cw_ElemDef discovery_request_elements[] ={
|
||||||
{0,0, CAPWAP_ELEM_WTP_DESCRIPTOR, 1, 0},
|
/* {0,0, CAPWAP_ELEM_WTP_DESCRIPTOR, 1, 0},*/
|
||||||
{0,0, CAPWAP_ELEM_WTP_BOARD_DATA, 0, 0},
|
{0,0, CAPWAP_ELEM_WTP_BOARD_DATA, 0, 0},
|
||||||
{0,CW_VENDOR_ID_CISCO, CW_CISCO_RAD_NAME, 1, 0},
|
{0,CW_VENDOR_ID_CISCO, CW_CISCO_RAD_NAME, 1, 0},
|
||||||
{0,CW_VENDOR_ID_CISCO, CW_CISCO_BOARD_DATA_OPTIONS, 0, 0},
|
{0,CW_VENDOR_ID_CISCO, CW_CISCO_BOARD_DATA_OPTIONS, 0, 0},
|
||||||
{0,0,0,00}
|
{0,0,0,00}
|
||||||
@ -122,6 +135,7 @@ static struct cw_ElemDef discovery_request_elements[] ={
|
|||||||
static int discovery_response_states[] = {CAPWAP_STATE_DISCOVERY,0};
|
static int discovery_response_states[] = {CAPWAP_STATE_DISCOVERY,0};
|
||||||
static struct cw_ElemDef discovery_response_elements[] ={
|
static struct cw_ElemDef discovery_response_elements[] ={
|
||||||
{0,CW_VENDOR_ID_CISCO, CISCO_ELEM_AP_TIMESYNC, 1, 0},
|
{0,CW_VENDOR_ID_CISCO, CISCO_ELEM_AP_TIMESYNC, 1, 0},
|
||||||
|
{0,CW_VENDOR_ID_CISCO, CISCO_ELEM_MWAR_TYPE, 0, 0},
|
||||||
{0,0,0,00}
|
{0,0,0,00}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user