Inital ...
FossilOrigin-Name: e6352b425bf6574bdaacc571723f7b54394e235d8b64bbaa504c9b7e529b7535
This commit is contained in:
31
src/capwap/acpriolist.h
Normal file
31
src/capwap/acpriolist.h
Normal file
@ -0,0 +1,31 @@
|
||||
#ifndef __ACIPRIORITYLIST_H
|
||||
#define __ACIPRIORITYLIST_H
|
||||
|
||||
|
||||
#include "avltree.h"
|
||||
|
||||
struct cw_acprio{
|
||||
char *name;
|
||||
uint8_t prio;
|
||||
};
|
||||
|
||||
typedef struct cw_acprio cw_acprio_t;
|
||||
typedef struct avltree * cw_acpriolist_t;
|
||||
|
||||
extern cw_acpriolist_t cw_acpriolist_create();
|
||||
cw_acprio_t * cw_acpriolist_add(cw_acpriolist_t l, const char *name,int name_len, uint8_t prio);
|
||||
|
||||
static inline int cw_acpriolist_get(cw_acpriolist_t l, char * acname){
|
||||
cw_acprio_t ps,*pf;
|
||||
ps.name=acname;
|
||||
|
||||
pf=avltree_get(l,&ps);
|
||||
if (!pf)
|
||||
return 256;
|
||||
return pf->prio;
|
||||
}
|
||||
|
||||
#define cw_acpriolist_del(l,s) avltree_del(l,s)
|
||||
#define cw_acpriolist_set(l,n,nl,p) cw_acpriolist_add(l,n,nl,p)
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user