/****************************************************************************
 *
 *	Copyright (C) 1984-2006 Micro Focus (IP) Limited.
 *	All rights reserved.
 *
 *	The software and information contained herein are
 *	proprietary to, and comprise valuable trade secrets of,
 *	Micro Focus (IP) Limited, which intends to preserve
 *	as trade secrets such software and information. This software
 *	is an unpublished copyright of Micro Focus and may not be
 *	used, copied, transmitted, or stored in any manner.  This
 *	software and information or any other copies thereof may not
 *	be provided or otherwise made available to any other person.
 *
 *	Genesis Run Time System (Studio/Server 5.0 Freeze)
 *
 *	@(#)mfaudit.h	11.3
 *
 *	Last Modified on 06/11/07 at 23:32:07
 *
 ****************************************************************************/

/** Start of source module mfaudit.h **/

#ifndef	MFAUDIT_H
#define	MFAUDIT_H

#include "mfctf.h"

struct audit_record;
struct audit_record_t;
struct audit_event;
struct audit_event_t;
struct audit_emitter_event;

/******************************************************************************/
/*  Function pointer definitions					      */
/******************************************************************************/
typedef cobrtncode_t (*PFI_COBAUD_EVENT)(cobuns32_t	    flags_p,
					 const cobuns8_t    *component_id_p,
					 struct audit_event *audit_event_p);

typedef cobrtncode_t (*PFI_COBAUD_FILE_READ)(
					cobuns32_t	    flags_p,
					cbl_os_pointer_t    auditfile_handle,
					struct audit_record *auditfile_record);

typedef cobrtncode_t (*PFI_AUD_CONFIG_PROPERTY_GET)(
					  cobuns32_t	  flags_p,
					  const cobuns8_t *property_name_p,
					  cbl_x4_comp5_t  *property_vallen_p,
					  cobuns8_t	  *property_value_p);

typedef cobrtncode_t (*PFI_AUD_CONFIG_PROPERTY_SET)(
					  cobuns32_t	  flags_p,
					  const cobuns8_t *property_name_p,
					  const cobuns8_t *property_value_p);

typedef cobrtncode_t (*PFI_AUD_EMITTER_PROPERTY_GET)(
					  cobuns32_t	  flags_p,
					  const cobuns8_t *emitter_name_p,
					  const cobuns8_t *property_name_p,
					  cbl_x4_comp5_t  *property_vallen_p,
					  cobuns8_t	  *property_value_p);

typedef cobrtncode_t (*PFI_AUD_EMITTER_PROPERTY_SET)(
					  cobuns32_t	  flags_p,
					  const cobuns8_t *emitter_name_p,
					  const cobuns8_t *property_name_p,
					  const cobuns8_t *property_value_p);

typedef cobrtncode_t (*PFI_AUD_EVENT)(cobuns32_t	   flags_p,
				      const cobuns8_t	   *component_id_p,
				      struct audit_event_t *audit_event_p);

typedef cobrtncode_t (*PFI_AUD_HANDLE_GET)(cobuns32_t      flags_p,
					   const cobuns8_t *component_name_p,
					   cbl_x4_comp5_t  *audit_handle_p);

typedef cobrtncode_t (*PFI_AUD_FILE_CLOSE)(cobuns32_t       flags_p,
					   cbl_os_pointer_t auditfile_handle);

typedef cobrtncode_t (*PFI_AUD_FILE_OPEN)(cobuns32_t      flags_p,
					  cbl_pointer_t   *auditfile_handle_p,
					  const cobuns8_t *auditfile_name_p);

typedef cobrtncode_t (*PFI_AUD_FILE_READ)(
				    cobuns32_t		  flags_p,
				    cbl_os_pointer_t      auditfile_handle,
				    struct audit_record_t *auditfile_record);


typedef int (*PFI_AUD_EMITTER_DEINIT)(cobuns32_t flags,
				      void	 *emitter_data);

typedef int (*PFI_AUD_EMITTER_INIT)(cobuns32_t		       flags,
				    const cobuns8_t	       *emitter_name,
				    struct audit_emitter_event *emitter_event,
				    void		       **emitter_data);

typedef void (*PFV_AUD_EMITTER_NOTIFY)(cobuns32_t notif_type,
				       void	  *notif_buf,
				       void	  *emitter_data);

