1 /* SPDX-License-Identifier: GPL-2.0-only */ 1 2 /* 3 * SELinux support for the Audit LSM hooks 4 * 5 * Author: James Morris <jmorris@redhat.com> 6 * 7 * Copyright (C) 2005 Red Hat, Inc., James Mor 8 * Copyright (C) 2006 Trusted Computer Solutio 9 * Copyright (C) 2006 IBM Corporation, Timothy 10 */ 11 12 #ifndef _SELINUX_AUDIT_H 13 #define _SELINUX_AUDIT_H 14 15 #include <linux/audit.h> 16 #include <linux/types.h> 17 18 /** 19 * selinux_audit_rule_init - alloc/init a 20 * @field: the field this rule refers to 21 * @op: the operator the rule uses 22 * @rulestr: the text "target" of the rul 23 * @rule: pointer to the new rule structu 24 * @gfp: GFP flag used for kmalloc 25 * 26 * Returns 0 if successful, -errno if not 27 * will be allocated internally. The cal 28 * selinux_audit_rule_free() after use. 29 */ 30 int selinux_audit_rule_init(u32 field, u32 op, 31 gfp_t gfp); 32 33 /** 34 * selinux_audit_rule_free - free an seli 35 * @rule: pointer to the audit rule to be 36 * 37 * This will free all memory associated w 38 * If @rule is NULL, no operation is perf 39 */ 40 void selinux_audit_rule_free(void *rule); 41 42 /** 43 * selinux_audit_rule_match - determine i 44 * @sid: the context ID to check 45 * @field: the field this rule refers to 46 * @op: the operator the rule uses 47 * @rule: pointer to the audit rule to ch 48 * 49 * Returns 1 if the context id matches th 50 * -errno on failure. 51 */ 52 int selinux_audit_rule_match(u32 sid, u32 fiel 53 54 /** 55 * selinux_audit_rule_known - check to se 56 * @rule: rule to be checked 57 * Returns 1 if there are selinux fields 58 */ 59 int selinux_audit_rule_known(struct audit_krul 60 61 #endif /* _SELINUX_AUDIT_H */ 62
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.