Almost all ktv stuff deleted

This commit is contained in:
2022-08-19 22:23:55 +02:00
parent 14354039e1
commit 6dc8d80102
51 changed files with 658 additions and 1880 deletions

View File

@ -1,13 +1,24 @@
#
# This file is igenerated by WAT
# If you edit this, your cahnges might be overwritten
#
capwap-local-ip-address: 192.168.0.14
capwap-timers/echo-interval: 30
capwap-timers/max-discovery-interval: 10
capwap/ac-name:
cisco-8011-assoc-limit/enable: false
cisco-8011-assoc-limit/interval: 500
cisco-8011-assoc-limit/limit: 25
cisco/ap-backup-software-version: .x00000000
cisco/ap-ethernet-port-type: .x000000
cisco/ap-led-state-config/led-state: 2
cisco/ap-group-name: default-group
cisco/ap-led-state-config/led-state: 1
cisco/ap-log-facility: 0
cisco/ap-min-ios-version: .x08036f00
cisco/ap-mode-and-type/mode: 0
cisco/ap-mode-and-type/type: 15
cisco/ap-model/image: 12.4(23c)JA2
cisco/ap-model/model: AIR-LAP1142N-E-K9
cisco/ap-model/model: "AIR-LAP1142N-E-K9 "
cisco/ap-power-injector-config/selection: 0
cisco/ap-power-injector-config/state: 17
cisco/ap-power-injector-config/switch-mac-address: .x000000000000
@ -20,40 +31,55 @@ cisco/ap-regulatory-domain.1/code0: 0
cisco/ap-regulatory-domain.1/code1: 1
cisco/ap-regulatory-domain.1/set: true
cisco/ap-regulatory-domain.1/slot: 1
cisco/ap-static-ip-addr/address: 192.168.0.13
cisco/ap-static-ip-addr/address: 192.168.0.14
cisco/ap-static-ip-addr/enabled: false
cisco/ap-static-ip-addr/gateway: 192.168.0.1
cisco/ap-static-ip-addr/netmask: 255.255.255.0
cisco/ap-static-ip-addr/unknown: 0.0.0.0
cisco/ap-sub-mode: 0
cisco/ap-telnet-ssh/ssh: true
cisco/ap-telnet-ssh/telnet: true
cisco/ap-uptime/current-uptime: 411251
cisco/ap-uptime/last-uptime: 411128
cisco/ap-username-and-password/login-credentials/enable-password: $1$SL3y$sc6giltX5bNe5mzHT8Gwy1
cisco/ap-telnet-ssh/ssh: false
cisco/ap-telnet-ssh/telnet: false
cisco/ap-uptime/current-uptime: 120
cisco/ap-uptime/last-uptime: 1
cisco/ap-username-and-password/login-credentials/enable-password: $1$IMuO$BHTjaFsUF.X3g3Q9YDmcS0
cisco/ap-username-and-password/login-credentials/option: 1
cisco/ap-username-and-password/login-credentials/password: $1$1Md9$y3hPcRV4nSg7iNJy4mwVt.
cisco/ap-username-and-password/login-credentials/password: $1$SL3y$sc6giltX5bNe5mzHT8Gwy1
cisco/ap-username-and-password/login-credentials/username: Cisco
cisco/cisco-discovery-protocol/data: 513
cisco/cisco-discovery-protocol/enabled: false
cisco/loghost-config/last-joined-ap: actube
cisco/elem132: .x0100000000
cisco/loghost-config/last-joined-ap: None
cisco/loghost-config/loghost: 255.255.255.255
cisco/mcast-mgid-info: .x0000000d0000000000000000000000000000000101000000
cisco/mwar-addr/address: 192.168.0.162
cisco/mwar-addr/mwar-type: 0
cisco/mwar-addr/unknown: 0
cisco/reset-button-state: true
cisco/rouge-and-mss/enable: false
cisco/rouge-and-mss/tcp-adjust-mss: 0
cisco/rouge-detection/rest: .x0000000a
cisco/rouge-detection/rouge-detection: true
cisco/sig-toogle: true
cisco/spam-domain-secret: .xe1ffd18a8f15b3b59c0a47a7f17a96e7cb36174f00
cisco/ssl-certfile: ../../ssl/certs/wtpc.crt
cisco/ssl-cipher: SHA1
cisco/ssl-keyfile: ../../ssl/certs/wtpc.key
cisco/wtp-board-data/card-id: 0
cisco/wtp-board-data/card-revision: 0
cisco/wtp-board-data/ethernet-mac-address: .xc47d4f3af8a6
cisco/wtp-board-data/options/ant-type: 1
cisco/wtp-board-data/options/ap-type: 1
cisco/wtp-board-data/options/failover-priority: 0
cisco/wtp-board-data/options/flex-connect: 1
cisco/wtp-board-data/options/ap-type: 0
cisco/wtp-board-data/options/failover-priority: 1
cisco/wtp-board-data/options/flex-connect: 0
cisco/wtp-board-data/wtp-model-hi: 0
cisco/wtp-board-data/wtp-model-lo: 0
cisco/wtp-board-data/wtp-serial-number: FCZ1406W232
radio.0/admin-state: enabled
cisco/wtp-use-ac-version: true
idle-timeout: 300
location-data: default location
maximum-message-length: 14000
radio.0/admin-state: 1 - enabled
radio.0/cisco/air-space-capability: 0
radio.0/cisco/antenna-payload/802-11n-rx-antennas: 7
radio.0/cisco/antenna-payload/802-11n-tx-antennas: 0
radio.0/cisco/antenna-payload/antenna-1: 1
@ -63,31 +89,53 @@ radio.0/cisco/antenna-payload/diversity-selection: 255
radio.0/cisco/antenna-payload/number-of-antennas: 2
radio.0/cisco/antenna-payload/unknown: 3
radio.0/cisco/channel-power: .x08080d0108221c16100a04fefe0208221c16100a04fefe0308221c16100a04fefe0408221c16100a04fefe0508221c16100a04fefe0608221c16100a04fefe0708221c16100a04fefe0808221c16100a04fefe0908221c16100a04fefe0a08221c16100a04fefe0b08221c16100a04fefe0c08221c16100a04fefe0d08221c16100a04fefe
radio.0/cisco/direct-sequence-control/cfg-type: 1
radio.0/cisco/direct-sequence-control/current-cca-mode: 0
radio.0/cisco/direct-sequence-control/current-channel: 1
radio.0/cisco/direct-sequence-control/energy-detect-threshold: -50
radio.0/cisco/direct-sequence-control/unknown: 1
radio.0/cisco/elem145: .x01
radio.0/cisco/elem146: .x690f
radio.0/cisco/elem153: .x00
radio.0/cisco/elem156: .x020100
radio.0/cisco/elem19: .xc0a800a10001000cc0a800a103000101003ccd774fc43bd27db633509934957d3acb000000000000000052464d000000000000000000000000000000000000000000000000000000000001060b010101
radio.0/cisco/elem22: .x0d00b400320102030405060708090a0b0c0d
radio.0/cisco/elem24: .x003c000c
radio.0/cisco/elem47: .x0100000000000000000000000000000000
radio.0/cisco/elem48: .x00
radio.0/cisco/elem81: .x00000000010101010a001e0a02051cbfffbfff0a00
radio.0/cisco/lwelem48: .x01055a0101a6c405b06432b03232
radio.0/cisco/lwelem9: .x0100000000000000000000000000000000
radio.0/cisco/mac-operation/fragmentation-threshold: 2346
radio.0/cisco/mac-operation/long-retry: 4
radio.0/cisco/mac-operation/reserved: 1
radio.0/cisco/mac-operation/rts-threshold: 2347
radio.0/cisco/mac-operation/rx-msdu-lifetime: 1000
radio.0/cisco/mac-operation/rx-msdu-lifetime: 512
radio.0/cisco/mac-operation/short-retry: 7
radio.0/cisco/mac-operation/tx-msdu-lifetime: 5000
radio.0/cisco/mac-operation/tx-msdu-lifetime: 512
radio.0/cisco/multi-domain-capability/first-channel: 1
radio.0/cisco/multi-domain-capability/max-tx-power-level: 65535
radio.0/cisco/multi-domain-capability/max-tx-power-level: 20
radio.0/cisco/multi-domain-capability/number-of-channels: 13
radio.0/cisco/multi-domain-capability/reserved: 1
radio.0/cisco/tx-power-levels: .x070011000e000b000800050002ffff0000
radio.0/cisco/tx-power/current-tx-power: 6
radio.0/cisco/tx-power/reserved: 0
radio.0/cisco/tx-power/current-tx-power: 1
radio.0/cisco/tx-power/reserved: 1
radio.0/cisco/wtp-radio-config/beacon-period: 100
radio.0/cisco/wtp-radio-config/bss-id: .x04fe7f499b90
radio.0/cisco/wtp-radio-config/cfg-period: 0
radio.0/cisco/wtp-radio-config/cfg-period: 4
radio.0/cisco/wtp-radio-config/cfg-type: 1
radio.0/cisco/wtp-radio-config/cfp-maximum-duration: 0
radio.0/cisco/wtp-radio-config/cfp-maximum-duration: 60
radio.0/cisco/wtp-radio-config/country-str1: "DE "
radio.0/cisco/wtp-radio-config/country-str2: "DE "
radio.0/cisco/wtp-radio-config/occupancy-limit: 0
radio.0/cisco/wtp-radio-config/reg: 768
radio.1/admin-state: reserved
radio.0/cisco/wtp-radio-config/country-str2: "DE "
radio.0/cisco/wtp-radio-config/occupancy-limit: 100
radio.0/cisco/wtp-radio-config/reg: 167772416
radio.0/decryption-error-report-period: 120
radio.0/operational-state/cause: Normal
radio.0/operational-state/state: enabled
radio.0/rate_set: .x82848b960c1218243048606c
radio.0/wtp-radio-information: 1
radio.1/admin-state: 1 - enabled
radio.1/cisco/air-space-capability: 0
radio.1/cisco/antenna-payload/802-11n-rx-antennas: 7
radio.1/cisco/antenna-payload/802-11n-tx-antennas: 0
radio.1/cisco/antenna-payload/antenna-1: 1
@ -97,49 +145,61 @@ radio.1/cisco/antenna-payload/diversity-selection: 255
radio.1/cisco/antenna-payload/number-of-antennas: 2
radio.1/cisco/antenna-payload/unknown: 3
radio.1/cisco/channel-power: .x0808102408221c16100a04fefe2808221c16100a04fefe2c08221c16100a04fefe3008221c16100a04fefe3408221c16100a04fefe3808221c16100a04fefe3c08221c16100a04fefe4008221c16100a04fefe6408221c16100a04fefe6808221c16100a04fefe6c08221c16100a04fefe7008221c16100a04fefe7408221c16100a04fefe8408221c16100a04fefe8808221c16100a04fefe8c08221c16100a04fefe
radio.1/cisco/elem145: .x01
radio.1/cisco/elem15: .x012407ffffffce000000
radio.1/cisco/elem153: .x00
radio.1/cisco/elem156: .x020100
radio.1/cisco/elem19: .xc0a800a10001000bc0a800a110000101003ccd774fc43bd27db633509934957d3acb000000000000000052464d000000000000000000000000000000000000000000000000000000000024282c3034383c4064686c707484888c01010101010101010101010101010101
radio.1/cisco/elem22: .x1000b4003224282c3034383c4064686c707484888c
radio.1/cisco/elem24: .x003c000c
radio.1/cisco/elem47: .x0100000000000000000000000000000000
radio.1/cisco/elem48: .x00
radio.1/cisco/elem81: .x00000000010101010a001e0a02050fbfffbfff0a00
radio.1/cisco/lwelem33: .x00
radio.1/cisco/lwelem48: .x01055a0101a6c405b06432b03232
radio.1/cisco/lwelem9: .x0100000000000000000000000000000000
radio.1/cisco/mac-operation/fragmentation-threshold: 2346
radio.1/cisco/mac-operation/long-retry: 4
radio.1/cisco/mac-operation/reserved: 1
radio.1/cisco/mac-operation/rts-threshold: 2347
radio.1/cisco/mac-operation/rx-msdu-lifetime: 1000
radio.1/cisco/mac-operation/rx-msdu-lifetime: 512
radio.1/cisco/mac-operation/short-retry: 7
radio.1/cisco/mac-operation/tx-msdu-lifetime: 5000
radio.1/cisco/mac-operation/tx-msdu-lifetime: 512
radio.1/cisco/multi-domain-capability/first-channel: 36
radio.1/cisco/multi-domain-capability/max-tx-power-level: 65535
radio.1/cisco/multi-domain-capability/number-of-channels: 16
radio.1/cisco/multi-domain-capability/max-tx-power-level: 20
radio.1/cisco/multi-domain-capability/number-of-channels: 4
radio.1/cisco/multi-domain-capability/reserved: 1
radio.1/cisco/tx-power-levels: .x070011000e000b000800050002ffff0000
radio.1/cisco/tx-power/current-tx-power: 1
radio.1/cisco/tx-power/reserved: 1
radio.1/cisco/wtp-radio-config/beacon-period: 100
radio.1/cisco/wtp-radio-config/bss-id: .x04fe7f499b90
radio.1/cisco/wtp-radio-config/cfg-period: 0
radio.1/cisco/wtp-radio-config/cfg-period: 4
radio.1/cisco/wtp-radio-config/cfg-type: 1
radio.1/cisco/wtp-radio-config/cfp-maximum-duration: 0
radio.1/cisco/wtp-radio-config/cfp-maximum-duration: 60
radio.1/cisco/wtp-radio-config/country-str1: "DE "
radio.1/cisco/wtp-radio-config/country-str2: "DE "
radio.1/cisco/wtp-radio-config/occupancy-limit: 0
radio.1/cisco/wtp-radio-config/reg: 768
radio.255/admin-state: enabled
radio.1/cisco/wtp-radio-config/occupancy-limit: 100
radio.1/cisco/wtp-radio-config/reg: 167772416
radio.1/decryption-error-report-period: 120
radio.1/operational-state/cause: Normal
radio.1/operational-state/state: enabled
radio.1/rate_set: .x8c129824b048606c
radio.1/wtp-radio-information: 2
radio.2/cisco/lwelem33: .x00
radio.255/admin-state: 1 - enabled
radio.255/operational-state/cause: Normal
radio.255/operational-state/state: enabled
session-id: .xd328ad6c
statistics-timer: 180
wtp-reboot-statistics/ac-initiated-count: 335
wtp-reboot-statistics/hw-failure-count: 0
wtp-reboot-statistics/last-failure-type: 1
wtp-reboot-statistics/link-failure-count: 0
wtp-reboot-statistics/other-failure-count: 1
wtp-reboot-statistics/reboot-count: 0
wtp-reboot-statistics/sw-failure-count: 0
wtp-reboot-statistics/unknown-failure-count: 0
wtp-board-data/board-id: .x0000
wtp-board-data/mac-address: .x0800276edf58
wtp-board-data/model-no: AIR-LAP1131AG-E-K9
wtp-board-data/revision: B0
wtp-board-data/serial-no: FCZ1441Q0XZ
wtp-board-data/model-no: "AIR-LAP1142N-E-K9 "
wtp-board-data/revision: A0
wtp-board-data/serial-no: FCZ1406W232
wtp-board-data/vendor: 4232704
wtp-descriptor/bootloader/vendor: 4232704
wtp-descriptor/bootloader/version: .x0c030800
wtp-descriptor/bootloader/version: .x0c041200
wtp-descriptor/hardware/vendor: 4232704
wtp-descriptor/hardware/version: .x01000000
wtp-descriptor/max-radios: 2
@ -148,24 +208,13 @@ wtp-descriptor/software/vendor: 4232704
wtp-descriptor/software/version: .x07007400
wtp-fallback: 1
wtp-frame-tunnel-mode: 4
wtp-mac-type: 1
wtp-name: Supertube
wtp-fallback: 1
wtp-frame-tunnel-mode: 4
wtp-mac-type: 1
capwap-timers/max-discovery-interval: 2
capwap-timers/min-discovery-interval: 0
discovery-type: 0
idle-timeout: 300
location-data: Berlin
radio.0/wtp-radio-information: 1
radio.1/wtp-radio-information: 2
cisco/ssl-certfile: ../../ssl/certs/wtpc.crt
cisco/ssl-cipher:SHA1
cisco/ssl-keyfile: ../../ssl/certs/wtpc.key
cisco/wtp-use-ac-version: true
session-id :Bstr16: .x00006215
wtp-mac-type: 1 - Split MAC
wtp-name: SoftWTP-Tube
wtp-reboot-statistics/ac-initiated-count: 1
wtp-reboot-statistics/hw-failure-count: 0
wtp-reboot-statistics/last-failure-type: 1
wtp-reboot-statistics/link-failure-count: 0
wtp-reboot-statistics/other-failure-count: 17
wtp-reboot-statistics/reboot-count: 0
wtp-reboot-statistics/sw-failure-count: 0
wtp-reboot-statistics/unknown-failure-count: 0

