/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#ifndef _BSM_LIBBSM_H
#define _BSM_LIBBSM_H
#include <ctype.h>
#include <secdb.h>
#include <stdio.h>
#include <errno.h>
#include <bsm/audit_record.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef TEXT_DOMAIN
#endif
extern const char *bsm_dom;
/*
* For audit_event(5)
*/
struct au_event_ent {
char *ae_name;
char *ae_desc;
};
/*
* For audit_class(5)
*/
struct au_class_ent {
char *ac_name;
char *ac_desc;
};
/*
* For audit_user(5)
*/
struct au_user_ent {
char *au_name;
};
/*
* Internal representation of audit user in libnsl
*/
typedef struct au_user_str_s {
char *au_name;
char *au_always;
char *au_never;
/*
* adrf's version of adr_t
*/
typedef struct adrf_s {
} adrf_t;
/*
* Functions that manipulate bytes from an audit file
*/
extern int adrf_short(adrf_t *, short *, int);
/*
* Functions that manipulate bytes from an audit character stream.
*/
extern void adrm_start(adr_t *, char *);
extern void adrm_short(adr_t *, short *, int);
/*
* Functions that do I/O for audit files
*/
extern int au_close(int, int, au_event_t);
extern int au_open(void);
/*
* Functions than manipulate audit events
*/
extern void setauevent(void);
extern void endauevent(void);
extern au_event_ent_t *getauevent(void);
extern au_event_ent_t *getauevnam(char *);
extern au_event_t getauevnonam(char *);
/*
* Functions that manipulate audit classes
*/
extern void setauclass(void);
extern void endauclass(void);
extern int cacheauclassnam(au_class_ent_t **, char *);
extern au_class_ent_t *getauclassent(void);
extern au_class_ent_t *getauclassnam(char *);
/*
* Functions that manipulate audit masks
*/
extern int au_user_mask(char *, au_mask_t *);
extern int getauditflagsbin(char *, au_mask_t *);
extern int getauditflagschar(char *, au_mask_t *, int);
/*
* Functions that do system calls
*/
extern int audit(char *, int);
extern int auditdoor(int);
extern int getaudit(auditinfo_t *);
extern int getaudit_addr(auditinfo_addr_t *, int);
extern int setaudit(auditinfo_t *);
extern int setaudit_addr(auditinfo_addr_t *, int);
/*
* Defines for au_preselect(3)
*/
#define AU_PRS_USECACHE 0
/*
* Defines for cacheauclass and cacheauevent
*/
/* Flags for user-level audit routines: au_open, au_close, au_to_ */
#define AU_TO_NO_WRITE 0
/* system audit files for auditd */
/* array sizes for audit library structures */
/*
* Some macros used internally by the nsswitch code
*/
#define AUDITUSER_SUCCESS 0
/*
* indices of searchable columns
*/
#ifdef __cplusplus
}
#endif
#endif /* _BSM_LIBBSM_H */