WTP can save json now.
FossilOrigin-Name: 9670c29689c90b8e4378e10b56682028dd690d58e1a69da0f584c4c770cd2110
This commit is contained in:
@ -389,7 +389,7 @@ int mbag_tojson(char *dst, mbag_t m, struct mbag_itemdef *defs, int n)
|
||||
return d-dst;
|
||||
}
|
||||
|
||||
int tester()
|
||||
int cfg_json_save()
|
||||
{
|
||||
struct conn * conn = get_conn();
|
||||
char dst[4096];
|
||||
@ -398,8 +398,7 @@ int tester()
|
||||
|
||||
printf("Json: %s\n",dst);
|
||||
|
||||
cw_save_file("cfg.save.json",dst,n);
|
||||
exit(0);
|
||||
cw_save_file("cfg.json",dst,n);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,21 +1,12 @@
|
||||
{
|
||||
"wtp_name":"TubeWTPx",
|
||||
"wtp_name":"Tobias-zu-Hause",
|
||||
"hardware_version":["4232704",".x01000000"],
|
||||
"software_version":["4232704",".x08006e00"],
|
||||
"wtp_board_data":{
|
||||
"vendor_id":"4232704",
|
||||
"model_no":"AIR-LAP1131AG-E-K9",
|
||||
"serial_no":"2045"
|
||||
},
|
||||
"location_data":"China",
|
||||
"bssid": ".x003a9902fac0",
|
||||
|
||||
"wtp_board_data" : {
|
||||
"vendor_id": "4232704",
|
||||
"model_no": "AIR-LAP1131AG-E-K9",
|
||||
"serial_no": "2045"
|
||||
},
|
||||
|
||||
|
||||
"acname_with_priority": {
|
||||
"1":"Master-AC",
|
||||
"2":"Cisco-AC"
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
"bssid":""
|
||||
}
|
@ -17,6 +17,7 @@
|
||||
#include "wtp_conf.h"
|
||||
|
||||
#include "capwap/dbg.h"
|
||||
#include "capwap/mavl.h"
|
||||
|
||||
#include "jsmn.h"
|
||||
|
||||
@ -41,6 +42,33 @@ bstr_t get_base_rmac()
|
||||
}
|
||||
|
||||
|
||||
int handle_update_req(struct conn *conn, struct cw_action_in *a, uint8_t * data,
|
||||
int len,struct sockaddr *from)
|
||||
{
|
||||
printf("There was an config update request\n");
|
||||
MAVLITER_DEFINE(it,conn->incomming);
|
||||
printf("Here are the results\n");
|
||||
|
||||
mavliter_foreach(&it){
|
||||
mbag_item_t * item = mavliter_get(&it);
|
||||
|
||||
printf("MBAG ITEM GOT: %d\n",item->id);
|
||||
if (item->id == CW_ITEM_WTP_NAME) {
|
||||
printf("Yea! WTP NAME\n");
|
||||
|
||||
printf("The name is %.*s\n",bstr16_len(item->data),bstr16_data(item->data));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
cfg_json_save();
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
@ -133,11 +161,21 @@ conn->config=mbag_create();
|
||||
mbag_set_byte(conn->local,CW_ITEM_WTP_FRAME_TUNNEL_MODE,0);
|
||||
|
||||
|
||||
|
||||
|
||||
cw_set_msg_end_callback(conn,CW_STATE_RUN,CW_MSG_CONFIGURATION_UPDATE_REQUEST,handle_update_req);
|
||||
|
||||
|
||||
|
||||
the_conn->strict_capwap=0;
|
||||
discovery();
|
||||
join();
|
||||
configure();
|
||||
changestate();
|
||||
|
||||
mavl_destroy(conn->incomming);
|
||||
conn->incomming=conn->config;
|
||||
|
||||
run();
|
||||
|
||||
//image_update();
|
||||
|
Reference in New Issue
Block a user