source: libabac/abac_list.h @ d0efdec

mei_rt2
Last change on this file since d0efdec was 2e9455f, checked in by Mei <mei@…>, 11 years ago

1) added namespace
2) tweak ?This,
3) allowing linking role/oset as constraining conditions
4) adding access_tests regression testing that uses GENI's access policy
5) added couple multi contexts regression tests
6) add compression/uncompression calls to abac_encode_string/abac_decode_string
(libstrongwan only allows 512 char for attribute rule storage)
7) add attribute_now option to creddy that takes a whole char string for attribute
rule

  • Property mode set to 100644
File size: 1.0 KB
Line 
1#ifndef __ABAC_LIST_H__
2#define __ABAC_LIST_H__
3
4#include "utlist.h"
5
6typedef struct _abac_list_t abac_list_t;
7typedef struct _abac_list_element_t abac_list_element_t;
8
9struct _abac_list_element_t {
10    void *ptr;
11    abac_list_element_t *prev, *next;
12};
13
14struct _abac_list_t {
15    abac_list_element_t *elts;
16    int size;
17};
18
19#define abac_list_foreach(LIST, CURRENT, BODY) do {  \
20    abac_list_element_t *_elt;                  \
21    DL_FOREACH(LIST->elts, _elt) {              \
22        CURRENT = (typeof(CURRENT))_elt->ptr;   \
23        BODY                                    \
24    }                                           \
25} while (0)
26
27/* exported */
28extern abac_list_t *abac_list_new(void);
29extern void abac_list_add(abac_list_t *list, void *elt);
30extern int abac_list_unique_add(abac_list_t *list, void *elt);
31extern void abac_list_prepend(abac_list_t *list, void *elt);
32extern int abac_list_remove(abac_list_t *list, void *elt);
33extern int abac_list_size(abac_list_t *list);
34extern void abac_list_free(abac_list_t *list);
35
36#endif /* __ABAC_LIST_H__ */
Note: See TracBrowser for help on using the repository browser.