16cd6a6acSopenharmony_ci/* Functions used to define policy grammar components. */ 26cd6a6acSopenharmony_ci 36cd6a6acSopenharmony_ci#ifndef _POLICY_DEFINE_H_ 46cd6a6acSopenharmony_ci#define _POLICY_DEFINE_H_ 56cd6a6acSopenharmony_ci 66cd6a6acSopenharmony_ci/* 76cd6a6acSopenharmony_ci * We need the following so we have a valid error return code in yacc 86cd6a6acSopenharmony_ci * when we have a parse error for a conditional rule. We can't check 96cd6a6acSopenharmony_ci * for NULL (ie 0) because that is a potentially valid return. 106cd6a6acSopenharmony_ci */ 116cd6a6acSopenharmony_ci#define COND_ERR ((avrule_t *)-1) 126cd6a6acSopenharmony_ci#define TRUE 1 136cd6a6acSopenharmony_ci#define FALSE 0 146cd6a6acSopenharmony_ci 156cd6a6acSopenharmony_ciavrule_t *define_cond_compute_type(int which); 166cd6a6acSopenharmony_ciavrule_t *define_cond_pol_list(avrule_t *avlist, avrule_t *stmt); 176cd6a6acSopenharmony_ciavrule_t *define_cond_te_avtab(int which); 186cd6a6acSopenharmony_ciavrule_t *define_cond_filename_trans(void); 196cd6a6acSopenharmony_cicond_expr_t *define_cond_expr(uint32_t expr_type, void *arg1, void* arg2); 206cd6a6acSopenharmony_ciint define_attrib(void); 216cd6a6acSopenharmony_ciint define_attrib_role(void); 226cd6a6acSopenharmony_ciint define_av_perms(int inherits); 236cd6a6acSopenharmony_ciint define_bool_tunable(int is_tunable); 246cd6a6acSopenharmony_ciint define_category(void); 256cd6a6acSopenharmony_ciint define_class(void); 266cd6a6acSopenharmony_ciint define_default_user(int which); 276cd6a6acSopenharmony_ciint define_default_role(int which); 286cd6a6acSopenharmony_ciint define_default_type(int which); 296cd6a6acSopenharmony_ciint define_default_range(int which); 306cd6a6acSopenharmony_ciint define_common_perms(void); 316cd6a6acSopenharmony_ciint define_compute_type(int which); 326cd6a6acSopenharmony_ciint define_conditional(cond_expr_t *expr, avrule_t *t_list, avrule_t *f_list ); 336cd6a6acSopenharmony_ciint define_constraint(constraint_expr_t *expr); 346cd6a6acSopenharmony_ciint define_dominance(void); 356cd6a6acSopenharmony_ciint define_fs_context(unsigned int major, unsigned int minor); 366cd6a6acSopenharmony_ciint define_fs_use(int behavior); 376cd6a6acSopenharmony_ciint define_genfs_context(int has_type); 386cd6a6acSopenharmony_ciint define_initial_sid_context(void); 396cd6a6acSopenharmony_ciint define_initial_sid(void); 406cd6a6acSopenharmony_ciint define_ipv4_node_context(void); 416cd6a6acSopenharmony_ciint define_ipv6_node_context(void); 426cd6a6acSopenharmony_ciint define_level(void); 436cd6a6acSopenharmony_ciint define_netif_context(void); 446cd6a6acSopenharmony_ciint define_permissive(void); 456cd6a6acSopenharmony_ciint define_polcap(void); 466cd6a6acSopenharmony_ciint define_ibpkey_context(unsigned int low, unsigned int high); 476cd6a6acSopenharmony_ciint define_ibendport_context(unsigned int port); 486cd6a6acSopenharmony_ciint define_port_context(unsigned int low, unsigned int high); 496cd6a6acSopenharmony_ciint define_pirq_context(unsigned int pirq); 506cd6a6acSopenharmony_ciint define_iomem_context(uint64_t low, uint64_t high); 516cd6a6acSopenharmony_ciint define_ioport_context(unsigned long low, unsigned long high); 526cd6a6acSopenharmony_ciint define_pcidevice_context(unsigned long device); 536cd6a6acSopenharmony_ciint define_devicetree_context(void); 546cd6a6acSopenharmony_ciint define_range_trans(int class_specified); 556cd6a6acSopenharmony_ciint define_role_allow(void); 566cd6a6acSopenharmony_ciint define_role_trans(int class_specified); 576cd6a6acSopenharmony_ciint define_role_types(void); 586cd6a6acSopenharmony_ciint define_role_attr(void); 596cd6a6acSopenharmony_ciint define_roleattribute(void); 606cd6a6acSopenharmony_ciint define_filename_trans(void); 616cd6a6acSopenharmony_ciint define_sens(void); 626cd6a6acSopenharmony_ciint define_te_avtab(int which); 636cd6a6acSopenharmony_ciint define_te_avtab_extended_perms(int which); 646cd6a6acSopenharmony_ciint define_typealias(void); 656cd6a6acSopenharmony_ciint define_typeattribute(void); 666cd6a6acSopenharmony_ciint define_typebounds(void); 676cd6a6acSopenharmony_ciint define_type(int alias); 686cd6a6acSopenharmony_ciint define_user(void); 696cd6a6acSopenharmony_ciint define_validatetrans(constraint_expr_t *expr); 706cd6a6acSopenharmony_ciint expand_attrib(void); 716cd6a6acSopenharmony_ciint insert_id(const char *id,int push); 726cd6a6acSopenharmony_ciint insert_separator(int push); 736cd6a6acSopenharmony_cirole_datum_t *define_role_dom(role_datum_t *r); 746cd6a6acSopenharmony_cirole_datum_t *merge_roles_dom(role_datum_t *r1,role_datum_t *r2); 756cd6a6acSopenharmony_ciuintptr_t define_cexpr(uint32_t expr_type, uintptr_t arg1, uintptr_t arg2); 766cd6a6acSopenharmony_ci 776cd6a6acSopenharmony_ci#endif /* _POLICY_DEFINE_H_ */ 78