Refactoring, work on mod_load

FossilOrigin-Name: ae3ed889283aac53bbbe900b6859605b153f90b91430d231767343bcf05447a8
This commit is contained in:
7u83@mail.ru
2018-02-26 11:21:50 +00:00
parent 775aa8d133
commit 7ecca3ef1f
15 changed files with 79 additions and 71 deletions

View File

@ -24,7 +24,7 @@ mbag_t cisco_config = NULL;
static int register_actions(struct cw_actiondef *actions, int mode)
{
switch (mode) {
case MOD_MODE_CAPWAP:
case CW_MOD_MODE_CAPWAP:
{
struct cw_Mod *cmod = modload_ac("cipwap");
@ -33,7 +33,7 @@ static int register_actions(struct cw_actiondef *actions, int mode)
"Can't initialize mod_cisco, failed to load base mod mod_cipwap");
return 1;
}
cmod->register_actions(actions, MOD_MODE_CAPWAP);
cmod->register_actions(actions, CW_MOD_MODE_CAPWAP);
int rc = cisco_register_actions_ac(actions);
cw_dbg(DBG_INFO, "Initialized mod_cisco with %d actions", rc);
return 0;
@ -144,7 +144,7 @@ static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int ele
uint32_t vendor_id = cw_get_dword(cw_get_elem_data(elem));
if (vendor_id == CW_VENDOR_ID_CISCO) {
// conn->actions = &actions;
if (mode == MOD_MODE_CAPWAP) {
if (mode == CW_MOD_MODE_CAPWAP) {
cw_dbg(DBG_MOD, "CISCO capwap detected: yes");
} else {
cw_dbg(DBG_MOD, "CISCO bindings detected: yes");
@ -158,7 +158,7 @@ static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int ele
}
if (mode == MOD_MODE_CAPWAP) {
if (mode == CW_MOD_MODE_CAPWAP) {
cw_dbg(DBG_MOD, "CISCO capwap detected: no");
} else {
cw_dbg(DBG_MOD, "CISCO bindings detected: no");

View File

@ -21,7 +21,7 @@ static int register_actions(struct cw_actiondef *actions, int mode)
{
switch (mode) {
case MOD_MODE_CAPWAP:
case CW_MOD_MODE_CAPWAP:
{
struct cw_Mod *cmod = modload_wtp("cipwap");
@ -31,7 +31,7 @@ static int register_actions(struct cw_actiondef *actions, int mode)
return 1;
}
cmod->register_actions(actions, MOD_MODE_CAPWAP);
cmod->register_actions(actions, CW_MOD_MODE_CAPWAP);
int rc = cisco_register_actions_wtp(actions);
@ -132,7 +132,7 @@ static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int ele
uint32_t vendor_id = cw_get_dword(cw_get_elem_data(elem));
if (vendor_id == CW_VENDOR_ID_CISCO) {
// conn->actions = &actions;
if (mode == MOD_MODE_CAPWAP) {
if (mode == CW_MOD_MODE_CAPWAP) {
cw_dbg(DBG_MOD, "CISCO capwap detected: yes");
} else {
cw_dbg(DBG_MOD, "CISCO bindings detected: yes");
@ -146,7 +146,7 @@ static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int ele
}
if (mode == MOD_MODE_CAPWAP) {
if (mode == CW_MOD_MODE_CAPWAP) {
cw_dbg(DBG_MOD, "CISCO capwap detected: no");
} else {
cw_dbg(DBG_MOD, "CISCO bindings detected: no");