typedef int (*PFI_AUD_EMITTER_OUTPUT)
				    (cobuns32_t			flags,
				     struct audit_emitter_event *emitter_event,
				     void			*emitter_data);

typedef int (*PFI_AUD_RESERVED)(void);

/******************************************************************************/
/*  AUDITFILE emitter user exit						      */
/******************************************************************************/

/*
**  User exit function prototype
*/
typedef cobrtncode_t (*PFI_AUDITFILE_EMITTER_EXIT)(cobuns32_t function,
						   cobuns8_t  *emitter_name,
						   ...);

/*
**  User exit name
*/
#define AUDITFILE_EXIT_NAME		    "AUDITFILE_EMITTER_EXIT"

/*
**  User exit functions
*/
#define AUDITFILE_EXIT_FUNC_INIT	    0
#define AUDITFILE_EXIT_FUNC_DEINIT	    1
#define AUDITFILE_EXIT_FUNC_FILE_ACTIVE	    2
#define AUDITFILE_EXIT_FUNC_FILE_FULL	    3
#define AUDITFILE_EXIT_FUNC_NO_FILES	    4

/******************************************************************************/
/*  CBL_AUDIT_ API control flags					      */
/******************************************************************************/

/*
**  Used by:
**
**	CBL_AUDIT_CONFIG_PROPERTY_GET
**	CBL_AUDIT_CONFIG_PROPERTY_SET
**	CBL_AUDIT_EMITTER_PROPERTY_GET
**	CBL_AUDIT_EMITTER_PROPERTY_SET
*/
#define AUDIT_FLAG_PROP_STRING_VALUE	    0x00000000
#define AUDIT_FLAG_PROP_INT_VALUE	    0x00000001
#define AUDIT_FLAG_PROP_NULL_TERM	    0x00000002

/*
**  Used by:
**
**	CBL_AUDIT_FILE_CLOSE
*/
#define AUDIT_FLAG_CLOSE_ALL		    0x00000000
#define AUDIT_FLAG_CLOSE_CURRENT	    0x00000001
#define AUDIT_FLAG_CLOSE_DUMPED		    0x00000002

/*
**  Used by:
**
**	CBL_AUDIT_FILE_OPEN
*/
#define AUDIT_FLAG_OPEN_FILE		    0x00000000
#define AUDIT_FLAG_OPEN_COLLECTION	    0x00000001
#define AUDIT_FLAG_OPEN_NAME_NULL_TERM	    0x00000002

/*
**  Used by:
**
**	CBL_AUDIT_EVENT
*/
#define AUDIT_FLAG_EVENT_ARRAY_DATA	    0x00002000

/*
**  Used by:
**
**	CBL_AUDIT_EMITTER_PROPERTY_GET
**	CBL_AUDIT_EMITTER_PROPERTY_SET
*/
#define AUDIT_FLAG_EMITTER_NAME_NULL_TERM   0x10000000

/*
**  Used by:
**
**	CBL_AUDIT_CONFIG_PROPERTY_GET
**	CBL_AUDIT_CONFIG_PROPERTY_SET
*/
#define AUDIT_FLAG_PROP_NAME_NULL_TERM	    0x20000000

/*
**  Used by:
**
**	CBL_AUDIT_EVENT
**	CBL_AUDIT_HANDLE_GET
*/
#define AUDIT_FLAG_COMP_NAME_NULL_TERM	    0x40000000

/*
**  Used by:
**
**	CBL_AUDIT_EVENT
*/
#define AUDIT_FLAG_COMPID_STRING	    0x80000000

/******************************************************************************/
/*  Audit categories							      */
/******************************************************************************/
#define AUDIT_EVENT_CATEGORY_UNKNOWN		    0
#define AUDIT_EVENT_CATEGORY_AUDIT_FACILITY	    1
#define AUDIT_EVENT_CATEGORY_SYSTEM		    2
#define AUDIT_EVENT_CATEGORY_SEC_API_REQ_CHECK	    3
#define AUDIT_EVENT_CATEGORY_SEC_API_REQ_DEFINE	    4
#define AUDIT_EVENT_CATEGORY_SEC_API_REQ_OTHER	    5
#define AUDIT_EVENT_CATEGORY_SEC_API_RES_ALLOW	    6
#define AUDIT_EVENT_CATEGORY_SEC_API_RES_DENY	    7
#define AUDIT_EVENT_CATEGORY_SEC_API_RES_ERROR	    8
#define AUDIT_EVENT_CATEGORY_SEC_API_RES_SUCCESS    9

