Work on mods.
FossilOrigin-Name: 2933314d1c705fae5022e022409b5f77a878656baead522ceb629b7f648c8307
This commit is contained in:
parent
8f325f2f6f
commit
a704463acf
@ -15,6 +15,7 @@ CFLAGS += -Werror -g -O0 -D_REENTRANT -DIPV6 -I/usr/local/include -I../ -DSYS_AR
|
|||||||
|
|
||||||
|
|
||||||
LIBS+=-lcapwap
|
LIBS+=-lcapwap
|
||||||
|
LIBS+=-lcisco
|
||||||
LIBS+=-lcipwap
|
LIBS+=-lcipwap
|
||||||
LIBS+=-lcw
|
LIBS+=-lcw
|
||||||
LIBS+=-lrt
|
LIBS+=-lrt
|
||||||
|
@ -144,7 +144,8 @@ static int init_mods()
|
|||||||
|
|
||||||
conf_mods[0]=modload_ac("cipwap");
|
conf_mods[0]=modload_ac("cipwap");
|
||||||
conf_mods[1]=modload_ac("capwap");
|
conf_mods[1]=modload_ac("capwap");
|
||||||
conf_mods[2]=NULL;
|
conf_mods[2]=modload_ac("cisco");
|
||||||
|
conf_mods[3]=NULL;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ UTILOBJS= \
|
|||||||
stravltree.o \
|
stravltree.o \
|
||||||
intavltree.o \
|
intavltree.o \
|
||||||
cw_util.o \
|
cw_util.o \
|
||||||
send.o
|
send.o \
|
||||||
|
|
||||||
MAVLOBJS= \
|
MAVLOBJS= \
|
||||||
mavl_del.o \
|
mavl_del.o \
|
||||||
|
@ -34,8 +34,7 @@
|
|||||||
#include "intavltree.h"
|
#include "intavltree.h"
|
||||||
#include "item.h"
|
#include "item.h"
|
||||||
|
|
||||||
|
struct conn;
|
||||||
|
|
||||||
|
|
||||||
/* Generic functions and structs */
|
/* Generic functions and structs */
|
||||||
void * cw_actionlist_add(struct avltree *t, void *a, size_t s);
|
void * cw_actionlist_add(struct avltree *t, void *a, size_t s);
|
||||||
|
@ -170,13 +170,16 @@ static int process_elements(struct conn *conn, uint8_t * rawmsg, int len,
|
|||||||
|
|
||||||
|
|
||||||
if (!conn->detected) {
|
if (!conn->detected) {
|
||||||
if (conn->mods){
|
if (conn->mods) {
|
||||||
struct mod_ac ** mods = (struct mod_ac **)conn->mods;
|
struct mod_ac **mods = (struct mod_ac **) conn->mods;
|
||||||
int i;
|
int i;
|
||||||
for (i=0; mods[i]; i++){
|
for (i = 0; mods[i]; i++) {
|
||||||
if (mods[i]->detect){
|
if (mods[i]->detect) {
|
||||||
if (mods[i]->detect(conn,rawmsg,len,from)){
|
if (mods[i]->detect(conn, rawmsg, len, from)) {
|
||||||
cw_dbg(DBG_INFO,"Using mod '%s' to handle connection from %s",mods[i]->name,sock_addr2str(from));
|
cw_dbg(DBG_INFO,
|
||||||
|
"Using mod '%s' to handle connection from %s",
|
||||||
|
mods[i]->name,
|
||||||
|
sock_addr2str(from));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -184,9 +187,10 @@ static int process_elements(struct conn *conn, uint8_t * rawmsg, int len,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!conn->detected){
|
if (!conn->detected) {
|
||||||
cw_dbg(DBG_INFO,"Cant't detect capwap, discarding message from %s",sock_addr2str(from));
|
cw_dbg(DBG_INFO, "Cant't detect capwap, discarding message from %s",
|
||||||
errno=EAGAIN;
|
sock_addr2str(from));
|
||||||
|
errno = EAGAIN;
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,9 @@
|
|||||||
|
|
||||||
#include "capwap/sock.h"
|
#include "capwap/sock.h"
|
||||||
#include "capwap/conn.h"
|
#include "capwap/conn.h"
|
||||||
|
#include "action.h"
|
||||||
|
|
||||||
|
struct cw_actiondef;
|
||||||
|
|
||||||
struct mod_ac
|
struct mod_ac
|
||||||
{
|
{
|
||||||
@ -21,6 +24,9 @@ struct mod_ac
|
|||||||
|
|
||||||
/** used for private data */
|
/** used for private data */
|
||||||
void *data;
|
void *data;
|
||||||
|
|
||||||
|
int (*register_actions)(struct cw_actiondef *def);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
include ../../Macros.mak
|
|
||||||
include ../../Config.mak
|
|
||||||
|
|
||||||
OBJS=\
|
OBJS=\
|
||||||
mod_capwap_ac.o \
|
mod_capwap_ac.o \
|
||||||
@ -7,30 +5,9 @@ OBJS=\
|
|||||||
capwap_in_wtp_descriptor.o \
|
capwap_in_wtp_descriptor.o \
|
||||||
capwap_in_wtp_board_data.o
|
capwap_in_wtp_board_data.o
|
||||||
|
|
||||||
OBJS:=$(patsubst %.o,$(ARCH)/%.o,$(OBJS))
|
|
||||||
|
|
||||||
|
|
||||||
CFLAGS = -Wall -g -O0 -D_REENTRANT -DWITH_IPV6 -DWITH_RMAC_SUPPORT -I ../../ -I../
|
|
||||||
|
|
||||||
NAME=libcapwap.a
|
NAME=libcapwap.a
|
||||||
LIBDIR=../../lib/$(ARCH)
|
|
||||||
|
|
||||||
SRCS = $(OBJS:.o=.c)
|
include ../Mod.mak
|
||||||
|
|
||||||
$(ARCH)/%.o:%.c
|
|
||||||
@mkdir -p $(ARCH)
|
|
||||||
@echo " CC "$<
|
|
||||||
@$(CC) -c $(CFLAGS) $< -o $@
|
|
||||||
|
|
||||||
|
|
||||||
$(LIBDIR)/$(NAME) : $(OBJS) $(MODOBJS)
|
|
||||||
@mkdir -p $(LIBDIR)
|
|
||||||
@echo " AR $(LIBDIR)/$(NAME)"
|
|
||||||
@$(AR) rcs $(LIBDIR)/$(NAME) $(OBJS) $(MODOBJS)
|
|
||||||
|
|
||||||
|
|
||||||
all: $(LIBDIR)/$(NAME)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf $(ARCH)
|
|
||||||
rm -f $(LIBDIR)/$(NAME)
|
|
||||||
|
@ -156,9 +156,11 @@ static int cw_read_wtp_descriptor(mbag_t mbag, struct conn *conn,
|
|||||||
int capwap_in_wtp_descriptor(struct conn *conn, struct cw_action_in *a, uint8_t * data,
|
int capwap_in_wtp_descriptor(struct conn *conn, struct cw_action_in *a, uint8_t * data,
|
||||||
int len, struct sockaddr *from)
|
int len, struct sockaddr *from)
|
||||||
{
|
{
|
||||||
|
|
||||||
mbag_t mbag = conn->incomming;
|
mbag_t mbag = conn->incomming;
|
||||||
|
|
||||||
return cw_read_wtp_descriptor(mbag, conn, a, data, len, 0);
|
int rc =cw_read_wtp_descriptor(mbag, conn, a, data, len, 0);
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
#include "mod.h"
|
#include "capwap/mod.h"
|
||||||
#include "capwap/log.h"
|
#include "capwap/log.h"
|
||||||
#include "capwap/dbg.h"
|
#include "capwap/dbg.h"
|
||||||
|
|
||||||
@ -35,7 +35,8 @@ static int detect(struct conn *conn,const uint8_t *rawmsg, int rawlen,struct soc
|
|||||||
static struct mod_ac capwap_ac = {
|
static struct mod_ac capwap_ac = {
|
||||||
.name ="capwap",
|
.name ="capwap",
|
||||||
.init = init,
|
.init = init,
|
||||||
.detect = detect
|
.detect = detect,
|
||||||
|
.register_actions = capwap_register_actions_ac
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,32 +1,8 @@
|
|||||||
include ../../Macros.mak
|
|
||||||
include ../../Config.mak
|
|
||||||
|
|
||||||
OBJS=\
|
OBJS=\
|
||||||
mod_cipwap_ac.o
|
mod_cipwap_ac.o
|
||||||
|
|
||||||
OBJS:=$(patsubst %.o,$(ARCH)/%.o,$(OBJS))
|
|
||||||
|
|
||||||
|
|
||||||
CFLAGS = -Wall -g -O0 -D_REENTRANT -DWITH_IPV6 -DWITH_RMAC_SUPPORT -I ../../ -I../
|
|
||||||
|
|
||||||
|
|
||||||
NAME=libcipwap.a
|
NAME=libcipwap.a
|
||||||
LIBDIR=../../lib/$(ARCH)
|
|
||||||
|
|
||||||
SRCS = $(OBJS:.o=.c)
|
include ../Mod.mak
|
||||||
|
|
||||||
$(ARCH)/%.o:%.c
|
|
||||||
@mkdir -p $(ARCH)
|
|
||||||
@echo " CC "$<
|
|
||||||
@$(CC) -c $(CFLAGS) $< -o $@
|
|
||||||
|
|
||||||
$(LIBDIR)/$(NAME) : $(OBJS) $(MODOBJS)
|
|
||||||
@mkdir -p $(LIBDIR)
|
|
||||||
@echo " AR $(LIBDIR)/$(NAME)"
|
|
||||||
@$(AR) rcs $(LIBDIR)/$(NAME) $(OBJS) $(MODOBJS)
|
|
||||||
|
|
||||||
|
|
||||||
all: $(LIBDIR)/$(NAME)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf $(ARCH)
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
#include "mod.h"
|
#include "capwap/mod.h"
|
||||||
#include "capwap/log.h"
|
#include "capwap/log.h"
|
||||||
|
|
||||||
#include "mod_cipwap.h"
|
#include "mod_cipwap.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user