2015-04-26 14:19:18 +02:00
|
|
|
|
|
|
|
|
2016-03-11 22:23:00 +01:00
|
|
|
#include "cw.h"
|
2015-04-26 14:19:18 +02:00
|
|
|
#include "capwap_items.h"
|
|
|
|
|
|
|
|
#include "dbg.h"
|
|
|
|
#include "log.h"
|
|
|
|
|
|
|
|
#include "acpriolist.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int cw_put_ac_name_with_priority(uint8_t *dst,cw_acprio_t * acprio)
|
|
|
|
{
|
|
|
|
int len = strlen(acprio->name);
|
|
|
|
cw_put_byte(dst,acprio->prio);
|
|
|
|
cw_put_data(dst+1,(uint8_t*)acprio->name,len);
|
|
|
|
return len+1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
int cw_out_ac_name_with_priority(struct conn *conn, struct cw_action_out *a, uint8_t * dst)
|
|
|
|
{
|
2015-05-01 00:16:54 +02:00
|
|
|
cw_acpriolist_t prios = mbag_get_mavl(conn->config,CW_ITEM_AC_NAME_WITH_PRIORITY);
|
2015-04-26 14:19:18 +02:00
|
|
|
if (!prios)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
uint8_t *d = dst;
|
|
|
|
|
|
|
|
MAVLITER_DEFINE(it,prios);
|
|
|
|
mavliter_foreach(&it){
|
|
|
|
cw_acprio_t * ac = mavliter_get(&it);
|
|
|
|
|
|
|
|
int l = cw_put_ac_name_with_priority(d+4,ac);
|
|
|
|
d+=cw_put_elem_hdr(d,CW_ELEM_AC_NAME_WITH_PRIORITY,l)+l;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return d-dst;
|
|
|
|
}
|
|
|
|
|