Some work on wtp and ktv config files
FossilOrigin-Name: 3747732055809fd587f96cff65c389a0878a09a197947c1e68a76f605bdb44a0
This commit is contained in:
@ -18,10 +18,10 @@
|
||||
|
||||
|
||||
#include "cw/cw.h"
|
||||
#include "cw/kvt.h"
|
||||
#include "cw/ktv.h"
|
||||
#include "cw/log.h"
|
||||
|
||||
#include "cw/msget.h"
|
||||
#include "cw/msgset.h"
|
||||
|
||||
#include "mod_capwap.h"
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
#include "cw/capwap.h"
|
||||
#include "cw/msget.h"
|
||||
#include "cw/msgset.h"
|
||||
#include "cw/dbg.h"
|
||||
|
||||
|
||||
|
@ -34,7 +34,9 @@ int capwap_in_vendor_specific_payload(struct cw_ElemHandler *handler,
|
||||
}
|
||||
|
||||
cw_dbg_elem(DBG_ELEM,params->conn,0,vhandler,data+6,len-6);
|
||||
vhandler->get(vhandler, params, data+6, len-6);
|
||||
//vhandler->get(vhandler, params, data+6, len-6);
|
||||
|
||||
cw_process_element(params,0,vendor_id,elem_id,data+6,len-6);
|
||||
|
||||
return 1;
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "cw/dbg.h"
|
||||
#include "cw/cw.h"
|
||||
|
||||
#include "cw/kvt.h"
|
||||
#include "cw/ktv.h"
|
||||
|
||||
#include "cw/keys.h"
|
||||
|
||||
@ -99,7 +99,7 @@ static void readsubelems_wtp_board_data(mavl_t cfg, uint8_t * msgelem,
|
||||
if (key){
|
||||
char add_key[256];
|
||||
sprintf(add_key,"wtp_board_data/%s",key);
|
||||
cw_kvt_add(cfg,add_key,CW_TYPE_BSTR16,msgelem+i,sublen);
|
||||
cw_ktv_add(cfg,add_key,CW_TYPE_BSTR16,msgelem+i,sublen);
|
||||
|
||||
}
|
||||
|
||||
@ -134,7 +134,7 @@ int capwap_in_wtp_board_data(struct cw_ElemHandler *eh, struct cw_ElemHandlerPar
|
||||
|
||||
sprintf(vendor_key,"%s/%s",eh->key,CW_KEY_VENDOR);
|
||||
|
||||
cw_kvt_add(cfg,vendor_key,CW_TYPE_DWORD,data,len);
|
||||
cw_ktv_add(cfg,vendor_key,CW_TYPE_DWORD,data,len);
|
||||
|
||||
/*
|
||||
mbag_t itemstore = conn->incomming;
|
||||
|
@ -25,7 +25,7 @@ int capwap_out_ac_descriptor(struct conn *conn,struct cw_action_out * a,uint8_t
|
||||
|
||||
d+=cw_put_ac_status(d ,(struct cw_ac_status*)(i->u2.data),conn);
|
||||
|
||||
|
||||
/*
|
||||
|
||||
i = mbag_get(conn->local,CW_ITEM_AC_HARDWARE_VERSION);
|
||||
if ( i ) {
|
||||
@ -44,7 +44,7 @@ int capwap_out_ac_descriptor(struct conn *conn,struct cw_action_out * a,uint8_t
|
||||
else {
|
||||
cw_log(LOG_ERR, "Can't send software version in AC descriptor, not set.");
|
||||
}
|
||||
|
||||
*/
|
||||
int len = d-dst-4;
|
||||
|
||||
return len + cw_put_elem_hdr(dst,a->elem_id,len);
|
||||
|
@ -41,7 +41,7 @@ int capwap_out_wtp_descriptor(struct conn *conn, struct cw_action_out *a, uint8_
|
||||
|
||||
mbag_item_t * i;
|
||||
i = mbag_get(mbag,CW_ITEM_WTP_HARDWARE_VERSION);
|
||||
if ( i ) {
|
||||
/* if ( i ) {
|
||||
d += cw_put_version(d,CW_SUBELEM_WTP_HARDWARE_VERSION,i->u2.data);
|
||||
if (bstrv_get_vendor_id(i->u2.data)){
|
||||
d += cw_put_dword(d, 0);
|
||||
@ -55,10 +55,10 @@ int capwap_out_wtp_descriptor(struct conn *conn, struct cw_action_out *a, uint8_
|
||||
cw_log(LOG_ERR, "Can't send Hardware Version in WTP Descriptor, not set.");
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
i = mbag_get(mbag,CW_ITEM_WTP_SOFTWARE_VERSION);
|
||||
|
||||
if ( i ) {
|
||||
/* if ( i ) {
|
||||
d += cw_put_version(d,CW_SUBELEM_WTP_SOFTWARE_VERSION,i->u2.data);
|
||||
}
|
||||
else {
|
||||
@ -73,7 +73,7 @@ int capwap_out_wtp_descriptor(struct conn *conn, struct cw_action_out *a, uint8_
|
||||
cw_log(LOG_ERR, "Can't send Bootloader Version in WTP descriptor, not set.");
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
int len = d-dst-4;
|
||||
return len + cw_put_elem_hdr(dst,a->elem_id,len);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
struct cw_Mod *mod_capwap_ac();
|
||||
struct cw_Mod *mod_capwap_wtp();
|
||||
|
||||
#include "cw/msget.h"
|
||||
#include "cw/msgset.h"
|
||||
#include "cw/conn.h"
|
||||
|
||||
|
||||
|
@ -17,7 +17,7 @@ extern int capwap_register_actions_ac(struct cw_actiondef *def);
|
||||
|
||||
static int init()
|
||||
{
|
||||
cw_dbg(DBG_MOD, "Initialiazing mod_capwap.");
|
||||
cw_dbg(DBG_MOD, "CAPWAP: Initialiazing mod_capwap.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ static int init()
|
||||
static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int elems_len,
|
||||
struct sockaddr *from, int mode)
|
||||
{
|
||||
if (mode != MOD_MODE_BINDINGS)
|
||||
if (mode != CW_MOD_MODE_BINDINGS)
|
||||
return 0;
|
||||
|
||||
int wbid = cw_get_hdr_wbid(rawmsg);
|
||||
@ -41,7 +41,7 @@ static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int ele
|
||||
|
||||
static int register_actions(struct cw_actiondef *actions, int mode)
|
||||
{
|
||||
if (mode != MOD_MODE_BINDINGS)
|
||||
if (mode != CW_MOD_MODE_BINDINGS)
|
||||
return 0;
|
||||
|
||||
return capwap80211_register_actions_ac(actions);
|
||||
|
@ -26,7 +26,7 @@ static int init()
|
||||
static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int elems_len,
|
||||
struct sockaddr *from, int mode)
|
||||
{
|
||||
if (mode != MOD_MODE_BINDINGS)
|
||||
if (mode != CW_MOD_MODE_BINDINGS)
|
||||
return 0;
|
||||
|
||||
cw_log(LOG_INFO, "Detecting WTP 80211");
|
||||
@ -35,7 +35,7 @@ static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int ele
|
||||
|
||||
static int register_actions(struct cw_actiondef *actions,int mode)
|
||||
{
|
||||
if (mode != MOD_MODE_BINDINGS)
|
||||
if (mode != CW_MOD_MODE_BINDINGS)
|
||||
return 0;
|
||||
return capwap80211_register_actions_wtp(actions);
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ OBJDIR := ../../../obj/mod_cisco/$(ARCH)
|
||||
SNAME := $(LIBARCHDIR)/libmod_cisco.a
|
||||
DNAME := $(LIBARCHDIR)/mod_cisco.so
|
||||
MODNAME := $(LIBDIR)/mod_cisco.so
|
||||
SLIBS := -lcw -lmod_cipwap -lmod_capwap
|
||||
SLIBS := -lcw -lmod_cipwap -lmod_capwap -lconfuse
|
||||
|
||||
|
||||
include ../Mod.mak
|
||||
|
@ -41,8 +41,8 @@
|
||||
|
||||
#include "include/cipwap_items.h"
|
||||
|
||||
#include "cw/msget.h"
|
||||
#include "cw/kvt.h"
|
||||
#include "cw/msgset.h"
|
||||
#include "cw/ktv.h"
|
||||
|
||||
|
||||
static struct cw_ElemHandler handlers[] = {
|
||||
@ -86,6 +86,7 @@ static int discovery_request_states[] = {CAPWAP_STATE_DISCOVERY,0};
|
||||
static struct cw_ElemDef discovery_request_elements[] ={
|
||||
{0,0, CAPWAP_ELEM_WTP_DESCRIPTOR, 1, 0},
|
||||
{0,CW_VENDOR_ID_CISCO, CW_CISCO_RAD_NAME, 1, 0},
|
||||
{0,CW_VENDOR_ID_CISCO, CW_CISCO_BOARD_DATA_OPTIONS, 1, 0},
|
||||
{0,0,0,00}
|
||||
|
||||
};
|
||||
|
@ -47,7 +47,7 @@ int cisco_out_ac_descriptor(struct conn *conn,struct cw_action_out * a,uint8_t *
|
||||
otherwise the AP wants us to send an image */
|
||||
i = mbag_get(conn->incomming,CW_ITEM_WTP_SOFTWARE_VERSION);
|
||||
}
|
||||
|
||||
/*
|
||||
if ( i ) {
|
||||
d += cw_put_version(d,1,i->u2.data);
|
||||
}
|
||||
@ -62,7 +62,7 @@ int cisco_out_ac_descriptor(struct conn *conn,struct cw_action_out * a,uint8_t *
|
||||
else {
|
||||
cw_log(LOG_ERR, "Can't set Cisco Hardware Version in AC descriptor, No value defined.");
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
int len = d-dst-4;
|
||||
|
||||
|
@ -28,16 +28,16 @@ mbag_t mbag = NULL;
|
||||
|
||||
mbag_item_t * i;
|
||||
i = mbag_get(mbag,CW_ITEM_WTP_HARDWARE_VERSION);
|
||||
if ( i ) {
|
||||
/* if ( i ) {
|
||||
d += cw_put_version(d,CW_SUBELEM_WTP_HARDWARE_VERSION,i->u2.data);
|
||||
}
|
||||
else {
|
||||
cw_log(LOG_ERR, "Can't send Hardware Version in WTP Descriptor, not set.");
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
i = mbag_get(mbag,CW_ITEM_WTP_SOFTWARE_VERSION);
|
||||
|
||||
/*
|
||||
if ( i ) {
|
||||
d += cw_put_version(d,CW_SUBELEM_WTP_SOFTWARE_VERSION,i->u2.data);
|
||||
}
|
||||
@ -52,7 +52,7 @@ mbag_t mbag = NULL;
|
||||
else {
|
||||
cw_log(LOG_ERR, "Can't send Bootloader Version in WTP descriptor, not set.");
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
int len = d-dst-4;
|
||||
return len + cw_put_elem_hdr(dst,a->elem_id,len);
|
||||
|
@ -26,7 +26,7 @@ static struct cw_MsgSet * register_messages(struct cw_MsgSet *set, int mode)
|
||||
switch (mode) {
|
||||
case CW_MOD_MODE_CAPWAP:
|
||||
{
|
||||
cw_dbg(DBG_MOD,"Cisco: loading base med capwap");
|
||||
cw_dbg(DBG_MOD,"Cisco: loading base mod capwap");
|
||||
|
||||
struct cw_Mod *cmod = cw_mod_load("capwap");
|
||||
if (!cmod) {
|
||||
@ -40,18 +40,19 @@ static struct cw_MsgSet * register_messages(struct cw_MsgSet *set, int mode)
|
||||
|
||||
cw_dbg(DBG_MOD,"Cisco: loading cisco message set");
|
||||
cisco_register_msg_set(set,CW_MOD_MODE_CAPWAP);
|
||||
cw_dbg(DBG_INFO, "Initialized mod_cisco with %d messafe", 7);
|
||||
cw_dbg(DBG_INFO, "Initialized mod_cisco with %d messages", 7);
|
||||
return 0;
|
||||
}
|
||||
case MOD_MODE_BINDINGS:
|
||||
case CW_MOD_MODE_BINDINGS:
|
||||
{
|
||||
struct cw_Mod *cmod = NULL; //modload_ac("capwap80211");
|
||||
return 0;
|
||||
struct cw_Mod *cmod = cw_mod_load("capwap80211"); //modload_ac("capwap80211");
|
||||
if (!cmod) {
|
||||
cw_log(LOG_ERR,
|
||||
"Can't initialize mod_cisco, failed to load base mod mod_capwap80211");
|
||||
return 1;
|
||||
}
|
||||
cmod->register_messages(set, MOD_MODE_BINDINGS);
|
||||
cmod->register_messages(set, CW_MOD_MODE_BINDINGS);
|
||||
int rc = cisco_register_actions80211_ac(set);
|
||||
cw_dbg(DBG_INFO, "Initialized mod_cisco 80211 with %d actions", 12);
|
||||
return 0;
|
||||
|
@ -39,7 +39,7 @@ static int register_actions(struct cw_actiondef *actions, int mode)
|
||||
cw_dbg(DBG_INFO, "Initialized mod cisco with %d actions", rc);
|
||||
return rc;
|
||||
}
|
||||
case MOD_MODE_BINDINGS:
|
||||
case CW_MOD_MODE_BINDINGS:
|
||||
{
|
||||
struct cw_Mod *cmod = modload_wtp("capwap80211");
|
||||
if (!cmod) {
|
||||
@ -47,7 +47,7 @@ static int register_actions(struct cw_actiondef *actions, int mode)
|
||||
"Can't initzialize mod_cisco, failed to load base mod mod_capwap80211");
|
||||
return 1;
|
||||
}
|
||||
cmod->register_actions(actions, MOD_MODE_BINDINGS);
|
||||
cmod->register_actions(actions, CW_MOD_MODE_BINDINGS);
|
||||
int rc = cisco_register_actions80211_wtp(actions);
|
||||
cw_dbg(DBG_INFO, "Initialized mod cisco 80211 with %d actions", rc);
|
||||
return 0;
|
||||
|
@ -32,7 +32,7 @@ static int register_actions(struct cw_actiondef *actions, int mode)
|
||||
cw_dbg(DBG_INFO, "Initialized mod fortinet with %d actions", rc);
|
||||
return 0;
|
||||
}
|
||||
case MOD_MODE_BINDINGS:
|
||||
case CW_MOD_MODE_BINDINGS:
|
||||
{
|
||||
struct cw_Mod *cmod = modload_ac("capwap80211");
|
||||
if (!cmod) {
|
||||
@ -40,7 +40,7 @@ static int register_actions(struct cw_actiondef *actions, int mode)
|
||||
"Can't initialize mod_fortinet, failed to load base mod mod_capwap80211");
|
||||
return 1;
|
||||
}
|
||||
cmod->register_actions(actions, MOD_MODE_BINDINGS);
|
||||
cmod->register_actions(actions, CW_MOD_MODE_BINDINGS);
|
||||
int rc = fortinet_register_actions80211_ac(actions);
|
||||
cw_dbg(DBG_INFO, "Initialized mod_fortinet 80211 with %d actions", rc);
|
||||
return 0;
|
||||
|
@ -36,7 +36,7 @@ static int register_actions(struct cw_actiondef *actions, int mode)
|
||||
cw_dbg(DBG_INFO, "Initialized mod_fortinet with %d actions", rc);
|
||||
return rc;
|
||||
}
|
||||
case MOD_MODE_BINDINGS:
|
||||
case CW_MOD_MODE_BINDINGS:
|
||||
{
|
||||
struct cw_Mod *cmod = modload_wtp("capwap80211");
|
||||
if (!cmod) {
|
||||
@ -44,7 +44,7 @@ static int register_actions(struct cw_actiondef *actions, int mode)
|
||||
"Can't initialize mod_fortinet, failed to load base mod mod_capwap80211");
|
||||
return 1;
|
||||
}
|
||||
cmod->register_actions(actions, MOD_MODE_BINDINGS);
|
||||
cmod->register_actions(actions, CW_MOD_MODE_BINDINGS);
|
||||
int rc = cisco_register_actions80211_wtp(actions);
|
||||
cw_dbg(DBG_INFO, "Initialized mod_fortinet 80211 with %d actions", rc);
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user