xref: /titanic_51/usr/src/lib/auditd_plugins/auditd.h (revision 8f775e0a5fbe731ba531e9ef613571bdb0adf6b3)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*8f775e0aSJan Friedel  * Common Development and Distribution License (the "License").
6*8f775e0aSJan Friedel  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*8f775e0aSJan Friedel  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  *
257c478bd9Sstevel@tonic-gate  * This is an unstable interface; changes may be made without
267c478bd9Sstevel@tonic-gate  * notice.
277c478bd9Sstevel@tonic-gate  */
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #ifndef	_AUDITD_H
307c478bd9Sstevel@tonic-gate #define	_AUDITD_H
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate #include <secdb.h>
337c478bd9Sstevel@tonic-gate #include <sys/types.h>
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate #ifdef __cplusplus
367c478bd9Sstevel@tonic-gate extern "C" {
377c478bd9Sstevel@tonic-gate #endif
387c478bd9Sstevel@tonic-gate 
397c478bd9Sstevel@tonic-gate /*
407c478bd9Sstevel@tonic-gate  * "WARN" errors trigger calls to audit_warn
417c478bd9Sstevel@tonic-gate  */
427c478bd9Sstevel@tonic-gate enum auditd_rc {
437c478bd9Sstevel@tonic-gate 	AUDITD_SUCCESS,	/*   ok						*/
447c478bd9Sstevel@tonic-gate 	AUDITD_RETRY,	/*   retry after a delay	(WARN retry)	*/
457c478bd9Sstevel@tonic-gate 	AUDITD_NO_MEMORY, /* can't allocate memory	(WARN no_memory) */
467c478bd9Sstevel@tonic-gate 	AUDITD_INVALID,	/*   bad input			(WARN invalid)	*/
477c478bd9Sstevel@tonic-gate 	AUDITD_COMM_FAIL, /* communications failure			*/
487c478bd9Sstevel@tonic-gate 	AUDITD_FATAL,	/*   other error		(WARN failure)	*/
497c478bd9Sstevel@tonic-gate 	AUDITD_FAIL	/*   other non-fatal error			*/
507c478bd9Sstevel@tonic-gate };
517c478bd9Sstevel@tonic-gate typedef enum auditd_rc auditd_rc_t;
527c478bd9Sstevel@tonic-gate 
537c478bd9Sstevel@tonic-gate /*
547c478bd9Sstevel@tonic-gate  * auditd_plugin()
557c478bd9Sstevel@tonic-gate  *	arg 1 - input buffer, binary Solaris audit record
567c478bd9Sstevel@tonic-gate  *	arg 2 - input buffer length
577c478bd9Sstevel@tonic-gate  *	arg 3 - record sequence number
587c478bd9Sstevel@tonic-gate  *	arg 4 - optional explanation of error return (use NULL,
597c478bd9Sstevel@tonic-gate  *		not an empty string if not used.)
607c478bd9Sstevel@tonic-gate  */
61*8f775e0aSJan Friedel auditd_rc_t	auditd_plugin(const char *, size_t, uint64_t, char **);
627c478bd9Sstevel@tonic-gate /*
637c478bd9Sstevel@tonic-gate  * auditd_plugin_open()
647c478bd9Sstevel@tonic-gate  *	arg 1 - attr/val struct, use with kva_match()
657c478bd9Sstevel@tonic-gate  *	arg 2 - attr/value pair string:  attr1=value1;attr2=value2
667c478bd9Sstevel@tonic-gate  *	arg 3 - optional explanation of error return (use NULL,
677c478bd9Sstevel@tonic-gate  *		not an empty string if not used.)
687c478bd9Sstevel@tonic-gate  *
697c478bd9Sstevel@tonic-gate  *	make local copy of args 1 and 2; they are trashed after return.
707c478bd9Sstevel@tonic-gate  */
717c478bd9Sstevel@tonic-gate auditd_rc_t	auditd_plugin_open(const kva_t *, char **, char **);
727c478bd9Sstevel@tonic-gate 
737c478bd9Sstevel@tonic-gate /*
747c478bd9Sstevel@tonic-gate  * auditd_plugin_close()
757c478bd9Sstevel@tonic-gate  *	arg 1 - optional explanation of error return (use NULL,
767c478bd9Sstevel@tonic-gate  *		not an empty string if not used.)
777c478bd9Sstevel@tonic-gate  */
787c478bd9Sstevel@tonic-gate auditd_rc_t	auditd_plugin_close(char **);
797c478bd9Sstevel@tonic-gate 
807c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
817c478bd9Sstevel@tonic-gate }
827c478bd9Sstevel@tonic-gate #endif
837c478bd9Sstevel@tonic-gate 
847c478bd9Sstevel@tonic-gate #endif	/* _AUDITD_H */
85