X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=postlicyd%2Ffilter.h;h=e8319d3b73b74322fb4932a291b231b38c8c2ded;hb=4e8709f2fc6338d2774c24c9c353deca1990f600;hp=abfb5afcceea0741b80667c349a0df27098b5b93;hpb=5c75febadf099c0a656b3b8072b14ec14b38c2f6;p=apps%2Fpfixtools.git diff --git a/postlicyd/filter.h b/postlicyd/filter.h index abfb5af..e8319d3 100644 --- a/postlicyd/filter.h +++ b/postlicyd/filter.h @@ -70,10 +70,15 @@ typedef struct filter_t { void *data; A(filter_param_t) params; + + /* Internal: to check the filter tree structure. + */ + unsigned safe :1; + unsigned seen :1; } filter_t; ARRAY(filter_t) -#define FILTER_INIT { NULL, FTK_UNKNOWN, ARRAY_INIT, NULL, ARRAY_INIT } +#define FILTER_INIT { NULL, FTK_UNKNOWN, ARRAY_INIT, NULL, ARRAY_INIT, false, false } #define CHECK_FILTER(Filter) \ assert(Filter != FTK_UNKNOWN && Filter != FTK_count \ && "Unknown filter type") @@ -147,6 +152,9 @@ static inline int filter_find_with_name(A(filter_t) *array, const char *name) __attribute__((nonnull(1,2))) bool filter_update_references(filter_t *filter, A(filter_t) *array); +__attribute__((nonnull(1))) +bool filter_check_safety(A(filter_t) *array); + __attribute__((nonnull(1))) static inline void filter_hook_wipe(filter_hook_t *hook) {