From e14d8d36b0f446102823c1552a3e788119664637 Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Sat, 31 Mar 2018 16:49:38 +0000 Subject: [PATCH] Work on join FossilOrigin-Name: 5e55d9a27f8f7cce95c16618e1f7bf9b8c9c4a60c28346ec2d3ef2638de33e9b --- actube.workspace | 4 ++-- src/ac/ac_main.c | 13 ------------- src/wtp/Makefile | 2 +- src/wtp/join.c | 27 +++++++++++++++------------ 4 files changed, 18 insertions(+), 28 deletions(-) diff --git a/actube.workspace b/actube.workspace index e0162c79..b21adfd1 100644 --- a/actube.workspace +++ b/actube.workspace @@ -1,11 +1,11 @@ - + - + diff --git a/src/ac/ac_main.c b/src/ac/ac_main.c index 87cde7d8..f5e3d839 100644 --- a/src/ac/ac_main.c +++ b/src/ac/ac_main.c @@ -346,22 +346,9 @@ int ac_run() conf_parse_listen_addr (conf_listen_addrs[i], addr, port, &proto); - - /* //struct sockaddr sa;*/ - - socklist_add_unicast (addr, port, proto); - - /* -//#ifdef WITH_LWAPP -// if (conf_lwapp) -// socklist_add_unicast(conf_listen_addrs[i], conf_lw_control_port, -// AC_PROTO_LWAPP); -//#endif*/ } - - if (socklist_len == 0) { cw_log (LOG_ERR, "Fatal error: Could not setup any listen socket"); return 1; diff --git a/src/wtp/Makefile b/src/wtp/Makefile index 13c87fc7..0fa1dd65 100644 --- a/src/wtp/Makefile +++ b/src/wtp/Makefile @@ -32,7 +32,7 @@ endif #SRC=$(wildcard *.c) -SRC=wtp_main.c discovery.c +SRC=wtp_main.c discovery.c join.c OBJS=$(patsubst %.c,%.o,$(SRC)) OBJS:=$(patsubst %.o,$(OBJDIR)/%.o,$(OBJS)) diff --git a/src/wtp/join.c b/src/wtp/join.c index d77c850f..621ea680 100644 --- a/src/wtp/join.c +++ b/src/wtp/join.c @@ -13,9 +13,10 @@ #include "cw/dbg.h" #include "cw/sock.h" #include "cw/dtls.h" -#include "cw/aciplist.h" +#include "wtp.h" + /* #define acinfo_log acinfo_log_ @@ -94,10 +95,11 @@ acinfo.result_code=99; */ -int run_join_d(struct sockaddr *sa) +int run_join_d(struct conn * conn, struct sockaddr *sa) { char addrstr[SOCK_ADDR_BUFSIZE]; - struct conn *conn = get_conn(); +/* struct conn *conn = get_conn();*/ + conn->capwap_state = CAPWAP_STATE_JOIN; int sockfd; @@ -130,7 +132,7 @@ int run_join_d(struct sockaddr *sa) int dtls_conf_ok=0; - if (conf_dtls_psk) { + if (conn->dtls_psk) { conn->dtls_psk = conf_dtls_psk; conn->dtls_psk_len = strlen(conn->dtls_psk); conn->dtls_cipher = conf_dtls_cipher; @@ -214,12 +216,12 @@ int run_join(struct conn *conn) -int join() +int join(struct conn * conn, struct cw_DiscoveryResult dis) { - struct conn *conn = get_conn(); + mavliter_t ii; char addrstr[SOCK_ADDR_BUFSIZE]; - printf("Join\n"); + /*mbag_del_all(conn->incomming);*/ @@ -236,16 +238,17 @@ int join() } */ - /*DEFINE_AVLITER(ii, iplist);*/ + mavliter_foreach(&ii) { - cw_acip_t *ip = avliter_get(&ii); +/* cw_acip_t *ip = avliter_get(&ii);*/ - cw_dbg(DBG_INFO, "Going to join CAWAP controller on %s", + /* cw_dbg(DBG_INFO, "Going to join CAWAP controller on %s", sock_addr2str_p(&ip->ip,addrstr)); +*/ - int rc = run_join_d((struct sockaddr *) &ip->ip); +/* int rc = run_join_d((struct sockaddr *) &ip->ip); if (rc<=0) continue; @@ -255,7 +258,7 @@ int join() conn->capwap_state = CW_STATE_CONFIGURE; return 1; } - +*/ }