View File

@ -7,14 +7,17 @@
#include "cw/dbg.h"
#include "wtp_interface.h"
#include "cfg.h"
#include "wtp.h"
static int config_cb(struct cw_ElemHandlerParams * params, uint8_t * elems_ptr, int elems_len)
{
struct cw_DiscoveryResults *results = (struct cw_DiscoveryResults *)params->conn->data;
cw_dbg(DBG_X,"Configurations status response received");
cw_cfg_dump(params->cfg);
cw_dbg(DBG_X,"*** Configurations Status Response received ****");
cw_cfg_copy(params->cfg, params->conn->global_cfg);
cw_cfg_save(bootcfg.cfgfilename, params->conn->global_cfg,
"#\n# This file is igenerated by WAT\n# If you edit this, your cahnges might be overwritten\n#\n");
cw_dbg(DBG_X,"*** Cnofig Saved ***");
return 0;
}
@ -24,12 +27,13 @@ int configure(struct cw_Conn * conn)
{
char sockbuff[SOCK_ADDR_BUFSIZE];
// cw_dbg_ktv_dump(conn->local_cfg,DBG_INFO,"KTV DUMP ----------------","LOCAL:", "DUMP done -------");
cw_conn_set_msg_cb(conn,CAPWAP_MSG_CONFIGURATION_STATUS_RESPONSE,config_cb);
int rc;
cw_cfg_copy(conn->global_cfg,conn->update_cfg);
rc = cw_send_request(conn, CAPWAP_MSG_CONFIGURATION_STATUS_REQUEST);
cw_cfg_clear(conn->update_cfg);
if (!cw_result_is_ok(rc)) {
if (rc > 0) {
@ -47,9 +51,5 @@ int configure(struct cw_Conn * conn)
return 0;
}
// cw_dbg_ktv_dump(conn->remote_cfg,DBG_INFO,"Config ***","CFG: ", "End config ***");
// cw_ktv_set_byte(conn->remote_cfg,"
/*exit(0);*/
return 1;
}

View File

@ -154,10 +154,7 @@ static int run_join_d(struct cw_Conn * conn, struct sockaddr *sa,cw_Cfg_t * cfg)
cw_dbg(DBG_DTLS, "DTLS Connection successful established with %s",
sock_addr2str(sa,addrstr));
// conn->remote_cfg=cfg;
rc = run_join(conn);
// conn->remote_cfg=NULL;
return rc;
return run_join(conn);
}
@ -221,8 +218,6 @@ int join(struct cw_Conn * conn, struct cw_DiscoveryResults * results)
if (rc)
return 1;
}
return 0;