/******************************************************************************/
/*  CBL_AUDIT_ API return codes						      */
/******************************************************************************/
#define AUDIT_RET_SUCCESS		    CTF_RET_SUCCESS
#define AUDIT_RET_FAILURE		    CTF_RET_FAILURE
#define AUDIT_RET_INVALID_HANDLE	    CTF_RET_INVALID_TRACE_HANDLE
#define AUDIT_RET_INVALID_AUDIT_CATEGORY    4
#define AUDIT_RET_NOT_ENOUGH_MEMORY	    CTF_RET_NOT_ENOUGH_MEMORY
#define AUDIT_RET_OUTPUT_ERROR		    CTF_RET_OUTPUT_ERROR
#define AUDIT_RET_PROPERTY_NOT_FOUND	    CTF_RET_PROPERTY_NOT_FOUND
#define AUDIT_RET_BUFFER_TOO_SMALL	    CTF_RET_BUFFER_TOO_SMALL
#define AUDIT_RET_VALUE_NOT_INTEGER	    CTF_RET_VALUE_NOT_INTEGER
#define AUDIT_RET_EMITTER_NOT_FOUND	    CTF_RET_EMITTER_NOT_FOUND
#define AUDIT_RET_ZERO_LENGTH_DATA	    CTF_RET_ZERO_LENGTH_DATA
#define AUDIT_RET_INVALID_PROP_NAME	    CTF_RET_INVALID_PROPERTY_NAME
#define AUDIT_RET_INVALID_COMP_NAME	    CTF_RET_INVALID_COMPONENT_NAME
#define AUDIT_RET_INVALID_EMITTER_NAME	    CTF_RET_INVALID_EMITTER_NAME
#define AUDIT_RET_NO_SERVER_PROCESS	    CTF_RET_NO_SERVER_PROCESS
#define AUDIT_RET_ACCESS_DENIED		    CTF_RET_ACCESS_DENIED

#define AUDIT_RET_FILE_NOT_EXIST	    1000
#define AUDIT_RET_FILE_NOT_AVAILABLE	    1001
#define AUDIT_RET_FILE_INVALID_FORMAT	    1002
#define AUDIT_RET_FILE_EOF		    1003
#define AUDIT_RET_FILE_NO_MORE_RECORDS	    1004
#define AUDIT_RET_FILE_INVALID_NAME	    1005
#define AUDIT_RET_FILE_NOT_DUMPED	    1006

/******************************************************************************/
/*  Structures								      */
/******************************************************************************/

/*----------------------------------------------------------------------------*/
/*  Audit Functions							      */
/*----------------------------------------------------------------------------*/
typedef struct audit_funcs
{
    cobuns32_t			    version;
    cobuns32_t			    reserved;
    PFI_AUD_CONFIG_PROPERTY_GET	    fn_config_property_get;
    PFI_AUD_CONFIG_PROPERTY_SET	    fn_config_property_set;
    PFI_AUD_EMITTER_PROPERTY_GET    fn_emitter_property_get;
    PFI_AUD_EMITTER_PROPERTY_SET    fn_emitter_property_set;
    PFI_AUD_EVENT		    fn_audit_event;
    PFI_AUD_HANDLE_GET		    fn_audit_handle_get;
    PFI_AUD_FILE_CLOSE		    fn_audit_file_close;
    PFI_AUD_FILE_OPEN		    fn_audit_file_open;
    PFI_AUD_FILE_READ		    fn_audit_file_read;
    PFI_COBAUD_EVENT		    fn_cobaud_event;
    PFI_COBAUD_FILE_READ	    fn_cobaud_file_read;
    PFI_AUD_RESERVED		    fn_reserved[16];
}AUDIT_FUNCS;

