Code reorganized.
FossilOrigin-Name: f0cd261531de060a6ad8dd4030a1a47587fd7b6f37101286b7d0dcf57d1de838
This commit is contained in:
@ -163,6 +163,11 @@ int read_config(const char * filename){
|
||||
if (str)
|
||||
conf_vendor_id=atoi(str);
|
||||
|
||||
str = uci_lookup_option_string(ctx,section,"echo_interval");
|
||||
if (str)
|
||||
conf_echo_interval=atoi(str);
|
||||
|
||||
|
||||
str = uci_lookup_option_string(ctx,section,"software_version");
|
||||
if (str){
|
||||
uint8_t * s = bstr_create_from_cfgstr(str);
|
||||
@ -208,6 +213,8 @@ int read_config(const char * filename){
|
||||
bstr_replace(&conf_model_no,s);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return 1;
|
||||
|
@ -164,5 +164,7 @@ conn->capwap_mode = CWMODE_CISCO;
|
||||
|
||||
join_state(conn);
|
||||
|
||||
printf("Joined with conn %p\n",conn);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -1,11 +1,14 @@
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "capwap/capwap.h"
|
||||
#include "capwap/conn.h"
|
||||
#include "capwap/radioinfo.h"
|
||||
#include "capwap/cw_log.h"
|
||||
#include "capwap/dtls.h"
|
||||
#include "capwap/sock.h"
|
||||
|
||||
|
||||
#include "wtp_conf.h"
|
||||
@ -59,9 +62,14 @@ struct cwrmsg * send_request(struct conn * conn,struct cwmsg *cwmsg)
|
||||
|
||||
|
||||
|
||||
extern struct conn * get_conn();
|
||||
|
||||
int run(struct conn * conn)
|
||||
{
|
||||
|
||||
conn = get_conn();
|
||||
printf("Running with conn %p\n");
|
||||
|
||||
struct radioinfo radioinfo;
|
||||
memset(&radioinfo,0,sizeof(radioinfo));
|
||||
|
||||
@ -69,19 +77,30 @@ int run(struct conn * conn)
|
||||
while (1){
|
||||
if (time(NULL)-echo_interval_timer >= conf_echo_interval)
|
||||
{
|
||||
struct cwmsg cwmsg;
|
||||
uint8_t buffer[CWMSG_MAX_SIZE];
|
||||
// struct cwmsg cwmsg;
|
||||
// uint8_t buffer[CWMSG_MAX_SIZE];
|
||||
|
||||
// cwsend_echo_request(conn,&radioinfo);
|
||||
|
||||
// cw_log_debug1("Sending echo request");
|
||||
cwmsg_init_echo_request(&cwmsg,buffer,conn,&radioinfo);
|
||||
struct cwrmsg * rc = send_request(conn,&cwmsg);
|
||||
struct cwmsg *cwmsg=&conn->req_msg;
|
||||
uint8_t * buffer = conn->req_buffer;
|
||||
cwmsg_init_echo_request(cwmsg,buffer,conn,&radioinfo);
|
||||
|
||||
|
||||
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");
|
||||
exit(0);
|
||||
|
||||
dtls_shutdown(conn);
|
||||
// cw_log_debug1("Connection lost, no echo response");
|
||||
return 0;
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "capwap/wtpinfo.h"
|
||||
#include "capwap/acinfo.h"
|
||||
#include "capwap/conn.h"
|
||||
#include "capwap/capwap_ieee80211.h"
|
||||
#include "capwap/capwap_80211.h"
|
||||
|
||||
#include "wtp_conf.h"
|
||||
#include "wtp_interface.h"
|
||||
@ -96,5 +96,6 @@ struct conn * get_conn()
|
||||
}
|
||||
conn->mtu_discovery=conf_mtu_discovery;
|
||||
}
|
||||
printf("Get conn returns %p\n",conn);
|
||||
return conn;
|
||||
}
|
||||
|
@ -31,6 +31,11 @@ config 'wtp'
|
||||
option discovery_interval 5
|
||||
|
||||
|
||||
# capwap mmode
|
||||
# possible values: capwap, cisco
|
||||
# default is "capwap"
|
||||
option capwap_mode "capwap"
|
||||
|
||||
|
||||
config 'dbg'
|
||||
# debug options
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "capwap/cw_log.h"
|
||||
#include "capwap/radioinfo.h"
|
||||
#include "capwap/sock.h"
|
||||
#include "capwap/capwap_ieee80211.h"
|
||||
#include "capwap/capwap_80211.h"
|
||||
|
||||
int wpa_printf()
|
||||
{
|
||||
@ -1222,7 +1222,7 @@ int wtpdrv_get_radioinfo(int rid,struct radioinfo * radioinfo)
|
||||
|
||||
radioinfo->rmac = bstr_create(rm,6);
|
||||
|
||||
radioinfo->type|=CW_IEEE80211_RADIO_TYPE_B; //CWRADIO_TYPE_N;
|
||||
radioinfo->type|=CW_80211_RADIO_TYPE_B; //CWRADIO_TYPE_N;
|
||||
|
||||
/*
|
||||
struct wpa_driver_ops * drv = wpa_drivers[0];
|
||||
|
Reference in New Issue
Block a user