Updated socumentation.
FossilOrigin-Name: 180466b9b455526e2be3202bc4df5d2bba6f33dae24eceed974faed4a490ceef
This commit is contained in:
parent
d90ff4651a
commit
6752c884c4
12
src/ac/db.c
12
src/ac/db.c
@ -135,7 +135,7 @@ void db_put_wtp_prop(const char *wtp_id,const char * id,const char *sub_id,const
|
||||
{
|
||||
int rc;
|
||||
|
||||
DBGX("Putting %s/%s:%s",id,sub_id,val);
|
||||
//DBGX("Putting %s/%s:%s",id,sub_id,val);
|
||||
|
||||
sqlite3_reset(put_wtp_prop_stmt);
|
||||
sqlite3_clear_bindings(put_wtp_prop_stmt);
|
||||
@ -196,17 +196,17 @@ mavl_conststr_t db_get_update_tasks(struct conn * conn,const char * wtpid)
|
||||
while (SQLITE_ROW == sqlite3_step(get_tasks_stmt)) {
|
||||
|
||||
int ii;
|
||||
DBGX("-----------------------------------------------------","");
|
||||
//DBGX("-----------------------------------------------------","");
|
||||
for (ii=0; ii<5; ii++){
|
||||
|
||||
DBGX("CVALL: %s",(const char*)sqlite3_column_text(get_tasks_stmt,ii));
|
||||
//DBGX("CVALL: %s",(const char*)sqlite3_column_text(get_tasks_stmt,ii));
|
||||
|
||||
|
||||
}
|
||||
|
||||
const char *id = (const char*)sqlite3_column_text(get_tasks_stmt,1);
|
||||
if (!id) {
|
||||
DBGX("::::::::::::::::::::::::::::::::::::::::::::::::::::NULL ID!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","");
|
||||
//DBGX("::::::::::::::::::::::::::::::::::::::::::::::::::::NULL ID!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","");
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -214,11 +214,11 @@ mavl_conststr_t db_get_update_tasks(struct conn * conn,const char * wtpid)
|
||||
|
||||
const char *val = (const char*)sqlite3_column_text(get_tasks_stmt,3);
|
||||
|
||||
DBGX("ID: (%s), SubID (%s), Val (%s)",id,sub_id,val);
|
||||
//DBGX("ID: (%s), SubID (%s), Val (%s)",id,sub_id,val);
|
||||
|
||||
const struct cw_itemdef * cwi = cw_itemdef_get(conn->actions->items,id,sub_id);
|
||||
if (!cwi) {
|
||||
DBGX("Not item definition found for: %s/%s",id,sub_id);
|
||||
//DBGX("Not item definition found for: %s/%s",id,sub_id);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -341,7 +341,8 @@ void config_to_sql(struct conn *conn)
|
||||
|
||||
const struct cw_itemdef * cwi = cw_itemdef_get(conn->actions->items,i->id,NULL);
|
||||
if (cwi){
|
||||
DBGX("ID %d,%s",i->id,cwi->id);
|
||||
DBGX("ID %s,%s",i->id,cwi->id);
|
||||
DBGX("Typei %s,Typecwd %s",i->type->name,cwi->type->name);
|
||||
|
||||
// printf("%s != %s ?\n",i->type->name,cwi->type->name);
|
||||
char str[256];
|
||||
@ -459,17 +460,12 @@ static void wtpman_run(void *arg)
|
||||
|
||||
// DBGX("Have %d tasks",r->count);
|
||||
|
||||
DBGX("Sending Request","");
|
||||
rc = cw_send_request(conn, CW_MSG_CONFIGURATION_UPDATE_REQUEST);
|
||||
DBGX("Request Sent","");
|
||||
mavl_merge(conn->config,conn->outgoing);
|
||||
mavl_destroy(conn->outgoing);
|
||||
conn->outgoing=mbag_create();
|
||||
DBGX("Mavel merged","");
|
||||
config_to_sql(conn);
|
||||
DBGX("Back tu SQL","");
|
||||
mavl_destroy(r);
|
||||
DBGX("DESTROY R","");
|
||||
|
||||
|
||||
|
||||
|
@ -235,6 +235,8 @@ CWACTION=action.o \
|
||||
cisco.o \
|
||||
mbag.o\
|
||||
mbag_type_word.o\
|
||||
mbag_type_vendorstr.o\
|
||||
mbag_type_sockaddr.o\
|
||||
radio.o \
|
||||
cw_out_radio_info.o \
|
||||
capwap_items.o \
|
||||
|
@ -19,6 +19,8 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief Definitions for bstr functions
|
||||
* @defgroup Bstr BSTR Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef __BSTR_H
|
||||
@ -29,7 +31,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* bstr typeS
|
||||
* bstr type
|
||||
*
|
||||
* bstr_t serves as binary string where the first byte cponntains
|
||||
* the length of the string.
|
||||
@ -64,19 +66,26 @@ extern int bstr_to_str(char *dst, bstr_t str,char * def);
|
||||
*/
|
||||
#define BSTR_MAX_LEN 254
|
||||
|
||||
|
||||
/**
|
||||
* The same as #bstr_t, but there are two bytes used
|
||||
* to describe the length of the string.
|
||||
*/
|
||||
typedef uint8_t *bstr16_t;
|
||||
|
||||
#define bstr16_len(s) ( *((uint16_t*)(s)) )
|
||||
#define bstr16_data(s) (((uint8_t*)s)+2)
|
||||
#define bstr16_size(l) (l+2)
|
||||
#define BSTR16_MAX_LEN (0xffff-2)
|
||||
|
||||
/*
|
||||
static inline int bstr16_ncpy(uint8_t *dst,uint8_t*src,uint16_t len)
|
||||
{
|
||||
*((uint16_t*)dst)=len;
|
||||
memcpy(dst+2,src,len);
|
||||
return len+2;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
static inline uint8_t * bstr16_create(uint8_t *data, uint16_t len)
|
||||
{
|
||||
@ -129,3 +138,5 @@ uint8_t * bstr16cfgstr(const char * s);
|
||||
|
||||
#endif
|
||||
|
||||
/**@}*/
|
||||
|
||||
|
@ -271,7 +271,7 @@ CW_MSG_MAXMSG = 26
|
||||
#define CW_ELEM_IMAGE_INFORMATION 26
|
||||
#define CW_ELEM_INITIATE_DOWNLOAD 27
|
||||
#define CW_ELEM_LOCATION_DATA 28
|
||||
#define CWMSGELEM_MAXIMUM_MESSAGE_LENGTH 29
|
||||
#define CW_ELEM_MAXIMUM_MESSAGE_LENGTH 29
|
||||
#define CWMSGELEM_MTU_DISCOVERY_PADDING 52
|
||||
#define CW_ELEM_RADIO_ADMINISTRATIVE_STATE 31
|
||||
#define CW_ELEM_RADIO_OPERATIONAL_STATE 32
|
||||
|
@ -63,9 +63,9 @@
|
||||
#define CW_ACTION_IN_STATISTICS_TIMER \
|
||||
CW_ELEM_STATISTICS_TIMER, /* Element ID*/ \
|
||||
cw_in_generic, 0, /* start/end callback */ \
|
||||
MBAG_DWORD, /* Type of element */ \
|
||||
MBAG_WORD, /* Type of element */ \
|
||||
CW_ITEM_STATISTICS_TIMER, /* ID to use store */ \
|
||||
1, 1024 /* min/max length */
|
||||
2, 2 /* min/max length */
|
||||
|
||||
#define CW_ACTION_IN_WTP_REBOOT_STATISTICS \
|
||||
CW_ELEM_WTP_REBOOT_STATISTICS, /* Element ID*/ \
|
||||
@ -188,7 +188,7 @@
|
||||
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 */ \
|
||||
CW_ITEM_MAXIMUM_MESSAGE_LENGTH, /* ID to use store */ \
|
||||
2, 2 /* min/max length */
|
||||
|
||||
|
||||
|
@ -93,10 +93,19 @@ cw_action_in_t capwap_actions_ac_in[] = {
|
||||
/* Element WTP MAC Type */
|
||||
{0, 0, CW_STATE_JOIN, CW_MSG_JOIN_REQUEST, CW_ACTION_IN_WTP_MAC_TYPE, 1}
|
||||
,
|
||||
|
||||
/* Non-Mandatory Join Req Elements */
|
||||
|
||||
/* Element Vendor Specific Payload */
|
||||
{0, 0, CW_STATE_JOIN, CW_MSG_JOIN_REQUEST, CW_ACTION_IN_VENDOR_SPECIFIC_PAYLOAD}
|
||||
,
|
||||
|
||||
/* Maximum Message Length */
|
||||
{0, 0, CW_STATE_JOIN, CW_MSG_JOIN_REQUEST, CW_ACTION_IN_MAXIMUM_MESSAGE_LENGTH}
|
||||
,
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------------- */
|
||||
|
||||
/* Message: Configuration Status Request */
|
||||
|
@ -101,9 +101,12 @@ struct cw_itemdef capwap_itemdefs[] = {
|
||||
{CW_ITEM_WTP_HARDWARE_VERSION,CW_ITEM_NONE,MBAG_VENDORSTR},
|
||||
{CW_ITEM_WTP_SOFTWARE_VERSION,CW_ITEM_NONE,MBAG_VENDORSTR},
|
||||
{CW_ITEM_WTP_GROUP_NAME,CW_ITEM_NONE,MBAG_STR},
|
||||
{CW_ITEM_MAXIMUM_MESSAGE_LENGTH,CW_ITEM_NONE,MBAG_WORD},
|
||||
{CW_ITEM_STATISTICS_TIMER,CW_ITEM_NONE,MBAG_WORD},
|
||||
|
||||
|
||||
|
||||
{CW_ITEM_WTP_BOARD_DATA,CW_ITEM_NONE,MBAG_MBAG},
|
||||
{CW_ITEM_WTP_BOARD_DATA,CW_ITEM_WTP_BOARD_VENDOR,MBAG_VENDORSTR},
|
||||
|
||||
{CW_ITEM_AP_MODE_AND_TYPE,CW_ITEM_NONE,MBAG_WORD},
|
||||
{CW_ITEM_WTP_BOARD_DATA,CW_ITEM_WTP_BOARD_VENDOR},
|
||||
|
@ -35,7 +35,7 @@ struct cw_str capwap_strings_elem[] = {
|
||||
{CW_ELEM_IMAGE_INFORMATION, "Image Information"},
|
||||
{CW_ELEM_INITIATE_DOWNLOAD, "Initiate Download"},
|
||||
{CW_ELEM_LOCATION_DATA, "Location Data"},
|
||||
{CWMSGELEM_MAXIMUM_MESSAGE_LENGTH, "Maximum Message Length"},
|
||||
{CW_ELEM_MAXIMUM_MESSAGE_LENGTH, "Maximum Message Length"},
|
||||
{CWMSGELEM_MTU_DISCOVERY_PADDING, "MTU Discovery Padding"},
|
||||
{CW_ELEM_RADIO_ADMINISTRATIVE_STATE, "Radio Administrative State"},
|
||||
{CW_ELEM_RADIO_OPERATIONAL_STATE, "Radio Operational State"},
|
||||
|
@ -18,6 +18,8 @@
|
||||
/**
|
||||
*@file
|
||||
*@brief prototypes for format-functions
|
||||
*@defgroup FormatFunctions FORMAT Functions
|
||||
*@{
|
||||
*/
|
||||
|
||||
#ifndef __CW_FORMAT_H
|
||||
@ -87,4 +89,9 @@ static inline int cw_format_hdr_flags(char *dst,uint8_t *th)
|
||||
|
||||
}
|
||||
|
||||
|
||||
int cw_is_utf8(unsigned char *str, size_t len);
|
||||
|
||||
/**@}*/
|
||||
|
||||
#endif
|
||||
|
@ -78,9 +78,11 @@ const struct mbag_typedef mbag_type_str = {
|
||||
"str",free,mbag_strstr,mbag_fromstr
|
||||
};
|
||||
|
||||
/*
|
||||
const struct mbag_typedef mbag_type_vendorstr = {
|
||||
"vendorstr",free
|
||||
};
|
||||
*/
|
||||
|
||||
|
||||
void free_avltree(void*t){
|
||||
|
@ -21,7 +21,7 @@
|
||||
#define __MBAG_H
|
||||
|
||||
/**
|
||||
* @defgroup MBaglFunctions MBAG Functions
|
||||
* @defgroup MbagFunctions MBAG
|
||||
* @{
|
||||
*/
|
||||
|
||||
@ -85,6 +85,7 @@ typedef struct mbag_item mbag_item_t;
|
||||
|
||||
/**
|
||||
* The MBAG Type
|
||||
*
|
||||
* It's simply an #mavl AVL Tree.
|
||||
*/
|
||||
typedef mavl_t mbag_t;
|
||||
@ -101,6 +102,10 @@ extern const struct mbag_typedef mbag_type_str;
|
||||
extern const struct mbag_typedef mbag_type_avltree;
|
||||
extern const struct mbag_typedef mbag_type_const_data;
|
||||
|
||||
/**
|
||||
*@defgroup MbagTypes MBAG Types
|
||||
*@{
|
||||
*/
|
||||
#define MBAG_BYTE (&mbag_type_byte)
|
||||
#define MBAG_WORD (&mbag_type_word)
|
||||
#define MBAG_DWORD (&mbag_type_dword)
|
||||
@ -113,7 +118,7 @@ extern const struct mbag_typedef mbag_type_const_data;
|
||||
#define MBAG_AVLTREE (&mbag_type_avltree)
|
||||
#define MBAG_FUN MBAG_STR
|
||||
#define MBAG_CONST_DATA (&mbag_type_const_data)
|
||||
|
||||
/**@}*/
|
||||
|
||||
extern mbag_t mbag_create();
|
||||
extern mbag_t mbag_i_create();
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
|
||||
#include "mbag.h"
|
||||
#include "format.h"
|
||||
|
||||
|
||||
static struct mbag_item * from_str(const char *src)
|
||||
@ -38,7 +39,7 @@ static int to_str(void *item,char *dst)
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** Defines a word, two bytes. */
|
||||
const struct mbag_typedef mbag_type_word = {
|
||||
"WORD",NULL,to_str,from_str
|
||||
};
|
||||
|
@ -13,7 +13,6 @@
|
||||
"capwap_timers":"2590",
|
||||
"cisco_ap_mode_and_type":"516",
|
||||
"idle_timeout":"300",
|
||||
,
|
||||
"radios":{
|
||||
"0":{
|
||||
"admin_state":"1",
|
||||
|
Loading…
Reference in New Issue
Block a user