Refactoring ...

a# Please enter the commit message for your changes. Lines starting

FossilOrigin-Name: c126f130f351f7103d1594a42255a1affd24061a75cf0cfeb129a92a8d2fb2a1
This commit is contained in:
7u83@mail.ru
2018-03-26 11:22:55 +00:00
parent 00b51bacf9
commit 5f5fccb14f
14 changed files with 46 additions and 94 deletions

View File

@ -0,0 +1,59 @@
#include "cw/mod.h"
#include "cw/log.h"
#include "cw/dbg.h"
#include "cw/cw.h"
#include "mod_capwap80211.h"
static int init()
{
cw_dbg(DBG_INFO, "Initialiazing mod_capwap80211 ...");
return 0;
}
static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int elems_len,
struct sockaddr *from, int mode)
{
int wbid;
if (mode != CW_MOD_MODE_BINDINGS)
return 0;
/* Check, if we can handle the Wireless Binding ID */
wbid = cw_get_hdr_wbid(rawmsg);
if (wbid != CAPWAP_WBID_IEEE80211 ) {
cw_dbg(DBG_MOD,"CAPWAP80211 detected: no, my wbid=%d, remote wbid=%d",CAPWAP_WBID_IEEE80211,wbid);
return 0;
}
cw_dbg(DBG_MOD,"CAPWAP80211 detected: yes");
return 1;
}
/*
static int register_actions(struct cw_actiondef *actions, int mode)
{
if (mode != CW_MOD_MODE_BINDINGS)
return 0;
return capwap80211_register_actions_ac(actions);
}
*/
static struct cw_Mod capwap80211_ac = {
.name = "capwap80211",
.init = init,
.detect = detect,
};
struct cw_Mod *mod_capwap80211_ac()
{
return &capwap80211_ac;
}