VM
FossilOrigin-Name: 4bbb8402b5110003c6d19908b6fa9b4a7a6b5903ba1fa691eb93a49aa0f089f4
This commit is contained in:
@ -6,7 +6,7 @@ ifndef CC
|
||||
endif
|
||||
|
||||
|
||||
|
||||
V=0
|
||||
|
||||
CFLAGS+=-DWITH_RMAC_SUPPORT
|
||||
CFLAGS+=-DWITH_IPV6
|
||||
@ -21,6 +21,7 @@ endif
|
||||
|
||||
|
||||
CFLAGS += -Os -Wall -g
|
||||
CFLAGS += -Os -Wall
|
||||
LDFLAGS += -L../../src/capwap/$(ARCH)
|
||||
|
||||
|
||||
@ -103,7 +104,7 @@ ALL=wtp
|
||||
|
||||
all: $(ALL)
|
||||
|
||||
Q=
|
||||
Q=@
|
||||
E=echo
|
||||
ifeq ($(V), 1)
|
||||
Q=
|
||||
@ -111,8 +112,8 @@ E=true
|
||||
endif
|
||||
|
||||
%.o: %.c
|
||||
$(Q)$(CC) -c -o $@ $(CFLAGS) $<
|
||||
@$(E) " CC " $<
|
||||
$(Q)$(CC) -c -o $@ $(CFLAGS) $<
|
||||
|
||||
|
||||
wtp: $(BCHECK) $(OBJS)
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
int configure()
|
||||
{
|
||||
/*
|
||||
struct conn * conn = get_conn();
|
||||
struct wtpinfo * wtpinfo = get_wtpinfo();
|
||||
|
||||
@ -22,7 +23,7 @@ int configure()
|
||||
|
||||
|
||||
printf("Got change resp %p\n",cwrmsg);
|
||||
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
@ -25,253 +25,55 @@
|
||||
|
||||
|
||||
#include "capwap/capwap.h"
|
||||
#include "capwap/capwap_items.h"
|
||||
#include "capwap/cw_log.h"
|
||||
#include "capwap/wtpinfo.h"
|
||||
#include "capwap/acinfo.h"
|
||||
#include "capwap/sock.h"
|
||||
#include "capwap/cw_util.h"
|
||||
|
||||
|
||||
#include "wtp.h"
|
||||
#include "wtp_conf.h"
|
||||
#include "wtp_interface.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
struct discovery_info{
|
||||
ACIPLIST * aciplist;
|
||||
struct conn * conn;
|
||||
int response_count;
|
||||
};
|
||||
|
||||
static int acprint(void *p,void*d) //,int ctr)
|
||||
|
||||
static int run_discovery(struct conn *conn)
|
||||
{
|
||||
conn->capwap_state=CW_STATE_DISCOVERY;
|
||||
cw_itemstore_set_byte(conn->local,CW_ITEM_DISCOVERY_TYPE,CW_DISCOVERY_TYPE_UNKNOWN);
|
||||
|
||||
|
||||
ACIP * ip = (ACIP*)d;
|
||||
char str[100];
|
||||
sock_addrtostr((struct sockaddr*)&ip->ip,str,100);
|
||||
printf("ACIP: %s\n",str);
|
||||
printf("CTR: %i\n",ip->wtp_count);
|
||||
return 1;
|
||||
cw_init_request(conn,CW_MSG_DISCOVERY_REQUEST);
|
||||
cw_put_msg(conn,conn->req_buffer);
|
||||
conn_send_msg(conn,conn->req_buffer);
|
||||
|
||||
|
||||
time_t timer = cw_timer_start(10);
|
||||
|
||||
while (!cw_timer_timeout(timer)
|
||||
&& conn->capwap_state == CW_STATE_DISCOVERY) {
|
||||
cw_read_messages(conn);
|
||||
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
struct ac_info wtp_acinfo;
|
||||
|
||||
|
||||
static int msg_cb(void *priv,struct cwrmsg * cwrmsg)
|
||||
{
|
||||
if (cwrmsg->type != CW_MSG_DISCOVERY_RESPONSE){
|
||||
cw_dbg(DBG_ERR,"Expected discovery response, but received %i",cwrmsg->type);
|
||||
return 1;
|
||||
}
|
||||
|
||||
struct discovery_info * di = (struct discovery_info*)priv;
|
||||
|
||||
/*
|
||||
if (di->conn->seqnum != cwrmsg->seqnum){
|
||||
cw_log_debug0("Ignoring discovery respone, seqnum=%i, expected seqnum %i",cwrmsg->seqnum,di->conn->seqnum);
|
||||
return 1;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
struct ac_info * acinfo = &wtp_acinfo;
|
||||
memset(acinfo,0,sizeof(struct ac_info));
|
||||
|
||||
acinfo->aciplist = di->aciplist;
|
||||
|
||||
|
||||
|
||||
|
||||
cwread_discovery_response(acinfo,cwrmsg->msgelems,cwrmsg->msgelems_len);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
char ai [4096];
|
||||
acinfo_print(ai,acinfo);
|
||||
printf("AC INFO\n%s",ai);
|
||||
|
||||
|
||||
//printf("CWRHW: %s\n",sock_hwaddr2str(bstr_data(cwrmsg->rmac),bstr_len(cwrmsg->rmac)));
|
||||
///exit(0);
|
||||
|
||||
|
||||
/*
|
||||
printf("AC NAME %s\n",acinfo.ac_name);
|
||||
printf("AC Software version %s\n",acinfo.software_version);
|
||||
printf("AC Hardwareversion %s\n",acinfo.hardware_version);
|
||||
|
||||
printf("Active wtps: %i\n",acinfo.active_wtps);
|
||||
printf("Active max wtps: %i\n",acinfo.max_wtps);
|
||||
|
||||
|
||||
printf("Got Discovery response\n");
|
||||
|
||||
printf("ACL COUNT: %i\n",acinfo.aciplist->count);
|
||||
*/
|
||||
aciplist_foreach(acinfo->aciplist,acprint,0);
|
||||
|
||||
// responses++;
|
||||
//
|
||||
di->response_count++;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static void rand_sleep(int seconds)
|
||||
{
|
||||
int usecs = seconds * 1000;
|
||||
uint16_t rnd;
|
||||
cw_rand((uint8_t*)&rnd,sizeof(rnd));
|
||||
uint16_t max = 0-1;
|
||||
int r = (rnd * usecs) / max;
|
||||
cw_dbg(DBG_CW_INFO,"Sleeping for %u milliseconds\n",r);
|
||||
usleep(r*1000);
|
||||
}
|
||||
|
||||
|
||||
static int do_discover_conn(struct conn * conn,struct discovery_info * di)
|
||||
{
|
||||
rand_sleep(conf_max_discovery_interval);
|
||||
|
||||
|
||||
struct wtpinfo * wtpinfo;
|
||||
wtpinfo = get_wtpinfo();
|
||||
// wtpinfo_print(wtpinfo);
|
||||
|
||||
|
||||
// struct timespec tstart,tcur;
|
||||
struct radioinfo ri;
|
||||
memset(&ri,0,sizeof(ri));
|
||||
|
||||
struct radioinfo * rip = &wtpinfo->radioinfo[0];
|
||||
|
||||
/*
|
||||
ri.rmac[0]=6;
|
||||
ri.rmac[2]=14;
|
||||
ri.rmac[3]=14;
|
||||
ri.rmac[4]=14;
|
||||
ri.rmac[5]=14;
|
||||
ri.rmac[6]=14;
|
||||
ri.rmac[7]=14;
|
||||
*/
|
||||
|
||||
#ifdef WITH_CW_LOG_DEBUG
|
||||
char str[100];
|
||||
sock_addrtostr((struct sockaddr*)&conn->addr,str,100);
|
||||
// cw_log_debug0("Sending discovery request to %s",str);
|
||||
#endif
|
||||
|
||||
int rc;
|
||||
|
||||
do {
|
||||
conn->capwap_mode=CWMODE_CISCO;
|
||||
rc = cwsend_discovery_request(conn,rip,wtpinfo);
|
||||
if (rc<0){
|
||||
if (errno == EINTR)
|
||||
continue;
|
||||
if (errno == EMSGSIZE){
|
||||
conn->mtu-=4;
|
||||
// cw_log_debug2("Setting mtu to %i",conn->mtu);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}while (rc<0);
|
||||
|
||||
|
||||
if (rc < 0 )
|
||||
{
|
||||
char str[100];
|
||||
sock_addrtostr((struct sockaddr*)&conn->addr,str,100);
|
||||
cw_log(LOG_ERR,"Error sending discovery request to %s: %s",str,strerror(errno));
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct connlist * connlist;
|
||||
connlist = connlist_create(30);
|
||||
|
||||
// clock_gettime(CLOCK_REALTIME,&tstart);
|
||||
//
|
||||
int tstart = time(0);
|
||||
int treset = 0;
|
||||
do {
|
||||
char buf[2048];
|
||||
int buflen=2048;
|
||||
struct sockaddr_storage sa;
|
||||
socklen_t fromlen=sizeof(struct sockaddr_storage);
|
||||
rc = recvfrom(conn->sock,buf,buflen,0,(struct sockaddr*)&sa,&fromlen);
|
||||
if (rc<0){
|
||||
if (errno==EINTR)
|
||||
rc=0;
|
||||
if (errno==EAGAIN)
|
||||
rc=0;
|
||||
if (errno==EWOULDBLOCK)
|
||||
rc=0;
|
||||
}
|
||||
if (rc>0) {
|
||||
#ifdef WITH_CW_LOG_DEBUG
|
||||
char str[100];
|
||||
sock_addrtostr((struct sockaddr*)&sa,str,100);
|
||||
// cw_log_debug0("Received packet from %s",str);
|
||||
#endif
|
||||
|
||||
struct conn * rconn;
|
||||
rconn = connlist_get(connlist,(struct sockaddr*)&sa);
|
||||
|
||||
if (!rconn){
|
||||
rconn = conn_create_noq(conn->sock,(struct sockaddr*)&sa); //msg_cb,NULL,0);
|
||||
// rconn->pmsgarg=conn->pmsgarg;
|
||||
rconn->mtu = conn->mtu;
|
||||
rconn->seqnum=conn->seqnum;
|
||||
connlist_add(connlist,rconn);
|
||||
}
|
||||
|
||||
conn_process_packet(rconn,(uint8_t*)buf,rc,msg_cb,di);
|
||||
}
|
||||
|
||||
/* reset discovery timer after we have received the first response */
|
||||
if ( di->response_count == 1 && !treset ){
|
||||
tstart=time(0);
|
||||
treset=1;
|
||||
}
|
||||
|
||||
//clock_gettime(CLOCK_REALTIME,&tcur);
|
||||
// printf("TTSub: %i %i\n",time(0)-tstart, conf_discovery_interval);
|
||||
}while(time(0)-tstart < conf_discovery_interval && rc>=0 );
|
||||
|
||||
|
||||
if (rc <0){
|
||||
char str[100];
|
||||
sock_addrtostr((struct sockaddr*)&conn->addr,str,100);
|
||||
cw_log(LOG_ERR,"Error sendings discovery request to %s: %s",str,strerror(errno));
|
||||
}
|
||||
|
||||
connlist_destroy(connlist);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static int discovery_count;
|
||||
|
||||
ACIPLIST * do_discovery(const char *acaddr)
|
||||
/**
|
||||
* Run discovery for on address (eg broadcast 255.255.255.255)
|
||||
*/
|
||||
static int cw_run_discovery(struct conn *conn, const char *acaddr)
|
||||
{
|
||||
|
||||
/* get an partially intialized connection object
|
||||
* (seqnum should be set)
|
||||
* */
|
||||
struct conn * conn = get_conn();
|
||||
if (!conn){
|
||||
cw_log(LOG_ERR,"Can't create conn for %s: %s",acaddr,strerror(errno));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* get addr of destination */
|
||||
/* get addr of destination */
|
||||
struct addrinfo hints;
|
||||
struct addrinfo * res,*res0;
|
||||
memset(&hints,0,sizeof(hints));
|
||||
@ -285,21 +87,8 @@ ACIPLIST * do_discovery(const char *acaddr)
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct discovery_info di;
|
||||
memset (&di,0,sizeof(struct discovery_info));
|
||||
di.aciplist = aciplist_create();
|
||||
di.response_count=0;
|
||||
|
||||
|
||||
for(res=res0; res; res=res->ai_next)
|
||||
{
|
||||
if ( discovery_count >= conf_max_discoveries){
|
||||
sulking_state();
|
||||
discovery_count=0;
|
||||
// cw_log_debug0("Entering discovery state");
|
||||
}
|
||||
discovery_count++;
|
||||
|
||||
|
||||
int sockfd;
|
||||
int opt;
|
||||
@ -311,39 +100,30 @@ ACIPLIST * do_discovery(const char *acaddr)
|
||||
|
||||
opt = 1;
|
||||
if (setsockopt(sockfd, SOL_SOCKET, SO_BROADCAST, &opt, sizeof(opt))<0){
|
||||
cw_log(LOG_ERR,"Cant set broadcast sockopt");
|
||||
cw_log(LOG_ERR,"Can't set broadcast sockopt");
|
||||
}
|
||||
sock_set_recvtimeout(sockfd,1);
|
||||
|
||||
sock_set_dontfrag(sockfd,0);
|
||||
|
||||
di.conn=conn;
|
||||
|
||||
sock_copyaddr(&conn->addr,res->ai_addr);
|
||||
conn->sock=sockfd;
|
||||
|
||||
do_discover_conn(conn,&di);
|
||||
|
||||
|
||||
if ( di.aciplist->count != 0){
|
||||
set_sock(sockfd);
|
||||
break;
|
||||
}
|
||||
run_discovery(conn);
|
||||
|
||||
close(sockfd);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
freeaddrinfo(res0);
|
||||
|
||||
if (di.aciplist->count){
|
||||
cw_dbg(DBG_CW_INFO,"Discovery responses received: %i\n",di.response_count);
|
||||
return di.aciplist;
|
||||
|
||||
}
|
||||
|
||||
aciplist_destroy(di.aciplist);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int discovery()
|
||||
{
|
||||
struct conn * conn = get_conn();
|
||||
cw_run_discovery(conn,"255.255.255.255");
|
||||
return 0;
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "capwap/sock.h"
|
||||
#include "capwap/dtls.h"
|
||||
|
||||
|
||||
/*
|
||||
#define acinfo_log acinfo_log_
|
||||
|
||||
void acinfo_log_(int level,const struct ac_info *acinfo,const char * xstr)
|
||||
@ -175,3 +175,6 @@ printf("Joined with conn %p\n",conn);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
|
@ -14,6 +14,7 @@
|
||||
|
||||
#include "wtp_conf.h"
|
||||
|
||||
/*
|
||||
static int echo_interval_timer;
|
||||
|
||||
struct cwrmsg * get_response(struct conn * conn, int type,int seqnum)
|
||||
@ -34,9 +35,10 @@ struct cwrmsg * get_response(struct conn * conn, int type,int seqnum)
|
||||
return 0;
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
struct cwrmsg * send_request(struct conn * conn,struct cwmsg *cwmsg)
|
||||
{
|
||||
int i;
|
||||
@ -61,10 +63,11 @@ struct cwrmsg * send_request(struct conn * conn,struct cwmsg *cwmsg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
//extern struct conn * get_conn();
|
||||
|
||||
extern struct conn * get_conn();
|
||||
|
||||
/*
|
||||
int run(struct conn * conn)
|
||||
{
|
||||
|
||||
@ -135,4 +138,4 @@ printf("Error !\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
@ -1,7 +1,15 @@
|
||||
#ifndef __WTP_H
|
||||
#define __WTP_H
|
||||
|
||||
#include "capwap/conn.h"
|
||||
|
||||
|
||||
|
||||
extern int sulking_state();
|
||||
extern int join();
|
||||
extern int discovery();
|
||||
|
||||
|
||||
struct conn * get_conn();
|
||||
|
||||
#endif
|
||||
|
@ -142,6 +142,8 @@ typedef struct {
|
||||
extern LONGSTRS conf_timer_cfgstrs[];
|
||||
|
||||
|
||||
int wtpconf_preinit();
|
||||
int wtpconf_init();
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "wtp_conf.h"
|
||||
#include "wtp_interface.h"
|
||||
|
||||
|
||||
/*
|
||||
struct wtpinfo * get_wtpinfo()
|
||||
{
|
||||
struct wtpinfo * wtpinfo;
|
||||
@ -125,3 +125,8 @@ struct conn * get_conn()
|
||||
printf("Get conn returns %p\n",conn);
|
||||
return conn;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -3,179 +3,71 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
//#include <iwlib.h>
|
||||
|
||||
#include "capwap/sock.h"
|
||||
#include "capwap/conn.h"
|
||||
#include "capwap/dtls.h"
|
||||
#include "capwap/avltree.h"
|
||||
#include "capwap/cw_log.h"
|
||||
#include "capwap/capwap.h"
|
||||
#include "capwap/cw_util.h"
|
||||
#include "capwap/wtpinfo.h"
|
||||
#include "capwap/capwap_items.h"
|
||||
#include "capwap/conn.h"
|
||||
#include "capwap/cw_log.h"
|
||||
#include "capwap/dtls.h"
|
||||
|
||||
#include "wtp.h"
|
||||
#include "wtp_conf.h"
|
||||
|
||||
|
||||
|
||||
struct wtpinfo wtpinfo;
|
||||
|
||||
//int conf_rids[2];
|
||||
//int conf_rids_len[2];
|
||||
|
||||
//int responses = 0;
|
||||
|
||||
struct avltree * aclist =0;
|
||||
/** The one and only connection object */
|
||||
struct conn *the_conn;
|
||||
struct cw_actiondef capwap_actions;
|
||||
|
||||
|
||||
extern struct wpa_driver_ops *wpa_drivers[];
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <ifaddrs.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
//struct sockaddr conf_preferred_ac;
|
||||
|
||||
|
||||
|
||||
static void * drv_priv[2];
|
||||
static void * drv_glob[2];
|
||||
|
||||
const char * interfaces[]={
|
||||
"wlan0",
|
||||
"wlan1-1"
|
||||
};
|
||||
|
||||
/*static int drv_init()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
*/
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
|
||||
|
||||
wtp_main();
|
||||
}
|
||||
|
||||
|
||||
#include <time.h>
|
||||
|
||||
int pmu;
|
||||
|
||||
//#include <openssl/ssl.h>
|
||||
|
||||
int do_connect(void *priv,void *data)
|
||||
{
|
||||
ACIP * ip = (ACIP*)data;
|
||||
// char str[100];
|
||||
// sock_addrtostr((struct sockaddr*)&ip->ip,str,100);
|
||||
|
||||
sock_setport(&ip->ip,atoi(conf_control_port));
|
||||
// printf("Would connect to %s\n",str);
|
||||
|
||||
|
||||
printf("Sleep 5000\n");
|
||||
printf("slept\n");
|
||||
|
||||
int rc;
|
||||
rc = join(&ip->ip);
|
||||
if (!rc)
|
||||
return 1;
|
||||
|
||||
printf("Sleep after oin\n");
|
||||
printf("Go conf\n");
|
||||
// extern struct conn * get_conn();
|
||||
// extern join_state(struct conn * conn);
|
||||
// struct conn * conn = get_conn();
|
||||
//printf("Join conn = %p\n",conn);
|
||||
|
||||
// join_state(conn);
|
||||
|
||||
|
||||
// rc = join(&ip->ip);
|
||||
// if (!rc)
|
||||
// return 1;
|
||||
|
||||
rc = configure();
|
||||
|
||||
run (get_conn());
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#include "capwap/bstr.h"
|
||||
|
||||
int wtp_main(const char *ad)
|
||||
{
|
||||
wtpconf_preinit();
|
||||
|
||||
if (!read_config("./wtp_uci.conf")){
|
||||
if (!read_config("./wtp_uci.conf")) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
cw_dbg_opt_level = conf_dbg_level;
|
||||
|
||||
wtpconf_init();
|
||||
|
||||
cw_dbg_opt_detail=DBG_DETAIL_ASC_DMP;
|
||||
|
||||
|
||||
cw_dbg_opt_detail = DBG_DETAIL_ASC_DMP;
|
||||
|
||||
|
||||
|
||||
|
||||
// cw_log_debug_level=6; //conf_debug_level;
|
||||
|
||||
// conf_dtls_psk="Tube";
|
||||
// conf_sslkeyfilename="../../ssl/wtp.key";
|
||||
// conf_sslcertfilename="../../ssl/wtp.crt";
|
||||
// conf_dtls_psk=0;
|
||||
|
||||
// conf_sslkeyfilename="../../ssl/ac_cisco.key";
|
||||
// conf_sslcertfilename="../../ssl/ac_cisco.pem";
|
||||
conf_sslkeypass="Tube";
|
||||
|
||||
|
||||
|
||||
#ifdef WITH_DTLS
|
||||
dtls_init();
|
||||
#endif
|
||||
|
||||
//drv_init();
|
||||
|
||||
the_conn = conn_create_noq(-1, NULL);
|
||||
struct conn *conn = the_conn;
|
||||
|
||||
|
||||
while (1){
|
||||
ACIPLIST * aciplist=0;
|
||||
int i;
|
||||
cw_register_actions_capwap_wtp(&capwap_actions);
|
||||
conn->actions = &capwap_actions;
|
||||
conn->remote = cw_itemstore_create();
|
||||
conn->local = cw_itemstore_create();
|
||||
|
||||
cw_dbg(DBG_CW_INFO,"Entering discovery state");
|
||||
|
||||
do {
|
||||
for (i=0; i<conf_ac_list_len; i++){
|
||||
if ((aciplist = do_discovery(conf_ac_list[i])))
|
||||
break;
|
||||
}
|
||||
}while (!aciplist);
|
||||
|
||||
// cw_log_debug0("Entering join state");
|
||||
if (!aciplist){
|
||||
// cw_log_debug0("Don't got any discovery response");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
aciplist_foreach(aciplist,do_connect,0);
|
||||
|
||||
aciplist_destroy(aciplist);
|
||||
cw_itemstore_t board_data = cw_itemstore_create();
|
||||
cw_itemstore_set_dword(board_data, CW_ITEM_WTP_BOARD_VENDOR, conf_vendor_id);
|
||||
|
||||
|
||||
}
|
||||
exit(0);
|
||||
cw_itemstore_set_bstrn(board_data, CW_ITEM_WTP_BOARD_MACADDRESS, conf_macaddress,
|
||||
conf_macaddress_len);
|
||||
cw_itemstore_set_bstr16n(board_data, CW_ITEM_WTP_BOARD_SERIALNO,
|
||||
bstr_data(conf_serial_no), bstr_len(conf_serial_no));
|
||||
|
||||
|
||||
|
||||
|
||||
cw_itemstore_set_avltree(conn->local, CW_ITEM_WTP_BOARD_DATA, board_data);
|
||||
|
||||
discovery();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
struct conn *get_conn()
|
||||
{
|
||||
return the_conn;
|
||||
}
|
||||
|
Reference in New Issue
Block a user