/*----------------------------------------------------------------------------*/
/*  Audit emitter function pointer table				      */
/*----------------------------------------------------------------------------*/
typedef struct audit_emitter_funcs
{
    cobuns32_t		    version;	    /* Version of structure format    */
    cobuns32_t		    reserved;	    /* Reserved for future use	      */
    PFI_AUD_EMITTER_INIT    fn_init;	    /* Function to initialise the     */
					    /* emitter			      */
    PFI_AUD_EMITTER_DEINIT  fn_deinit;	    /* Function to deinitialise the   */
					    /* emitter			      */
    PFI_AUD_EMITTER_OUTPUT  fn_output;	    /* Function to output a trace     */
					    /* event			      */
    PFV_AUD_EMITTER_NOTIFY  fn_notify;	    /* Function to handle notifcations*/
					    /* of emitter config changes      */
    PFI			    fn_reserved[4]; /* Reserved for future use	      */
} AUDIT_EMITTER_FUNCS;

/*
**  Version types (version)
*/
#define AUDIT_EMITTER_FUNCS_VERSION		    0

/*----------------------------------------------------------------------------*/
/*  Audit event details							      */
/*----------------------------------------------------------------------------*/
typedef struct audit_event
{
    cobuns32_t		version;	/* Version of structure format	      */
    cobuns32_t		flags;		/* Control flags		      */
    cobuns32_t		event_id;	/* Audit event identifier	      */
    cobuns32_t		event_category;	/* Audit event category		      */
    cobuns32_t		data_count;	/* Number of audit data items	      */
    cobuns32_t		reserved1[7];	/* Reserved for future use	      */
    cobuns32_t		*event_len;	/* Audit data item lengths	      */
    cobuns32_t		*event_type;	/* Audit data item types	      */
    void		*event_data;	/* Audit data items		      */
    void		*reserved2[7];	/* Reserved for future use	      */
}AUDIT_EVENT;

typedef struct audit_event_t
{
    cbl_x4_comp5_t	version;	/* Version of structure format	      */
    cbl_x4_comp5_t	flags;		/* Control flags		      */
    cbl_x4_comp5_t	event_id;	/* Audit event identifier	      */
    cbl_x4_comp5_t	event_category;	/* Audit event category		      */
    cbl_x4_comp5_t	data_count;	/* Number of audit data items	      */
    cbl_x4_comp5_t	reserved1[7];	/* Reserved for future use	      */
    cbl_pointer_t	event_len;	/* Audit data item lengths	      */
    cbl_pointer_t	event_type;	/* Audit data item types	      */
    cbl_pointer_t	event_data;	/* Audit data items		      */
    cbl_pointer_t	reserved2[7];	/* Reserved for future use	      */
}AUDIT_EVENT_T;

/*
**  Version types (version):
*/
#define AUDIT_EVENT_VERSION		    0

/*
**  Control flags (flags):
*/
#define AUDIT_EVENT_FLAGS_NONE		    0x00000000

/*
**  Audit data item types (event_type):
*/
#define AUDIT_EVENT_TYPE_BINARY		    TRACE_EVENT_TYPE_BINARY
#define AUDIT_EVENT_TYPE_TEXT		    TRACE_EVENT_TYPE_TEXT
#define AUDIT_EVENT_TYPE_ADDRESS	    TRACE_EVENT_TYPE_ADDRESS
#define AUDIT_EVENT_TYPE_COMP5		    TRACE_EVENT_TYPE_COMP5
#define AUDIT_EVENT_TYPE_COMPX		    TRACE_EVENT_TYPE_COMPX
#define AUDIT_EVENT_TYPE_UTF8		    TRACE_EVENT_TYPE_UTF8
#define AUDIT_EVENT_TYPE_COMP5S		    TRACE_EVENT_TYPE_COMP5S
#define AUDIT_EVENT_TYPE_COMPXS		    TRACE_EVENT_TYPE_COMPXS

#define AUDIT_EVENT_TYPE_MASK		    0x000000FF

