Added cisco_out_radio_generic

to handle radios starting with ID 0

FossilOrigin-Name: 41cc2ada858bf59094847e8c106ae23d4efe54660eddcecec3ef917f6e9695cb
This commit is contained in:
7u83@mail.ru 2018-03-28 08:58:26 +00:00
parent 8cb55b6e7a
commit d05617e84e
7 changed files with 49 additions and 7 deletions

View File

@ -4,8 +4,8 @@
<Project Name="wtp" Path="wtp.project" Active="No"/>
<Project Name="mod_cipwap" Path="mod_cipwap.project" Active="No"/>
<Project Name="mod_capwap" Path="mod_capwap.project" Active="No"/>
<Project Name="mod_cisco" Path="mod_cisco.project" Active="No"/>
<Project Name="libcw" Path="libcw.project" Active="Yes"/>
<Project Name="mod_cisco" Path="mod_cisco.project" Active="Yes"/>
<Project Name="libcw" Path="libcw.project" Active="No"/>
<Project Name="mod_capwap80211" Path="mod_capwap80211.project" Active="No"/>
<Project Name="mod_fortinet" Path="mod_fortinet.project" Active="No"/>
<BuildMatrix>

View File

@ -34,6 +34,7 @@
<File Name="src/mod/cisco/cisco80211.c"/>
<File Name="src/mod/cisco/mod_cisco.h"/>
<File Name="src/mod/cisco/capwap_cisco.h"/>
<File Name="src/mod/cisco/cisco_out_radio_generic.c"/>
</VirtualDirectory>
</VirtualDirectory>
</VirtualDirectory>

View File

@ -8,6 +8,8 @@ OBJS=\
cisco_in_wtp_descriptor.o \
cisco_out_wtp_descriptor.o \
cisco_in_ac_descriptor.o\
cisco_out_radio_generic.o\
# cisco80211.o \
# cisco_out_radio_administrative_state.o \

View File

@ -117,7 +117,17 @@ static struct cw_ElemHandler handlers[] = {
cw_out_generic /* put */
}
,
{
"80211 WTP Radio Information - Cisco", /* name */
CAPWAP80211_ELEM_WTP_RADIO_INFORMATION, /* Element ID */
0, 0, /* Vendor / Proto */
0, 0, /* min/max length */
CW_TYPE_DWORD, /* type */
"wtp-radio-information", /* Key */
cw_in_radio_generic, /* get */
cisco_out_radio_generic /* put */
}
,
{0,0,0,0,0,0,0,0}
};

View File

@ -0,0 +1,25 @@
#include "cw/cw.h"
#include "cw/dbg.h"
#include "mod_cisco.h"
int cisco_out_radio_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params
, uint8_t * dst)
{
int len,i,l;
int radios;
len =0;
radios = cw_ktv_get_byte(params->conn->local_cfg,"wtp-descriptor/max-radios",0);
for(i=0;i<radios+0;i++){
l = cw_write_radio_element(handler,params,i,dst+len);
cw_dbg_elem(DBG_ELEM_OUT,params->conn,params->msgdata->type,handler,dst,l);
len+=l;
}
return len;
}

View File

@ -12,6 +12,9 @@ int cisco_in_ac_descriptor(struct cw_ElemHandler *eh,
struct cw_ElemHandlerParams *params,
uint8_t * data, int len);
int cisco_out_radio_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params
, uint8_t * dst);
struct cw_MsgSet * cisco_register_msg_set(struct cw_MsgSet * set, int mode);
#endif

View File

@ -6,8 +6,8 @@ basic/mod:Bstr16:cisco
ansi/hallo:Dword:1
discovery-type:Byte:0
wtp-frame-tunnel-mode:Byte:3
wtp-mac-type:Byte:7
wtp-frame-tunnel-mode:Byte:1
wtp-mac-type:Byte:2
wtp-board-data/vendor:Dword:1234567
@ -26,7 +26,8 @@ wtp-descriptor/bootloader/vendor:Dword:906090
wtp-descriptor/bootloader/version:Bstr16:.x171312
wtp-descriptor/max-radios:Byte:2
radio/1/wtp-radio-information:Dword:01
radio/2/wtp-radio-information:Dword:02
radio/0/wtp-radio-information:Dword:01
radio/1/wtp-radio-information:Dword:15
radio/2/wtp-radio-information:Dword:03
wtp-name:Bstr16:WFAT01