Compiles with default options now
FossilOrigin-Name: 3b07a845258f7f5bb5276e4ce0ee1974cdaaa80ecb48716360127f2c9610b4d2
This commit is contained in:
parent
b84ee216da
commit
a2d9a1d335
@ -1,12 +1,12 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<CodeLite_Workspace Name="actube" Database="">
|
<CodeLite_Workspace Name="actube" Database="">
|
||||||
<Project Name="ac" Path="ac.project" Active="No"/>
|
<Project Name="ac" Path="ac.project" Active="Yes"/>
|
||||||
<Project Name="wtp" Path="wtp.project" Active="No"/>
|
<Project Name="wtp" Path="wtp.project" Active="No"/>
|
||||||
<Project Name="mod_cipwap" Path="mod_cipwap.project" Active="No"/>
|
<Project Name="mod_cipwap" Path="mod_cipwap.project" Active="No"/>
|
||||||
<Project Name="mod_capwap" Path="mod_capwap.project" Active="No"/>
|
<Project Name="mod_capwap" Path="mod_capwap.project" Active="No"/>
|
||||||
<Project Name="mod_cisco" Path="mod_cisco.project" Active="No"/>
|
<Project Name="mod_cisco" Path="mod_cisco.project" Active="No"/>
|
||||||
<Project Name="libcw" Path="libcw.project" Active="No"/>
|
<Project Name="libcw" Path="libcw.project" Active="No"/>
|
||||||
<Project Name="mod_capwap80211" Path="mod_capwap80211.project" Active="Yes"/>
|
<Project Name="mod_capwap80211" Path="mod_capwap80211.project" Active="No"/>
|
||||||
<Project Name="mod_fortinet" Path="mod_fortinet.project" Active="No"/>
|
<Project Name="mod_fortinet" Path="mod_fortinet.project" Active="No"/>
|
||||||
<BuildMatrix>
|
<BuildMatrix>
|
||||||
<WorkspaceConfiguration Name="Debug" Selected="yes">
|
<WorkspaceConfiguration Name="Debug" Selected="yes">
|
||||||
|
@ -36,6 +36,12 @@ CFLAGS += -Wall -Wunusupported -Wimplicit-function-declaration -I /usr/local/
|
|||||||
LD = tcc
|
LD = tcc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CC),cc)
|
||||||
|
LDFLAGS += -g -L/usr/local/lib
|
||||||
|
CFLAGS += -fPIC -g -O0 -D_REENTRANT -I /usr/local/include -I../
|
||||||
|
LD = cc
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CFLAGS += -DWITH_IPV6 -DWITH_RMAC_SUPPORT
|
CFLAGS += -DWITH_IPV6 -DWITH_RMAC_SUPPORT
|
||||||
|
@ -52,8 +52,8 @@ cw_aciplist_t get_aciplist()
|
|||||||
acip->index=3;
|
acip->index=3;
|
||||||
|
|
||||||
|
|
||||||
// printf ("Adding IP %s\n",sock_addr2str(&acip->ip));
|
/*// printf ("Adding IP %s\n",sock_addr2str(&acip->ip));
|
||||||
|
*/
|
||||||
cw_aciplist_add(aciplist,acip);
|
cw_aciplist_add(aciplist,acip);
|
||||||
|
|
||||||
|
|
||||||
@ -104,8 +104,8 @@ int handle_echo_req(struct conn *conn, struct cw_action_in *a, uint8_t * data,
|
|||||||
|
|
||||||
int ac_global_init()
|
int ac_global_init()
|
||||||
{
|
{
|
||||||
// mod_set_actions_registered_cb(setup_actions);
|
/*// mod_set_actions_registered_cb(setup_actions);
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
ac_config = mbag_create();
|
ac_config = mbag_create();
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#include "conf.h"
|
#include "conf.h"
|
||||||
|
|
||||||
#include "cw/capwap.h"
|
#include "cw/capwap.h"
|
||||||
//#include "cw/capwap_80211.h"
|
/*//#include "cw/capwap_80211.h"*/
|
||||||
#include "cw/aciplist.h"
|
#include "cw/aciplist.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -145,8 +145,8 @@ int mycmp (void *e1, void *e2)
|
|||||||
struct mykv * k1 = e1;
|
struct mykv * k1 = e1;
|
||||||
struct mykv * k2 = e2;
|
struct mykv * k2 = e2;
|
||||||
|
|
||||||
//printf("My CMP: %d and %d\n", k1->key, k2->key);
|
/*//printf("My CMP: %d and %d\n", k1->key, k2->key);
|
||||||
|
*/
|
||||||
if (k1->key > k2->key)
|
if (k1->key > k2->key)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
@ -255,11 +255,13 @@ exit(0);
|
|||||||
|
|
||||||
/* Warn, if the "secret" debugging feature for
|
/* Warn, if the "secret" debugging feature for
|
||||||
developers is turned on ;) */
|
developers is turned on ;) */
|
||||||
|
|
||||||
|
/*
|
||||||
// DBGX("Attention! %s", "DBG X is ON!");
|
// DBGX("Attention! %s", "DBG X is ON!");
|
||||||
|
|
||||||
// cw_mod_set_mod_path("../../lib/actube");
|
// cw_mod_set_mod_path("../../lib/actube");
|
||||||
//cw_mod_load("capwap");
|
//cw_mod_load("capwap");
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -345,16 +347,17 @@ int ac_run()
|
|||||||
conf_parse_listen_addr (conf_listen_addrs[i], addr, port, &proto);
|
conf_parse_listen_addr (conf_listen_addrs[i], addr, port, &proto);
|
||||||
|
|
||||||
|
|
||||||
//struct sockaddr sa;
|
/* //struct sockaddr sa;*/
|
||||||
|
|
||||||
|
|
||||||
socklist_add_unicast (addr, port, proto);
|
socklist_add_unicast (addr, port, proto);
|
||||||
|
|
||||||
|
/*
|
||||||
//#ifdef WITH_LWAPP
|
//#ifdef WITH_LWAPP
|
||||||
// if (conf_lwapp)
|
// if (conf_lwapp)
|
||||||
// socklist_add_unicast(conf_listen_addrs[i], conf_lw_control_port,
|
// socklist_add_unicast(conf_listen_addrs[i], conf_lw_control_port,
|
||||||
// AC_PROTO_LWAPP);
|
// AC_PROTO_LWAPP);
|
||||||
//#endif
|
//#endif*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -400,7 +403,7 @@ int ac_run()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
//get_acinfo();
|
/*//get_acinfo();*/
|
||||||
|
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -574,7 +577,7 @@ void process_cw_ctrl_packet (int index, struct sockaddr *addr, uint8_t * buffer,
|
|||||||
|
|
||||||
void process_lw_ctrl_packet (int index, struct sockaddr *addr, uint8_t * buffer, int len)
|
void process_lw_ctrl_packet (int index, struct sockaddr *addr, uint8_t * buffer, int len)
|
||||||
{
|
{
|
||||||
//int sock = socklist[index].reply_sockfd;
|
/*//int sock = socklist[index].reply_sockfd;*/
|
||||||
|
|
||||||
uint8_t *m = buffer + 6;
|
uint8_t *m = buffer + 6;
|
||||||
uint32_t val = ntohl (* ( (uint32_t *) (m)));
|
uint32_t val = ntohl (* ( (uint32_t *) (m)));
|
||||||
@ -588,7 +591,7 @@ void process_lw_ctrl_packet (int index, struct sockaddr *addr, uint8_t * buffer,
|
|||||||
int version = LWTH_GET_VERSION (m);
|
int version = LWTH_GET_VERSION (m);
|
||||||
|
|
||||||
if (version != LW_VERSION) {
|
if (version != LW_VERSION) {
|
||||||
// cw_log_debug1("Discarding LWAPP packet, wrong verson");
|
/*// cw_log_debug1("Discarding LWAPP packet, wrong verson");*/
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -596,7 +599,7 @@ void process_lw_ctrl_packet (int index, struct sockaddr *addr, uint8_t * buffer,
|
|||||||
printf ("LEN = %d\n", l);
|
printf ("LEN = %d\n", l);
|
||||||
|
|
||||||
if (l + 12 != len) {
|
if (l + 12 != len) {
|
||||||
// cw_log_debug1("Discarding LWAPP packet, wrong length");
|
/* // cw_log_debug1("Discarding LWAPP packet, wrong length");*/
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -621,10 +624,10 @@ void process_lw_ctrl_packet (int index, struct sockaddr *addr, uint8_t * buffer,
|
|||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
//wtpman_lw_start(wtpman);
|
/*//wtpman_lw_start(wtpman);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
//wtpman_lw_addpacket(wtpman,buffer,len);
|
/*//wtpman_lw_addpacket(wtpman,buffer,len);*/
|
||||||
wtplist_unlock();
|
wtplist_unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
29
src/ac/db.c
29
src/ac/db.c
@ -169,9 +169,9 @@ void db_put_radio_prop(const char *wtp_id,const char *rid, const char * key,cons
|
|||||||
{
|
{
|
||||||
int rc=0;
|
int rc=0;
|
||||||
|
|
||||||
// DBGX("Putting %s/%s:%s",id,sub_id,val);
|
/*// DBGX("Putting %s/%s:%s",id,sub_id,val);
|
||||||
// (wtpid,rid,key,sub_key,val,upd)
|
// (wtpid,rid,key,sub_key,val,upd)
|
||||||
|
*/
|
||||||
sqlite3_reset(stmt_put_radio_prop);
|
sqlite3_reset(stmt_put_radio_prop);
|
||||||
sqlite3_clear_bindings(stmt_put_radio_prop);
|
sqlite3_clear_bindings(stmt_put_radio_prop);
|
||||||
|
|
||||||
@ -197,22 +197,22 @@ void db_put_radio_prop(const char *wtp_id,const char *rid, const char * key,cons
|
|||||||
goto errX;
|
goto errX;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
// if (sqlite3_bind_int(put_wtp_prop_stmt,5,0))
|
// if (sqlite3_bind_int(put_wtp_prop_stmt,5,0))
|
||||||
// goto errX;
|
// goto errX;
|
||||||
|
|
||||||
// cw_dbg(DBG_X,"Her I am already, next is step");
|
// cw_dbg(DBG_X,"Her I am already, next is step");
|
||||||
|
*/
|
||||||
rc = sqlite3_step(stmt_put_radio_prop);
|
rc = sqlite3_step(stmt_put_radio_prop);
|
||||||
if (rc != SQLITE_DONE)
|
if (rc != SQLITE_DONE)
|
||||||
goto errX;
|
goto errX;
|
||||||
|
|
||||||
|
/*
|
||||||
// cw_dbg(DBG_X,"SQL schould be fine");
|
// cw_dbg(DBG_X,"SQL schould be fine");
|
||||||
|
*/
|
||||||
return;
|
return;
|
||||||
errX:
|
errX:
|
||||||
// cw_dbg (DBG_X, "Iam on err %d\n",rc);
|
/*// cw_dbg (DBG_X, "Iam on err %d\n",rc);*/
|
||||||
|
|
||||||
|
|
||||||
if (rc) {
|
if (rc) {
|
||||||
@ -261,7 +261,8 @@ void db_put_wtp_prop(const char *wtp_id,const char * id,const char *sub_id,const
|
|||||||
{
|
{
|
||||||
int rc=0;
|
int rc=0;
|
||||||
|
|
||||||
// DBGX("Putting %s/%s:%s",id,sub_id,val);
|
/*// DBGX("Putting %s/%s:%s",id,sub_id,val);
|
||||||
|
*/
|
||||||
|
|
||||||
sqlite3_reset(put_wtp_prop_stmt);
|
sqlite3_reset(put_wtp_prop_stmt);
|
||||||
sqlite3_clear_bindings(put_wtp_prop_stmt);
|
sqlite3_clear_bindings(put_wtp_prop_stmt);
|
||||||
@ -285,18 +286,18 @@ void db_put_wtp_prop(const char *wtp_id,const char * id,const char *sub_id,const
|
|||||||
if (sqlite3_bind_int(put_wtp_prop_stmt,5,0))
|
if (sqlite3_bind_int(put_wtp_prop_stmt,5,0))
|
||||||
goto errX;
|
goto errX;
|
||||||
|
|
||||||
// cw_dbg(DBG_X,"Her I am already, next is step");
|
/*// cw_dbg(DBG_X,"Her I am already, next is step");
|
||||||
|
*/
|
||||||
rc = sqlite3_step(put_wtp_prop_stmt);
|
rc = sqlite3_step(put_wtp_prop_stmt);
|
||||||
if (rc != SQLITE_DONE)
|
if (rc != SQLITE_DONE)
|
||||||
goto errX;
|
goto errX;
|
||||||
|
|
||||||
|
/*
|
||||||
// cw_dbg(DBG_X,"SQL schould be fine");
|
// cw_dbg(DBG_X,"SQL schould be fine");
|
||||||
|
*/
|
||||||
return;
|
return;
|
||||||
errX:
|
errX:
|
||||||
// cw_dbg (DBG_X, "Iam on err %d\n",rc);
|
/*// cw_dbg (DBG_X, "Iam on err %d\n",rc);*/
|
||||||
|
|
||||||
|
|
||||||
if (rc) {
|
if (rc) {
|
||||||
@ -306,7 +307,7 @@ errX:
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO XXXX
|
/*// TODO XXXX*/
|
||||||
mavl_t db_get_update_tasks(struct conn * conn,const char * wtpid)
|
mavl_t db_get_update_tasks(struct conn * conn,const char * wtpid)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
@ -147,7 +147,7 @@ int socklist_find_reply_socket(struct sockaddr *sa, int port)
|
|||||||
static int find_reply_socket(struct sockaddr *sa, int bc)
|
static int find_reply_socket(struct sockaddr *sa, int bc)
|
||||||
{
|
{
|
||||||
|
|
||||||
//printf("Looking for best sock of: %s\n",sock_addr2str(sa));
|
/* //printf("Looking for best sock of: %s\n",sock_addr2str(sa));*/
|
||||||
|
|
||||||
int bestsockfd = -1;
|
int bestsockfd = -1;
|
||||||
int i;
|
int i;
|
||||||
@ -279,13 +279,13 @@ int socklist_add_multicast(const char *addr, const char *port, int ac_proto)
|
|||||||
struct ipv6_mreq mreq;
|
struct ipv6_mreq mreq;
|
||||||
memset(&mreq, 0, sizeof(mreq));
|
memset(&mreq, 0, sizeof(mreq));
|
||||||
struct sockaddr_in6 *sain6 = (struct sockaddr_in6 *) res->ai_addr;
|
struct sockaddr_in6 *sain6 = (struct sockaddr_in6 *) res->ai_addr;
|
||||||
// mreq.ipv6mr_multiaddr.s_addr=sain->sin_addr.s_addr;
|
/*// mreq.ipv6mr_multiaddr.s_addr=sain->sin_addr.s_addr;*/
|
||||||
memcpy(&mreq.ipv6mr_multiaddr.s6_addr, &sain6->sin6_addr.s6_addr,
|
memcpy(&mreq.ipv6mr_multiaddr.s6_addr, &sain6->sin6_addr.s6_addr,
|
||||||
sizeof(sain6->sin6_addr.s6_addr));
|
sizeof(sain6->sin6_addr.s6_addr));
|
||||||
// int si = sizeof(sain6->sin6_addr.s6_addr);
|
/*// int si = sizeof(sain6->sin6_addr.s6_addr);
|
||||||
|
|
||||||
// int i = sain6->sin6_addr.s6_addr;
|
// int i = sain6->sin6_addr.s6_addr;
|
||||||
mreq.ipv6mr_interface = 0; //htonl(INADDR_ANY);
|
*/ mreq.ipv6mr_interface = 0; /*//htonl(INADDR_ANY);*/
|
||||||
opt = &mreq;
|
opt = &mreq;
|
||||||
optlen = sizeof(mreq);
|
optlen = sizeof(mreq);
|
||||||
if (setsockopt(sockfd, IPPROTO_IPV6, IPV6_JOIN_GROUP, opt, optlen)
|
if (setsockopt(sockfd, IPPROTO_IPV6, IPV6_JOIN_GROUP, opt, optlen)
|
||||||
@ -300,7 +300,7 @@ int socklist_add_multicast(const char *addr, const char *port, int ac_proto)
|
|||||||
int rfd = find_reply_socket(sa, 0);
|
int rfd = find_reply_socket(sa, 0);
|
||||||
|
|
||||||
socklist[socklist_len].sockfd = sockfd;
|
socklist[socklist_len].sockfd = sockfd;
|
||||||
// socklist[socklist_len].reply_sockfd = rfd;
|
/*// socklist[socklist_len].reply_sockfd = rfd;*/
|
||||||
socklist[socklist_len].type = SOCKLIST_BCASTMCAST_SOCKET;
|
socklist[socklist_len].type = SOCKLIST_BCASTMCAST_SOCKET;
|
||||||
socklist[socklist_len].family = sa->sa_family;
|
socklist[socklist_len].family = sa->sa_family;
|
||||||
socklist[socklist_len].ac_proto = ac_proto;
|
socklist[socklist_len].ac_proto = ac_proto;
|
||||||
@ -385,7 +385,7 @@ int socklist_add_unicast(const char *addr, const char *port, int ac_proto)
|
|||||||
|
|
||||||
|
|
||||||
socklist[socklist_len].sockfd = sockfd;
|
socklist[socklist_len].sockfd = sockfd;
|
||||||
// socklist[socklist_len].reply_sockfd = sockfd;
|
/*// socklist[socklist_len].reply_sockfd = sockfd;*/
|
||||||
socklist[socklist_len].family = sa->sa_family;
|
socklist[socklist_len].family = sa->sa_family;
|
||||||
socklist[socklist_len].type = SOCKLIST_UNICAST_SOCKET;
|
socklist[socklist_len].type = SOCKLIST_UNICAST_SOCKET;
|
||||||
socklist[socklist_len].ac_proto = ac_proto;
|
socklist[socklist_len].ac_proto = ac_proto;
|
||||||
@ -502,7 +502,7 @@ int socklist_add_broadcast(const char *addr, const char *port, int ac_proto)
|
|||||||
int rfd = find_reply_socket(sa, 1);
|
int rfd = find_reply_socket(sa, 1);
|
||||||
|
|
||||||
socklist[socklist_len].sockfd = sockfd;
|
socklist[socklist_len].sockfd = sockfd;
|
||||||
// socklist[socklist_len].reply_sockfd = rfd;
|
/*// socklist[socklist_len].reply_sockfd = rfd;*/
|
||||||
socklist[socklist_len].type = SOCKLIST_BCASTMCAST_SOCKET;
|
socklist[socklist_len].type = SOCKLIST_BCASTMCAST_SOCKET;
|
||||||
socklist[socklist_len].family = sa->sa_family;
|
socklist[socklist_len].family = sa->sa_family;
|
||||||
socklist[socklist_len].ac_proto = ac_proto;
|
socklist[socklist_len].ac_proto = ac_proto;
|
||||||
@ -510,9 +510,9 @@ int socklist_add_broadcast(const char *addr, const char *port, int ac_proto)
|
|||||||
memcpy(&socklist[socklist_len].addr, res->ai_addr,
|
memcpy(&socklist[socklist_len].addr, res->ai_addr,
|
||||||
sock_addrlen(res->ai_addr));
|
sock_addrlen(res->ai_addr));
|
||||||
|
|
||||||
// printf ("AC INIT PROTO : %d, i %i\n",ac_proto,socklist_len);
|
/*// printf ("AC INIT PROTO : %d, i %i\n",ac_proto,socklist_len);
|
||||||
// printf ("sock proto %d\n",socklist[socklist_len].ac_proto);
|
// printf ("sock proto %d\n",socklist[socklist_len].ac_proto);
|
||||||
socklist_len++;
|
*/ socklist_len++;
|
||||||
|
|
||||||
cw_log(LOG_INFO, "Bound to broadcast: %s:%s (%i,R:%i,I:%d)", addr, port,
|
cw_log(LOG_INFO, "Bound to broadcast: %s:%s (%i,R:%i,I:%d)", addr, port,
|
||||||
sockfd, rfd, socklist_len - 1);
|
sockfd, rfd, socklist_len - 1);
|
||||||
|
@ -52,9 +52,11 @@ static void reset_echointerval_timer(struct wtpman *wtpman)
|
|||||||
*/
|
*/
|
||||||
/* start echinterval timer and put 2 seconds for "safety" on it */
|
/* start echinterval timer and put 2 seconds for "safety" on it */
|
||||||
|
|
||||||
|
/*
|
||||||
// wtpman->echointerval_timer = cw_timer_start(2+ (ct & 0xff));
|
// wtpman->echointerval_timer = cw_timer_start(2+ (ct & 0xff));
|
||||||
// db_ping_wtp(sock_addr2str_p(&wtpman->conn->addr,sock_buf), conf_acname);
|
// db_ping_wtp(sock_addr2str_p(&wtpman->conn->addr,sock_buf), conf_acname);
|
||||||
// cw_dbg(DBG_X, "Starting capwap timer: %d", wtpman->echointerval_timer);
|
// cw_dbg(DBG_X, "Starting capwap timer: %d", wtpman->echointerval_timer);
|
||||||
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,25 +94,26 @@ static void wtpman_run_discovery(void *arg)
|
|||||||
|
|
||||||
|
|
||||||
wtpman->conn->capwap_state = CAPWAP_STATE_DISCOVERY;
|
wtpman->conn->capwap_state = CAPWAP_STATE_DISCOVERY;
|
||||||
// wtpman->conn->actions = &capwap_actions;
|
/*// wtpman->conn->actions = &capwap_actions;*/
|
||||||
|
|
||||||
/* wtpman->conn->outgoing = mbag_create();
|
/* wtpman->conn->outgoing = mbag_create();
|
||||||
wtpman->conn->incomming = mbag_create();
|
wtpman->conn->incomming = mbag_create();
|
||||||
*/
|
*/
|
||||||
wtpman->conn->remote_cfg = cw_ktv_create(); //mavl_cmp_kv,NULL,1312);
|
wtpman->conn->remote_cfg = cw_ktv_create(); /*//mavl_cmp_kv,NULL,1312);*/
|
||||||
|
|
||||||
while (!cw_timer_timeout(timer)
|
while (!cw_timer_timeout(timer)
|
||||||
&& wtpman->conn->capwap_state == CAPWAP_STATE_DISCOVERY) {
|
&& wtpman->conn->capwap_state == CAPWAP_STATE_DISCOVERY) {
|
||||||
cw_read_messages(wtpman->conn);
|
cw_read_messages(wtpman->conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
// struct mbag_item *wn = mbag_get(wtpman->conn->incomming, CW_ITEM_WTP_NAME);
|
// struct mbag_item *wn = mbag_get(wtpman->conn->incomming, CW_ITEM_WTP_NAME);
|
||||||
|
|
||||||
// if (wn) {
|
// if (wn) {
|
||||||
// printf("WTP Name: %s\n", wn->data);
|
// printf("WTP Name: %s\n", wn->data);
|
||||||
// exit(0);
|
// exit(0);
|
||||||
// }
|
// }
|
||||||
|
*/
|
||||||
wtpman_remove(wtpman);
|
wtpman_remove(wtpman);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -185,6 +188,7 @@ static int wtpman_join(void *arg, time_t timer)
|
|||||||
struct wtpman *wtpman = (struct wtpman *) arg;
|
struct wtpman *wtpman = (struct wtpman *) arg;
|
||||||
struct conn *conn = wtpman->conn;
|
struct conn *conn = wtpman->conn;
|
||||||
|
|
||||||
|
/*
|
||||||
// wtpman->conn->outgoing = mbag_create();
|
// wtpman->conn->outgoing = mbag_create();
|
||||||
// wtpman->conn->incomming = mbag_create();
|
// wtpman->conn->incomming = mbag_create();
|
||||||
// conn->config = conn->incomming;
|
// conn->config = conn->incomming;
|
||||||
@ -192,13 +196,15 @@ static int wtpman_join(void *arg, time_t timer)
|
|||||||
|
|
||||||
// mbag_set_str(conn->local, CW_ITEM_AC_NAME, conf_acname);
|
// mbag_set_str(conn->local, CW_ITEM_AC_NAME, conf_acname);
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
wtpman->conn->capwap_state = CAPWAP_STATE_JOIN;
|
wtpman->conn->capwap_state = CAPWAP_STATE_JOIN;
|
||||||
|
|
||||||
|
/*
|
||||||
// wtpman->conn->actions = &capwap_actions;
|
// wtpman->conn->actions = &capwap_actions;
|
||||||
|
|
||||||
// wtpman->conn->itemstore = mbag_create();
|
// wtpman->conn->itemstore = mbag_create();
|
||||||
|
*/
|
||||||
|
|
||||||
cw_dbg(DBG_INFO, "Join State - %s", sock_addr2str(&conn->addr,sock_buf));
|
cw_dbg(DBG_INFO, "Join State - %s", sock_addr2str(&conn->addr,sock_buf));
|
||||||
|
|
||||||
@ -404,7 +410,7 @@ void wtpman_run_data(void *wtpman_arg)
|
|||||||
cw_log(LOG_ERR, "I am the data thread**********************************************************************\n");
|
cw_log(LOG_ERR, "I am the data thread**********************************************************************\n");
|
||||||
while (1) {
|
while (1) {
|
||||||
sleep(5);
|
sleep(5);
|
||||||
// conn->write_data(conn, data, 100);
|
/*// conn->write_data(conn, data, 100);*/
|
||||||
cw_log(LOG_ERR, "O was the data thread***********************************************************\n");
|
cw_log(LOG_ERR, "O was the data thread***********************************************************\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -469,11 +475,11 @@ static void wtpman_run(void *arg)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
// cw_dbg(DBG_INFO, "Creating data thread");
|
// cw_dbg(DBG_INFO, "Creating data thread");
|
||||||
// pthread_t thread;
|
// pthread_t thread;
|
||||||
// pthread_create(&thread, NULL, (void *) wtpman_run_data, (void *) wtpman);
|
// pthread_create(&thread, NULL, (void *) wtpman_run_data, (void *) wtpman);
|
||||||
|
*/
|
||||||
|
|
||||||
/* here the WTP has joined, now we assume an image data request
|
/* here the WTP has joined, now we assume an image data request
|
||||||
or an configuration status request. Nothing else.
|
or an configuration status request. Nothing else.
|
||||||
@ -505,12 +511,12 @@ static void wtpman_run(void *arg)
|
|||||||
|
|
||||||
|
|
||||||
conn->capwap_state = CW_STATE_RUN;
|
conn->capwap_state = CW_STATE_RUN;
|
||||||
|
/*
|
||||||
// XXX testing ...
|
// XXX testing ...
|
||||||
// DBGX("Cofig to sql", "");
|
// DBGX("Cofig to sql", "");
|
||||||
// props_to_sql(conn,conn->incomming,0);
|
// props_to_sql(conn,conn->incomming,0);
|
||||||
// radios_to_sql(conn);
|
// radios_to_sql(conn);
|
||||||
|
*/
|
||||||
|
|
||||||
conn->msg_end=msg_end_handler;
|
conn->msg_end=msg_end_handler;
|
||||||
/* The main run loop */
|
/* The main run loop */
|
||||||
@ -524,8 +530,9 @@ static void wtpman_run(void *arg)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// cw_dbg(DBG_X, "Time left: %d",
|
/*// cw_dbg(DBG_X, "Time left: %d",
|
||||||
// cw_timer_timeleft(wtpman->echointerval_timer));
|
//*/
|
||||||
|
cw_timer_timeleft(wtpman->echointerval_timer);
|
||||||
if (cw_timer_timeout(wtpman->echointerval_timer)) {
|
if (cw_timer_timeout(wtpman->echointerval_timer)) {
|
||||||
|
|
||||||
cw_dbg(DBG_INFO, "Lost connection to WTP:%s",
|
cw_dbg(DBG_INFO, "Lost connection to WTP:%s",
|
||||||
@ -533,42 +540,48 @@ static void wtpman_run(void *arg)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
// mavl_del_all(conn->outgoing);
|
// mavl_del_all(conn->outgoing);
|
||||||
// conn_clear_upd(conn,1);
|
// conn_clear_upd(conn,1);
|
||||||
|
|
||||||
// props_to_sql(conn,conn->incomming,0);
|
// props_to_sql(conn,conn->incomming,0);
|
||||||
// radios_to_sql(conn);
|
// radios_to_sql(conn);
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
mavl_t r;
|
mavl_t r;
|
||||||
r = db_get_update_tasks(conn, sock_addr2str(&conn->addr,sock_buf));
|
r = db_get_update_tasks(conn, sock_addr2str(&conn->addr,sock_buf));
|
||||||
if (r) {
|
if (r) {
|
||||||
|
|
||||||
|
/*
|
||||||
// if (!conn->outgoing->count)
|
// if (!conn->outgoing->count)
|
||||||
// continue;
|
// continue;
|
||||||
|
*/
|
||||||
cw_dbg(DBG_INFO, "Updating WTP %s",sock_addr2str(&conn->addr,sock_buf));
|
cw_dbg(DBG_INFO, "Updating WTP %s",sock_addr2str(&conn->addr,sock_buf));
|
||||||
|
|
||||||
rc = cw_send_request(conn, CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST);
|
rc = cw_send_request(conn, CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST);
|
||||||
|
|
||||||
|
/*
|
||||||
// mavl_merge(conn->config, conn->outgoing);
|
// mavl_merge(conn->config, conn->outgoing);
|
||||||
// mavl_destroy(conn->outgoing);
|
// mavl_destroy(conn->outgoing);
|
||||||
// conn->outgoing = mbag_create();
|
// conn->outgoing = mbag_create();
|
||||||
// props_to_sql(conn,conn->incomming,0);
|
// props_to_sql(conn,conn->incomming,0);
|
||||||
// radios_to_sql(conn);
|
// radios_to_sql(conn);
|
||||||
// mavl_destroy(r);
|
// mavl_destroy(r);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
r = db_get_radio_tasks(conn, sock_addr2str(&conn->addr,sock_buf));
|
r = db_get_radio_tasks(conn, sock_addr2str(&conn->addr,sock_buf));
|
||||||
if (r) {
|
if (r) {
|
||||||
|
|
||||||
|
/*
|
||||||
// if (!conn->radios_upd->count)
|
// if (!conn->radios_upd->count)
|
||||||
// continue;
|
// continue;
|
||||||
|
*/
|
||||||
cw_dbg(DBG_INFO, "Updating Radios for %s",sock_addr2str(&conn->addr,sock_buf));
|
cw_dbg(DBG_INFO, "Updating Radios for %s",sock_addr2str(&conn->addr,sock_buf));
|
||||||
rc = cw_send_request(conn, CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST);
|
rc = cw_send_request(conn, CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST);
|
||||||
|
|
||||||
|
/*
|
||||||
// conn_clear_upd(conn,1);
|
// conn_clear_upd(conn,1);
|
||||||
|
|
||||||
// mavl_destroy(conn->radios_upd);
|
// mavl_destroy(conn->radios_upd);
|
||||||
@ -576,7 +589,7 @@ static void wtpman_run(void *arg)
|
|||||||
|
|
||||||
|
|
||||||
// radios_to_sql(conn);
|
// radios_to_sql(conn);
|
||||||
|
*/
|
||||||
/*
|
/*
|
||||||
rc = cw_send_request(conn, CW_MSG_CONFIGURATION_UPDATE_REQUEST);
|
rc = cw_send_request(conn, CW_MSG_CONFIGURATION_UPDATE_REQUEST);
|
||||||
mavl_merge(conn->config, conn->outgoing);
|
mavl_merge(conn->config, conn->outgoing);
|
||||||
@ -612,7 +625,7 @@ static void wtpman_run_dtls(void *arg)
|
|||||||
wtpman_remove(wtpman);
|
wtpman_remove(wtpman);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// time_t timer = cw_timer_start(wtpman->conn->wait_dtls);
|
/*// time_t timer = cw_timer_start(wtpman->conn->wait_dtls);*/
|
||||||
|
|
||||||
/* establish dtls session */
|
/* establish dtls session */
|
||||||
if (!wtpman_establish_dtls(wtpman)) {
|
if (!wtpman_establish_dtls(wtpman)) {
|
||||||
@ -660,8 +673,8 @@ struct wtpman *wtpman_create(int socklistindex, struct sockaddr *srcaddr)
|
|||||||
replyfd = socklist[socklistindex].sockfd;
|
replyfd = socklist[socklistindex].sockfd;
|
||||||
}
|
}
|
||||||
|
|
||||||
int sockfd = replyfd; //socklist[socklistindex].reply_sockfd;
|
int sockfd = replyfd; /*//socklist[socklistindex].reply_sockfd;
|
||||||
|
*/
|
||||||
|
|
||||||
struct sockaddr dbgaddr;
|
struct sockaddr dbgaddr;
|
||||||
socklen_t dbgaddrl = sizeof(dbgaddr);
|
socklen_t dbgaddrl = sizeof(dbgaddr);
|
||||||
@ -670,9 +683,10 @@ struct wtpman *wtpman_create(int socklistindex, struct sockaddr *srcaddr)
|
|||||||
cw_dbg(DBG_INFO, "Creating wtpman on socket %d, %s:%d", sockfd,
|
cw_dbg(DBG_INFO, "Creating wtpman on socket %d, %s:%d", sockfd,
|
||||||
sock_addr2str(&dbgaddr,sock_buf), sock_getport(&dbgaddr));
|
sock_addr2str(&dbgaddr,sock_buf), sock_getport(&dbgaddr));
|
||||||
|
|
||||||
|
/*
|
||||||
//extern int conn_process_packet2(struct conn *conn, uint8_t * packet, int len,
|
//extern int conn_process_packet2(struct conn *conn, uint8_t * packet, int len,
|
||||||
// struct sockaddr *from);
|
// struct sockaddr *from);
|
||||||
|
*/
|
||||||
wtpman->conn = conn_create(sockfd, srcaddr, 100);
|
wtpman->conn = conn_create(sockfd, srcaddr, 100);
|
||||||
wtpman->conn->receiver = CW_RECEIVER_AC;
|
wtpman->conn->receiver = CW_RECEIVER_AC;
|
||||||
|
|
||||||
@ -680,9 +694,9 @@ struct wtpman *wtpman_create(int socklistindex, struct sockaddr *srcaddr)
|
|||||||
sock_copyaddr(&wtpman->conn->data_addr, (struct sockaddr *) &wtpman->conn->addr);
|
sock_copyaddr(&wtpman->conn->data_addr, (struct sockaddr *) &wtpman->conn->addr);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
// wtpman->conn->process_packet = conn_process_packet2;
|
// wtpman->conn->process_packet = conn_process_packet2;
|
||||||
|
*/
|
||||||
if (!wtpman->conn) {
|
if (!wtpman->conn) {
|
||||||
wtpman_destroy(wtpman);
|
wtpman_destroy(wtpman);
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -692,13 +706,14 @@ struct wtpman *wtpman_create(int socklistindex, struct sockaddr *srcaddr)
|
|||||||
|
|
||||||
wtpman->conn->strict_capwap = conf_strict_capwap;
|
wtpman->conn->strict_capwap = conf_strict_capwap;
|
||||||
wtpman->conn->strict_hdr = conf_strict_headers;
|
wtpman->conn->strict_hdr = conf_strict_headers;
|
||||||
|
/*
|
||||||
// wtpman->conn->radios = mbag_i_create();
|
// wtpman->conn->radios = mbag_i_create();
|
||||||
// wtpman->conn->radios_upd = mbag_i_create();
|
// wtpman->conn->radios_upd = mbag_i_create();
|
||||||
// wtpman->conn->local = ac_config;
|
// wtpman->conn->local = ac_config;
|
||||||
//wtpman->conn->capwap_mode=0; //CW_MODE_STD; //CISCO;
|
//wtpman->conn->capwap_mode=0; //CW_MODE_STD; //CISCO;
|
||||||
// wtpman->conn->capwap_mode = CW_MODE_CISCO;
|
// wtpman->conn->capwap_mode = CW_MODE_CISCO;
|
||||||
//wtpman->conn->strict_capwap_hdr=0;
|
//wtpman->conn->strict_capwap_hdr=0;
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -752,8 +767,11 @@ void wtpman_start(struct wtpman *wtpman, int dtlsmode)
|
|||||||
|
|
||||||
void wtpman_lw_addpacket(struct wtpman *wtpman, uint8_t * packet, int len)
|
void wtpman_lw_addpacket(struct wtpman *wtpman, uint8_t * packet, int len)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/*
|
||||||
// uint8_t * m = packet+12;
|
// uint8_t * m = packet+12;
|
||||||
// int l = LWTH_GET_LENGTH(packet+6);
|
// int l = LWTH_GET_LENGTH(packet+6);
|
||||||
|
*/
|
||||||
|
|
||||||
uint8_t *msg = packet + 12;
|
uint8_t *msg = packet + 12;
|
||||||
|
|
||||||
@ -762,7 +780,9 @@ void wtpman_lw_addpacket(struct wtpman *wtpman, uint8_t * packet, int len)
|
|||||||
int msglen = LWMSG_GET_LEN(msg);
|
int msglen = LWMSG_GET_LEN(msg);
|
||||||
printf("Type is %d, Len is %d\n", msgtype, msglen);
|
printf("Type is %d, Len is %d\n", msgtype, msglen);
|
||||||
|
|
||||||
|
/*
|
||||||
// uint8_t *msgdata = LWMSG_GET_DATA(msg);
|
// uint8_t *msgdata = LWMSG_GET_DATA(msg);
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
int c=0;
|
int c=0;
|
||||||
@ -776,7 +796,8 @@ void wtpman_lw_addpacket(struct wtpman *wtpman, uint8_t * packet, int len)
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//uint8_t *data;
|
/*//uint8_t *data;*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
lw_foreach_msgelem(data,msgdata,msglen){
|
lw_foreach_msgelem(data,msgdata,msglen){
|
||||||
int eltype = LWMSGELEM_GET_TYPE(data);
|
int eltype = LWMSGELEM_GET_TYPE(data);
|
||||||
@ -790,6 +811,7 @@ void wtpman_lw_addpacket(struct wtpman *wtpman, uint8_t * packet, int len)
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
// char wi[4096];
|
// char wi[4096];
|
||||||
// wtpinfo_print(wi, &wtpman->wtpinfo);
|
// wtpinfo_print(wi, &wtpman->wtpinfo);
|
||||||
// printf("WTPINFO: \n%s\n", wi);
|
// printf("WTPINFO: \n%s\n", wi);
|
||||||
@ -802,7 +824,7 @@ void wtpman_lw_addpacket(struct wtpman *wtpman, uint8_t * packet, int len)
|
|||||||
|
|
||||||
// conn_send_packet(wtpman->conn,buffer,60);
|
// conn_send_packet(wtpman->conn,buffer,60);
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
#include "cw.h"
|
#include "cw.h"
|
||||||
#include "cw/msgset.h"
|
#include "msgset.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
static void (*actions_registered_cb) (struct cw_Mod * capwap, struct cw_Mod * bindings,
|
static void (*actions_registered_cb) (struct cw_Mod * capwap, struct cw_Mod * bindings,
|
||||||
|
@ -4,8 +4,8 @@ all:
|
|||||||
$(MAKE) -C capwap80211
|
$(MAKE) -C capwap80211
|
||||||
$(MAKE) -C cisco
|
$(MAKE) -C cisco
|
||||||
$(MAKE) -C fortinet
|
$(MAKE) -C fortinet
|
||||||
$(CC) -c modload_ac.c -I../
|
# $(CC) -c modload_ac.c -I../
|
||||||
$(CC) -c modload_wtp.c -I../
|
# $(CC) -c modload_wtp.c -I../
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(MAKE) -C capwap clean
|
$(MAKE) -C capwap clean
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
include ../../Config.mak
|
include ../../Config.mak
|
||||||
include ../../Config.local.mak
|
-include ../../Config.local.mak
|
||||||
include ../../Macros.mak
|
include ../../Macros.mak
|
||||||
|
|
||||||
OBJS:=$(patsubst %.o,$(OBJDIR)/%.o,$(OBJS))
|
OBJS:=$(patsubst %.o,$(OBJDIR)/%.o,$(OBJS))
|
||||||
|
Loading…
Reference in New Issue
Block a user