Better debug options for mods.
FossilOrigin-Name: 4fd4dd16e470f78d30afa54005a70452c95b6499c789c3bcb2a4fc73397e32f3
This commit is contained in:
@ -17,7 +17,7 @@ extern int capwap_register_actions_ac(struct cw_actiondef *def);
|
||||
|
||||
static int init()
|
||||
{
|
||||
cw_dbg(DBG_INFO, "Initialiazing mod_capwap ...");
|
||||
cw_dbg(DBG_MOD, "Initialiazing mod_capwap.");
|
||||
// int rc = capwap_register_actions_ac(&actions);
|
||||
// cw_dbg(DBG_INFO, "Initialized mod capwap with %d actions", rc);
|
||||
return 0;
|
||||
@ -29,7 +29,7 @@ static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int ele
|
||||
{
|
||||
if (mode != MOD_DETECT_CAPWAP)
|
||||
return 0;
|
||||
|
||||
cw_dbg(DBG_MOD,"CAPWAP detected: yes");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -29,8 +29,6 @@ static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int ele
|
||||
{
|
||||
if (mode != MOD_DETECT_CAPWAP)
|
||||
return 0;
|
||||
|
||||
cw_log(LOG_INFO, "Detecting ...");
|
||||
conn->detected = 1;
|
||||
conn->actions = &actions;
|
||||
return 1;
|
||||
|
@ -31,9 +31,11 @@ static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int ele
|
||||
return 0;
|
||||
|
||||
int wbid = cw_get_hdr_wbid(rawmsg);
|
||||
if (wbid != CW_WBID_IEEE80211 )
|
||||
if (wbid != CW_WBID_IEEE80211 ) {
|
||||
cw_dbg(DBG_MOD,"CAPWAP80211 detected: no, my wbid=%d, remote wbid=%d",CW_WBID_IEEE80211,wbid);
|
||||
return 0;
|
||||
|
||||
}
|
||||
cw_dbg(DBG_MOD,"CAPWAP80211 detected: yes");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
|
||||
#include "cw/mod.h"
|
||||
#include "cw/log.h"
|
||||
#include "cw/dbg.h"
|
||||
|
||||
#include "mod_cipwap.h"
|
||||
|
||||
@ -14,8 +15,10 @@ int cipwap_init()
|
||||
|
||||
static int detect(struct conn *conn,const uint8_t *rawmsg, int rawlen,int elems_len, struct sockaddr *from, int mode)
|
||||
{
|
||||
if (mode != MOD_DETECT_CAPWAP)
|
||||
return 0;
|
||||
|
||||
cw_log(LOG_INFO,"Detecting ...");
|
||||
cw_dbg(DBG_MOD,"CIPWAP detected: no");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -48,6 +48,7 @@ static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int ele
|
||||
if (mode != MOD_DETECT_CAPWAP)
|
||||
return 0;
|
||||
|
||||
|
||||
int offset = cw_get_hdr_msg_offset(rawmsg);
|
||||
const uint8_t *msg_ptr = rawmsg + offset;
|
||||
|
||||
@ -63,6 +64,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;
|
||||
cw_dbg(DBG_MOD,"CISCO detected: yes");
|
||||
return 1;
|
||||
|
||||
}
|
||||
@ -71,6 +73,7 @@ static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int ele
|
||||
|
||||
}
|
||||
|
||||
cw_dbg(DBG_MOD,"CISCO detected: no");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user