1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21/*
22 * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23 * Use is subject to license terms.
24 */
25
26#include <sys/syscall.h>
27#include <sys/types.h>
28#include <bsm/audit.h>
29#include <sys/socket.h>
30#include <sys/param.h>
31
32const char *bsm_dom = TEXT_DOMAIN;
33
34int
35auditdoor(int fd)
36{
37	return (syscall(SYS_auditsys, BSM_AUDITDOOR, fd));
38}
39
40
41int
42audit(char *record, int length)
43{
44	return (syscall(SYS_auditsys, BSM_AUDIT, record, length));
45}
46
47
48int
49getauid(au_id_t *auid)
50{
51	return (syscall(SYS_auditsys, BSM_GETAUID, auid));
52}
53
54
55int
56setauid(au_id_t *auid)
57{
58	return (syscall(SYS_auditsys, BSM_SETAUID, auid));
59}
60
61
62int
63getaudit(auditinfo_t *ai)
64{
65	return (syscall(SYS_auditsys, BSM_GETAUDIT, ai));
66}
67
68int
69getaudit_addr(auditinfo_addr_t *ai, int len)
70{
71	return (syscall(SYS_auditsys, BSM_GETAUDIT_ADDR, ai, len));
72}
73
74
75int
76setaudit(auditinfo_t *ai)
77{
78	return (syscall(SYS_auditsys, BSM_SETAUDIT, ai));
79}
80
81
82int
83setaudit_addr(auditinfo_addr_t *ai, int len)
84{
85	return (syscall(SYS_auditsys, BSM_SETAUDIT_ADDR, ai, len));
86}
87
88
89int
90auditon(int cmd, caddr_t data, int length)
91{
92	return (syscall(SYS_auditsys, BSM_AUDITCTL, cmd, data, length));
93}
94