2016-02-27 10:49:06 +01:00
|
|
|
#include "cw.h"
|
|
|
|
|
|
|
|
#include "capwap.h"
|
2018-03-17 17:29:09 +01:00
|
|
|
|
2022-07-31 17:15:32 +02:00
|
|
|
#include "val.h"
|
2018-03-07 08:57:04 +01:00
|
|
|
#include "keys.h"
|
2018-03-11 00:56:41 +01:00
|
|
|
|
2018-03-07 08:57:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
static struct cw_DescriptorSubelemDef allowed_default[] = {
|
2018-03-15 20:07:17 +01:00
|
|
|
{-1,CW_SUBELEM_WTP_HARDWARE_VERSION, CW_SKEY_HARDWARE, 1024,0},
|
|
|
|
{-1,CW_SUBELEM_WTP_SOFTWARE_VERSION, CW_SKEY_SOFTWARE, 1024.0},
|
|
|
|
{-1,CW_SUBELEM_WTP_BOOTLOADER_VERSION, CW_SKEY_BOOTLOADER, 1024,0},
|
|
|
|
{-1,CW_SUBELEM_WTP_OTHERSOFTWARE_VERSION, CW_SKEY_OTHER_SOFTWARE, 1024,0},
|
2018-03-07 08:57:04 +01:00
|
|
|
{0,0, NULL, 0,0}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2016-02-27 10:49:06 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Read WTP Descriptor in Cisco-Style (Draft 7)
|
|
|
|
*/
|
2022-08-09 22:35:47 +02:00
|
|
|
int cw_read_wtp_descriptor_7(mavl_t cfg, struct cw_Conn *conn,
|
2018-03-06 03:08:14 +01:00
|
|
|
struct cw_ElemHandler *eh, uint8_t * data, int len,
|
|
|
|
struct cw_DescriptorSubelemDef *allowed)
|
2016-02-27 10:49:06 +01:00
|
|
|
{
|
2018-03-11 00:56:41 +01:00
|
|
|
|
2018-03-15 20:20:19 +01:00
|
|
|
/* int ncrypt; //currentliy unused */
|
|
|
|
int pos;
|
2018-03-06 03:08:14 +01:00
|
|
|
char key[64];
|
2016-02-27 10:49:06 +01:00
|
|
|
|
2018-03-15 20:07:17 +01:00
|
|
|
sprintf(key,"%s/%s",eh->key, CW_SKEY_MAX_RADIOS);
|
2022-08-09 22:35:47 +02:00
|
|
|
cw_cfg_set_int(cfg,key,cw_get_byte(data));
|
2018-03-06 03:08:14 +01:00
|
|
|
|
2018-03-15 20:07:17 +01:00
|
|
|
sprintf(key,"%s/%s",eh->key, CW_SKEY_RADIOS_IN_USE);
|
2022-08-09 22:35:47 +02:00
|
|
|
cw_cfg_set_int(cfg,key,cw_get_byte(data+1));
|
2016-02-27 10:49:06 +01:00
|
|
|
|
2018-03-06 03:08:14 +01:00
|
|
|
pos = 2;
|
2016-02-27 10:49:06 +01:00
|
|
|
|
|
|
|
/* Encryption element, for now dumy XXX */
|
2018-03-07 08:57:04 +01:00
|
|
|
/* //cw_get_word(data + pos + 2);*/
|
2016-02-27 10:49:06 +01:00
|
|
|
pos += 2;
|
|
|
|
|
2016-03-15 00:31:31 +01:00
|
|
|
|
|
|
|
if (!allowed)
|
|
|
|
allowed=allowed_default;
|
|
|
|
|
2018-03-07 08:57:04 +01:00
|
|
|
return cw_read_descriptor_subelems(cfg, eh->key, data + pos, len - pos, allowed);
|
2016-02-27 10:49:06 +01:00
|
|
|
}
|