| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
#ifndef _SEPOL_POLICYDB_CONSTRAINT_H_ |
| 19 |
#define _SEPOL_POLICYDB_CONSTRAINT_H_ |
| 20 |
|
| 21 |
#include <sepol/policydb/policydb.h> |
| 22 |
#include <sepol/policydb/ebitmap.h> |
| 23 |
#include <sepol/policydb/flask_types.h> |
| 24 |
|
| 25 |
#ifdef __cplusplus |
| 26 |
extern "C" { |
| 27 |
#endif |
| 28 |
|
| 29 |
#define CEXPR_MAXDEPTH 5 |
| 30 |
|
| 31 |
struct type_set; |
| 32 |
|
| 33 |
typedef struct constraint_expr { |
| 34 |
#define CEXPR_NOT 1 |
| 35 |
#define CEXPR_AND 2 |
| 36 |
#define CEXPR_OR 3 |
| 37 |
#define CEXPR_ATTR 4 |
| 38 |
#define CEXPR_NAMES 5 |
| 39 |
uint32_t expr_type; |
| 40 |
|
| 41 |
#define CEXPR_USER 1 |
| 42 |
#define CEXPR_ROLE 2 |
| 43 |
#define CEXPR_TYPE 4 |
| 44 |
#define CEXPR_TARGET 8 |
| 45 |
#define CEXPR_XTARGET 16 |
| 46 |
#define CEXPR_L1L2 32 |
| 47 |
#define CEXPR_L1H2 64 |
| 48 |
#define CEXPR_H1L2 128 |
| 49 |
#define CEXPR_H1H2 256 |
| 50 |
#define CEXPR_L1H1 512 |
| 51 |
#define CEXPR_L2H2 1024 |
| 52 |
uint32_t attr; |
| 53 |
|
| 54 |
#define CEXPR_EQ 1 |
| 55 |
#define CEXPR_NEQ 2 |
| 56 |
#define CEXPR_DOM 3 |
| 57 |
#define CEXPR_DOMBY 4 |
| 58 |
#define CEXPR_INCOMP 5 |
| 59 |
uint32_t op; |
| 60 |
|
| 61 |
ebitmap_t names; |
| 62 |
struct type_set *type_names; |
| 63 |
|
| 64 |
struct constraint_expr *next; |
| 65 |
} constraint_expr_t; |
| 66 |
|
| 67 |
typedef struct constraint_node { |
| 68 |
sepol_access_vector_t permissions; |
| 69 |
constraint_expr_t *expr; |
| 70 |
struct constraint_node *next; |
| 71 |
} constraint_node_t; |
| 72 |
|
| 73 |
struct policydb; |
| 74 |
|
| 75 |
extern int constraint_expr_init(constraint_expr_t * expr); |
| 76 |
extern void constraint_expr_destroy(constraint_expr_t * expr); |
| 77 |
|
| 78 |
#ifdef __cplusplus |
| 79 |
} |
| 80 |
#endif |
| 81 |
|
| 82 |
#endif |
| 83 |
|
| 84 |
|