View File

@ -18,7 +18,7 @@
#include "cw/timer.h"
#include "wtp.h"
#include "cw/capwap.h"
@ -30,32 +30,20 @@
int update =1;
/*
int handle_update_req(struct cw_Conn *conn, struct cw_action_in *a, uint8_t * data,
int len, struct sockaddr *from)
static int update_cb(struct cw_ElemHandlerParams * params, uint8_t * elems_ptr, int elems_len)
{
if (a->msg_id == CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST){
update =1;
}
cw_dbg(DBG_X," **** Configuration Update Request Received ***");
// cw_cfg_dump(params->conn->global_cfg);
cw_cfg_copy(params->cfg, params->conn->global_cfg);
cw_cfg_save(bootcfg.cfgfilename, params->conn->global_cfg,
"#\n# This file is igenerated by WAT\n# If you edit this, your cahnges might be overwritten\n#\n");
cw_dbg(DBG_X," **** Configuration Update Request Received Saved ***");
return 0;
MAVLITER_DEFINE(it, conn->incomming);
mavliter_foreach(&it) {
mbag_item_t *item = mavliter_get(&it);
}
cw_dbg(DBG_X,"Saving configuration ...");
cfg_to_json();
return 0;
}
*/
/*
@ -88,66 +76,15 @@ static void update_radios(struct cw_Conn * conn, mbag_t result)
}
*/
static void do_update(struct cw_Conn * conn)
{
int rc;
cw_dbg_ktv_dump(conn->remote_cfg,DBG_INFO,"KTV DUMP ----------------","Remote:", "DUMP done -------");
// if (!update)
// return;
// update=0;
/* mbag_t result = mbag_create();
update_radios(conn,result);
*/ cw_dbg(DBG_INFO, "Saving configuration ...");
/* cfg_to_json();*/
/* Change State ... */
/*
rc = cw_send_request(conn,CAPWAP_MSG_CHANGE_STATE_EVENT_REQUEST);
if ( !cw_result_is_ok(rc) ) {
cw_strresult(rc);
return ;
}
*/
}
void clean_cfg(mavl_t cfg)
{
char key[CW_CFG_MAX_KEY_LEN];
cw_Val_t search;
int i;
int max;
max = cw_ktv_idx_get(cfg,"radio");
for (i=0;i<max+1;i++){
sprintf(key,"radio.%d/wtp-radio-information",i);
search.key = key;
mavl_del(cfg,&search);
}
}
int run(struct cw_Conn * conn)
{
cw_conn_set_msg_cb(conn,CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST,update_cb);
conn->capwap_state = CAPWAP_STATE_RUN;
/* conn->msg_end=handle_update_req;*/
do {
int echo_interval = cw_cfg_get_byte(conn->global_cfg,"capwap-timers/echo-interval",CAPWAP_ECHO_INTERVAL);
@ -166,14 +103,14 @@ int run(struct cw_Conn * conn)
if (rc < 0 && errno == EAGAIN) {
continue;
}
printf("--------------------------------------------------------------------------------------\n");
//printf("--------------------------------------------------------------------------------------\n");
if ( !cw_result_is_ok(rc)) {
printf("---------------------- cwrsult is not ok\n");
//printf("---------------------- cwrsult is not ok\n");
break;
}
printf("lalalala\n");
//printf("lalalala\n");
//cw_dbg_ktv_dump(conn->remote_cfg,DBG_INFO,"KTV DUMP ----------------","Remote:", "DUMP done -------");
// printf("Saving Config\n");
@ -181,9 +118,7 @@ printf("lalalala\n");
// cw_ktv_save(conn->local_cfg,"cisco.ktv");
// clean_cfg(conn->remote_cfg);
cw_dbg(DBG_X,"We hav a message processed");
update=1;
do_update(conn);
// cw_dbg(DBG_X,"We hav a message processed");
}
if (rc<0 && errno == EAGAIN){
@ -217,133 +152,3 @@ printf("lalalala\n");
/*
static int echo_interval_timer;
struct cwrmsg * get_response(struct cw_Conn * conn, int type,int seqnum)
{
struct cwrmsg * cwrmsg;
int i;
for(i=0; i<conf_retransmit_interval; i++){
cwrmsg = conn_get_message(conn);
if ( cwrmsg==0){
//printf("null message \n");
continue;
}
if (cwrmsg->type==type && cwrmsg->seqnum==seqnum)
return cwrmsg;
printf("another message was detected %i %i\n",cwrmsg->type,cwrmsg->seqnum);
}
return 0;
}
*/
/*
struct cwrmsg * send_request(struct cw_Conn * conn,struct cwmsg *cwmsg)
{
int i;
for (i=0; i<conf_max_retransmit; i++){
#ifdef WITH_CW_LOG_DEBUG
if (i>0){
// cw_log_debug1("Retransmitting request, type=%i,seqnum=%i",cwmsg->type,cwmsg->seqnum);
}
#endif
int rc = conn_send_cwmsg(conn,cwmsg);
if (rc<0){
// cw_log_debug1("Error sending request, type=%i, seqnum %i, %s",cwmsg->type,cwmsg->seqnum,strerror(errno));
return 0;
}
struct cwrmsg * r = get_response(conn,cwmsg->type+1,cwmsg->seqnum);
if (r)
return r;
}
return 0;
}
*/
/*//extern struct cw_Conn * get_conn();*/
/*
int run(struct cw_Conn * conn)
{
conn = get_conn();
printf("Running with conn %p\n");
struct radioinfo radioinfo;
memset(&radioinfo,0,sizeof(radioinfo));
struct cwrmsg * cwrmsg;
echo_interval_timer=time(NULL);
while (1){
if (time(NULL)-echo_interval_timer >= conf_echo_interval)
{
// struct cwmsg cwmsg;
// uint8_t buffer[CWMSG_MAX_SIZE];
// cwsend_echo_request(conn,&radioinfo);
// cw_log_debug1("Sending echo request");
struct cwmsg *cwmsg=&conn->req_msg;
uint8_t * buffer = conn->req_buffer;
struct wtpinfo * wtpinfo = get_wtpinfo();
struct radioinfo *rip = &(wtpinfo->radioinfo[0]);
cwmsg_init_echo_request(cwmsg,buffer,conn,rip);
printf("Echo ->>>>>>>>>>>>>>>>>>>>> Seqnum %d\n",conn->req_msg.seqnum);
printf("Conn target is %s",sock_addr2str(&conn->addr));
printf("Calling conn send req\n");
printf("conn max retrans: %d\n",conn->max_retransmit);
struct cwrmsg * rc = conn_send_request(conn);
printf("Back from conn send req\n");
// printf("conn->seqnum %i\n",conn->seqnum);
// struct cwrmsg * rc = get_response(conn,CWMSG_ECHO_RESPONSE,conn->seqnum);
if (rc==0){
printf("Error !\n");
// dtls_shutdown(conn);
// cw_log_debug1("Connection lost, no echo response");
// return 0;
}
echo_interval_timer=time(NULL);
}
time_t rt = cw_timer_start(5);
cwrmsg = conn_wait_for_request(conn,0,rt);
struct wtpinfo * wtpinfo = get_wtpinfo();
struct radioinfo *rip = &(wtpinfo->radioinfo[0]);
if(cwrmsg){
cw_readmsg_configuration_update_request(cwrmsg->msgelems,cwrmsg->msgelems_len);
cw_send_configuration_update_response(conn,cwrmsg->seqnum,rip);
}
sleep(1);
}
exit(0);
}
*/

View File

@ -21,4 +21,16 @@ int join(struct cw_Conn * conn, struct cw_DiscoveryResults * dis);
struct cw_Conn * get_conn();
#define MAX_MODS 32
struct bootcfg{
const char * modnames[MAX_MODS];
int nmods;
const char * modpath;
const char * cfgfilename;
};
extern struct bootcfg bootcfg;
#endif

View File

@ -17,14 +17,6 @@
#include "cw/cfg.h"
#define MAX_MODS 32
struct bootcfg{
const char * modnames[MAX_MODS];
int nmods;
const char * modpath;
const char * cfgfilename;
};
bstr_t get_base_rmac()
{
@ -40,7 +32,7 @@ static int parse_args (int argc, char *argv[], struct bootcfg * bootcfg)
int c;
opterr = 1;
bootcfg->cfgfilename = "config.ktv";
bootcfg->cfgfilename = "config.ckv";
while ( (c = getopt (argc, argv, "p:d:vc:m:h")) != -1) {
@ -83,9 +75,12 @@ static int parse_args (int argc, char *argv[], struct bootcfg * bootcfg)
#include "cw/rand.h"
struct bootcfg bootcfg;
int main (int argc, char **argv)
{
struct bootcfg bootcfg;
struct cw_Mod * mod;
struct cw_MsgSet * msgset=NULL;
struct cw_Conn * conn=NULL;
@ -145,7 +140,6 @@ int main (int argc, char **argv)
conn->dtls_mtu = 1200;
conn->msgset=msgset;
conn->global_cfg = global_cfg;
//conn->remote_cfg = cw_cfg_create();
conn->role = CW_ROLE_WTP;
conn->wbid=1;
@ -181,7 +175,6 @@ int main (int argc, char **argv)
// cw_run_discovery(conn, "192.168.0.255","192.168.0.14", &dis);
results = cw_run_discovery(conn, "255.255.255.255","192.168.0.14");
// mavl_del_all(conn->remote_cfg);
if (!join(conn,results)){
cw_discovery_results_destroy(results);
goto errX;
@ -191,8 +184,6 @@ int main (int argc, char **argv)
cw_discovery_results_destroy(results);
// clean_cfg(conn->remote_cfg);
// mavl_merge(conn->local_cfg,conn->remote_cfg);
changestate(conn);