196N/A/*
943N/A * Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved.
919N/A *
919N/A * Permission is hereby granted, free of charge, to any person obtaining a
919N/A * copy of this software and associated documentation files (the "Software"),
919N/A * to deal in the Software without restriction, including without limitation
919N/A * the rights to use, copy, modify, merge, publish, distribute, sublicense,
919N/A * and/or sell copies of the Software, and to permit persons to whom the
919N/A * Software is furnished to do so, subject to the following conditions:
919N/A *
919N/A * The above copyright notice and this permission notice (including the next
919N/A * paragraph) shall be included in all copies or substantial portions of the
919N/A * Software.
919N/A *
919N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
919N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
919N/A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
919N/A * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
919N/A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
919N/A * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
919N/A * DEALINGS IN THE SOFTWARE.
196N/A */
196N/A
196N/A#ifndef _BSM_AUDITWRITE_H
196N/A#define _BSM_AUDITWRITE_H
196N/A
196N/A
196N/A#include <bsm/libbsm.h>
196N/A#include <tsol/label.h>
196N/A#include <sys/tsol/label_macro.h>
196N/A
196N/A#ifdef __cplusplus
196N/Aextern "C" {
196N/A#endif
196N/A
196N/A
196N/A/*
196N/A * This file contains declarations and defines for use with
196N/A * auditwrite(3).
196N/A */
196N/A
196N/A/* Mandatory last arg on auditwrite(3) invocation line */
196N/A
196N/A#define AW_END (0)
196N/A
196N/A/* control commands */
196N/A
196N/A#define AW_ABORT (1) /* Stop everything. */
196N/A#define AW_APPEND (2) /* Append to recbuf. */
196N/A#define AW_DEFAULTRD (3) /* Use default rd. */
196N/A#define AW_DISCARD (4) /* Discard all audit recs. */
196N/A#define AW_DISCARDRD (5) /* Discard one audit rec. */
196N/A#define AW_FLUSH (6) /* Flush queued recbufs. */
196N/A#define AW_GETRD (7) /* Get a recbuf descriptor. */
196N/A#define AW_NOPRESELECT (8) /* No user level preselection */
196N/A#define AW_NOQUEUE (9) /* Stop queueing. Flush. */
196N/A#define AW_NOSAVE (10) /* Don't attach save buffer. */
196N/A#define AW_NOSERVER (11) /* We're not a trusted server. */
196N/A#define AW_PRESELECT (12) /* Do user level preselection. */
196N/A#define AW_QUEUE (13) /* Buffer all records. */
196N/A#define AW_SAVERD (14) /* Attach save buffer. */
196N/A#define AW_SERVER (15) /* We're a trusted server. */
196N/A#define AW_USERD (16) /* Use recbuf descriptor. */
196N/A#define AW_WRITE (17) /* Write to trail. */
196N/A
196N/A/*
196N/A * Attribute commands. These tell audiwrite(3) what kind
196N/A * of data to expect.
196N/A */
196N/A
196N/A#define AW_ACL (25)
196N/A#define AW_ARG (26)
196N/A#define AW_ATTR (27)
196N/A#define AW_DATA (28)
196N/A#define AW_EVENT (29)
196N/A#define AW_EVENTNUM (30)
196N/A#define AW_EXEC_ARGS (31)
196N/A#define AW_EXEC_ENV (32)
196N/A#define AW_EXIT (33)
196N/A#define AW_GROUPS (34)
196N/A#define AW_INADDR (35)
196N/A#define AW_IN_ADDR AW_INADDR
196N/A#define AW_IPC (36)
196N/A#define AW_IPORT (38)
196N/A#define AW_OPAQUE (39)
196N/A#define AW_PATH (40)
196N/A#define AW_PROCESS (41)
196N/A#define AW_RETURN (42)
196N/A#define AW_SOCKET (43)
196N/A#define AW_SUBJECT (44)
196N/A#define AW_TEXT (45)
196N/A#define AW_UAUTH (46)
196N/A#define AW_CMD (47)
196N/A
196N/A#define AW_LEVEL (52)
196N/A#define AW_LIAISON (53)
196N/A#define AW_PRIVILEGE (54) /* OBSOLETE */
196N/A#define AW_SLABEL (55)
196N/A#define AW_USEOFPRIV (56)
196N/A
196N/A#define AW_XATOM (60)
196N/A#define AW_XCOLORMAP (61)
196N/A#define AW_XCURSOR (62)
196N/A#define AW_XFONT (63)
196N/A#define AW_XGC (64)
196N/A#define AW_XOBJ (65) /* OBSOLETE */
196N/A#define AW_XPIXMAP (66)
196N/A#define AW_XPROPERTY (67)
196N/A#define AW_XPROTO (68) /* OBSOLETE */
196N/A#define AW_XSELECT (69)
196N/A#define AW_XWINDOW (70)
196N/A#define AW_XCLIENT (71)
196N/A#define AW_PROCESS_EX (72)
196N/A/*
196N/A * The next is the last and highest numbered valid command code; if more
196N/A * are added, remember to update AW_CMD_MAX in auditwrite.c.
196N/A */
303N/A#define AW_SUBJECT_EX (73)
196N/A
196N/A/*
196N/A * describe data specified with AW_DATA
196N/A */
196N/A
196N/A#define AWD_BYTE ((char)1)
196N/A#define AWD_CHAR ((char)2)
196N/A#define AWD_SHORT ((char)3)
196N/A#define AWD_INT ((char)4)
196N/A#define AWD_LONG ((char)5)
196N/A#define AWD_INT32 ((char)6)
196N/A#define AWD_INT64 ((char)7)
196N/A
196N/A/*
196N/A * describe how to print data specified with AW_DATA
196N/A */
196N/A
196N/A#define AWD_BINARY ((char)1)
196N/A#define AWD_OCTAL ((char)2)
196N/A#define AWD_DECIMAL ((char)3)
196N/A#define AWD_HEX ((char)4)
196N/A#define AWD_STRING ((char)5)
196N/A
196N/A/*
196N/A * auditwrite(3) error indicators
196N/A */
196N/A
196N/A#define AW_ERR_NO_ERROR (0)
196N/A
196N/A#define AW_ERR_ADDR_INVALID (1)
196N/A#define AW_ERR_ALLOC_FAIL (2)
196N/A#define AW_ERR_AUDITON_FAIL (3)
196N/A#define AW_ERR_AUDIT_FAIL (4)
196N/A#define AW_ERR_CMD_INCOMPLETE (5)
196N/A#define AW_ERR_CMD_INVALID (6)
196N/A#define AW_ERR_CMD_IN_EFFECT (7)
196N/A#define AW_ERR_CMD_NOT_IN_EFFECT (8)
196N/A#define AW_ERR_CMD_TOO_MANY (9)
196N/A#define AW_ERR_EVENT_ID_INVALID (10)
196N/A#define AW_ERR_EVENT_ID_NOT_SET (11)
196N/A#define AW_ERR_GETAUDIT_FAIL (12)
196N/A#define AW_ERR_QUEUE_SIZE_INVALID (13)
196N/A#define AW_ERR_RD_INVALID (14)
196N/A#define AW_ERR_REC_TOO_BIG (15)
196N/A#define AW_ERR_NO_PLABEL (16)
196N/A
196N/A#ifdef __STDC__
196N/Aextern int auditwrite(int, ...); /* writes audit records */
196N/Aextern int aw_errno; /* error number */
196N/Aextern void aw_perror(const char *); /* print error */
196N/Aextern void aw_perror_r(const int, const char *); /* print error for */
196N/A /* record descriptor */
196N/Aextern int aw_geterrno(const int); /* get error for record descriptor */
196N/Aextern char *aw_strerror(const int); /* format error into string */
196N/A#else
196N/Aextern int auditwrite();
196N/Aextern int aw_errno;
196N/Aextern void aw_perror();
196N/Aextern void aw_perror_r();
196N/Aextern int aw_geterrno();
196N/Aextern char *aw_strerror();
196N/A#endif /* __STDC__ */
196N/A
196N/A#ifdef __cplusplus
196N/A}
196N/A#endif
196N/A
196N/A#endif /* _BSM_AUDITWRITE_H */