X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=include%2Ftr_filter.h;h=08eb51c5ffefd2ebdcaad1c8a3dde1a08c61d2df;hb=9de6bdbaf99c345fd00337ed2293f743bd1faee0;hp=4c618889a212ff98b653c06e83d0ed445fbd413f;hpb=d1a72e14ea15ec59cd120d01ccad03cc0571f094;p=trust_router.git diff --git a/include/tr_filter.h b/include/tr_filter.h index 4c61888..08eb51c 100644 --- a/include/tr_filter.h +++ b/include/tr_filter.h @@ -41,18 +41,24 @@ #define TR_MAX_FILTERS 5 #define TR_MAX_FILTER_LINES 8 #define TR_MAX_FILTER_SPECS 8 +#define TR_MAX_CONS_VALUES 8 /* Filter actions */ #define TR_FILTER_ACTION_REJECT 0 #define TR_FILTER_ACTION_ACCEPT 1 +/* Match codes */ +#define TR_FILTER_MATCH 0 +#define TR_FILTER_NO_MATCH 1 + /* Filter types */ #define TR_FILTER_TYPE_RP_PERMITTED 0 /* Other types TBD */ +typedef json_t TR_CONSTRAINT_SET; + typedef struct tr_constraint { - struct tr_constraint *next; - TR_NAME values[]; + TR_NAME values[TR_MAX_CONS_VALUES]; } TR_CONSTRAINT; typedef struct tr_fspec { @@ -63,9 +69,7 @@ typedef struct tr_fspec { typedef struct tr_fline { int action; TR_FSPEC *specs[TR_MAX_FILTER_SPECS]; - TR_CONSTRAINT *realm_cons; - TR_CONSTRAINT *domain_cons; - json_t *j_constraints; + TR_CONSTRAINT_SET *constraints; } TR_FLINE; typedef struct tr_filter { @@ -75,5 +79,5 @@ typedef struct tr_filter { void tr_filter_free (TR_FILTER *filt); int tr_prefix_wildcard_match (char *str, char *wc_str); - +int tr_filter_process_rp_permitted (TR_NAME *rp_realm, TR_FILTER *rpp_filter, TR_CONSTRAINT_SET *in_constraints, TR_CONSTRAINT_SET **out_constraints, int *out_action); #endif