More documentation and Cisco support.
FossilOrigin-Name: 0a22e4c44b2df5712b2f8edaea0712fcc7fc0ca953e86179c0a653a484197a43
This commit is contained in:
@ -69,6 +69,10 @@ int acinfo_readelem_ac_descriptor(struct ac_info * acinfo,int type, uint8_t *msg
|
||||
|
||||
int sub=12;
|
||||
int sublen;
|
||||
|
||||
|
||||
printf("Now trying sublens\n");
|
||||
|
||||
while (sub<len){
|
||||
if (len-sub<8)
|
||||
return -1;
|
||||
@ -77,11 +81,15 @@ int acinfo_readelem_ac_descriptor(struct ac_info * acinfo,int type, uint8_t *msg
|
||||
val = ntohl(*((uint32_t*)(msgelem+sub+4)));
|
||||
sublen = val&0xffff;
|
||||
sub+=8;
|
||||
|
||||
printf("sublen = %d\n",sublen);
|
||||
|
||||
if (vendor != 0){
|
||||
sub+=sublen;
|
||||
continue;
|
||||
// sub+=sublen;
|
||||
// continue;
|
||||
}
|
||||
int subtype = val>>16;
|
||||
printf("sublen type = %d\n",subtype);
|
||||
|
||||
if (sub+sublen>len)
|
||||
return -1;
|
||||
|
@ -1,3 +1,8 @@
|
||||
/**
|
||||
*@file
|
||||
*@brief acinfo definitions.
|
||||
*/
|
||||
|
||||
#ifndef __ACINFO_H
|
||||
#define __ACINFO_H
|
||||
|
||||
@ -37,12 +42,18 @@ struct ac_info{
|
||||
int rmac;
|
||||
int dtls_policy;
|
||||
int vendor_id;
|
||||
uint8_t * hardware_version;
|
||||
int hardware_version_len;
|
||||
uint8_t * software_version;
|
||||
int software_version_len;
|
||||
|
||||
// const char * acname;
|
||||
/** Hardware version to use in capwap-mode */
|
||||
bstr_t hardware_version;
|
||||
/** Software version to use in capwap-mode */
|
||||
bstr_t software_version;
|
||||
|
||||
/** Hardware version to use if in cisco-mode */
|
||||
bstr_t cisco_hardware_version;
|
||||
/** Software version to use if in cisco-mode */
|
||||
bstr_t cisco_software_version;
|
||||
|
||||
|
||||
|
||||
struct sockaddr * salist;
|
||||
int salist_len;
|
||||
|
@ -1,3 +1,9 @@
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @breif defines acinfo_print function
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@ -6,14 +12,27 @@
|
||||
|
||||
#include "acinfo.h"
|
||||
|
||||
#include "cw_util.h"
|
||||
|
||||
|
||||
/**
|
||||
* Formats an acinfo object.
|
||||
*
|
||||
*/
|
||||
int acinfo_print(char *str,const struct ac_info *acinfo)
|
||||
{
|
||||
char *s = str;
|
||||
|
||||
s+=sprintf(s,"\tAC name: %s\n",acinfo->ac_name);
|
||||
s+=sprintf(s,"\tHardware version: %s\n",acinfo->hardware_version);
|
||||
s+=sprintf(s,"\tSoftware version: %s\n",acinfo->software_version);
|
||||
|
||||
s+=sprintf(s,"\tHardware version: ");
|
||||
s+=cw_format_version(s,acinfo->hardware_version,0,"-");
|
||||
s+=sprintf(s,"\n");
|
||||
|
||||
s+=sprintf(s,"\tSoftware version: ");
|
||||
s+=cw_format_version(s,acinfo->software_version,0,"-");
|
||||
s+=sprintf(s,"\n");
|
||||
|
||||
s+=sprintf(s,"\tStations: %i\n",acinfo->stations);
|
||||
s+=sprintf(s,"\tSation limit: %i\n",acinfo->limit);
|
||||
s+=sprintf(s,"\tActive WTPs: %i\n",acinfo->active_wtps);
|
||||
|
@ -16,25 +16,50 @@
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief Definitions for bstr functions
|
||||
*/
|
||||
|
||||
#ifndef __BSTR_H
|
||||
#define __BSTR_H
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* bstr typeS
|
||||
*
|
||||
* bstr_t serves as binary string where the first byte cponntains
|
||||
* the length of the string.
|
||||
*/
|
||||
typedef uint8_t* bstr_t;
|
||||
|
||||
extern uint8_t * bstr_create(uint8_t *data, uint8_t len);
|
||||
extern uint8_t * bstr_create_from_cfgstr(const char * s);
|
||||
extern uint8_t * bstr_replace( uint8_t ** dst, uint8_t * bstr);
|
||||
extern uint8_t * bstr_replace( bstr_t * dst, uint8_t * bstr);
|
||||
|
||||
extern int bstr_to_str(char *dst, bstr_t str,char * def);
|
||||
|
||||
|
||||
/**
|
||||
* Return the length of a bstr_t string.
|
||||
*/
|
||||
#define bstr_len(s) (*(s))
|
||||
|
||||
/**
|
||||
* Return the data of a bstr_t string.
|
||||
*/
|
||||
#define bstr_data(s) (s+1)
|
||||
|
||||
/**
|
||||
* Return the actual size in memory a bstr_t string needs.
|
||||
*/
|
||||
#define bstr_size(len) (len+1)
|
||||
|
||||
/**
|
||||
* Max. length of a bstr_t string.
|
||||
*/
|
||||
#define BSTR_MAX_LEN 254
|
||||
|
||||
|
||||
|
@ -16,11 +16,24 @@
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/**
|
||||
* Creates a bstr_t string.
|
||||
* @param data source data to create the string from
|
||||
* @param len length of the string
|
||||
* @return the created bstr_t string.
|
||||
*
|
||||
* The bstr_t string returned is allocated by malloc. So remember to free
|
||||
* this resource if you don't need it anymore.
|
||||
*/
|
||||
uint8_t * bstr_create(uint8_t *data, uint8_t len)
|
||||
{
|
||||
uint8_t * str = malloc(len*sizeof(uint8_t));
|
||||
|
@ -16,6 +16,10 @@
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief bstr_create_from_cfgstr function
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
@ -24,7 +28,17 @@
|
||||
#include "bstr.h"
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create a bstr_t string from a string read from config file.
|
||||
*
|
||||
* @param s String from config file.
|
||||
* @return The create bstr_t string.
|
||||
*
|
||||
* The string from config file is an ASCII-text which is interpreted
|
||||
* as hexadecimal string if it starts with ".x"
|
||||
*
|
||||
* @see bstr_t
|
||||
*/
|
||||
uint8_t * bstr_create_from_cfgstr(const char * s)
|
||||
{
|
||||
int l = strlen(s);
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include "bstr.h"
|
||||
|
||||
uint8_t * bstr_replace( uint8_t ** dst, uint8_t * bstr)
|
||||
uint8_t * bstr_replace( bstr_t * dst, uint8_t * bstr)
|
||||
{
|
||||
if (*dst)
|
||||
free(*dst);
|
||||
|
@ -34,7 +34,9 @@
|
||||
#define CAPWAP_CONTROL_PORT_STR "5246"
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* CAPWAP modes
|
||||
*/
|
||||
enum capwapmodes {
|
||||
CWMODE_STD = 0,
|
||||
CWMODE_CISCO,
|
||||
|
@ -21,16 +21,29 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#define CWVENDOR_CISCO_MWAR_ADDR 2
|
||||
#define CWVENDOR_CISCO_RAD 3
|
||||
#define CWVENDOR_CISCO_RAD_SLOT 4
|
||||
#define CWVENDOR_CISCO_RAD_NAME 5
|
||||
#define CWVENDOR_CISCO_MWAR 6
|
||||
#include "lwapp.h"
|
||||
|
||||
#define CWVENDOR_CISCO_AP_GROUP_NAME 123
|
||||
#define CWVENDOR_CISCO_AP_TIMESYNC 151
|
||||
#define CWVENDOR_CISCO_MWAR_ADDR 2
|
||||
#define CWVENDOR_CISCO_RAD 3
|
||||
#define CWVENDOR_CISCO_RAD_SLOT 4
|
||||
#define CWVENDOR_CISCO_RAD_NAME 5
|
||||
#define CWVENDOR_CISCO_MWAR 6
|
||||
|
||||
#define CWVENDOR_CISCO_PL207 207
|
||||
#define CWVENDOR_CISCO_BOARD DATA LWMSGELEM_WTP_BOARD_DATA /* 50 */
|
||||
#define CWVENDER_CISCO_AP_MODE_AND_TYPE 54
|
||||
|
||||
#define CWVENDOR_CISCO_SPAM_VENDOR_SPECIFIC 104
|
||||
|
||||
#define CWVENDOR_CISCO_AP_GROUP_NAME 123
|
||||
#define CWVENDOR_CISCO_AP_LED_STATE_CONFIG 125
|
||||
|
||||
|
||||
#define CWVENDOR_CISCO_AP_PRE_STD_SWITCH_CONFIG 137
|
||||
#define CWVENDOR_CISCO_AP_POWER_INJECTOR_CONFIG 138
|
||||
|
||||
#define CWVENDOR_CISCO_AP_TIMESYNC 151
|
||||
|
||||
#define CWVENDOR_CISCO_PL207 207
|
||||
|
||||
|
||||
extern void cwmsg_addelem_vendor_cisco_ap_timesync(struct cwmsg * cwmsg);
|
||||
|
@ -15,6 +15,12 @@
|
||||
along with Foobar. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
*@file
|
||||
*@brief Definitions for logging and debugging.
|
||||
*/
|
||||
|
||||
#ifndef __CW_LOG_H
|
||||
#define __CW_LOG_H
|
||||
|
||||
@ -22,7 +28,11 @@
|
||||
#include <stdint.h>
|
||||
#include <syslog.h>
|
||||
|
||||
/* CAPWAP specific debugs */
|
||||
/**
|
||||
* \defgroup Debug options
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define DBG_CW_MSG 0x00000001
|
||||
#define DBG_CW_MSGELEM 0x00000002
|
||||
#define DBG_CW_MSGELEM_DMP 0x00000004
|
||||
@ -36,7 +46,7 @@
|
||||
#define DBG_CW_PKT_ERR 0x00000200
|
||||
#define DBG_CW_MSG_ERR 0x00000400
|
||||
|
||||
/* drive specific debugs */
|
||||
/* driver specific debugs */
|
||||
#define DBG_DRV 0x00010000
|
||||
#define DBG_DRV_ERR 0x00020000
|
||||
|
||||
@ -57,6 +67,8 @@
|
||||
#define DBG_DETAIL_ALL 0xffffffff
|
||||
#define DBG_ERR (DBG_CW_MSG_ERR | DBG_CW_PKT_ERR)
|
||||
|
||||
/**@}*/
|
||||
|
||||
|
||||
#ifndef CW_LOG_DUMP_ROW_LEN
|
||||
#define CW_LOG_DUMP_ROW_LEN 32
|
||||
|
@ -16,6 +16,12 @@
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
*@file
|
||||
*@brief Debug helpers
|
||||
*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
@ -26,6 +32,16 @@
|
||||
#include "cw_util.h"
|
||||
|
||||
|
||||
int cw_dbg_opt_detail = 0;
|
||||
int cw_dbg_opt_level = 0;
|
||||
|
||||
|
||||
|
||||
int cw_log_debug_level = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
static void cw_log_debug0_(const char *format, ...)
|
||||
{
|
||||
if (cw_log_debug_level < 0)
|
||||
@ -49,6 +65,7 @@ static void cw_log_debug1_(const char *format, ...)
|
||||
closelog();
|
||||
}
|
||||
|
||||
|
||||
static void cw_log_debug2_(const char *format, ...)
|
||||
{
|
||||
if (cw_log_debug_level < 2)
|
||||
@ -62,6 +79,7 @@ static void cw_log_debug2_(const char *format, ...)
|
||||
|
||||
|
||||
|
||||
|
||||
int cw_log_debug_dump_(int level, const uint8_t * data, int len,
|
||||
const char *format, ...)
|
||||
{
|
||||
@ -110,13 +128,6 @@ int cw_log_debug_dump_(int level, const uint8_t * data, int len,
|
||||
|
||||
}
|
||||
|
||||
int cw_log_debug_level = 0;
|
||||
|
||||
|
||||
|
||||
int cw_dbg_opt_detail = 0;
|
||||
int cw_dbg_opt_level = 0;
|
||||
|
||||
|
||||
void cw_log_dbg_(int level, const char *file, int line, const char *format,
|
||||
...)
|
||||
@ -242,6 +253,7 @@ cw_log_debug0_, cw_log_debug1_, cw_log_debug2_};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* print debug info for message elements
|
||||
*/
|
||||
@ -276,6 +288,8 @@ void cw_dbg_msgelem_(int msg, int msgelem, const uint8_t * msgbuf, int len)
|
||||
cw_msgtostr(msg), msgelem, elemname, len);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void cw_dbg_missing_mand_elems_(struct conn *conn, int msgtype, int *mand)
|
||||
{
|
||||
if (!cw_dbg_is_level(DBG_CW_RFC))
|
||||
@ -289,5 +303,8 @@ void cw_dbg_missing_mand_elems_(struct conn *conn, int msgtype, int *mand)
|
||||
}
|
||||
}
|
||||
|
||||
//cw_dbg(DBG_CW_MSGELEM,"Process discovery req msgelem, type=%d (%s), len=%d",type,cw_msgelemtostr(type),len);
|
||||
//cw_dbg_dmp(DBG_CW_MSGELEM_DMP,msgelem,len,"Dump for msgelem ...");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -31,13 +31,13 @@ static int read_subelem_cisco(struct ac_info* acinfo,int subtype,uint8_t * elem,
|
||||
{
|
||||
switch (subtype) {
|
||||
case 0:
|
||||
/* software version */
|
||||
bstr_replace(&acinfo->software_version,bstr_create(elem,len));
|
||||
break;
|
||||
case 1:
|
||||
/* hardware version */
|
||||
bstr_replace(&acinfo->hardware_version,bstr_create(elem,len));
|
||||
break;
|
||||
case 1:
|
||||
/* software version */
|
||||
bstr_replace(&acinfo->software_version,bstr_create(elem,len));
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("What? %d\n",subtype);
|
||||
|
@ -2,9 +2,37 @@
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "capwap.h"
|
||||
#include "lwapp.h"
|
||||
|
||||
#include "cw_log.h"
|
||||
|
||||
#include <stdio.h> //tube
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
int cw_readelem_cisco_payload(void *data,int msgtype,int elem_id,uint8_t *msgelem, int len)
|
||||
{
|
||||
|
||||
|
||||
switch (msgtype) {
|
||||
case CWMSG_CONFIGURATION_STATUS_REQUEST:
|
||||
{
|
||||
if (lw_readelem_wtp_board_data((struct wtpinfo*)data,elem_id,msgelem,len))
|
||||
return 1;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
default:
|
||||
return 0;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -18,7 +46,19 @@ int cw_readelem_vendor_specific_payload(void * data,int msgtype,int elemtype,uin
|
||||
return 1;
|
||||
}
|
||||
|
||||
// uint32_t vendor_id = ntohl( *((uint32_t*)msgelem) );
|
||||
|
||||
uint32_t vendor_id = ntohl( *((uint32_t*)msgelem) );
|
||||
uint16_t elem_id = ntohs( *( (uint16_t*)(msgelem+4) ));
|
||||
int elem_len = len - 6;
|
||||
|
||||
switch (vendor_id) {
|
||||
|
||||
case CW_VENDOR_ID_CISCO:
|
||||
return cw_readelem_cisco_payload(data,msgtype,elem_id,msgelem+6,elem_len);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return 1;
|
||||
|
@ -16,11 +16,27 @@
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
*@file
|
||||
*@brief Definitions for imisc. cw_utill functions.
|
||||
*/
|
||||
|
||||
#ifndef __CW_UTIL_H
|
||||
#define __CW_UTIL_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
|
||||
extern uint8_t * cw_setstr(uint8_t ** dst, const uint8_t *src, int len);
|
||||
#include "bstr.h"
|
||||
|
||||
extern int cw_format_version(char *s, bstr_t version, uint32_t vendor, char * def);
|
||||
extern int cw_is_printable(const uint8_t * s,int len);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
extern uint8_t * cw_setstr(uint8_t ** dst, const uint8_t *src, int len);
|
||||
|
||||
extern int cw_foreach_msgelem(uint8_t * msgelems, int len,
|
||||
int (*callback)(void*,int,uint8_t*,int),void *arg );
|
||||
@ -28,14 +44,13 @@ extern int cw_foreach_msgelem(uint8_t * msgelems, int len,
|
||||
|
||||
extern int cw_rand(uint8_t*dst, int len);
|
||||
|
||||
extern int cw_is_printable(const uint8_t * s,int len);
|
||||
|
||||
|
||||
#define cw_timer_start(t) (time(NULL)+t)
|
||||
#define cw_timer_timeout(t) (time(NULL)>t ? 1 : 0)
|
||||
|
||||
|
||||
/* generic macroto to isolate bits from a dword */
|
||||
/** Generic macroto to isolate bits from a dword */
|
||||
#define cw_get_dword_bits(src,start,len) ((~(0xFFFFFFFF<<len)) & (src >> (32 - start - len)))
|
||||
|
||||
|
||||
@ -44,3 +59,4 @@ void cw_mand_elem_found(int *l,int type);
|
||||
int cw_is_missing_mand_elems(int *l);
|
||||
void cw_get_missing_mand_elems(char *dst, int *l);
|
||||
|
||||
#endif
|
||||
|
@ -57,10 +57,13 @@ void cwmsg_addelem_ac_descriptor(struct cwmsg *msg,struct ac_info * acinfo)
|
||||
case CWMODE_CISCO:
|
||||
len+=add_subelem(buffer+len,0,CW_VENDOR_ID_CISCO,acinfo->cisco_hardware_version);
|
||||
len+=add_subelem(buffer+len,1,CW_VENDOR_ID_CISCO,acinfo->cisco_software_version);
|
||||
//len+=add_subelem(buffer+len,5,CW_VENDOR_ID_CISCO,acinfo->cisco_software_version);
|
||||
|
||||
break;
|
||||
default:
|
||||
len+=add_subelem(buffer+len,0,0,acinfo->hardware_version);
|
||||
len+=add_subelem(buffer+len,1,0,acinfo->software_version);
|
||||
len+=add_subelem(buffer+len,4,0,acinfo->hardware_version);
|
||||
len+=add_subelem(buffer+len,5,0,acinfo->software_version);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ void cwmsg_addelem_wtp_radio_info(struct cwmsg * msg,struct radioinfo *radioinfo
|
||||
void cwmsg_addelem_wtp_radio_infos(struct cwmsg * msg,struct radioinfo * radioinfos)
|
||||
{
|
||||
int i;
|
||||
for (i=1; i<=4; i++)
|
||||
for (i=0; i<=1; i++)
|
||||
{
|
||||
// if (radioinfos[i].rid!=0)
|
||||
cwmsg_addelem_wtp_radio_info(msg,&radioinfos[i]);
|
||||
|
@ -20,7 +20,6 @@
|
||||
* @file
|
||||
* @brief Defines cwread_change_state_even_request function.
|
||||
*
|
||||
* Full text
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@ -56,7 +55,11 @@ foundX:
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Read elements of a Change State Event Request message.
|
||||
* Read elements of a Change State Event Request message.
|
||||
* @param wtpinfo wtpinfo where the results are stored.
|
||||
* @param msg a pointer to the message
|
||||
* @param len length of the message
|
||||
* @return result code
|
||||
*/
|
||||
int cwread_change_state_event_request(struct wtpinfo * wtpinfo, uint8_t * msg, int len)
|
||||
{
|
||||
|
@ -16,6 +16,11 @@
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief Implents configuration status request
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "capwap.h"
|
||||
@ -34,15 +39,30 @@ static int readelem(void * eparm,int type,uint8_t* msgelem,int len)
|
||||
cw_dbg_msgelem(CWMSG_CONFIGURATION_STATUS_REQUEST, type, msgelem,len);
|
||||
|
||||
/* mandatory elements */
|
||||
|
||||
/* ac name */
|
||||
if (cw_readelem_ac_name(&e->wtpinfo->ac_name,type,msgelem,len))
|
||||
goto foundX;
|
||||
if (cw_readelem_wtp_reboot_statistics(&e->wtpinfo->reboot_statistics,type,msgelem,len))
|
||||
goto foundX;
|
||||
|
||||
/* radio administrative state */
|
||||
if (cw_readelem_radio_administrative_state(e->wtpinfo->radioinfo, type,msgelem,len))
|
||||
goto foundX;
|
||||
|
||||
/* statistics timer */
|
||||
if (cw_readelem_statistics_timer(&e->wtpinfo->statistics_timer, type,msgelem,len))
|
||||
goto foundX;
|
||||
|
||||
/* reboot statistics */
|
||||
if (cw_readelem_wtp_reboot_statistics(&e->wtpinfo->reboot_statistics,type,msgelem,len))
|
||||
goto foundX;
|
||||
|
||||
/* non-mantatory elements */
|
||||
|
||||
if (cw_readelem_vendor_specific_payload
|
||||
(e->wtpinfo, CWMSG_CONFIGURATION_STATUS_REQUEST, type, msgelem, len))
|
||||
return 1;
|
||||
|
||||
|
||||
return 0;
|
||||
foundX:
|
||||
cw_mand_elem_found(e->mand,type);
|
||||
|
@ -44,7 +44,7 @@ static int acinfo_readelem_discovery_resp(void * eparm,int type,uint8_t* msgelem
|
||||
struct eparm *e = (struct eparm *) eparm;
|
||||
|
||||
|
||||
if (acinfo_readelem_ac_descriptor(e->acinfo,type,msgelem,len))
|
||||
if (cw_readelem_ac_descriptor(e->acinfo,type,msgelem,len))
|
||||
goto foundX;
|
||||
|
||||
if (acinfo_readelem_ac_name(e->acinfo,type,msgelem,len))
|
||||
|
@ -25,7 +25,6 @@
|
||||
static int acinfo_readelem_join_resp(void * a,int type,uint8_t* msgelem,int len)
|
||||
{
|
||||
|
||||
printf("Here we are reading\n");
|
||||
cw_dbg_msgelem(CWMSG_JOIN_RESPONSE, type, msgelem, len);
|
||||
|
||||
struct ac_info * acinfo = (struct ac_info *)a;
|
||||
@ -38,7 +37,7 @@ printf("Here we are reading\n");
|
||||
if (acinfo_readelem_ecn_support(acinfo,type,msgelem,len))
|
||||
goto foundX;
|
||||
|
||||
if (acinfo_readelem_ac_descriptor(acinfo,type,msgelem,len))
|
||||
if (cw_readelem_ac_descriptor(acinfo,type,msgelem,len))
|
||||
goto foundX;
|
||||
|
||||
if (acinfo_readelem_ac_name(acinfo,type,msgelem,len))
|
||||
|
@ -35,6 +35,7 @@ void cwsend_discovery_response(struct conn * conn,int seqnum, struct radioinfo *
|
||||
|
||||
struct cwmsg * cwmsg = &conn->resp_msg;
|
||||
cwmsg_init(cwmsg,conn->resp_buffer,CWMSG_DISCOVERY_RESPONSE,seqnum,NULL);
|
||||
cwmsg->capwap_mode = conn->capwap_mode;
|
||||
|
||||
|
||||
cwmsg_addelem_ac_descriptor(cwmsg,acinfo);
|
||||
@ -45,9 +46,15 @@ void cwsend_discovery_response(struct conn * conn,int seqnum, struct radioinfo *
|
||||
|
||||
|
||||
/* Send Cisco-specific message elements if needed */
|
||||
// if (conn->capwap_mode == CWMODE_CISCO){
|
||||
// cwmsg_addelem_vendor_cisco_ap_timesync(cwmsg);
|
||||
// }
|
||||
switch (cwmsg->capwap_mode) {
|
||||
case CWMODE_CISCO:
|
||||
case CWMODE_CIPWAP:
|
||||
cwmsg_addelem_vendor_cisco_ap_timesync(cwmsg);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -10,6 +10,7 @@ void cwsend_join_response(struct conn * conn,int seqnum, int rc, struct radioinf
|
||||
{
|
||||
struct cwmsg * cwmsg = &conn->resp_msg;
|
||||
cwmsg_init(cwmsg,conn->resp_buffer,CWMSG_JOIN_RESPONSE,seqnum,NULL);
|
||||
cwmsg->capwap_mode=conn->capwap_mode;
|
||||
|
||||
/* mandatory messagesg elements */
|
||||
cwmsg_addelem_result_code(cwmsg,rc);
|
||||
@ -24,7 +25,6 @@ void cwsend_join_response(struct conn * conn,int seqnum, int rc, struct radioinf
|
||||
cwmsg_addelem_image_identifier(cwmsg,CW_VENDOR_ID_CISCO,(uint8_t*)"/tobias",strlen("/tobias"));
|
||||
|
||||
|
||||
|
||||
uint8_t buffer[]="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
buffer[0]=0; /* Mwar Type */
|
||||
buffer[1]=1; /* h/w version */
|
||||
@ -41,7 +41,7 @@ void cwsend_join_response(struct conn * conn,int seqnum, int rc, struct radioinf
|
||||
*((uint16_t*)(buffer+9+2))=htons(23); /* Supported MS */
|
||||
*((uint16_t*)(buffer+9+4))=htons(5); /* Active RAD's */
|
||||
*((uint16_t*)(buffer+9+6))=htons(15); /* Supported RAD's */
|
||||
cwmsg_addelem_vendor_specific_payload(cwmsg,CW_VENDOR_ID_CISCO, CWVENDOR_CISCO_MWAR, buffer,34);
|
||||
// cwmsg_addelem_vendor_specific_payload(cwmsg,CW_VENDOR_ID_CISCO, CWVENDOR_CISCO_MWAR, buffer,34);
|
||||
|
||||
|
||||
conn_send_response(conn,cwmsg,seqnum);
|
||||
|
@ -18,8 +18,8 @@
|
||||
|
||||
|
||||
/*
|
||||
* This file implements a simple fragment management system
|
||||
* for the capwap protocol.
|
||||
* @file
|
||||
* @brief This file implements a simple fragment management system for the capwap protocol.
|
||||
*
|
||||
* Usage goes as follows.
|
||||
*
|
||||
@ -52,7 +52,7 @@
|
||||
#include "capwap.h"
|
||||
#include "fragman.h"
|
||||
|
||||
/*
|
||||
/**
|
||||
* check if we keep already fragments belonging to the
|
||||
* specified fragment id
|
||||
*/
|
||||
@ -70,7 +70,7 @@ static struct frag * frag_get(struct frag * frags, int fragid)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* create a new fragment
|
||||
*/
|
||||
static struct frag * frag_new(struct frag * frags, int fragid)
|
||||
|
@ -16,6 +16,10 @@
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __LWAPP_H
|
||||
#define __LWAPP_H
|
||||
|
||||
|
||||
#include <arpa/inet.h>
|
||||
|
||||
|
||||
@ -92,19 +96,19 @@
|
||||
*/
|
||||
|
||||
|
||||
/* LWAPP message elements */
|
||||
|
||||
#define LWMSGELEM_WTP_DESCRIPTOR 3
|
||||
|
||||
#define LWMSGELEM_WTP_DESCRIPTOR 3
|
||||
|
||||
#define LWMSGELEM_WTP_BOARD_DATA 50
|
||||
|
||||
|
||||
/* function proto types */
|
||||
|
||||
uint16_t lw_checksum(uint8_t *d,int len);
|
||||
int lw_readelem_wtp_board_data(struct wtpinfo *wtpinfo, int type, uint8_t *msgelem, int len);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user