fmd_log.h revision 7ee93e3bbce920c0d0742deb6632b0939e30b783
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _FMD_LOG_H
#define _FMD_LOG_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <libnvpair.h>
#include <exacct.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Fault Management Daemon Log File Interfaces
*
* Note: The contents of this file are private to the implementation of the
* Solaris system and FMD subsystem and are subject to change at any time
* without notice. Applications and drivers using these interfaces will fail
* to run on future releases. These interfaces should not be used for any
* purpose until they are publicly documented for use outside of Sun.
*/
extern fmd_log_t *fmd_log_open(int, const char *, int *);
extern void fmd_log_close(fmd_log_t *);
extern const char *fmd_log_label(fmd_log_t *);
extern const char *fmd_log_errmsg(fmd_log_t *, int);
extern int fmd_log_errno(fmd_log_t *);
typedef struct fmd_log_header {
const char *log_creator; /* ea_get_creator(3EXACCT) string */
const char *log_hostname; /* ea_get_hostname(3EXACCT) string */
const char *log_label; /* fmd(1M) log file label */
const char *log_version; /* fmd(1M) log file version */
const char *log_osrelease; /* uname(1) -r value at creation time */
const char *log_osversion; /* uname(1) -v value at creation time */
const char *log_platform; /* uname(1) -i value at creation time */
const char *log_uuid; /* fmd(1M) log file uuid */
typedef struct fmd_log_record {
const char *rec_class; /* protocol event class */
typedef int fmd_log_err_f(fmd_log_t *, void *);
extern int fmd_log_rewind(fmd_log_t *);
typedef struct fmd_log_filter {
void *filt_arg; /* filter argument (see below) */
extern int fmd_log_filter(fmd_log_t *,
/*
* fmd_log_xiter() can be used to perform sophisticated iteration over an fmd
* log file such as that required by fmdump(1M). The arguments are as follows:
*
* fmd_log_t *lp - log to use for iteration from fmd_log_open()
* uint_t iflags - FMD_LOG_XITER_* flags (see above)
* uint_t filtc - count of number of filters (or zero for no filtering)
* fmd_log_filter_t *filtv - array of 'filtc' filter structures
* fmd_log_rec_f *rfunc - function to invoke for each record in log
* fmd_log_err_f *efunc - function to invoke for any errors in log
* void *private - argument to pass to 'rfunc' and 'efunc' callbacks
* ulong_t *cntp - pointer to storage for record count (or NULL)
*/
#ifdef __cplusplus
}
#endif
#endif /* _FMD_LOG_H */