/*----------------------------------------------------------------------------*/
/*  Audit emitter event details						      */
/*----------------------------------------------------------------------------*/
typedef struct audit_emitter_event
{
    cobuns32_t		version;	/* Version of structure format	      */
    cobuns32_t		flags;		/* Control flags		      */
    cobuns32_t		date;		/* Encoded date			      */
    cobuns32_t		time;		/* Encoded time			      */
    cobuns32_t		process_id_len;	/* Length of process identifier	      */
    cobuns32_t		thread_id_len;	/* Length of thread identifier	      */
    cobuns32_t		comp_id;	/* Component identifier		      */
    cobuns32_t		event_id;	/* Audit event identifier	      */
    cobuns32_t		event_category;	/* Audit event category		      */
    cobuns32_t		data_count;	/* Number of audit data items	      */
    cobuns32_t		reserved1[6];	/* Reserved for future use	      */

    const cobuns8_t	*process_id;	/* Process identifier		      */
    const cobuns8_t	*thread_id;	/* Thread identifier		      */
    const cobuns8_t	*appname;	/* Null-terminated application name   */
    const cobuns8_t	*cmdline;	/* Null-terminated process cmd line   */
    const cobuns8_t	*os_name;	/* Operating system name	      */
    const cobuns8_t	*mc_name;	/* Machine name			      */
    const cobuns8_t	*sys_name;	/* Null-terminated system name	      */
    const cobuns8_t	*comp_name;	/* Null-terminated component name     */
    const cobuns8_t	*auditmgr_name;	/* Null-terminated auditmgr name      */
    const cobuns32_t	*event_len;	/* Audit data item lengths	      */
    const cobuns32_t	*event_type;	/* Audit data item types	      */
    const void		**event_data;	/* Audit data items		      */
    void		*reserved2[7];	/* Reserved for future use	      */
}AUDIT_EMITTER_EVENT;

/*
**  Version types (version):
*/
#define AUDIT_EMITTER_VERSION		    0

/*
**  Control flags (flags)
*/
#define AUDIT_EMITTER_FLAGS_NONE	    0x00000000
#define AUDIT_EMITTER_FLAGS_ARRAY_DATA	    0x00000002

/*
**  Audit emiiter data types (data_type)
*/
#define AUDIT_EMITTER_DATA_TYPE_BINARY	    TRACER_EVENT_DATA_TYPE_BINARY
#define AUDIT_EMITTER_DATA_TYPE_STRING	    TRACER_EVENT_DATA_TYPE_STRING
#define AUDIT_EMITTER_DATA_TYPE_PTR	    TRACER_EVENT_DATA_TYPE_PTR
#define AUDIT_EMITTER_DATA_TYPE_COMP5	    TRACER_EVENT_DATA_TYPE_COMP5
#define AUDIT_EMITTER_DATA_TYPE_COMPX	    TRACER_EVENT_DATA_TYPE_COMPX
#define AUDIT_EMITTER_DATA_TYPE_UTF8	    TRACER_EVENT_DATA_TYPE_UTF8
#define AUDIT_EMITTER_DATA_TYPE_COMP5S	    TRACER_EVENT_DATA_TYPE_COMP5S
#define AUDIT_EMITTER_DATA_TYPE_COMPXS	    TRACER_EVENT_DATA_TYPE_COMPXS

