Deleted Added
full compact
audit_internal.h (155191) audit_internal.h (156289)
1/*
2 * Copyright (c) 2005 Apple Computer, Inc.
3 * Copyright (c) 2005 SPARTA, Inc.
4 * All rights reserved.
5 *
6 * This code was developed in part by Robert N. M. Watson, Senior Principal
7 * Scientist, SPARTA, Inc.
8 *

--- 20 unchanged lines hidden (view full) ---

29 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
31 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 *
35 * @APPLE_BSD_LICENSE_HEADER_END@
36 *
1/*
2 * Copyright (c) 2005 Apple Computer, Inc.
3 * Copyright (c) 2005 SPARTA, Inc.
4 * All rights reserved.
5 *
6 * This code was developed in part by Robert N. M. Watson, Senior Principal
7 * Scientist, SPARTA, Inc.
8 *

--- 20 unchanged lines hidden (view full) ---

29 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
31 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 *
35 * @APPLE_BSD_LICENSE_HEADER_END@
36 *
37 * $P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit_internal.h#5 $
38 * $FreeBSD: head/sys/bsm/audit_internal.h 155191 2006-02-01 19:54:22Z rwatson $
37 * $P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit_internal.h#7 $
38 * $FreeBSD: head/sys/bsm/audit_internal.h 156289 2006-03-04 16:54:21Z rwatson $
39 */
40
39 */
40
41#ifndef _LIBBSM_INTERNAL_H
42#define _LIBBSM_INTERNAL_H
41#ifndef _AUDIT_INTERNAL_H
42#define _AUDIT_INTERNAL_H
43
43
44#if defined(__linux__) && !defined(__unused)
45#define __unused
46#endif
47
44/*
45 * audit_internal.h contains private interfaces that are shared by user space
46 * and the kernel for the purposes of assembling audit records. Applications
47 * should not include this file or use the APIs found within, or it may be
48 * broken with future releases of OpenBSM, which may delete, modify, or
49 * otherwise break these interfaces or the assumptions they rely on.
50 */
48/*
49 * audit_internal.h contains private interfaces that are shared by user space
50 * and the kernel for the purposes of assembling audit records. Applications
51 * should not include this file or use the APIs found within, or it may be
52 * broken with future releases of OpenBSM, which may delete, modify, or
53 * otherwise break these interfaces or the assumptions they rely on.
54 */
55struct au_token {
56 u_char *t_data;
57 size_t len;
58 TAILQ_ENTRY(au_token) tokens;
59};
51
60
61struct au_record {
62 char used; /* Record currently in use? */
63 int desc; /* Descriptor for record. */
64 TAILQ_HEAD(, au_token) token_q; /* Queue of BSM tokens. */
65 u_char *data;
66 size_t len;
67 LIST_ENTRY(au_record) au_rec_q;
68};
69typedef struct au_record au_record_t;
70
71
52/* We could determined the header and trailer sizes by
53 * defining appropriate structures. We hold off that approach
54 * till we have a consistant way of using structures for all tokens.
55 * This is not straightforward since these token structures may
56 * contain pointers of whose contents we dont know the size
57 * (e.g text tokens)
58 */
59#define BSM_HEADER_SIZE 18

--- 32 unchanged lines hidden (view full) ---

92#define ADD_MEM(loc, data, size) \
93 do { \
94 memcpy((loc), (data), (size)); \
95 (loc) += size; \
96 } while(0)
97
98#define ADD_STRING(loc, data, size) ADD_MEM(loc, data, size)
99
72/* We could determined the header and trailer sizes by
73 * defining appropriate structures. We hold off that approach
74 * till we have a consistant way of using structures for all tokens.
75 * This is not straightforward since these token structures may
76 * contain pointers of whose contents we dont know the size
77 * (e.g text tokens)
78 */
79#define BSM_HEADER_SIZE 18

--- 32 unchanged lines hidden (view full) ---

112#define ADD_MEM(loc, data, size) \
113 do { \
114 memcpy((loc), (data), (size)); \
115 (loc) += size; \
116 } while(0)
117
118#define ADD_STRING(loc, data, size) ADD_MEM(loc, data, size)
119
100#endif /* !_LIBBSM_INTERNAL_H_ */
120#endif /* !_AUDIT_INTERNAL_H_ */