/*
* 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
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* File name: praudit.h
* praudit.c defines, globals
*/
#ifndef _PRAUDIT_H
#define _PRAUDIT_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/* DEFINES */
/*
* output value types
*/
#define PRA_INT32 0
/*
* Formatting flags
*/
/*
* source of audit data (data_mode)
*/
/*
* max. number of audit file names entered on command line
*/
/*
* max. size of file name
*/
/*
* used to store value to be output
*/
typedef union u_tag {
short short_val;
char char_val;
char uchar_val;
char *string_val;
} u_tag_t;
typedef struct u_val {
int uvaltype;
} uval_t;
/*
* Strings and things for xml prolog & ending printing.
*/
"'-//Sun Microsystems, Inc.//DTD Audit V1//EN' " \
/* Special main element: */
/*
* used to save context for print_audit and related functions.
*/
struct pr_context {
int format;
int data_mode;
int audit_rec_len;
char *audit_rec_start;
char *inbuf_start;
/* header or file token in the input */
int inbuf_totalsize;
char *outbuf_p;
char *outbuf_start;
/* header or file token in the output */
int outbuf_remain_len;
};
extern void init_tokens(void);
extern int is_file_token(int);
extern int is_header_token(int);
extern int is_token(int);
extern char *bu2string(char basic_unit);
extern int convert_char_to_string(char printmode, char c, char *p);
extern int convert_short_to_string(char printmode, short c, char *p);
extern char *htp2string(char print_sugg);
/*
* Functions that format audit data
*/
extern int print_audit(const int, const char *);
extern int print_audit_buf(char **, int *, char **, int *, const int,
const char *);
extern void print_audit_xml_prolog(void);
extern void print_audit_xml_ending(void);
extern int print_audit_xml_prolog_buf(char *out_buf,
const int out_buf_len);
extern int print_audit_xml_ending_buf(char *out_buf,
const int out_buf_len);
#ifdef __cplusplus
}
#endif
#endif /* _PRAUDIT_H */