2018-03-03 17:42:28 +01:00
|
|
|
#include "cw/mbag.h"
|
2016-03-05 10:11:39 +01:00
|
|
|
#include "cw/log.h"
|
|
|
|
#include "cw/conn.h"
|
2015-04-05 02:10:37 +02:00
|
|
|
|
2016-03-05 10:11:39 +01:00
|
|
|
#include "cw/mbag.h"
|
|
|
|
#include "cw/capwap_items.h"
|
|
|
|
#include "cw/capwap.h"
|
2015-04-05 02:10:37 +02:00
|
|
|
|
|
|
|
|
2016-03-05 10:11:39 +01:00
|
|
|
#include "cw/cw.h"
|
2016-03-04 21:01:38 +01:00
|
|
|
|
|
|
|
|
2015-04-05 02:10:37 +02:00
|
|
|
|
2016-03-05 10:11:39 +01:00
|
|
|
int capwap_out_ac_descriptor(struct conn *conn,struct cw_action_out * a,uint8_t *dst)
|
2015-04-05 02:10:37 +02:00
|
|
|
{
|
|
|
|
|
|
|
|
uint8_t *d = dst+4;
|
2015-04-19 23:27:44 +02:00
|
|
|
struct mbag_item * i;
|
|
|
|
i = mbag_get(conn->local,CW_ITEM_AC_STATUS);
|
2015-04-05 02:10:37 +02:00
|
|
|
|
|
|
|
if (!i) {
|
|
|
|
cw_log(LOG_ERR,"Can't send AC Descriptor, no AC Status Item found");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-03-03 17:42:28 +01:00
|
|
|
d+=cw_put_ac_status(d ,(struct cw_ac_status*)(i->u2.data),conn);
|
2015-04-05 02:10:37 +02:00
|
|
|
|
2018-03-12 11:22:06 +01:00
|
|
|
/*
|
2015-04-05 02:10:37 +02:00
|
|
|
|
2015-04-19 23:27:44 +02:00
|
|
|
i = mbag_get(conn->local,CW_ITEM_AC_HARDWARE_VERSION);
|
2015-04-05 02:10:37 +02:00
|
|
|
if ( i ) {
|
2018-03-03 17:42:28 +01:00
|
|
|
d += cw_put_version(d,CW_SUBELEM_AC_HARDWARE_VERSION,i->u2.data);
|
2015-04-05 02:10:37 +02:00
|
|
|
}
|
|
|
|
else {
|
2015-04-11 19:00:51 +02:00
|
|
|
cw_log(LOG_ERR, "Can't send hard version in AC descriptor, not set.");
|
2015-04-05 02:10:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-19 23:27:44 +02:00
|
|
|
i = mbag_get(conn->local,CW_ITEM_AC_SOFTWARE_VERSION);
|
2015-04-05 02:10:37 +02:00
|
|
|
|
|
|
|
if ( i ) {
|
2018-03-03 17:42:28 +01:00
|
|
|
d += cw_put_version(d,CW_SUBELEM_AC_SOFTWARE_VERSION,i->u2.data);
|
2015-04-05 02:10:37 +02:00
|
|
|
}
|
|
|
|
else {
|
2015-04-11 19:00:51 +02:00
|
|
|
cw_log(LOG_ERR, "Can't send software version in AC descriptor, not set.");
|
2015-04-05 02:10:37 +02:00
|
|
|
}
|
2018-03-12 11:22:06 +01:00
|
|
|
*/
|
2015-04-05 02:10:37 +02:00
|
|
|
int len = d-dst-4;
|
|
|
|
|
2015-04-05 20:27:17 +02:00
|
|
|
return len + cw_put_elem_hdr(dst,a->elem_id,len);
|
2015-04-05 02:10:37 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|