more progress in new ktv storage

FossilOrigin-Name: a2c26a366de1946feb707439302b22de2e3d02f7621d0834fdf242852b28639c
This commit is contained in:
7u83@mail.ru
2018-03-15 19:07:17 +00:00
parent 8b2e36e912
commit 15cca4e553
40 changed files with 411 additions and 310 deletions

View File

@ -18,13 +18,19 @@ static int run_discovery(struct conn *conn)
{
/*// conn->incomming = mbag_create();*/
time_t timer;
uint8_t dtype=0;
conn->capwap_state = CAPWAP_STATE_DISCOVERY;
cw_ktv_add(conn->local_cfg, "discovery_type", CW_TYPE_BYTE, &dtype,1);
/* mbag_set_byte(conn->outgoing, CW_ITEM_DISCOVERY_TYPE,
CAPWAP_DISCOVERY_TYPE_UNKNOWN);
*/
cw_init_request(conn, CAPWAP_MSG_DISCOVERY_REQUEST);
cw_put_msg(conn, conn->req_buffer);
conn_send_msg(conn, conn->req_buffer);

View File

@ -65,12 +65,14 @@ static int parse_args (int argc, char *argv[], struct bootcfg * bootcfg)
}
int main (int argc, char **argv)
{
struct bootcfg bootcfg;
struct cw_Mod * mod;
struct cw_MsgSet * msgset;
struct conn * conn;
FILE * file;
parse_args(argc,argv, &bootcfg);
@ -101,8 +103,16 @@ int main (int argc, char **argv)
conn->dtls_mtu = 12000;
conn->msgset=msgset;
conn->local_cfg = cw_ktv_create();
file = fopen(bootcfg.cfgfilename,"r");
if (file == NULL){
cw_log(LOG_ERR,"Cant open file '%s':%s", strerror(errno));
exit(EXIT_FAILURE);
}
cw_run_discovery(conn, "255.255.255.255","192.168.0.14");
cw_ktv_read_file(file,conn->local_cfg,msgset->types_tree);
cw_run_discovery(conn, "255.255.255.255",NULL);
return (EXIT_SUCCESS);