Initsal...
FossilOrigin-Name: 9a8ac4903d4780d5e9c5ee4cd79307f3ed4e5d6b3ba5e03244507a2d82fbd71d
This commit is contained in:
parent
5d8771b897
commit
7528e007d4
41
src/capwap/cw_out_ac_name_with_priority.c
Normal file
41
src/capwap/cw_out_ac_name_with_priority.c
Normal file
@ -0,0 +1,41 @@
|
||||
|
||||
|
||||
#include "capwap.h"
|
||||
#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)
|
||||
{
|
||||
cw_acpriolist_t prios = mbag_get_mavl(conn->config,CW_ITEM_AC_NAME_WITH_PRIORITY,NULL);
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user