/*----------------------------------------------------------------------------*/
/*  Audit record details						      */
/*----------------------------------------------------------------------------*/
typedef struct audit_record
{
    cobuns32_t		version;	/* Version of structure format	      */
    cobuns32_t		flags;		/* Control flags		      */

    cobuns32_t		process_id_len;	/* Process identifier length	      */
    cobuns32_t		thread_id_len;	/* Thread identifier length	      */

    union
    {
	cobuns32_t	process_id_32;	/* Process identifier (32-bit)	      */
	cobuns64_t	process_id_64;	/* Process identifier (64-bit)	      */
    }p;

    union
    {
	cobuns32_t	thread_id_32;	/* Thread identifier (32-bit)	      */
	cobuns64_t	thread_id_64;	/* Thread identifier (64-bit)	      */
    }t;

    cobuns32_t		event_id;	/* Audit event identifier	      */
    cobuns32_t		event_category;	/* Audit event category		      */
    cobuns32_t		data_count;	/* Number of audit data items	      */
    cobuns32_t		appname_len;	/* Application name length	      */
    cobuns32_t		cmdline_len;	/* Process command line length	      */
    cobuns32_t		os_name_len;	/* Operating system name length	      */
    cobuns32_t		mc_name_len;	/* Machine name length		      */
    cobuns32_t		sys_name_len;	/* System name length		      */
    cobuns32_t		comp_name_len;	/* Component name length	      */

    cobuns32_t		time;		/* Encoded time			      */
    cobuns32_t		hour;		/* Decoded hour			      */
    cobuns32_t		minute;		/* Decoded minute		      */
    cobuns32_t		second;		/* Decoded second		      */
    cobuns32_t		millisecond;	/* Decoded millisecond		      */
    cobuns32_t		date;		/* Encoded date			      */
    cobuns32_t		year;		/* Decoded year			      */
    cobuns32_t		month;		/* Decoded month		      */
    cobuns32_t		day;		/* Decoded day			      */

    cobuns32_t		reserved1[7];	/* Reserved for future use	      */

    const cobuns8_t	*appname;	/* Null-terminated application name   */
    const cobuns8_t	*cmdline;	/* Null-terminated process cmd line   */
    const cobuns8_t	*os_name;	/* Operating system name	      */
    const cobuns8_t	*mc_name;	/* Machine name			      */
    const cobuns8_t	*sys_name;	/* Null-terminated system name	      */
    const cobuns8_t	*comp_name;	/* Null-terminated component name     */
    cobuns32_t		*event_len;	/* Audit data item lengths	      */
    cobuns32_t		*event_type;	/* Audit data item types	      */
    void		*event_data;	/* Audit data items		      */
    void		*reserved2[7];	/* Reserved for future use	      */
}AUDIT_RECORD;

typedef struct audit_record_t
{
    cbl_x4_comp5_t	version;	/* Version of structure format	      */
    cbl_x4_comp5_t	flags;		/* Control flags		      */

    cbl_x4_comp5_t	process_id_len;	/* Process identifier length	      */
    cbl_x4_comp5_t	thread_id_len;	/* Thread identifier length	      */

    union
    {
	cbl_x4_comp5_t	process_id_32;	/* Process identifier (32-bit)	      */
	cbl_x8_comp5_t	process_id_64;	/* Process identifier (64-bit)	      */
    }p;

    union
    {
	cbl_x4_comp5_t	thread_id_32;	/* Thread identifier (32-bit)	      */
	cbl_x8_comp5_t	thread_id_64;	/* Thread identifier (64-bit)	      */
    }t;

    cbl_x4_comp5_t	event_id;	/* Audit event identifier	      */
    cbl_x4_comp5_t	event_category;	/* Audit event category		      */
    cbl_x4_comp5_t	data_count;	/* Number of audit data items	      */
    cbl_x4_comp5_t	appname_len;	/* Application name length	      */
    cbl_x4_comp5_t	cmdline_len;	/* Process command line length	      */
    cbl_x4_comp5_t	os_name_len;	/* Operating system name length	      */
    cbl_x4_comp5_t	mc_name_len;	/* Machine name length		      */
    cbl_x4_comp5_t	sys_name_len;	/* System name length		      */
    cbl_x4_comp5_t	comp_name_len;	/* Component name length	      */

    cbl_x4_comp5_t	time;		/* Encoded time			      */
    cbl_x4_comp5_t	hour;		/* Decoded hour			      */
    cbl_x4_comp5_t	minute;		/* Decoded minute		      */
    cbl_x4_comp5_t	second;		/* Decoded second		      */
    cbl_x4_comp5_t	millisecond;	/* Decoded millisecond		      */
    cbl_x4_comp5_t	date;		/* Encoded date			      */
    cbl_x4_comp5_t	year;		/* Decoded year			      */
    cbl_x4_comp5_t	month;		/* Decoded month		      */
    cbl_x4_comp5_t	day;		/* Decoded day			      */

    cbl_x4_comp5_t	reserved1[7];	/* Reserved for future use	      */

    cbl_pointer_t	appname;	/* Null-terminated application name   */
    cbl_pointer_t	cmdline;	/* Null-terminated process cmd line   */
    cbl_pointer_t	os_name;	/* Null-terminated OS name	      */
    cbl_pointer_t	mc_name;	/* Null-terminated machine name	      */
    cbl_pointer_t	sys_name;	/* Null-terminated system name	      */
    cbl_pointer_t	comp_name;	/* Null-terminated component name     */
    cbl_pointer_t	event_len;	/* Audit data item lengths	      */
    cbl_pointer_t	event_type;	/* Audit data item types	      */
    cbl_pointer_t	event_data;	/* Audit data items		      */
    cbl_pointer_t	reserved2[7];	/* Reserved for future use	      */
}AUDIT_RECORD_T;

