_audit.h revision 2020b2b6df0384feda1732f65486c4604fbf5bea
/*
* 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 __AUDIT_DOT_H
#define __AUDIT_DOT_H
#ifndef _ASM
#include <rtld.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Define all auditing structures.
*
* A shared object may be a client of one or more audit libraries. Calls to an
* auditor are accompanied with cookies that identify an object being audited.
* These cookies are initialized to the link-map pointers of the object being
* audited, however the auditor is free to re-allocate these cookies, and thus
* associate their own data with each object being audited.
*
* With auditing version LAV_VERSION5, local auditors can provide la_preinit()
* and la_activity() routines, each of which should be passed a cookie that
* represents the link-map of the head of the associated link-map list. These
* cookies are maintained on the associated link-map list, using the lm_cookies
* alist. These cookies are created by _audit_add_head(), and dynamically
* retrieved by the _audit_preinit() and _audit_activity() routines.
*
* Having these cookies kept on the link-map list decouples these cookies from
* the Audit_client structure of the object being locally audited. In addition,
* this model ensures that multiple objects, undergoing local auditing from the
* same auditor, receive the same head link-map cookie.
*/
typedef struct {
} Audit_client;
#define FLG_AC_BINDTO 0x00001
#define FLG_AC_BINDFROM 0x00002
/*
* Each shared object being audited may provide a list of client structures
* and dynamic plts (one per auditor).
*/
struct audit_info {
void *ai_dynplts; /* array of dynamic plts */
};
/*
* Define an Audit Descriptor - each audit object is added to this descriptor
* as an Audit Interface. There is one global audit descriptor - auditors,
* and a specific object my require its own - AUDITORS(lmp).
*/
struct audit_desc {
char *ad_name; /* originating audit names */
/* LML_TFLG_AUD_* flags */
};
/*
* Define an Audit List descriptor for each audit object.
*/
struct audit_list {
const char *al_libname; /* object name for diagnostics */
void (*al_preinit)(uintptr_t *);
uint_t);
#if defined(_ELF64)
void *, uint_t *, const char *);
uintptr_t, const char *);
#else
void *, uint_t *);
#endif /* _ELF64 */
};
/*
* Link-Edit audit functions
*/
extern void audit_desc_cleanup(Rt_map *);
extern void audit_info_cleanup(Rt_map *);
extern void audit_preinit(Rt_map *);
void *, uint_t *);
uint_t);
extern uint_t audit_flags;
#endif /* _ASM */
/*
* Values for audit_flags. Intended to be the same as the LML equivalents
* but kept in a separate variable to simplify boot_elf.s coding.
*/
#ifdef __cplusplus
}
#endif
#endif /* __AUDIT_DOT_H */