Work in progress

FossilOrigin-Name: 155605fd55cbb193d4f5ac8c704930c050a11cda541f1a5cdb93c57a8c51534f
This commit is contained in:
7u83@mail.ru
2018-03-17 11:32:40 +00:00
parent c4307d9e70
commit b668a8f4a9
63 changed files with 770 additions and 982 deletions

View File

@ -4,13 +4,14 @@
#include "capwap_items.h"
#include "dbg.h"
#include "ktv.h"
#include "keys.h"
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,CW_SUBELEM_WTP_HARDWARE_VERSION, CW_SKEY_HARDWARE, 1024,1},
{0,CW_SUBELEM_WTP_SOFTWARE_VERSION, CW_SKEY_SOFTWARE, 1024,1},
{0,CW_SUBELEM_WTP_BOOTLOADER_VERSION, CW_SKEY_BOOTLOADER, 1024,1},
{0,CW_SUBELEM_WTP_OTHERSOFTWARE_VERSION, CW_SKEY_OTHER_SOFTWARE, 1024,0},
{0,0, NULL, 0,0}
};
@ -19,51 +20,44 @@ int cw_read_wtp_descriptor(mavl_t cfg, struct conn *conn,
struct cw_ElemHandler *eh, uint8_t * data, int len,
struct cw_DescriptorSubelemDef *allowed)
{
printf( "toto here cw_read_wtp_descriptor\n");
exit(0);
/*
int ncrypt, pos,i;
mavldata_t md;
char key[64];
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));
*/
/* Get number of encryption elements */
/*
ncrypt = cw_get_byte(data + 2);
if (ncrypt == 0) {
if (conn->strict_capwap) {
cw_dbg(DBG_ELEM_ERR,
"Bad WTP Descriptor, number of encryption elements is 0.");
return 0;
return CAPWAP_RESULT_UNRECOGNIZED_MESSAGE_ELEMENT;
}
cw_dbg(DBG_RFC,
"Non standard conform WTP Descriptor, number of encryptoin elements is 0.");
}
pos = 3;
*/
//
// for (i = 0; i < ncrypt; i++) {
///* // It's a dummy for now *
// pos += 3;
// }
sprintf(key,"%s/%s",eh->key, CW_SKEY_MAX_RADIOS);
cw_ktv_add(cfg,key,CW_TYPE_BYTE,data,1);
sprintf(key,"%s/%s",eh->key, CW_SKEY_RADIOS_IN_USE);
cw_ktv_add(cfg,key,CW_TYPE_BYTE,data+1,1);
pos = 3;
for (i = 0; i < ncrypt; i++) {
/* It's a dummy for now */
pos += 3;
}
/*
if (!allowed) {
allowed=allowed_default;
}
printf("call read subelems\n");
return cw_read_descriptor_subelems(cfg,eh->key , data + pos, len - pos, allowed);
*/
}