2016-02-23 19:38:10 +01:00
|
|
|
|
2016-03-03 20:46:20 +01:00
|
|
|
#include "cw/mod.h"
|
|
|
|
#include "cw/log.h"
|
|
|
|
#include "cw/dbg.h"
|
2016-02-23 19:38:10 +01:00
|
|
|
|
2016-03-03 20:46:20 +01:00
|
|
|
#include "cw/action.h"
|
2016-02-23 19:38:10 +01:00
|
|
|
|
|
|
|
#include "mod_capwap.h"
|
|
|
|
|
|
|
|
|
2016-03-10 08:07:30 +01:00
|
|
|
//static struct cw_actiondef actions;
|
2016-02-23 19:38:10 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern int capwap_register_actions_ac(struct cw_actiondef *def);
|
|
|
|
|
|
|
|
|
|
|
|
static int init()
|
|
|
|
{
|
2016-03-09 18:39:57 +01:00
|
|
|
cw_dbg(DBG_MOD, "Initialiazing mod_capwap.");
|
2016-03-08 01:20:22 +01:00
|
|
|
// int rc = capwap_register_actions_ac(&actions);
|
|
|
|
// cw_dbg(DBG_INFO, "Initialized mod capwap with %d actions", rc);
|
2016-02-23 19:38:10 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-03-08 01:20:22 +01:00
|
|
|
static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int elems_len,
|
|
|
|
struct sockaddr *from, int mode)
|
2016-02-23 19:38:10 +01:00
|
|
|
{
|
2016-03-10 08:07:30 +01:00
|
|
|
if (mode != MOD_MODE_CAPWAP)
|
2016-03-08 01:20:22 +01:00
|
|
|
return 0;
|
2016-03-09 18:39:57 +01:00
|
|
|
cw_dbg(DBG_MOD,"CAPWAP detected: yes");
|
2016-02-23 19:38:10 +01:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2016-03-10 08:07:30 +01:00
|
|
|
static int register_actions(struct cw_actiondef *def, int mode)
|
|
|
|
{
|
|
|
|
if (mode != MOD_MODE_CAPWAP)
|
|
|
|
return 0;
|
|
|
|
return capwap_register_actions_ac(def);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-02-23 19:38:10 +01:00
|
|
|
static struct mod_ac capwap_ac = {
|
2016-03-08 01:20:22 +01:00
|
|
|
.name = "capwap",
|
2016-02-23 19:38:10 +01:00
|
|
|
.init = init,
|
2016-02-27 05:35:25 +01:00
|
|
|
.detect = detect,
|
2016-03-10 08:07:30 +01:00
|
|
|
.register_actions = register_actions
|
2016-02-23 19:38:10 +01:00
|
|
|
};
|
|
|
|
|
2016-03-08 01:20:22 +01:00
|
|
|
struct mod_ac *mod_capwap_ac()
|
|
|
|
{
|
2016-02-23 19:38:10 +01:00
|
|
|
return &capwap_ac;
|
|
|
|
};
|