Audit File Logger
[Logging Modules]


Files

file  xdm_file.c
 OpenXDAS loadable back-end logger for a simple file-based audit log.

Defines

#define strnenv(d, s, n)   ((strncpy((d),(s),(n)-1)[(n)-1] = 0),(d))
#define XDM_ALOGPATH   LSTDIR "/log"
#define XDMAPI
#define XDMEXP
#define FOPEN_FLAGSTR   "a"
#define XDM_ALOGFNAME   "xdas_audit.log"
#define XDM_DEF_ALOGFILE   XDM_ALOGPATH "/" XDM_ALOGFNAME
 The default audit log file path.

Functions

XDMEXP int XDMAPI xdm_append (const char **msgflds)
 XDM module append routine.
XDMEXP int XDMAPI xdm_init (void(*logmsg)(int level, const char *msg,...), char *(*getcnfstr)(const char *, char *, size_t *))
 XDM module initialization routine.
XDMEXP void XDMAPI xdm_exit (void)
 XDM module exit routine.

Variables

static char s_alogfile [FILENAME_MAX]
 The global audit log filename.
static FILE * s_file = 0
 The global audit file pointer.
static void(* s_fplogmsg )(int level, const char *msg,...)=0
 A pointer to the xdasd logmsg function.

Define Documentation

#define FOPEN_FLAGSTR   "a"

Definition at line 65 of file xdm_file.c.

Referenced by xdm_init().

#define strnenv ( d,
s,
 )     ((strncpy((d),(s),(n)-1)[(n)-1] = 0),(d))

Definition at line 61 of file xdm_file.c.

Referenced by xdasd_conf_set_defaults(), xdasd_parse_cmdline(), and xdm_init().

#define XDM_ALOGFNAME   "xdas_audit.log"

Definition at line 68 of file xdm_file.c.

#define XDM_ALOGPATH   LSTDIR "/log"

Definition at line 62 of file xdm_file.c.

#define XDM_DEF_ALOGFILE   XDM_ALOGPATH "/" XDM_ALOGFNAME

The default audit log file path.

Definition at line 71 of file xdm_file.c.

Referenced by xdm_init().

#define XDMAPI

Definition at line 63 of file xdm_file.c.

#define XDMEXP

Definition at line 64 of file xdm_file.c.


Function Documentation

XDMEXP int XDMAPI xdm_append ( const char **  msgflds  ) 

XDM module append routine.

Parameters:
[in] msgflds - an array of 34 char ptrs that point into the message at the start of each field. The last pointer (numbered 33) points to the byte that is 2 beyond the last printable character of the last field.
Returns:
Zero on success, -1 if the audit record cannot be written to storage.

For internal use only.

Definition at line 92 of file xdm_file.c.

References s_file.

XDMEXP void XDMAPI xdm_exit ( void   ) 

XDM module exit routine.

For internal use only.

Definition at line 132 of file xdm_file.c.

References s_file.

Referenced by xdm_init().

XDMEXP int XDMAPI xdm_init ( void(*)(int level, const char *msg,...)  logmsg,
char *(*)(const char *, char *, size_t *)  getcnfstr 
)

XDM module initialization routine.

Returns:
Zero on success, or -1 on initialization failure.

For internal use only.

Definition at line 106 of file xdm_file.c.

References FOPEN_FLAGSTR, s_alogfile, s_file, s_fplogmsg, strnenv, void(), and XDM_DEF_ALOGFILE.


Variable Documentation

char s_alogfile[FILENAME_MAX] [static]

The global audit log filename.

Definition at line 74 of file xdm_file.c.

Referenced by xdm_init().

FILE* s_file = 0 [static]

The global audit file pointer.

Definition at line 77 of file xdm_file.c.

Referenced by xdm_append(), xdm_exit(), and xdm_init().

void(* s_fplogmsg)(int level, const char *msg,...)=0 [static]

A pointer to the xdasd logmsg function.

Referenced by logsqlerr(), ns_connect(), ns_write(), xdm_append(), and xdm_init().


Generated on Thu Aug 20 22:33:07 2009 for OpenXDAS by  doxygen 1.5.6