Uses hardware and software version
FossilOrigin-Name: b90f934110348889a11eb97bbaf9b948b29a8dc451bc0bdb594206a110fa4827
This commit is contained in:
parent
3f9a281a32
commit
5d7b0afd3e
@ -11,10 +11,15 @@
|
|||||||
|
|
||||||
#include "cw/vendors.h"
|
#include "cw/vendors.h"
|
||||||
|
|
||||||
|
#include "cw/capwap_items.h"
|
||||||
|
|
||||||
|
|
||||||
extern int cisco_register_actions80211_ac(struct cw_actiondef *def);
|
extern int cisco_register_actions80211_ac(struct cw_actiondef *def);
|
||||||
extern int cisco_register_actions_ac(struct cw_actiondef *def);
|
extern int cisco_register_actions_ac(struct cw_actiondef *def);
|
||||||
|
|
||||||
|
mbag_t cisco_config = NULL;
|
||||||
|
|
||||||
|
|
||||||
static int register_actions(struct cw_actiondef *actions, int mode)
|
static int register_actions(struct cw_actiondef *actions, int mode)
|
||||||
{
|
{
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
@ -60,7 +65,29 @@ static int register_actions(struct cw_actiondef *actions, int mode)
|
|||||||
static int init()
|
static int init()
|
||||||
{
|
{
|
||||||
cw_dbg(DBG_INFO, "Initialiazing mod_cisco ...");
|
cw_dbg(DBG_INFO, "Initialiazing mod_cisco ...");
|
||||||
// struct mod_ac *cmod = modload_ac("capwap");
|
cisco_config = mbag_create();
|
||||||
|
|
||||||
|
char * hardware_version = ".x01000001";
|
||||||
|
char * software_version = ".x07036500";
|
||||||
|
|
||||||
|
|
||||||
|
uint8_t * str;
|
||||||
|
|
||||||
|
str = bstr_create_from_cfgstr(hardware_version);
|
||||||
|
mbag_set_bstrv(cisco_config, CW_ITEM_AC_HARDWARE_VERSION,
|
||||||
|
CW_VENDOR_ID_CISCO,
|
||||||
|
bstr_data(str),bstr_len(str)
|
||||||
|
);
|
||||||
|
free(str);
|
||||||
|
|
||||||
|
str = bstr_create_from_cfgstr(software_version);
|
||||||
|
mbag_set_bstrv(cisco_config, CW_ITEM_AC_SOFTWARE_VERSION,
|
||||||
|
CW_VENDOR_ID_CISCO,
|
||||||
|
bstr_data(str),bstr_len(str)
|
||||||
|
);
|
||||||
|
free(str);
|
||||||
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,7 +96,6 @@ static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int ele
|
|||||||
struct sockaddr *from, int mode)
|
struct sockaddr *from, int mode)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
int offset = cw_get_hdr_msg_offset(rawmsg);
|
int offset = cw_get_hdr_msg_offset(rawmsg);
|
||||||
const uint8_t *msg_ptr = rawmsg + offset;
|
const uint8_t *msg_ptr = rawmsg + offset;
|
||||||
|
|
||||||
@ -112,10 +138,12 @@ static struct mod_ac capwap_ac = {
|
|||||||
.name = "cisco",
|
.name = "cisco",
|
||||||
.init = init,
|
.init = init,
|
||||||
.detect = detect,
|
.detect = detect,
|
||||||
.register_actions = register_actions
|
.register_actions = register_actions,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct mod_ac *mod_cisco_ac()
|
struct mod_ac *mod_cisco_ac()
|
||||||
{
|
{
|
||||||
return &capwap_ac;
|
return &capwap_ac;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user