auditwrite.h revision 303
335N/A/*
335N/A * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
335N/A * Use is subject to license terms.
335N/A */
943N/A
335N/A#ifndef _BSM_AUDITWRITE_H
335N/A#define _BSM_AUDITWRITE_H
919N/A
919N/A#pragma ident "@(#)auditwrite.h 1.5 08/02/04 SMI"
919N/A
919N/A#include <bsm/libbsm.h>
919N/A#include <tsol/label.h>
919N/A#include <sys/tsol/label_macro.h>
919N/A
919N/A#ifdef __cplusplus
919N/Aextern "C" {
919N/A#endif
919N/A
919N/A
919N/A/*
919N/A * This file contains declarations and defines for use with
919N/A * auditwrite(3).
919N/A */
919N/A
335N/A/* Mandatory last arg on auditwrite(3) invocation line */
335N/A
335N/A#define AW_END (0)
335N/A
493N/A/* control commands */
335N/A
335N/A#define AW_ABORT (1) /* Stop everything. */
493N/A#define AW_APPEND (2) /* Append to recbuf. */
335N/A#define AW_DEFAULTRD (3) /* Use default rd. */
911N/A#define AW_DISCARD (4) /* Discard all audit recs. */
911N/A#define AW_DISCARDRD (5) /* Discard one audit rec. */
911N/A#define AW_FLUSH (6) /* Flush queued recbufs. */
911N/A#define AW_GETRD (7) /* Get a recbuf descriptor. */
335N/A#define AW_NOPRESELECT (8) /* No user level preselection */
335N/A#define AW_NOQUEUE (9) /* Stop queueing. Flush. */
335N/A#define AW_NOSAVE (10) /* Don't attach save buffer. */
970N/A#define AW_NOSERVER (11) /* We're not a trusted server. */
970N/A#define AW_PRESELECT (12) /* Do user level preselection. */
970N/A#define AW_QUEUE (13) /* Buffer all records. */
970N/A#define AW_SAVERD (14) /* Attach save buffer. */
335N/A#define AW_SERVER (15) /* We're a trusted server. */
335N/A#define AW_USERD (16) /* Use recbuf descriptor. */
493N/A#define AW_WRITE (17) /* Write to trail. */
335N/A
910N/A/*
910N/A * Attribute commands. These tell audiwrite(3) what kind
910N/A * of data to expect.
970N/A */
970N/A
970N/A#define AW_ACL (25)
335N/A#define AW_ARG (26)
335N/A#define AW_ATTR (27)
335N/A#define AW_DATA (28)
851N/A#define AW_EVENT (29)
851N/A#define AW_EVENTNUM (30)
#define AW_EXEC_ARGS (31)
#define AW_EXEC_ENV (32)
#define AW_EXIT (33)
#define AW_GROUPS (34)
#define AW_INADDR (35)
#define AW_IN_ADDR AW_INADDR
#define AW_IPC (36)
#define AW_IPORT (38)
#define AW_OPAQUE (39)
#define AW_PATH (40)
#define AW_PROCESS (41)
#define AW_RETURN (42)
#define AW_SOCKET (43)
#define AW_SUBJECT (44)
#define AW_TEXT (45)
#define AW_UAUTH (46)
#define AW_CMD (47)
#define AW_LEVEL (52)
#define AW_LIAISON (53)
#define AW_PRIVILEGE (54) /* OBSOLETE */
#define AW_SLABEL (55)
#define AW_USEOFPRIV (56)
#define AW_XATOM (60)
#define AW_XCOLORMAP (61)
#define AW_XCURSOR (62)
#define AW_XFONT (63)
#define AW_XGC (64)
#define AW_XOBJ (65) /* OBSOLETE */
#define AW_XPIXMAP (66)
#define AW_XPROPERTY (67)
#define AW_XPROTO (68) /* OBSOLETE */
#define AW_XSELECT (69)
#define AW_XWINDOW (70)
#define AW_XCLIENT (71)
#define AW_PROCESS_EX (72)
/*
* The next is the last and highest numbered valid command code; if more
* are added, remember to update AW_CMD_MAX in auditwrite.c.
*/
#define AW_SUBJECT_EX (73)
/*
* describe data specified with AW_DATA
*/
#define AWD_BYTE ((char)1)
#define AWD_CHAR ((char)2)
#define AWD_SHORT ((char)3)
#define AWD_INT ((char)4)
#define AWD_LONG ((char)5)
#define AWD_INT32 ((char)6)
#define AWD_INT64 ((char)7)
/*
* describe how to print data specified with AW_DATA
*/
#define AWD_BINARY ((char)1)
#define AWD_OCTAL ((char)2)
#define AWD_DECIMAL ((char)3)
#define AWD_HEX ((char)4)
#define AWD_STRING ((char)5)
/*
* auditwrite(3) error indicators
*/
#define AW_ERR_NO_ERROR (0)
#define AW_ERR_ADDR_INVALID (1)
#define AW_ERR_ALLOC_FAIL (2)
#define AW_ERR_AUDITON_FAIL (3)
#define AW_ERR_AUDIT_FAIL (4)
#define AW_ERR_CMD_INCOMPLETE (5)
#define AW_ERR_CMD_INVALID (6)
#define AW_ERR_CMD_IN_EFFECT (7)
#define AW_ERR_CMD_NOT_IN_EFFECT (8)
#define AW_ERR_CMD_TOO_MANY (9)
#define AW_ERR_EVENT_ID_INVALID (10)
#define AW_ERR_EVENT_ID_NOT_SET (11)
#define AW_ERR_GETAUDIT_FAIL (12)
#define AW_ERR_QUEUE_SIZE_INVALID (13)
#define AW_ERR_RD_INVALID (14)
#define AW_ERR_REC_TOO_BIG (15)
#define AW_ERR_NO_PLABEL (16)
#ifdef __STDC__
extern int auditwrite(int, ...); /* writes audit records */
extern int aw_errno; /* error number */
extern void aw_perror(const char *); /* print error */
extern void aw_perror_r(const int, const char *); /* print error for */
/* record descriptor */
extern int aw_geterrno(const int); /* get error for record descriptor */
extern char *aw_strerror(const int); /* format error into string */
#else
extern int auditwrite();
extern int aw_errno;
extern void aw_perror();
extern void aw_perror_r();
extern int aw_geterrno();
extern char *aw_strerror();
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif
#endif /* _BSM_AUDITWRITE_H */