2016-03-11 22:23:00 +01:00
|
|
|
#include "cw.h"
|
2015-04-26 23:52:11 +02:00
|
|
|
#include "capwap_items.h"
|
|
|
|
#include "dbg.h"
|
|
|
|
#include "mbag.h"
|
2015-04-10 17:16:33 +02:00
|
|
|
|
2015-04-26 23:52:11 +02:00
|
|
|
|
2016-03-15 00:31:31 +01:00
|
|
|
int cw_in_ac_descriptor(struct conn *conn, struct cw_action_in *a, uint8_t * data,
|
|
|
|
int len, struct sockaddr *from)
|
2015-04-26 23:52:11 +02:00
|
|
|
{
|
|
|
|
|
2016-03-15 00:31:31 +01:00
|
|
|
return cw_read_ac_descriptor(conn->config,data,len,NULL);
|
2015-04-26 23:52:11 +02:00
|
|
|
|
|
|
|
struct cw_ac_status *status = malloc(sizeof(struct cw_ac_status));
|
|
|
|
if (!status)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
status->stations = cw_get_word(data);
|
2016-03-15 00:31:31 +01:00
|
|
|
status->limit = cw_get_word(data + 2);
|
|
|
|
status->active_wtps = cw_get_word(data + 4);
|
|
|
|
status->max_wtps = cw_get_word(data + 6);
|
|
|
|
status->security = cw_get_byte(data + 8);
|
|
|
|
status->rmac_field = cw_get_byte(data + 9);
|
|
|
|
status->dtls_policy = cw_get_byte(data + 11);
|
|
|
|
|
|
|
|
cw_dbg(DBG_SUBELEM,
|
|
|
|
"AC Descriptor: WTPs:%d/%d, Stations:%d/%d, Security:%d, Rmac:%d, DTLS-Policy:%d",
|
|
|
|
status->active_wtps, status->max_wtps, status->stations, status->limit,
|
|
|
|
status->security, status->rmac_field, status->dtls_policy);
|
2015-04-26 23:52:11 +02:00
|
|
|
|
|
|
|
|
2016-03-15 00:31:31 +01:00
|
|
|
mbag_set_ptr(conn->incomming, CW_ITEM_AC_STATUS, status);
|
2015-04-26 23:52:11 +02:00
|
|
|
|
2018-03-06 03:08:14 +01:00
|
|
|
static struct cw_DescriptorSubelemDef allowed[] = {
|
2016-03-15 00:31:31 +01:00
|
|
|
{0,CW_SUBELEM_AC_HARDWARE_VERSION, CW_ITEM_WTP_HARDWARE_VERSION, 1024,1},
|
|
|
|
{0,CW_SUBELEM_AC_SOFTWARE_VERSION, CW_ITEM_WTP_SOFTWARE_VERSION, 1024,1},
|
|
|
|
{0,0, NULL,0, 0}
|
|
|
|
};
|
|
|
|
|
2018-03-07 08:57:04 +01:00
|
|
|
cw_read_descriptor_subelems(conn->config,"ackey" , data + 12, len - 12, allowed);
|
2015-04-26 23:52:11 +02:00
|
|
|
|
|
|
|
return 1;
|
2015-04-10 17:16:33 +02:00
|
|
|
}
|