Initial commitw
FossilOrigin-Name: 194d0349b89aee61b9f83e926599be2e47e08f2ae2ecd43a10a39f2e513edf60
This commit is contained in:
parent
41265f342a
commit
b49b8787eb
61
src/mod/capwap/capwap_actions_wtp.c
Normal file
61
src/mod/capwap/capwap_actions_wtp.c
Normal file
@ -0,0 +1,61 @@
|
||||
#include "capwap/capwap.h"
|
||||
#include "capwap/action.h"
|
||||
#include "capwap/capwap_items.h"
|
||||
|
||||
|
||||
static cw_action_in_t actions_in[] = {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
static cw_action_out_t actions_out[] = {
|
||||
/* ---------------------------------------------------------------
|
||||
* Discovery Request
|
||||
*/
|
||||
|
||||
/* Discovery Type - Discovery Request */
|
||||
{
|
||||
.msg_id = CW_MSG_DISCOVERY_REQUEST,
|
||||
.elem_id = CW_ELEM_DISCOVERY_TYPE,
|
||||
.item_id = CW_ITEM_DISCOVERY_TYPE,
|
||||
.out = cw_out_generic,
|
||||
.get = cw_out_get_outgoing,
|
||||
.mand = 1
|
||||
}
|
||||
,
|
||||
|
||||
|
||||
|
||||
// {CW_MSG_DISCOVERY_REQUEST, CW_ITEM_DISCOVERY_TYPE, 0,
|
||||
// CW_ELEM_DISCOVERY_TYPE, NULL,cw_out_generic, cw_out_get_outgoing}
|
||||
|
||||
};
|
||||
|
||||
|
||||
int capwap_register_actions_wtp(struct cw_actiondef *def)
|
||||
{
|
||||
def->in = cw_actionlist_in_create();
|
||||
def->out = cw_actionlist_out_create();
|
||||
def->strmsg = cw_strheap_create();
|
||||
def->strelem = cw_strheap_create();
|
||||
def->items = cw_itemdefheap_create();
|
||||
def->radioitems = cw_itemdefheap_create();
|
||||
|
||||
|
||||
|
||||
int rc;
|
||||
|
||||
rc = cw_actionlist_in_register_actions(def->in, actions_in);
|
||||
rc += cw_actionlist_out_register_actions(def->out, actions_out);
|
||||
|
||||
rc += cw_strheap_register_strings(def->strmsg, capwap_strings_msg);
|
||||
rc += cw_strheap_register_strings(def->strelem, capwap_strings_elem);
|
||||
|
||||
rc += cw_itemdefheap_register(def->items,capwap_itemdefs);
|
||||
// rc += cw_itemdefheap_register(def->radioitems,capwap_radioitemdefs);
|
||||
|
||||
return rc;
|
||||
}
|
46
src/mod/capwap/mod_capwap_wtp.c
Normal file
46
src/mod/capwap/mod_capwap_wtp.c
Normal file
@ -0,0 +1,46 @@
|
||||
|
||||
#include "capwap/mod.h"
|
||||
#include "capwap/log.h"
|
||||
#include "capwap/dbg.h"
|
||||
|
||||
#include "capwap/action.h"
|
||||
|
||||
#include "mod_capwap.h"
|
||||
|
||||
|
||||
static struct cw_actiondef actions;
|
||||
|
||||
|
||||
|
||||
extern int capwap_register_actions_wtp(struct cw_actiondef *def);
|
||||
|
||||
|
||||
static int init()
|
||||
{
|
||||
cw_dbg(DBG_INFO,"Initialiazing mod_capwap ...");
|
||||
int rc = capwap_register_actions_wtp(&actions);
|
||||
cw_dbg(DBG_INFO,"Initialized mod capwap with %d actions",rc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int detect(struct conn *conn,const uint8_t *rawmsg, int rawlen,int elems_len,struct sockaddr *from)
|
||||
{
|
||||
cw_log(LOG_INFO,"Detecting ...");
|
||||
conn->detected=1;
|
||||
conn->actions=&actions;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static struct mod_wtp capwap_wtp = {
|
||||
.name ="capwap",
|
||||
.init = init,
|
||||
.detect = detect,
|
||||
.register_actions = capwap_register_actions_wtp
|
||||
|
||||
};
|
||||
|
||||
struct mod_wtp * mod_capwap_wtp(){
|
||||
return &capwap_wtp;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user