diff --git a/actube.workspace b/actube.workspace
index a1ba30eb..e0162c79 100644
--- a/actube.workspace
+++ b/actube.workspace
@@ -7,6 +7,7 @@
+
@@ -17,6 +18,7 @@
+
@@ -27,6 +29,7 @@
+
diff --git a/libcw.project b/libcw.project
index bb9d7294..001da76a 100644
--- a/libcw.project
+++ b/libcw.project
@@ -305,6 +305,7 @@
+
diff --git a/mod_cisco.project b/mod_cisco.project
index bfeabae9..eb8d2f99 100644
--- a/mod_cisco.project
+++ b/mod_cisco.project
@@ -13,7 +13,6 @@
-
diff --git a/src/ac/Makefile b/src/ac/Makefile
index 4d8300d8..cdbbcdfe 100644
--- a/src/ac/Makefile
+++ b/src/ac/Makefile
@@ -25,6 +25,7 @@ LIBS+=-lrt
LIBS+=-lpthread
LIBS+=-lconfuse
LIBS+=-lsqlite3
+LIBS+=-ldl
ifeq ($(SSL_LIBRARY),GNUTLS)
diff --git a/src/ac/ac_main.c b/src/ac/ac_main.c
index 29a1e937..61484bb9 100644
--- a/src/ac/ac_main.c
+++ b/src/ac/ac_main.c
@@ -87,7 +87,7 @@ static int parse_args(int argc, char *argv[])
#include "cw/mod.h"
-extern struct mod_ac * cw_get_mod_ac(const char *name);
+extern struct cw_Mod * cw_get_mod_ac(const char *name);
#include "cw/mlist.h"
@@ -99,7 +99,10 @@ int main(int argc, char *argv[])
-
+ cw_mod_add_dynamic("../../lib/actube/capwap.so" );
+
+ exit(0);
+
diff --git a/src/ac/conf.c b/src/ac/conf.c
index f878678b..38506b49 100644
--- a/src/ac/conf.c
+++ b/src/ac/conf.c
@@ -539,7 +539,7 @@ static int conf_read_dbg_level(cfg_t * cfg)
-struct mod_ac ** conf_mods; //[10];
+struct cw_Mod ** conf_mods; //[10];
@@ -570,7 +570,7 @@ static int conf_read_mods(cfg_t *cfg){
int n, i;
n = cfg_size(cfg,CFG_ENTRY_MODS);
- conf_mods = malloc(sizeof(struct mod_ac *)*(n+1));
+ conf_mods = malloc(sizeof(struct cw_Mod *)*(n+1));
for (i=0; i < n; i++){
char *modname = cfg_getnstr(cfg, CFG_ENTRY_MODS, i);
diff --git a/src/ac/conf.h b/src/ac/conf.h
index 54e4bd85..98b8e12e 100644
--- a/src/ac/conf.h
+++ b/src/ac/conf.h
@@ -33,7 +33,7 @@
#include "cw/vendors.h"
-extern struct mod_ac ** conf_mods;
+extern struct cw_Mod ** conf_mods;
#ifndef CONF_DEFAULT_ACNAME
#define CONF_DEFAULT_ACNAME "AC"
diff --git a/src/cw/Makefile b/src/cw/Makefile
index 03427153..f5bf9feb 100644
--- a/src/cw/Makefile
+++ b/src/cw/Makefile
@@ -333,7 +333,7 @@ OBJS:=$(patsubst %.o,$(ARCH)/%.o,$(OBJS))
-CFLAGS = -Wall -g -O0 -D_REENTRANT -DWITH_IPV6 -DWITH_RMAC_SUPPORT -I /usr/local/include -I../
+CFLAGS = -Wall -fPIC -g -O0 -D_REENTRANT -DWITH_IPV6 -DWITH_RMAC_SUPPORT -I /usr/local/include -I../
#CFLAGS = -Wall -Os -D_REENTRANT -DWITH_IPV6 -DWITH_RMAC_SUPPORT -I/usr/local/include
CFLAGS += $(GNUTLS_CFLAGS) \
diff --git a/src/cw/conn_process_packet.c b/src/cw/conn_process_packet.c
index ffea24a8..b25dac44 100644
--- a/src/cw/conn_process_packet.c
+++ b/src/cw/conn_process_packet.c
@@ -168,23 +168,21 @@ static int check_len(struct conn *conn, struct cw_action_in *a, uint8_t * data,
return 1;
}
-static struct mod_ac *detect_mod(struct conn *conn, uint8_t * rawmsg, int len,
+static struct cw_Mod *detect_mod(struct conn *conn, uint8_t * rawmsg, int len,
int elems_len, struct sockaddr *from, int mode)
{
- if (conn->mods) {
- struct mod_ac **mods = (struct mod_ac **) conn->mods;
- int i;
- for (i = 0; mods[i]; i++) {
- if (mods[i]->detect) {
- if (mods[i]->detect
- (conn, rawmsg, len, elems_len, from, mode)) {
- return mods[i];
-
- }
- }
- }
+ if (!conn->mods)
+ return MOD_NULL;
+
+ struct cw_Mod **mods = (struct cw_Mod **) conn->mods;
+ int i;
+ for (i = 0; mods[i]; i++) {
+ if (!mods[i]->detect)
+ continue;
+ if (mods[i]->detect (conn, rawmsg, len, elems_len, from, mode))
+ return mods[i];
}
-
+
return MOD_NULL;
}
@@ -192,16 +190,16 @@ static struct cw_actiondef *load_mods(struct conn *conn, uint8_t * rawmsg, int l
int elems_len, struct sockaddr *from)
{
- struct mod_ac *cmod =
+ struct cw_Mod *cmod =
detect_mod(conn, rawmsg, len, elems_len, from, MOD_MODE_CAPWAP);
if (cmod == MOD_NULL) {
cw_dbg(DBG_MSG_ERR,
- "Can't find mod to handle connection from %s , discarding message",
+ "Can't find mod to handle connection from %s, discarding message",
sock_addr2str_p(from));
return NULL;
}
- struct mod_ac *bmod =
+ struct cw_Mod *bmod =
detect_mod(conn, rawmsg, len, elems_len, from, MOD_MODE_BINDINGS);
cw_dbg(DBG_INFO, "Mods deteced: %s,%s", cmod->name, bmod->name);
diff --git a/src/cw/cw.h b/src/cw/cw.h
index fbb85509..de09911f 100644
--- a/src/cw/cw.h
+++ b/src/cw/cw.h
@@ -120,10 +120,11 @@ typedef struct {
}cw_elem_handler_t;
-typedef struct {
+struct cw_MsgSet {
mavl_t messages;
mavl_t all_elems;
-}cw_message_set_t;
+};
+typedef struct cw_MsgSet cw_MsgSet_t;
typedef struct{
cw_elem_handler_t * elem;
diff --git a/src/cw/cw_get_mod_ac.c b/src/cw/cw_get_mod_ac.c
index e1ed47d2..adc782bc 100644
--- a/src/cw/cw_get_mod_ac.c
+++ b/src/cw/cw_get_mod_ac.c
@@ -7,15 +7,15 @@
#include
-struct mod_ac *(*mods_ac[])() = MODS_AC;
+struct cw_Mod *(*mods_ac[])() = MODS_AC;
-struct mod_ac * cw_get_mod_ac(const char *name)
+struct cw_Mod * cw_get_mod_ac(const char *name)
{
int i;
for (i=0; mods_ac[i];i++){
- struct mod_ac * m = mods_ac[i]();
+ struct cw_Mod * m = mods_ac[i]();
if (strcmp(m->name,name)==0)
return m;
}
diff --git a/src/cw/message_set.c b/src/cw/message_set.c
index 9c70c127..75dc0a92 100644
--- a/src/cw/message_set.c
+++ b/src/cw/message_set.c
@@ -39,7 +39,7 @@ static inline int msg_cmp(const void *elem1, const void *elem2)
}
-void cw_message_set_destroy(cw_message_set_t * set){
+void cw_message_set_destroy(cw_MsgSet_t * set){
if (set->messages){
mavl_destroy(set->messages);
}
@@ -49,14 +49,14 @@ void cw_message_set_destroy(cw_message_set_t * set){
free(set);
}
-cw_message_set_t * cw_message_set_create(){
+cw_MsgSet_t * cw_message_set_create(){
/* allocate memory for a message_set */
- cw_message_set_t * set = malloc(sizeof(cw_message_set_t));
+ cw_MsgSet_t * set = malloc(sizeof(cw_MsgSet_t));
if (set==NULL)
return NULL;
- memset(set,0,sizeof(cw_message_set_t));
+ memset(set,0,sizeof(cw_MsgSet_t));
/* create mavl for all_elems */
set->all_elems = mavl_create(cmp_cw_msgelemprops,NULL);
@@ -77,7 +77,7 @@ cw_message_set_t * cw_message_set_create(){
}
-static void update_message(message2_t * msg, cw_msgdef_t * src, cw_message_set_t * set){
+static void update_message(message2_t * msg, cw_msgdef_t * src, cw_MsgSet_t * set){
cw_msgelemprops_t *md;
@@ -95,7 +95,7 @@ static void update_message(message2_t * msg, cw_msgdef_t * src, cw_message_set_t
-void cw_message_set_add(cw_message_set_t * set,
+void cw_msgset_add(cw_MsgSet_t * set,
cw_msgdef_t messages[]){
cw_msgdef_t * m;
@@ -136,19 +136,17 @@ void cw_message_set_add(cw_message_set_t * set,
next->states=m->states;
update_message(next,m, set);
-
}
-
}
cw_elem_handler_t * cw_message_set_find_element(
- cw_message_set_t * set,
+ cw_MsgSet_t * set,
cw_elem_handler_t * element){
return mavl_find(set->all_elems,element);
}
-mlist_t cw_msgset_get_msg(cw_message_set_t * set, int type){
+mlist_t cw_msgset_get_msg(cw_MsgSet_t * set, int type){
message2_t search;
search.type = type;
message2_t * result = mavl_find(set->messages,&search);
diff --git a/src/cw/message_set.h b/src/cw/message_set.h
index 39ef9174..5e087afe 100644
--- a/src/cw/message_set.h
+++ b/src/cw/message_set.h
@@ -3,9 +3,9 @@
#include "cw.h"
-extern void cw_message_set_destroy(cw_message_set_t * set);
-extern cw_message_set_t * cw_message_set_create();
-extern void cw_message_set_add(cw_message_set_t * set,
+extern void cw_message_set_destroy(cw_MsgSet_t * set);
+extern cw_MsgSet_t * cw_message_set_create();
+extern void cw_msgset_add(cw_MsgSet_t * set,
cw_msgdef_t messages[]);
-mlist_t cw_msgset_get_msg(cw_message_set_t * set, int type);
+mlist_t cw_msgset_get_msg(cw_MsgSet_t * set, int type);
#endif
\ No newline at end of file
diff --git a/src/cw/mod.c b/src/cw/mod.c
index 4e4c610f..d7272259 100644
--- a/src/cw/mod.c
+++ b/src/cw/mod.c
@@ -18,11 +18,12 @@
/**
* @file
- * @brief Functions for mods
+ * @brief Functions for modules (mods) management.
*/
#include
#include
+#include
#include "action.h"
@@ -31,15 +32,16 @@
#include "log.h"
-static void (*actions_registered_cb) (struct mod_ac * capwap, struct mod_ac * bindings,
+static void (*actions_registered_cb) (struct cw_Mod * capwap, struct cw_Mod * bindings,
struct cw_actiondef * actions) = NULL;
-int mod_caching = 1;
+
void mod_set_actions_registered_cb(void (*fun)
- (struct mod_ac *, struct mod_ac *, struct cw_actiondef *))
+ (struct cw_Mod *, struct cw_Mod *,
+ struct cw_actiondef *))
{
actions_registered_cb = fun;
}
@@ -49,7 +51,7 @@ struct cache_item {
const char *capwap;
const char *bindings;
struct cw_actiondef actions;
-
+ struct cw_MsgSet * msgset;
};
static struct mavl *cache = NULL;
@@ -62,9 +64,10 @@ static int mod_null_register_actions(struct cw_actiondef *def, int mode)
/**
* mod_null is a dummy mod
*/
-struct mod_ac mod_null = {
+struct cw_Mod mod_null = {
.name = "none",
- .register_actions = mod_null_register_actions
+ .register_actions = mod_null_register_actions,
+
};
@@ -89,7 +92,7 @@ struct cw_actiondef *mod_cache_get(const char *capwap, const char *bindings)
}
-struct cw_actiondef *mod_cache_add(struct conn *conn, struct mod_ac *c, struct mod_ac *b)
+struct cw_actiondef *mod_cache_add(struct conn *conn, struct cw_Mod *c, struct cw_Mod *b)
{
if (!cache) {
cache = mavl_create(cmp, NULL);
@@ -130,8 +133,65 @@ struct cw_actiondef *mod_cache_add(struct conn *conn, struct mod_ac *c, struct m
}
if (actions_registered_cb)
- actions_registered_cb(c,b,&(i->actions));
+ actions_registered_cb(c, b, &(i->actions));
mavl_add(cache, i);
return &(i->actions);
}
+
+
+
+/* static mavl to store modules */
+static struct mavl * modlist = NULL;
+static int mod_cmp(const void *e1, const void *e2){
+ struct cw_Mod * (*m1fn)() = e1;
+ struct cw_Mod * (*m2fn)() = e2;
+ return strcmp(m1fn()->name,m2fn()->name);
+}
+
+
+/**
+ * @brief Load a module
+ * @param name Name of the module
+ * @return pointer to the module structure or NULL if the
+ * module cannot be loaded.
+ */
+struct cw_Mod * cw_mod_get(const char *name)
+{
+
+/*int i;
+ for (i=0; modlist[i];i++){
+
+ struct cw_Mod * m = modlist[i]();
+ if (strcmp(m->name,name)==0)
+ return m;
+ }
+ return NULL;
+*/
+}
+
+int cw_mod_add(struct cw_Mod * (*modfn)() ){
+ if (modlist == NULL){
+ modlist = mavl_create(mod_cmp,NULL);
+ if (modlist==NULL){
+ return 0;
+ }
+ }
+ mavl_add(modlist,modfn);
+ return 1;
+}
+
+
+int cw_mod_add_dynamic(const char * filename){
+ void * handle;
+ handle = dlopen(filename,RTLD_NOW);
+ if (!handle){
+ printf("Error: %s",dlerror());
+ }
+
+ printf("Load DLL %p\n",handle);
+
+ void * ifu = dlsym(handle,"bstr_create");
+
+ printf("IFU DLL %p\n",ifu);
+}
\ No newline at end of file
diff --git a/src/cw/mod.h b/src/cw/mod.h
index caedd4a0..97558c72 100644
--- a/src/cw/mod.h
+++ b/src/cw/mod.h
@@ -16,6 +16,11 @@
*/
+/**
+ * @file
+ * @brief module definitions
+ */
+
#ifndef __MOD_H
#define __MOD_H
@@ -28,15 +33,14 @@
struct cw_actiondef;
-#define MOD_MAXMODS 8
enum {
MOD_MODE_CAPWAP,
MOD_MODE_BINDINGS
};
-struct mod_ac {
- /** Name of the mod */
+struct cw_Mod {
+ /** Name of the module */
const char *name;
/** Initializion method */
int (*init) ();
@@ -45,8 +49,10 @@ struct mod_ac {
int (*init_config) (mbag_t config);
/** Detect capwap
- This function is called after receiving and disassembling a complete
- CAPWAP message. Either on Discovery Request or Join Request
+ * This function is called after receiving and disassembling a complete
+ * CAPWAP message. Either on Discovery Request or Join Request.
+ * @param conn current connection
+ * @return 0 if notdetected
**/
int (*detect) (struct conn * conn, const uint8_t * rawmsg, int rawlen,
int elems_len, struct sockaddr * from, int mode);
@@ -56,31 +62,28 @@ struct mod_ac {
/** Register actions */
int (*register_actions) (struct cw_actiondef * def,int mode);
+
+ struct cw_MsgSet * (*register_messages)(struct cw_MsgSet set, int mode);
};
-/**
- * We define here struct mod_wtp in case we need
- * different methods for WTP and AC later
- */
-#define mod_wtp mod_ac
-
-extern struct mod_ac mod_null;
+extern struct cw_Mod mod_null;
#define MOD_NULL (&mod_null)
-struct cw_actiondef * mod_cache_add(struct conn *conn,struct mod_ac *c, struct mod_ac *b);
+struct cw_actiondef * mod_cache_add(struct conn *conn,struct cw_Mod *c, struct cw_Mod *b);
#define mod_init_config(mod,cfg) (mod->init_config ? mod->init_config(cfg):1)
-void mod_set_actions_registered_cb(void (*fun) (struct mod_ac *, struct mod_ac *, struct cw_actiondef *));
+void mod_set_actions_registered_cb(void (*fun) (struct cw_Mod *, struct cw_Mod *, struct cw_actiondef *));
extern int mod_caching;
#define mod_set_caching(var) (mod_caching=var)
#define mod_get_caching() (mod_caching)
+extern int cw_mod_add_dynamic(const char * filename);
#endif
diff --git a/src/mod/Mod.mak b/src/mod/Mod.mak
index 51663598..eb847f4a 100644
--- a/src/mod/Mod.mak
+++ b/src/mod/Mod.mak
@@ -5,7 +5,7 @@ include ../../Config.mak
OBJS:=$(patsubst %.o,$(ARCH)/%.o,$(OBJS))
-CFLAGS = -Wall -g -O0 -D_REENTRANT -DWITH_IPV6 $(COMPDEFS) -DWITH_RMAC_SUPPORT -I ../../ -I../ -I../../include
+CFLAGS = -fPIC -Wall -g -O0 -D_REENTRANT -DWITH_IPV6 $(COMPDEFS) -DWITH_RMAC_SUPPORT -I ../../ -I../ -I../../include
LIBDIR=../../lib/$(ARCH)
@@ -21,6 +21,7 @@ $(LIBDIR)/$(NAME) : $(OBJS) $(MODOBJS)
@mkdir -p $(LIBDIR)
@echo " AR $(LIBDIR)/$(NAME)"
@$(AR) rcs $(LIBDIR)/$(NAME) $(OBJS) $(MODOBJS)
+ $(CC) -L$(LIBDIR) $(OBJS) $(MODOBJS) $(SLIBS) -v -shared -o ../../../lib/actube/capwap.so
all: $(LIBDIR)/$(NAME)
diff --git a/src/mod/capwap/Makefile b/src/mod/capwap/Makefile
index b57c7671..49477a6b 100644
--- a/src/mod/capwap/Makefile
+++ b/src/mod/capwap/Makefile
@@ -16,6 +16,7 @@ OBJS=\
NAME=libcapwap.a
+SLIBS=-lcw
include ../Mod.mak
diff --git a/src/mod/capwap/capwap_actions_ac.c b/src/mod/capwap/capwap_actions_ac.c
index 03005c4c..391df913 100644
--- a/src/mod/capwap/capwap_actions_ac.c
+++ b/src/mod/capwap/capwap_actions_ac.c
@@ -127,15 +127,20 @@ static cw_msgdef_t messages[] = {
};
+
+int capwap_register_msg_set(struct cw_MsgSet * set){
+
+}
+
void test_sets(){
- cw_message_set_t * set = cw_message_set_create();
+ cw_MsgSet_t * set = cw_message_set_create();
if (set==NULL){
cw_log(LOG_ERR,"No mem");
return;
}
- cw_message_set_add(set,messages);
+ cw_msgset_add(set,messages);
cw_elem_handler_t el;
memset(&el,0,sizeof(el));
diff --git a/src/mod/capwap/mod_capwap.h b/src/mod/capwap/mod_capwap.h
index a118fc3f..ed14a383 100644
--- a/src/mod/capwap/mod_capwap.h
+++ b/src/mod/capwap/mod_capwap.h
@@ -1,8 +1,8 @@
#ifndef __MOD_CAPWAP_H
#define __MOD_CAPWAP_H
-struct mod_ac *mod_capwap_ac();
-struct mod_wtp *mod_capwap_wtp();
+struct cw_Mod *mod_capwap_ac();
+struct cw_Mod *mod_capwap_wtp();
extern int capwap_in_wtp_descriptor(struct conn *conn, struct cw_action_in *a,
diff --git a/src/mod/capwap/mod_capwap_ac.c b/src/mod/capwap/mod_capwap_ac.c
index e5387fe6..84faeac1 100644
--- a/src/mod/capwap/mod_capwap_ac.c
+++ b/src/mod/capwap/mod_capwap_ac.c
@@ -42,14 +42,14 @@ static int register_actions(struct cw_actiondef *def, int mode)
-static struct mod_ac capwap_ac = {
+static struct cw_Mod capwap_ac = {
.name = "capwap",
.init = init,
.detect = detect,
.register_actions = register_actions
};
-struct mod_ac *mod_capwap_ac()
+struct cw_Mod *mod_capwap_ac()
{
return &capwap_ac;
};
diff --git a/src/mod/capwap/mod_capwap_wtp.c b/src/mod/capwap/mod_capwap_wtp.c
index 7c2f69d1..87745df3 100644
--- a/src/mod/capwap/mod_capwap_wtp.c
+++ b/src/mod/capwap/mod_capwap_wtp.c
@@ -41,14 +41,14 @@ static int register_actions(struct cw_actiondef *def, int mode)
return capwap_register_actions_wtp(def);
}
-static struct mod_wtp capwap_wtp = {
+static struct cw_Mod capwap_wtp = {
.name = "capwap",
.init = init,
.detect = detect,
.register_actions=register_actions
};
-struct mod_wtp *mod_capwap_wtp()
+struct cw_Mod *mod_capwap_wtp()
{
return &capwap_wtp;
};
diff --git a/src/mod/capwap80211/mod_capwap80211.h b/src/mod/capwap80211/mod_capwap80211.h
index ebae79b2..4fbedea0 100644
--- a/src/mod/capwap80211/mod_capwap80211.h
+++ b/src/mod/capwap80211/mod_capwap80211.h
@@ -1,8 +1,8 @@
#ifndef __MOD_CAPWAP80211_H
#define __MOD_CAPWAP80211_H
-struct mod_ac *mod_capwap80211_ac();
-struct mod_wtp *mod_capwap80211_wtp();
+struct cw_Mod *mod_capwap80211_ac();
+struct cw_Mod *mod_capwap80211_wtp();
extern int capwap80211_register_actions_ac(struct cw_actiondef *def);
extern int capwap80211_register_actions_wtp(struct cw_actiondef *def);
diff --git a/src/mod/capwap80211/mod_capwap80211_ac.c b/src/mod/capwap80211/mod_capwap80211_ac.c
index 12884259..10e5cf64 100644
--- a/src/mod/capwap80211/mod_capwap80211_ac.c
+++ b/src/mod/capwap80211/mod_capwap80211_ac.c
@@ -47,14 +47,14 @@ static int register_actions(struct cw_actiondef *actions, int mode)
return capwap80211_register_actions_ac(actions);
}
-static struct mod_ac capwap80211_ac = {
+static struct cw_Mod capwap80211_ac = {
.name = "capwap80211",
.init = init,
.detect = detect,
.register_actions = register_actions
};
-struct mod_ac *mod_capwap80211_ac()
+struct cw_Mod *mod_capwap80211_ac()
{
return &capwap80211_ac;
};
diff --git a/src/mod/capwap80211/mod_capwap80211_wtp.c b/src/mod/capwap80211/mod_capwap80211_wtp.c
index 69f5675e..9dd9cdc3 100644
--- a/src/mod/capwap80211/mod_capwap80211_wtp.c
+++ b/src/mod/capwap80211/mod_capwap80211_wtp.c
@@ -40,14 +40,14 @@ static int register_actions(struct cw_actiondef *actions,int mode)
return capwap80211_register_actions_wtp(actions);
}
-static struct mod_ac capwap80211_wtp = {
+static struct cw_Mod capwap80211_wtp = {
.name = "capwap80211",
.init = init,
.detect = detect,
.register_actions = register_actions
};
-struct mod_ac *mod_capwap80211_wtp()
+struct cw_Mod *mod_capwap80211_wtp()
{
return &capwap80211_wtp;
};
diff --git a/src/mod/cipwap/mod_cipwap.h b/src/mod/cipwap/mod_cipwap.h
index d6530c53..0c4bb045 100644
--- a/src/mod/cipwap/mod_cipwap.h
+++ b/src/mod/cipwap/mod_cipwap.h
@@ -1,8 +1,8 @@
#ifndef __MOD_CIPWAP_H
#define __MOD_CIPWAP_H
-struct mod_ac * mod_cipwap_ac();
-struct mod_wtp * mod_cipwap_wtp();
+struct cw_Mod * mod_cipwap_ac();
+struct cw_Mod * mod_cipwap_wtp();
extern int cipwap_register_actions_ac(struct cw_actiondef *def);
diff --git a/src/mod/cipwap/mod_cipwap_ac.c b/src/mod/cipwap/mod_cipwap_ac.c
index 72d54fb9..b2cba020 100644
--- a/src/mod/cipwap/mod_cipwap_ac.c
+++ b/src/mod/cipwap/mod_cipwap_ac.c
@@ -30,7 +30,7 @@ static int register_actions(struct cw_actiondef *actions, int mode)
case MOD_MODE_CAPWAP:
{
- struct mod_ac *cmod = modload_ac("capwap");
+ struct cw_Mod *cmod = modload_ac("capwap");
if (!cmod) {
cw_log(LOG_ERR,
"Can't initialize mod_cisco, failed to load base mod mod_capwap");
@@ -69,7 +69,7 @@ static int register_actions(struct cw_actiondef *actions, int mode)
-static struct mod_ac cipwap_ac = {
+static struct cw_Mod cipwap_ac = {
.name ="cipwap",
.init = cipwap_init,
.detect = detect,
@@ -79,7 +79,7 @@ static struct mod_ac cipwap_ac = {
-struct mod_ac * mod_cipwap_ac(){
+struct cw_Mod * mod_cipwap_ac(){
return &cipwap_ac;
};
diff --git a/src/mod/cipwap/mod_cipwap_wtp.c b/src/mod/cipwap/mod_cipwap_wtp.c
index cac0e6b9..5f388c83 100644
--- a/src/mod/cipwap/mod_cipwap_wtp.c
+++ b/src/mod/cipwap/mod_cipwap_wtp.c
@@ -30,7 +30,7 @@ static int register_actions(struct cw_actiondef *actions, int mode)
case MOD_MODE_CAPWAP:
{
- struct mod_ac *cmod = modload_wtp("capwap");
+ struct cw_Mod *cmod = modload_wtp("capwap");
if (!cmod) {
cw_log(LOG_ERR,
"Can't initialize mod_cisco, failed to load base mod mod_capwap");
@@ -69,7 +69,7 @@ static int register_actions(struct cw_actiondef *actions, int mode)
-static struct mod_ac cipwap_wtp = {
+static struct cw_Mod cipwap_wtp = {
.name ="cipwap",
.init = cipwap_init,
.detect = detect,
@@ -79,7 +79,7 @@ static struct mod_ac cipwap_wtp = {
-struct mod_ac * mod_cipwap_wtp(){
+struct cw_Mod * mod_cipwap_wtp(){
return &cipwap_wtp;
};
diff --git a/src/mod/cisco/mod_cisco.h b/src/mod/cisco/mod_cisco.h
index e0e4b9b2..ebc90140 100644
--- a/src/mod/cisco/mod_cisco.h
+++ b/src/mod/cisco/mod_cisco.h
@@ -1,8 +1,8 @@
#ifndef __MOD_CISCO_H
#define __MOD_CISCO_H
-struct mod_ac * mod_cisco_ac();
-struct mod_ac * mod_cisco_wtp();
+struct cw_Mod * mod_cisco_ac();
+struct cw_Mod * mod_cisco_wtp();
#endif
diff --git a/src/mod/cisco/mod_cisco_ac.c b/src/mod/cisco/mod_cisco_ac.c
index 54608193..5024d441 100644
--- a/src/mod/cisco/mod_cisco_ac.c
+++ b/src/mod/cisco/mod_cisco_ac.c
@@ -27,7 +27,7 @@ static int register_actions(struct cw_actiondef *actions, int mode)
case MOD_MODE_CAPWAP:
{
- struct mod_ac *cmod = modload_ac("cipwap");
+ struct cw_Mod *cmod = modload_ac("cipwap");
if (!cmod) {
cw_log(LOG_ERR,
"Can't initialize mod_cisco, failed to load base mod mod_cipwap");
@@ -40,7 +40,7 @@ static int register_actions(struct cw_actiondef *actions, int mode)
}
case MOD_MODE_BINDINGS:
{
- struct mod_ac *cmod = modload_ac("capwap80211");
+ struct cw_Mod *cmod = modload_ac("capwap80211");
if (!cmod) {
cw_log(LOG_ERR,
"Can't initialize mod_cisco, failed to load base mod mod_capwap80211");
@@ -167,14 +167,14 @@ static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int ele
return 0;
}
-static struct mod_ac capwap_ac = {
+static struct cw_Mod capwap_ac = {
.name = "cisco",
.init = init,
.detect = detect,
.register_actions = register_actions,
};
-struct mod_ac *mod_cisco_ac()
+struct cw_Mod *mod_cisco_ac()
{
return &capwap_ac;
};
diff --git a/src/mod/cisco/mod_cisco_wtp.c b/src/mod/cisco/mod_cisco_wtp.c
index aded4bf1..329bc9cb 100644
--- a/src/mod/cisco/mod_cisco_wtp.c
+++ b/src/mod/cisco/mod_cisco_wtp.c
@@ -19,11 +19,12 @@ extern int cisco_register_actions_wtp(struct cw_actiondef *def);
static int register_actions(struct cw_actiondef *actions, int mode)
{
+
switch (mode) {
case MOD_MODE_CAPWAP:
{
- struct mod_wtp *cmod = modload_wtp("cipwap");
+ struct cw_Mod *cmod = modload_wtp("cipwap");
if (!cmod) {
cw_log(LOG_ERR,
"Can't initzialize mod_cisco, failed to load base mod mod_cipwap");
@@ -40,7 +41,7 @@ static int register_actions(struct cw_actiondef *actions, int mode)
}
case MOD_MODE_BINDINGS:
{
- struct mod_ac *cmod = modload_wtp("capwap80211");
+ struct cw_Mod *cmod = modload_wtp("capwap80211");
if (!cmod) {
cw_log(LOG_ERR,
"Can't initzialize mod_cisco, failed to load base mod mod_capwap80211");
@@ -154,7 +155,7 @@ static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int ele
return 0;
}
-static struct mod_ac cisco_wtp = {
+static struct cw_Mod cisco_wtp = {
.name = "cisco",
.init = init,
.init_config = init_config,
@@ -162,7 +163,7 @@ static struct mod_ac cisco_wtp = {
.register_actions = register_actions
};
-struct mod_ac *mod_cisco_wtp()
+struct cw_Mod *mod_cisco_wtp()
{
return &cisco_wtp;
};
diff --git a/src/mod/fortinet/mod_fortinet.h b/src/mod/fortinet/mod_fortinet.h
index 0cdc9338..9b3d477b 100644
--- a/src/mod/fortinet/mod_fortinet.h
+++ b/src/mod/fortinet/mod_fortinet.h
@@ -1,8 +1,8 @@
#ifndef __MOD_FORTINET_H
#define __MOD_FORTINET_H
-struct mod_ac * mod_fortinet_ac();
-struct mod_ac * mod_fortinet_wtp();
+struct cw_Mod * mod_fortinet_ac();
+struct cw_Mod * mod_fortinet_wtp();
#endif
diff --git a/src/mod/fortinet/mod_fortinet_ac.c b/src/mod/fortinet/mod_fortinet_ac.c
index 0d96ed1b..0ba67e53 100644
--- a/src/mod/fortinet/mod_fortinet_ac.c
+++ b/src/mod/fortinet/mod_fortinet_ac.c
@@ -21,7 +21,7 @@ static int register_actions(struct cw_actiondef *actions, int mode)
case MOD_MODE_CAPWAP:
{
- struct mod_ac *cmod = modload_ac("capwap");
+ struct cw_Mod *cmod = modload_ac("capwap");
if (!cmod) {
cw_log(LOG_ERR,
"Can't initialize mod_fortinet, failed to load base mod mod_capwap");
@@ -34,7 +34,7 @@ static int register_actions(struct cw_actiondef *actions, int mode)
}
case MOD_MODE_BINDINGS:
{
- struct mod_ac *cmod = modload_ac("capwap80211");
+ struct cw_Mod *cmod = modload_ac("capwap80211");
if (!cmod) {
cw_log(LOG_ERR,
"Can't initialize mod_fortinet, failed to load base mod mod_capwap80211");
@@ -60,7 +60,7 @@ static int register_actions(struct cw_actiondef *actions, int mode)
static int init()
{
cw_dbg(DBG_INFO, "Initialiazing mod_fortineto ...");
-// struct mod_ac *cmod = modload_ac("capwap");
+// struct cw_Mod *cmod = modload_ac("capwap");
return 1;
}
@@ -108,14 +108,14 @@ static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int ele
return 0;
}
-static struct mod_ac capwap_ac = {
+static struct cw_Mod capwap_ac = {
.name = "fortinet",
.init = init,
.detect = detect,
.register_actions = register_actions
};
-struct mod_ac *mod_fortinet_ac()
+struct cw_Mod *mod_fortinet_ac()
{
return &capwap_ac;
};
diff --git a/src/mod/fortinet/mod_fortinet_wtp.c b/src/mod/fortinet/mod_fortinet_wtp.c
index a5316b09..cadbc959 100644
--- a/src/mod/fortinet/mod_fortinet_wtp.c
+++ b/src/mod/fortinet/mod_fortinet_wtp.c
@@ -21,7 +21,7 @@ static int register_actions(struct cw_actiondef *actions, int mode)
case MOD_MODE_CAPWAP:
{
- struct mod_wtp *cmod = modload_wtp("capwap");
+ struct cw_Mod *cmod = modload_wtp("capwap");
if (!cmod) {
cw_log(LOG_ERR,
"Can't initialize mod_fortinet, failed to load base mod mod_capwap");
@@ -38,7 +38,7 @@ static int register_actions(struct cw_actiondef *actions, int mode)
}
case MOD_MODE_BINDINGS:
{
- struct mod_ac *cmod = modload_wtp("capwap80211");
+ struct cw_Mod *cmod = modload_wtp("capwap80211");
if (!cmod) {
cw_log(LOG_ERR,
"Can't initialize mod_fortinet, failed to load base mod mod_capwap80211");
@@ -82,7 +82,7 @@ static int init()
mbag_set_bstr16(cisco_config_wtp,CW_ITEM_WTP_BOOTLOADER_VERSION,v);
#endif
-// struct mod_ac *cmod = modload_ac("capwap");
+// struct cw_Mod *cmod = modload_ac("capwap");
return 1;
}
@@ -153,7 +153,7 @@ static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int ele
return 0;
}
-static struct mod_ac fortinet_wtp = {
+static struct cw_Mod fortinet_wtp = {
.name = "fortinet",
.init = init,
.init_config = init_config,
@@ -161,7 +161,7 @@ static struct mod_ac fortinet_wtp = {
.register_actions = register_actions
};
-struct mod_ac *mod_fortinet_wtp()
+struct cw_Mod *mod_fortinet_wtp()
{
return &fortinet_wtp;
};
diff --git a/src/mod/modload.h b/src/mod/modload.h
index 65965d2f..ee8e0a1c 100644
--- a/src/mod/modload.h
+++ b/src/mod/modload.h
@@ -1,8 +1,8 @@
#include "cw/mod.h"
-struct mod_ac * modload_ac(const char *name);
-struct mod_wtp * modload_wtp(const char *name);
+struct cw_Mod * modload_ac(const char *name);
+struct cw_Mod * modload_wtp(const char *name);
diff --git a/src/mod/modload_ac.c b/src/mod/modload_ac.c
index 128b8a49..ff803c99 100644
--- a/src/mod/modload_ac.c
+++ b/src/mod/modload_ac.c
@@ -14,14 +14,14 @@
*/
-struct mod_ac *(*mods_ac[])() = MODS_AC;
+struct cw_Mod *(*mods_ac[])() = MODS_AC;
-struct mod_ac * modload_ac(const char *name)
+struct cw_Mod * modload_ac(const char *name)
{
int i;
for (i=0; mods_ac[i];i++){
- struct mod_ac * m = mods_ac[i]();
+ struct cw_Mod * m = mods_ac[i]();
if (strcmp(m->name,name)==0)
return m;
}
diff --git a/src/mod/modload_wtp.c b/src/mod/modload_wtp.c
index a3ca162e..74dabde6 100644
--- a/src/mod/modload_wtp.c
+++ b/src/mod/modload_wtp.c
@@ -12,14 +12,14 @@
#include "modload.h"
-struct mod_wtp *(*mods_wtp[])() = MODS_WTP;
+struct cw_Mod *(*mods_wtp[])() = MODS_WTP;
-struct mod_wtp * modload_wtp(const char *name)
+struct cw_Mod * modload_wtp(const char *name)
{
int i;
for (i=0; mods_wtp[i];i++){
- struct mod_wtp * m = mods_wtp[i]();
+ struct cw_Mod * m = mods_wtp[i]();
if (strcmp(m->name,name)==0)
return m;
}
diff --git a/src/mod/zyxel/mod_zyxel.h b/src/mod/zyxel/mod_zyxel.h
index 2f7078da..ae91e352 100644
--- a/src/mod/zyxel/mod_zyxel.h
+++ b/src/mod/zyxel/mod_zyxel.h
@@ -1,7 +1,7 @@
#ifndef __MOD_ZYXEL_H
#define __MOD_ZYXEL_H
-struct mod_ac * mod_zyxel_ac();
+struct cw_Mod * mod_zyxel_ac();
#endif
diff --git a/src/wtp/wtp_main.c b/src/wtp/wtp_main.c
index 30aea18a..4cdec9bb 100644
--- a/src/wtp/wtp_main.c
+++ b/src/wtp/wtp_main.c
@@ -123,7 +123,7 @@ int main()
//#define CWBIND "capwap80211"
- struct mod_wtp *mod = modload_wtp(CWMOD);
+ struct cw_Mod *mod = modload_wtp(CWMOD);
if (!mod) {
printf("Can't load mod capwap\n");
exit(0);