More Cisco actionsadded.
FossilOrigin-Name: 063446c7f3a86b125941b7787a3e6d0703dade946b00ab874146562a29e38b38
This commit is contained in:
@ -10,26 +10,44 @@
|
||||
#include "../modload.h"
|
||||
|
||||
|
||||
static struct cw_actiondef actions;
|
||||
|
||||
|
||||
|
||||
extern int cisco_register_actions80211_ac(struct cw_actiondef *def);
|
||||
extern int cisco_register_actions_ac(struct cw_actiondef *def);
|
||||
|
||||
static int register_actions(struct cw_actiondef *actions,int mode)
|
||||
static int register_actions(struct cw_actiondef *actions, int mode)
|
||||
{
|
||||
if (mode != MOD_MODE_CAPWAP)
|
||||
return 0;
|
||||
switch (mode) {
|
||||
case MOD_MODE_CAPWAP:
|
||||
{
|
||||
|
||||
struct mod_ac *cmod = modload_ac("capwap");
|
||||
if (!cmod) {
|
||||
cw_log(LOG_ERR,
|
||||
"Can't initzialize mod_cisco, failed to load base mod mod_capwap");
|
||||
return 1;
|
||||
}
|
||||
cmod->register_actions(actions, MOD_MODE_CAPWAP);
|
||||
int rc = cisco_register_actions_ac(actions);
|
||||
cw_dbg(DBG_INFO, "Initialized mod cisco with %d actions", rc);
|
||||
return 0;
|
||||
}
|
||||
case MOD_MODE_BINDINGS:
|
||||
{
|
||||
struct mod_ac *cmod = modload_ac("capwap80211");
|
||||
if (!cmod) {
|
||||
cw_log(LOG_ERR,
|
||||
"Can't initzialize mod_cisco, failed to load base mod mod_capwap80211");
|
||||
return 1;
|
||||
}
|
||||
cmod->register_actions(actions, MOD_MODE_BINDINGS);
|
||||
int rc = cisco_register_actions80211_ac(actions);
|
||||
cw_dbg(DBG_INFO, "Initialized mod cisco 80211 with %d actions", rc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
struct mod_ac *cmod = modload_ac("capwap");
|
||||
if (!cmod) {
|
||||
cw_log(LOG_ERR,
|
||||
"Can't initzialize mod_cisco, failed to load base mod mod_capwap");
|
||||
return 1;
|
||||
}
|
||||
cmod->register_actions(actions,MOD_MODE_CAPWAP);
|
||||
int rc = cisco_register_actions_ac(actions);
|
||||
cw_dbg(DBG_INFO, "Initialized mod cisco with %d actions", rc);
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
|
||||
@ -40,7 +58,7 @@ static int register_actions(struct cw_actiondef *actions,int mode)
|
||||
static int init()
|
||||
{
|
||||
cw_dbg(DBG_INFO, "Initialiazing mod_cisco ...");
|
||||
// struct mod_ac *cmod = modload_ac("capwap");
|
||||
// struct mod_ac *cmod = modload_ac("capwap");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -64,8 +82,13 @@ static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int ele
|
||||
if (id == CW_ELEM_VENDOR_SPECIFIC_PAYLOAD) {
|
||||
uint32_t vendor_id = cw_get_dword(cw_get_elem_data(elem));
|
||||
if (vendor_id == CW_VENDOR_ID_CISCO) {
|
||||
conn->actions = &actions;
|
||||
cw_dbg(DBG_MOD,"CISCO detected: yes");
|
||||
// conn->actions = &actions;
|
||||
if (mode == MOD_MODE_CAPWAP) {
|
||||
cw_dbg(DBG_MOD, "CISCO capwap detected: yes");
|
||||
} else {
|
||||
cw_dbg(DBG_MOD, "CISCO bindings detected: yes");
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
}
|
||||
@ -74,7 +97,12 @@ static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int ele
|
||||
|
||||
}
|
||||
|
||||
cw_dbg(DBG_MOD,"CISCO detected: no");
|
||||
if (mode == MOD_MODE_CAPWAP) {
|
||||
cw_dbg(DBG_MOD, "CISCO capwap detected: no");
|
||||
} else {
|
||||
cw_dbg(DBG_MOD, "CISCO bindings detected: no");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user