2010-12-20 12:29:10 -08:00
|
|
|
/*
|
2007-04-11 08:12:51 +00:00
|
|
|
* Copyright (c) 2003, 2004, 2005, 2006, 2007 Novell, Inc.
|
|
|
|
* (All rights reserved)
|
|
|
|
*
|
|
|
|
* The libapparmor library is licensed under the terms of the GNU
|
|
|
|
* Lesser General Public License, version 2.1. Please see the file
|
|
|
|
* COPYING.LGPL.
|
|
|
|
*/
|
2007-02-27 02:29:16 +00:00
|
|
|
|
|
|
|
#ifndef APPARMOR_RE_H
|
|
|
|
#define APPARMOR_RE_H
|
|
|
|
|
2011-03-13 05:46:29 -07:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2010-01-08 02:17:45 -08:00
|
|
|
typedef enum dfaflags {
|
2010-01-08 04:30:56 -08:00
|
|
|
DFA_CONTROL_EQUIV = 1 << 0,
|
2010-11-09 11:23:45 -08:00
|
|
|
DFA_CONTROL_TREE_NORMAL = 1 << 1,
|
|
|
|
DFA_CONTROL_TREE_SIMPLE = 1 << 2,
|
2010-01-08 04:30:56 -08:00
|
|
|
DFA_CONTROL_TREE_LEFT = 1 << 3,
|
2010-11-09 11:23:45 -08:00
|
|
|
DFA_CONTROL_MINIMIZE = 1 << 4,
|
2010-11-09 11:22:54 -08:00
|
|
|
DFA_CONTROL_MINIMIZE_HASH_TRANS = 1 << 5,
|
|
|
|
DFA_CONTROL_MINIMIZE_HASH_PERMS = 1 << 6,
|
2010-11-09 11:23:45 -08:00
|
|
|
DFA_CONTROL_REMOVE_UNREACHABLE = 1 << 7,
|
2010-11-09 11:22:54 -08:00
|
|
|
DFA_CONTROL_TRANS_HIGH = 1 << 8,
|
|
|
|
|
2010-11-09 11:56:28 -08:00
|
|
|
DFA_DUMP_UNIQ_PERMS = 1 << 14,
|
|
|
|
DFA_DUMP_MIN_UNIQ_PERMS = 1 << 15,
|
2010-11-09 11:22:54 -08:00
|
|
|
DFA_DUMP_TREE_STATS = 1 << 16,
|
|
|
|
DFA_DUMP_TREE = 1 << 17,
|
|
|
|
DFA_DUMP_SIMPLE_TREE = 1 << 18,
|
|
|
|
DFA_DUMP_PROGRESS = 1 << 19,
|
|
|
|
DFA_DUMP_STATS = 1 << 20,
|
|
|
|
DFA_DUMP_STATES = 1 << 21,
|
|
|
|
DFA_DUMP_GRAPH = 1 << 22,
|
|
|
|
DFA_DUMP_TRANS_PROGRESS = 1 << 23,
|
|
|
|
DFA_DUMP_TRANS_STATS = 1 << 24,
|
|
|
|
DFA_DUMP_TRANS_TABLE = 1 << 25,
|
|
|
|
DFA_DUMP_EQUIV = 1 << 26,
|
|
|
|
DFA_DUMP_EQUIV_STATS = 1 << 27,
|
|
|
|
DFA_DUMP_MINIMIZE = 1 << 28,
|
|
|
|
DFA_DUMP_UNREACHABLE = 1 << 29,
|
|
|
|
DFA_DUMP_RULE_EXPR = 1 << 30,
|
2010-11-09 11:55:40 -08:00
|
|
|
DFA_DUMP_NODE_TO_DFA = 1 << 31,
|
2010-01-08 02:17:45 -08:00
|
|
|
} dfaflags_t;
|
|
|
|
|
2007-02-27 02:29:16 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct aare_ruleset;
|
|
|
|
|
|
|
|
typedef struct aare_ruleset aare_ruleset_t;
|
|
|
|
|
|
|
|
aare_ruleset_t *aare_new_ruleset(int reverse);
|
|
|
|
void aare_delete_ruleset(aare_ruleset_t *rules);
|
2008-03-13 16:46:19 +00:00
|
|
|
int aare_add_rule(aare_ruleset_t *rules, char *rule, int deny,
|
2010-07-23 13:29:35 +02:00
|
|
|
uint32_t perms, uint32_t audit, dfaflags_t flags);
|
2008-03-13 16:46:19 +00:00
|
|
|
int aare_add_rule_vec(aare_ruleset_t *rules, int deny, uint32_t perms,
|
2010-07-23 13:29:35 +02:00
|
|
|
uint32_t audit, int count, char **rulev, dfaflags_t flags);
|
2010-01-08 04:30:56 -08:00
|
|
|
void *aare_create_dfa(aare_ruleset_t *rules, size_t *size, dfaflags_t flags);
|
2009-07-24 07:33:09 +00:00
|
|
|
void aare_reset_matchflags(void);
|
2007-02-27 02:29:16 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* APPARMOR_RE_H */
|