actube/src/cw/cw_read_ac_descriptor.c

45 lines
1.0 KiB
C
Raw Permalink Normal View History

#include "cw.h"
#include "dbg.h"
2022-07-31 17:15:32 +02:00
#include "val.h"
static struct cw_DescriptorSubelemDef allowed_default[] = {
{0,CAPWAP_SUBELEM_AC_HARDWARE_VERSION, "hardware", 1024,1},
{0,CAPWAP_SUBELEM_AC_SOFTWARE_VERSION, "software", 1024,1},
{0,0, NULL,0, 0}
};
2022-07-31 17:15:32 +02:00
cw_ValStruct_t acstatus [] = {
/* type key len, pos */
{CW_TYPE_WORD, "stations", 2, -1},
{CW_TYPE_WORD, "station-limit", 2, -1},
{CW_TYPE_WORD, "active-wtps", 2, -1},
{CW_TYPE_WORD, "max-wtps", 2, -1},
{CW_TYPE_BYTE, "security", 1, -1},
{CW_TYPE_BYTE, "r-mac-field", 1, -1},
{CW_TYPE_BYTE, "reserved1", 1, -1},
{CW_TYPE_BYTE, "dtls-policy", 1, -1},
{NULL,NULL,0,0}
};
2022-08-22 01:59:23 +02:00
int cw_read_ac_descriptor(cw_Cfg_t * store,
struct cw_ElemHandler *eh,
struct cw_ElemHandlerParams * params,
uint8_t *data, int len,
struct cw_DescriptorSubelemDef *allowed)
{
2022-08-13 09:47:12 +02:00
CW_TYPE_STRUCT->read(params->cfg,eh->key,data,len,acstatus);
if (!allowed)
allowed=allowed_default;
return cw_read_descriptor_subelems(store, eh->key, data + 12, len - 12, allowed);
}