audit.h (185573) | audit.h (186647) |
---|---|
1/*- 2 * Copyright (c) 2005 Apple Inc. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * --- 13 unchanged lines hidden (view full) --- 22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * 29 * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit.h#1 | 1/*- 2 * Copyright (c) 2005 Apple Inc. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * --- 13 unchanged lines hidden (view full) --- 22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * 29 * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit.h#1 |
30 * $FreeBSD: head/sys/bsm/audit.h 185573 2008-12-02 23:26:43Z rwatson $ | 30 * $FreeBSD: head/sys/bsm/audit.h 186647 2008-12-31 11:12:24Z rwatson $ |
31 */ 32 33#ifndef _BSM_AUDIT_H 34#define _BSM_AUDIT_H 35 | 31 */ 32 33#ifndef _BSM_AUDIT_H 34#define _BSM_AUDIT_H 35 |
36#ifdef __APPLE__ 37/* Temporary until rdar://problem/6133383 is resolved. */ 38#include <sys/types.h> |
|
36#include <sys/param.h> | 39#include <sys/param.h> |
40#include <sys/socket.h> |
|
37#include <sys/cdefs.h> 38#include <sys/queue.h> | 41#include <sys/cdefs.h> 42#include <sys/queue.h> |
43#endif /* __APPLE__ */ |
|
39 40#define AUDIT_RECORD_MAGIC 0x828a0f1b 41#define MAX_AUDIT_RECORDS 20 42#define MAXAUDITDATA (0x8000 - 1) 43#define MAX_AUDIT_RECORD_SIZE MAXAUDITDATA 44#define MIN_AUDIT_FILE_SIZE (512 * 1024) 45 46/* --- 8 unchanged lines hidden (view full) --- 55 * Triggers for the audit daemon. 56 */ 57#define AUDIT_TRIGGER_MIN 1 58#define AUDIT_TRIGGER_LOW_SPACE 1 /* Below low watermark. */ 59#define AUDIT_TRIGGER_ROTATE_KERNEL 2 /* Kernel requests rotate. */ 60#define AUDIT_TRIGGER_READ_FILE 3 /* Re-read config file. */ 61#define AUDIT_TRIGGER_CLOSE_AND_DIE 4 /* Terminate audit. */ 62#define AUDIT_TRIGGER_NO_SPACE 5 /* Below min free space. */ | 44 45#define AUDIT_RECORD_MAGIC 0x828a0f1b 46#define MAX_AUDIT_RECORDS 20 47#define MAXAUDITDATA (0x8000 - 1) 48#define MAX_AUDIT_RECORD_SIZE MAXAUDITDATA 49#define MIN_AUDIT_FILE_SIZE (512 * 1024) 50 51/* --- 8 unchanged lines hidden (view full) --- 60 * Triggers for the audit daemon. 61 */ 62#define AUDIT_TRIGGER_MIN 1 63#define AUDIT_TRIGGER_LOW_SPACE 1 /* Below low watermark. */ 64#define AUDIT_TRIGGER_ROTATE_KERNEL 2 /* Kernel requests rotate. */ 65#define AUDIT_TRIGGER_READ_FILE 3 /* Re-read config file. */ 66#define AUDIT_TRIGGER_CLOSE_AND_DIE 4 /* Terminate audit. */ 67#define AUDIT_TRIGGER_NO_SPACE 5 /* Below min free space. */ |
63#define AUDIT_TRIGGER_ROTATE_USER 6 /* User requests roate. */ 64#define AUDIT_TRIGGER_MAX 6 | 68#define AUDIT_TRIGGER_ROTATE_USER 6 /* User requests rotate. */ 69#define AUDIT_TRIGGER_INITIALIZE 7 /* Initialize audit. */ 70#define AUDIT_TRIGGER_MAX 7 |
65 66/* 67 * The special device filename (FreeBSD). 68 */ 69#define AUDITDEV_FILENAME "audit" 70#define AUDIT_TRIGGER_FILE ("/dev/" AUDITDEV_FILENAME) 71 72/* 73 * Pre-defined audit IDs 74 */ | 71 72/* 73 * The special device filename (FreeBSD). 74 */ 75#define AUDITDEV_FILENAME "audit" 76#define AUDIT_TRIGGER_FILE ("/dev/" AUDITDEV_FILENAME) 77 78/* 79 * Pre-defined audit IDs 80 */ |
75#define AU_DEFAUDITID -1 | 81#define AU_DEFAUDITID (uid_t)(-1) 82#define AU_DEFAUDITSID 0 83#define AU_ASSIGN_ASID -1 |
76 77/* 78 * IPC types. 79 */ 80#define AT_IPC_MSG ((u_char)1) /* Message IPC id. */ 81#define AT_IPC_SEM ((u_char)2) /* Semaphore IPC id. */ 82#define AT_IPC_SHM ((u_char)3) /* Shared mem IPC id. */ 83 --- 27 unchanged lines hidden (view full) --- 111#define A_GETPINFO 24 112#define A_SETPMASK 25 113#define A_SETFSIZE 26 114#define A_GETFSIZE 27 115#define A_GETPINFO_ADDR 28 116#define A_GETKAUDIT 29 117#define A_SETKAUDIT 30 118#define A_SENDTRIGGER 31 | 84 85/* 86 * IPC types. 87 */ 88#define AT_IPC_MSG ((u_char)1) /* Message IPC id. */ 89#define AT_IPC_SEM ((u_char)2) /* Semaphore IPC id. */ 90#define AT_IPC_SHM ((u_char)3) /* Shared mem IPC id. */ 91 --- 27 unchanged lines hidden (view full) --- 119#define A_GETPINFO 24 120#define A_SETPMASK 25 121#define A_SETFSIZE 26 122#define A_GETFSIZE 27 123#define A_GETPINFO_ADDR 28 124#define A_GETKAUDIT 29 125#define A_SETKAUDIT 30 126#define A_SENDTRIGGER 31 |
127#define A_GETSINFO_ADDR 32 |
|
119 120/* 121 * Audit policy controls. 122 */ 123#define AUDIT_CNT 0x0001 124#define AUDIT_AHLT 0x0002 125#define AUDIT_ARGV 0x0004 126#define AUDIT_ARGE 0x0008 --- 64 unchanged lines hidden (view full) --- 191}; 192typedef struct auditinfo auditinfo_t; 193 194struct auditinfo_addr { 195 au_id_t ai_auid; /* Audit user ID. */ 196 au_mask_t ai_mask; /* Audit masks. */ 197 au_tid_addr_t ai_termid; /* Terminal ID. */ 198 au_asid_t ai_asid; /* Audit session ID. */ | 128 129/* 130 * Audit policy controls. 131 */ 132#define AUDIT_CNT 0x0001 133#define AUDIT_AHLT 0x0002 134#define AUDIT_ARGV 0x0004 135#define AUDIT_ARGE 0x0008 --- 64 unchanged lines hidden (view full) --- 200}; 201typedef struct auditinfo auditinfo_t; 202 203struct auditinfo_addr { 204 au_id_t ai_auid; /* Audit user ID. */ 205 au_mask_t ai_mask; /* Audit masks. */ 206 au_tid_addr_t ai_termid; /* Terminal ID. */ 207 au_asid_t ai_asid; /* Audit session ID. */ |
208 u_int64_t ai_flags; /* Audit session flags. */ |
|
199}; 200typedef struct auditinfo_addr auditinfo_addr_t; 201 202struct auditpinfo { 203 pid_t ap_pid; /* ID of target process. */ 204 au_id_t ap_auid; /* Audit user ID. */ 205 au_mask_t ap_mask; /* Audit masks. */ 206 au_tid_t ap_termid; /* Terminal ID. */ 207 au_asid_t ap_asid; /* Audit session ID. */ | 209}; 210typedef struct auditinfo_addr auditinfo_addr_t; 211 212struct auditpinfo { 213 pid_t ap_pid; /* ID of target process. */ 214 au_id_t ap_auid; /* Audit user ID. */ 215 au_mask_t ap_mask; /* Audit masks. */ 216 au_tid_t ap_termid; /* Terminal ID. */ 217 au_asid_t ap_asid; /* Audit session ID. */ |
218 u_int64_t ap_flags; /* Audit session flags. */ |
|
208}; 209typedef struct auditpinfo auditpinfo_t; 210 211struct auditpinfo_addr { 212 pid_t ap_pid; /* ID of target process. */ 213 au_id_t ap_auid; /* Audit user ID. */ 214 au_mask_t ap_mask; /* Audit masks. */ 215 au_tid_addr_t ap_termid; /* Terminal ID. */ 216 au_asid_t ap_asid; /* Audit session ID. */ 217}; 218typedef struct auditpinfo_addr auditpinfo_addr_t; 219 | 219}; 220typedef struct auditpinfo auditpinfo_t; 221 222struct auditpinfo_addr { 223 pid_t ap_pid; /* ID of target process. */ 224 au_id_t ap_auid; /* Audit user ID. */ 225 au_mask_t ap_mask; /* Audit masks. */ 226 au_tid_addr_t ap_termid; /* Terminal ID. */ 227 au_asid_t ap_asid; /* Audit session ID. */ 228}; 229typedef struct auditpinfo_addr auditpinfo_addr_t; 230 |
231struct au_session { 232 auditinfo_addr_t *as_aia_p; /* Ptr to full audit info. */ 233#define as_asid as_aia_p->ai_asid 234#define as_auid as_aia_p->ai_auid 235#define as_termid as_aia_p->ai_termid 236 237 au_mask_t as_mask; /* Process Audit Masks. */ 238}; 239typedef struct au_session au_session_t; 240 |
|
220/* 221 * Contents of token_t are opaque outside of libbsm. 222 */ 223typedef struct au_token token_t; 224 225/* 226 * Kernel audit queue control parameters. 227 */ --- 66 unchanged lines hidden --- | 241/* 242 * Contents of token_t are opaque outside of libbsm. 243 */ 244typedef struct au_token token_t; 245 246/* 247 * Kernel audit queue control parameters. 248 */ --- 66 unchanged lines hidden --- |