2018-03-03 17:42:28 +01:00
|
|
|
#include "cw/mbag.h"
|
2016-03-03 20:46:20 +01:00
|
|
|
#include "cw/mod.h"
|
|
|
|
#include "cw/log.h"
|
|
|
|
#include "cw/dbg.h"
|
2016-03-02 19:27:40 +01:00
|
|
|
|
2016-03-03 20:46:20 +01:00
|
|
|
#include "cw/action.h"
|
2016-03-02 19:27:40 +01:00
|
|
|
|
|
|
|
#include "mod_capwap.h"
|
|
|
|
|
|
|
|
|
|
|
|
static struct cw_actiondef actions;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern int capwap_register_actions_wtp(struct cw_actiondef *def);
|
|
|
|
|
|
|
|
|
|
|
|
static int init()
|
|
|
|
{
|
2016-03-08 01:20:22 +01:00
|
|
|
cw_dbg(DBG_INFO, "Initialiazing mod_capwap ...");
|
2016-03-02 19:27:40 +01:00
|
|
|
int rc = capwap_register_actions_wtp(&actions);
|
2016-03-08 01:20:22 +01:00
|
|
|
cw_dbg(DBG_INFO, "Initialized mod capwap with %d actions", rc);
|
2016-03-02 19:27:40 +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-03-02 19:27:40 +01:00
|
|
|
{
|
2018-02-26 12:21:50 +01:00
|
|
|
if (mode != CW_MOD_MODE_CAPWAP)
|
2016-03-08 01:20:22 +01:00
|
|
|
return 0;
|
|
|
|
conn->detected = 1;
|
2018-02-26 18:28:12 +01:00
|
|
|
//conn->actions = &actions;
|
2016-03-02 19:27:40 +01:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2016-03-10 08:07:30 +01:00
|
|
|
static int register_actions(struct cw_actiondef *def, int mode)
|
|
|
|
{
|
2018-02-26 12:21:50 +01:00
|
|
|
if (mode != CW_MOD_MODE_CAPWAP)
|
2016-03-10 08:07:30 +01:00
|
|
|
return 0;
|
|
|
|
return capwap_register_actions_wtp(def);
|
|
|
|
}
|
|
|
|
|
2018-02-25 19:12:28 +01:00
|
|
|
static struct cw_Mod capwap_wtp = {
|
2016-03-08 01:20:22 +01:00
|
|
|
.name = "capwap",
|
2016-03-02 19:27:40 +01:00
|
|
|
.init = init,
|
|
|
|
.detect = detect,
|
2016-03-10 08:07:30 +01:00
|
|
|
.register_actions=register_actions
|
2016-03-02 19:27:40 +01:00
|
|
|
};
|
|
|
|
|
2018-02-25 19:12:28 +01:00
|
|
|
struct cw_Mod *mod_capwap_wtp()
|
2016-03-08 01:20:22 +01:00
|
|
|
{
|
2016-03-02 19:27:40 +01:00
|
|
|
return &capwap_wtp;
|
|
|
|
};
|