]> git.saurik.com Git - apple/xnu.git/blob - bsd/bsm/audit_klib.h
xnu-792.22.5.tar.gz
[apple/xnu.git] / bsd / bsm / audit_klib.h
1 /*
2 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
3 *
4 * This file contains Original Code and/or Modifications of Original Code
5 * as defined in and that are subject to the Apple Public Source License
6 * Version 2.0 (the 'License'). You may not use this file except in
7 * compliance with the License. The rights granted to you under the License
8 * may not be used to create, or enable the creation or redistribution of,
9 * unlawful or unlicensed copies of an Apple operating system, or to
10 * circumvent, violate, or enable the circumvention or violation of, any
11 * terms of an Apple operating system software license agreement.
12 *
13 * Please obtain a copy of the License at
14 * http://www.opensource.apple.com/apsl/ and read it before using this file.
15 *
16 * The Original Code and all software distributed under the License are
17 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
18 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
19 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
21 * Please see the License for the specific language governing rights and
22 * limitations under the License.
23 *
24 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
25 */
26
27 #ifndef _BSM_AUDIT_KLIB_H_
28 #define _BSM_AUDIT_KLIB_H_
29
30 #define AU_PRS_SUCCESS 1
31 #define AU_PRS_FAILURE 2
32 #define AU_PRS_BOTH (AU_PRS_SUCCESS|AU_PRS_FAILURE)
33
34 #ifdef KERNEL
35 #include <bsm/audit_kernel.h>
36 /*
37 * Some of the BSM tokenizer functions take different parameters in the
38 * kernel implementations in order to save the copying of large kernel
39 * data structures. The prototypes of these functions are declared here.
40 */
41 token_t *kau_to_socket(struct socket_au_info *soi);
42 token_t *kau_to_attr32(struct vnode_au_info *vni);
43 token_t *kau_to_attr64(struct vnode_au_info *vni);
44 int auditon_command_event(int cmd);
45 int au_preselect(au_event_t event, au_mask_t *mask_p, int sorf);
46 au_event_t flags_and_error_to_openevent(int oflags, int error);
47 au_event_t ctlname_to_sysctlevent(int name[], uint64_t valid_arg);
48 au_event_t msgctl_to_event(int cmd);
49 au_event_t semctl_to_event(int cmd);
50 void au_evclassmap_init(void);
51 void au_evclassmap_insert(au_event_t event, au_class_t class);
52 au_class_t au_event_class(au_event_t event);
53
54 int canon_path(struct proc *p, char *path, char *cpath);
55
56
57
58
59 /*
60 * Define a system call to audit event mapping table.
61 */
62 extern au_event_t sys_au_event[];
63 extern int nsys_au_event; /* number of entries in this table */
64
65 #endif /*KERNEL*/
66
67 #endif /* ! _BSM_AUDIT_KLIB_H_ */