Work on DTLS
FossilOrigin-Name: 5cc472aaf15b6e5dfe9beb3241c11f51af85dc3a29d94fee47992cbaf794fde2
This commit is contained in:
parent
284c81f1a8
commit
3d51c17a9a
@ -21,6 +21,7 @@
|
|||||||
<File Name="src/ac/ac.h"/>
|
<File Name="src/ac/ac.h"/>
|
||||||
<File Name="src/ac/dataman.h"/>
|
<File Name="src/ac/dataman.h"/>
|
||||||
<File Name="src/ac/socklist.h"/>
|
<File Name="src/ac/socklist.h"/>
|
||||||
|
<File Name="src/ac/discovery_cache.c"/>
|
||||||
</VirtualDirectory>
|
</VirtualDirectory>
|
||||||
</VirtualDirectory>
|
</VirtualDirectory>
|
||||||
<Description/>
|
<Description/>
|
||||||
|
@ -14,12 +14,6 @@ LDFLAGS+=-L$(LIBARCHDIR)
|
|||||||
|
|
||||||
CFLAGS+=-DSYS_ARCH=\"$(ARCH)\"
|
CFLAGS+=-DSYS_ARCH=\"$(ARCH)\"
|
||||||
|
|
||||||
#LIBS+=-lcapwap
|
|
||||||
#LIBS+=-lcapwap80211
|
|
||||||
#LIBS+=-lcipwap
|
|
||||||
#LIBS+=-lcisco
|
|
||||||
#LIBS+=-lfortinet
|
|
||||||
#LIBS+=-lzyxel
|
|
||||||
LIBS+=-lcw
|
LIBS+=-lcw
|
||||||
LIBS+=-lrt
|
LIBS+=-lrt
|
||||||
LIBS+=-lpthread
|
LIBS+=-lpthread
|
||||||
@ -63,6 +57,7 @@ AC_OBJS = \
|
|||||||
socklist.o \
|
socklist.o \
|
||||||
db.o \
|
db.o \
|
||||||
ac_global.o \
|
ac_global.o \
|
||||||
|
discovery_cache.o\
|
||||||
${AC_MODULES}
|
${AC_MODULES}
|
||||||
|
|
||||||
|
|
||||||
|
@ -533,8 +533,6 @@ void process_cw_ctrl_packet (int index, struct sockaddr *addr, uint8_t * buffer,
|
|||||||
wtplist_lock();
|
wtplist_lock();
|
||||||
struct wtpman *wtpman = wtplist_get (addr);
|
struct wtpman *wtpman = wtplist_get (addr);
|
||||||
|
|
||||||
printf("Seaching for packet %s\n",sock_addr2str(addr,sock_buf));
|
|
||||||
|
|
||||||
|
|
||||||
if (!wtpman) {
|
if (!wtpman) {
|
||||||
|
|
||||||
|
25
src/ac/discovery_cache.c
Normal file
25
src/ac/discovery_cache.c
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
#include "cw/mlist.h"
|
||||||
|
#include "cw/mavl.h"
|
||||||
|
|
||||||
|
struct cw_DiscoveryCache{
|
||||||
|
int len;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CacheElem{
|
||||||
|
struct sockaddr_storage addr;
|
||||||
|
const char *mod_capwap;
|
||||||
|
const char *mod_bindings;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
void discovery_cache_destroy(struct cw_DiscoveryCache * c)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
struct cw_DiscoveryCache * discovery_cache_init(int len){
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
@ -24,7 +24,7 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
|
||||||
#define MAX_WTPS 200
|
/*#define MAX_WTPS 200*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
@ -81,9 +81,11 @@ struct wtpman * wtplist_get(const struct sockaddr * addr)
|
|||||||
struct wtpman * wtplist_get_by_session_id(uint8_t *session_id)
|
struct wtpman * wtplist_get_by_session_id(uint8_t *session_id)
|
||||||
{
|
{
|
||||||
struct conn search;
|
struct conn search;
|
||||||
|
struct conn * conn;
|
||||||
|
|
||||||
memcpy (search.session_id, session_id,16);
|
memcpy (search.session_id, session_id,16);
|
||||||
|
|
||||||
struct conn * conn = connlist_get_by_session_id(connlist,&search);
|
conn = connlist_get_by_session_id(connlist,&search);
|
||||||
return conn->data;
|
return conn->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,6 +15,6 @@ int conn_q_wait_packet(struct conn * conn, int seconds)
|
|||||||
if (sem_timedwait(&conn->q_sem,×pec)==-1){
|
if (sem_timedwait(&conn->q_sem,×pec)==-1){
|
||||||
return EAGAIN;
|
return EAGAIN;
|
||||||
};
|
};
|
||||||
|
sem_post(&conn->q_sem);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -241,11 +241,12 @@ int run_join(struct conn *conn)
|
|||||||
|
|
||||||
int join(struct conn * conn, struct cw_DiscoveryResult * dis)
|
int join(struct conn * conn, struct cw_DiscoveryResult * dis)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
struct sockaddr_storage s;
|
struct sockaddr_storage s;
|
||||||
sock_strtoaddr("192.168.0.14:5246",(struct sockaddr*)&s);
|
sock_strtoaddr("192.168.0.14:5246",(struct sockaddr*)&s);
|
||||||
run_join_d(conn,(struct sockaddr*)&s);
|
run_join_d(conn,(struct sockaddr*)&s);
|
||||||
exit(0);
|
exit(0);
|
||||||
|
*/
|
||||||
mavliter_t ii;
|
mavliter_t ii;
|
||||||
mavliter_init(&ii,dis->prio_ip);
|
mavliter_init(&ii,dis->prio_ip);
|
||||||
|
|
||||||
|
@ -165,9 +165,9 @@ int main (int argc, char **argv)
|
|||||||
|
|
||||||
|
|
||||||
cw_discovery_init_results(&dis);
|
cw_discovery_init_results(&dis);
|
||||||
/* cw_run_discovery(conn, "255.255.255.255",NULL, &dis);
|
cw_run_discovery(conn, "255.255.255.255",NULL, &dis);
|
||||||
cw_dbg_ktv_dump(dis.prio_ip, DBG_INFO, "=== IP list ===", "IP", "=== END IP List ===");
|
cw_dbg_ktv_dump(dis.prio_ip, DBG_INFO, "=== IP list ===", "IP", "=== END IP List ===");
|
||||||
*/
|
|
||||||
/*
|
/*
|
||||||
{
|
{
|
||||||
mavliter_t i;
|
mavliter_t i;
|
||||||
|
Loading…
Reference in New Issue
Block a user