/*
**  Version types (version):
*/
#define AUDIT_RECORD_VERSION		    0

/*
**  Control flags (flags)
*/
#define AUDIT_RECORD_FLAGS_NONE		    0x00000000

/*
**  Audit record data types (data_type)
*/
#define AUDIT_RECORD_DATA_TYPE_BINARY	    TRACER_EVENT_DATA_TYPE_BINARY
#define AUDIT_RECORD_DATA_TYPE_STRING	    TRACER_EVENT_DATA_TYPE_STRING
#define AUDIT_RECORD_DATA_TYPE_PTR	    TRACER_EVENT_DATA_TYPE_PTR
#define AUDIT_RECORD_DATA_TYPE_COMP5	    TRACER_EVENT_DATA_TYPE_COMP5
#define AUDIT_RECORD_DATA_TYPE_COMPX	    TRACER_EVENT_DATA_TYPE_COMPX
#define AUDIT_RECORD_DATA_TYPE_UTF8	    TRACER_EVENT_DATA_TYPE_UTF8
#define AUDIT_RECORD_DATA_TYPE_COMP5S	    TRACER_EVENT_DATA_TYPE_COMP5S
#define AUDIT_RECORD_DATA_TYPE_COMPXS	    TRACER_EVENT_DATA_TYPE_COMPXS

/******************************************************************************/
/*  APIs								      */
/******************************************************************************/
cobrtncode_t CBL_AUDIT_CONFIG_PROPERTY_GET(cobuns32_t      flags_p,
					   const cobuns8_t *property_name_p,
					   cbl_x4_comp5_t  *property_vallen_p,
					   cobuns8_t       *property_value_p);

cobrtncode_t CBL_AUDIT_CONFIG_PROPERTY_SET(cobuns32_t      flags_p,
					   const cobuns8_t *property_name_p,
					   const cobuns8_t *property_value_p);

cobrtncode_t CBL_AUDIT_EMITTER_PROPERTY_GET(cobuns32_t	    flags_p,
					    const cobuns8_t *emitter_name_p,
					    const cobuns8_t *property_name_p,
					    cbl_x4_comp5_t  *property_vallen_p,
					    cobuns8_t	    *property_value_p);

cobrtncode_t CBL_AUDIT_EMITTER_PROPERTY_SET(cobuns32_t	    flags_p,
					    const cobuns8_t *emitter_name_p,
					    const cobuns8_t *property_name_p,
					    const cobuns8_t *property_value_p);

cobrtncode_t CBL_AUDIT_EVENT(cobuns32_t	     flags_p,
			     const cobuns8_t *component_id_p,
			     AUDIT_EVENT_T   *audit_event_p);

cobrtncode_t CBL_AUDIT_HANDLE_GET(cobuns32_t      flags_p,
				  const cobuns8_t *component_name_p,
				  cbl_x4_comp5_t  *audit_handle_p);

cobrtncode_t CBL_AUDIT_FILE_CLOSE(cobuns32_t	   flags_p,
				  cbl_os_pointer_t auditfile_handle);

cobrtncode_t CBL_AUDIT_FILE_OPEN(cobuns32_t      flags_p,
				 cbl_pointer_t   *auditfile_handle_p,
				 const cobuns8_t *auditfile_name_p);

cobrtncode_t CBL_AUDIT_FILE_READ(cobuns32_t       flags_p,
				 cbl_os_pointer_t auditfile_handle,
				 AUDIT_RECORD_T	  *auditfile_record);

cobrtncode_t cobaudit_event(cobuns32_t	    flags_p,
			    const cobuns8_t *component_id_p,
			    AUDIT_EVENT	    *audit_event_p);

cobrtncode_t cobaudit_file_read(cobuns32_t	 flags_p,
				cbl_os_pointer_t auditfile_handle,
				AUDIT_RECORD	 *auditfile_record);

/******************************************************************************/
/*  Externals								      */
/******************************************************************************/

#endif	/* MFAUDIT_H */

/** End of source module mfaudit.h **/
