1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22 /* 23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27 #ifndef _FMD_LOG_IMPL_H 28 #define _FMD_LOG_IMPL_H 29 30 #pragma ident "%Z%%M% %I% %E% SMI" 31 32 #include <sys/types.h> 33 #include <sys/stat.h> 34 #include <exacct.h> 35 #include <fmd_log.h> 36 37 #ifdef __cplusplus 38 extern "C" { 39 #endif 40 41 struct fmd_log { 42 struct stat64 log_stat; /* fstat64() information for log file */ 43 ea_file_t log_ea; /* libexacct handle for log file */ 44 char *log_path; /* log file pathname used for open */ 45 char *log_version; /* creator version string */ 46 char *log_label; /* label indicating type */ 47 char *log_osrelease; /* uname -r at log creation time */ 48 char *log_osversion; /* uname -v at log creation time */ 49 char *log_platform; /* uname -i at log creation time */ 50 int log_abi; /* abi version of library client */ 51 int log_errno; /* err from last library call */ 52 int log_fd; /* file descriptor for log */ 53 int log_flags; /* miscellaneous flags (see below) */ 54 struct fmd_log *log_xrefs; /* list of cross-referenced logs */ 55 struct fmd_log *log_xnext; /* next log on cross-reference list */ 56 }; 57 58 #define FMD_LF_EAOPEN 0x1 /* log_ea is open and active */ 59 #define FMD_LF_START 0x2 /* log is at start of iter */ 60 #define FMD_LF_XREFS 0x4 /* log xrefs have been loaded */ 61 #define FMD_LF_DEBUG 0x8 /* print debug messages for this log */ 62 63 typedef struct fmd_log_filtvec { 64 const fmd_log_filter_t *filt_argv; /* set of equivalent filters to OR */ 65 uint_t filt_argc; /* number of total filters to AND */ 66 } fmd_log_filtvec_t; 67 68 #define EFDL_BASE 1000 /* base value for libfmd_log errnos */ 69 70 enum { 71 EFDL_VERSION = EFDL_BASE, /* invalid library client version */ 72 EFDL_NOMEM, /* memory allocation failure */ 73 EFDL_BADHDR, /* invalid fmd file header */ 74 EFDL_NOCLASS, /* record does not contain class */ 75 EFDL_BADTAG, /* invalid exacct catalog tag */ 76 EFDL_BADREF, /* invalid cross-reference group */ 77 EFDL_BADDEV, /* invalid cross-reference dev_t */ 78 /* 79 * Note: EFDL_EXACCT must be the final internal errno definition so we 80 * can store libexacct ea_error() values as EFDL_EXACCT + ea_error(). 81 */ 82 EFDL_EXACCT /* exacct error (must be last!) */ 83 }; 84 85 #ifdef __cplusplus 86 } 87 #endif 88 89 #endif /* _FMD_LOG_IMPL_H */ 90