2016-02-27 14:25:23 +01:00
|
|
|
#include "cw.h"
|
2016-02-27 10:49:06 +01:00
|
|
|
|
2016-02-27 14:25:23 +01:00
|
|
|
#include "capwap.h"
|
|
|
|
#include "capwap_items.h"
|
|
|
|
#include "dbg.h"
|
2018-03-11 00:56:41 +01:00
|
|
|
#include "kvt.h"
|
2016-02-27 14:25:23 +01:00
|
|
|
|
|
|
|
|
2018-03-06 03:08:14 +01:00
|
|
|
static struct cw_DescriptorSubelemDef allowed_default[] = {
|
|
|
|
{0,CW_SUBELEM_WTP_HARDWARE_VERSION, "hardware_version", 1024,1},
|
|
|
|
{0,CW_SUBELEM_WTP_SOFTWARE_VERSION, "software_version", 1024,1},
|
|
|
|
{0,CW_SUBELEM_WTP_BOOTLOADER_VERSION, "bootloader_version", 1024,1},
|
|
|
|
{0,CW_SUBELEM_WTP_OTHERSOFTWARE_VERSION, "other_software_version", 1024,0},
|
|
|
|
{0,0, NULL, 0,0}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
int cw_read_wtp_descriptor(mavl_t cfg, struct conn *conn,
|
|
|
|
struct cw_ElemHandler *eh, uint8_t * data, int len,
|
|
|
|
struct cw_DescriptorSubelemDef *allowed)
|
2016-02-27 14:25:23 +01:00
|
|
|
{
|
2018-03-11 00:56:41 +01:00
|
|
|
printf( "toto here cw_read_wtp_descriptor\n");
|
|
|
|
exit(0);
|
|
|
|
|
|
|
|
/*
|
2018-03-06 03:08:14 +01:00
|
|
|
int ncrypt, pos,i;
|
|
|
|
mavldata_t md;
|
|
|
|
char key[64];
|
2016-02-27 14:25:23 +01:00
|
|
|
|
2018-03-06 03:08:14 +01:00
|
|
|
sprintf(key,"%s/%s",eh->key, "max_radios");
|
|
|
|
md.kv.key=strdup(key);
|
|
|
|
mavl_replace (cfg, cw_type_byte.get(&md,data,1));
|
|
|
|
|
|
|
|
sprintf(key,"%s/%s",eh->key, "radios_in_use");
|
|
|
|
md.kv.key=strdup(key);
|
|
|
|
mavl_replace (cfg, cw_type_byte.get(&md,data+1,1));
|
|
|
|
*/
|
|
|
|
|
2018-03-11 00:56:41 +01:00
|
|
|
|
2016-02-27 14:25:23 +01:00
|
|
|
/* Get number of encryption elements */
|
2018-03-11 00:56:41 +01:00
|
|
|
|
|
|
|
/*
|
2018-03-06 03:08:14 +01:00
|
|
|
ncrypt = cw_get_byte(data + 2);
|
2016-02-27 14:25:23 +01:00
|
|
|
if (ncrypt == 0) {
|
|
|
|
if (conn->strict_capwap) {
|
|
|
|
cw_dbg(DBG_ELEM_ERR,
|
|
|
|
"Bad WTP Descriptor, number of encryption elements is 0.");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
cw_dbg(DBG_RFC,
|
|
|
|
"Non standard conform WTP Descriptor, number of encryptoin elements is 0.");
|
|
|
|
}
|
|
|
|
|
2018-03-06 03:08:14 +01:00
|
|
|
pos = 3;
|
2018-03-11 00:56:41 +01:00
|
|
|
*/
|
|
|
|
//
|
|
|
|
// for (i = 0; i < ncrypt; i++) {
|
|
|
|
///* // It's a dummy for now *
|
|
|
|
// pos += 3;
|
|
|
|
// }
|
2016-03-15 00:31:31 +01:00
|
|
|
|
2018-03-11 00:56:41 +01:00
|
|
|
/*
|
2016-03-15 00:31:31 +01:00
|
|
|
if (!allowed) {
|
|
|
|
allowed=allowed_default;
|
|
|
|
}
|
2018-03-06 03:08:14 +01:00
|
|
|
printf("call read subelems\n");
|
2018-03-07 08:57:04 +01:00
|
|
|
return cw_read_descriptor_subelems(cfg,eh->key , data + pos, len - pos, allowed);
|
2018-03-11 00:56:41 +01:00
|
|
|
*/
|
2016-02-27 14:25:23 +01:00
|
|
|
}
|