xdas.c File Reference

OpenXDAS Linux Kernel Submit API implementation. More...

#include <xdas.h>

Go to the source code of this file.

Data Structures

struct  xdas_session_tag
 The internal representation of an xdas_audit_ref_t session handle. More...
struct  xdas_record_tag
 The internal representation of an xdas_audit_rec_desc_t record handle. More...

Defines

#define XDAS_AUDIT_SERVICE   0x00000001
#define XDAS_AUDIT_SUBMIT   0x00000002
#define XDAS_AUDIT_IMPORT   0x00000004
#define XDAS_AUDIT_CONTROL   0x00000008
#define XDAS_AUDIT_READ   0x00000010
#define malloc(x)   kmalloc(GFP_ATOMIC,(x))
#define free(x)   kfree(x)
#define xdas_assert(x)   (void)0
#define xdas_elemcount(x)   (sizeof(x)/sizeof(*(x)))
#define ORG_FLD_COUNT   6
#define INT_FLD_COUNT   3
#define TGT_FLD_COUNT   6
#define MAX_TIME_SOURCE   1024
#define MAX_TIME_ZONE   128
#define XDAS_SESSION_SIG   0x58444153
#define XDAS_RECORD_SIG   0x52435244
#define XDAS_LAF_TYPE   7000
#define FLD_DELIMS   ":"
#define ESC_CHAR   '%'

Typedefs

typedef struct xdas_session_tag xdas_session
typedef struct xdas_record_tag xdas_record

Functions

static int __init xdas_module_init (void)
static void __exit xdas_module_exit (void)
static char * strdup (const char *s)
static xdas_sessionxdas_validate_session (xdas_audit_ref_t das_ref)
static void xdas_set_session_rights (xdas_session *xs)
static int xdas_session_has_rights (xdas_session *xs, unsigned rights)
static int xdas_set_time_info (xdas_session *xs)
static void xdas_exit_laf (xdas_session *xs)
static int xdas_service_connect (int *minor, xdas_session *xs)
static void xdas_internal_terminate_session (xdas_session *xs)
static size_t xdas_calc_max_record_len (xdas_session *xs, xdas_record *xr)
static int xdas_format_record (xdas_session *xs, xdas_record *xr)
static xdas_recordxdas_validate_record (xdas_audit_rec_desc_t record_ref)
static unsigned xdas_get_next_record_number (void)
static void xdas_set_record_timestamp (xdas_record *xr)
static int xdas_is_valid_outcome (unsigned outcome)
static void xdas_internal_discard_record (xdas_record *xr)
static int xdas_send_record (int *minorp, xdas_session *xs, xdas_record *xr, int eval, int import)
static char * xdas_tokenize (char *str, const char *delims, char esc, char **nextok)
static int xdas_parse_info (const char *info, char **fields, unsigned maxflds)
XDASXPC int XDASAPI xdas_initialize_session (int *minor_status, const char *org_info, xdas_audit_ref_t *das_ref)
 Initialize an XDAS session for use within the process.
XDASXPC int XDASAPI xdas_terminate_session (int *minor_status, xdas_audit_ref_t *das_ref)
 Terminate an XDAS session.
XDASXPC int XDASAPI xdas_commit_record (int *minor_status, xdas_audit_ref_t das_ref, xdas_audit_rec_desc_t *audit_record_descriptor)
 Write a completed audit record to the associated audit stream.
XDASXPC int XDASAPI xdas_discard_record (int *minor_status, xdas_audit_ref_t das_ref, xdas_audit_rec_desc_t *audit_record_descriptor)
 Discard a previously created audit record.
XDASXPC int XDASAPI xdas_put_event_info (int *minor_status, xdas_audit_ref_t das_ref, xdas_audit_rec_desc_t *audit_record_descriptor, unsigned event_number, unsigned outcome, const char *initiator_information, const char *target_information, const char *event_information)
 Add specific event information to an audit record.
XDASXPC int XDASAPI xdas_start_record (int *minor_status, xdas_audit_ref_t das_ref, xdas_audit_rec_desc_t *audit_record_descriptor, unsigned event_number, unsigned outcome, const char *initiator_information, const char *target_information, const char *event_information)
 Creates a new event record object.
XDASXPC int XDASAPI xdas_timestamp_record (int *minor_status, xdas_audit_ref_t das_ref, xdas_audit_rec_desc_t audit_record_descriptor)
 Add a timestamp to the specified audit record.


Detailed Description

OpenXDAS Linux Kernel Submit API implementation.

Author:
John Calcote (jcalcote@novell.com)
Attention:
Please submit patches to http://openxdas.sourceforge.net

Definition in file xdas.c.


Define Documentation

#define ESC_CHAR   '%'

#define FLD_DELIMS   ":"

#define free (  )     kfree(x)

#define INT_FLD_COUNT   3

Definition at line 69 of file xdas.c.

#define malloc (  )     kmalloc(GFP_ATOMIC,(x))

#define MAX_TIME_SOURCE   1024

Definition at line 72 of file xdas.c.

#define MAX_TIME_ZONE   128

Definition at line 73 of file xdas.c.

#define ORG_FLD_COUNT   6

Definition at line 68 of file xdas.c.

#define TGT_FLD_COUNT   6

Definition at line 70 of file xdas.c.

#define xdas_assert (  )     (void)0

Definition at line 65 of file xdas.c.

#define XDAS_AUDIT_CONTROL   0x00000008

#define XDAS_AUDIT_IMPORT   0x00000004

Definition at line 58 of file xdas.c.

Referenced by xdas_import_event_records(), and xdas_set_session_rights().

#define XDAS_AUDIT_READ   0x00000010

#define XDAS_AUDIT_SERVICE   0x00000001

#define XDAS_AUDIT_SUBMIT   0x00000002

#define xdas_elemcount (  )     (sizeof(x)/sizeof(*(x)))

Definition at line 66 of file xdas.c.

#define XDAS_LAF_TYPE   7000

Referenced by xdas_service_connect().

#define XDAS_RECORD_SIG   0x52435244

Definition at line 90 of file xdas.c.

Referenced by xdas_start_record(), and xdas_validate_record().

#define XDAS_SESSION_SIG   0x58444153

Definition at line 77 of file xdas.c.

Referenced by xdas_initialize_session(), and xdas_validate_session().


Typedef Documentation

typedef struct xdas_record_tag xdas_record


Function Documentation

static char* strdup ( const char *  s  )  [static]

Definition at line 122 of file xdas.c.

References malloc.

Referenced by xdas_parse_info(), xdas_put_event_info(), xdas_start_record(), and xf_process_filter_attrs().

static size_t xdas_calc_max_record_len ( xdas_session xs,
xdas_record xr 
) [static]

static void xdas_exit_laf ( xdas_session xs  )  [static]

Definition at line 166 of file xdas.c.

References xdas_session_tag::ab.

Referenced by xdas_internal_terminate_session().

static int xdas_format_record ( xdas_session xs,
xdas_record xr 
) [static]

static unsigned xdas_get_next_record_number ( void   )  [static]

Definition at line 362 of file xdas.c.

Referenced by xdas_start_record().

static void xdas_internal_discard_record ( xdas_record xr  )  [static]

static void xdas_internal_terminate_session ( xdas_session xs  )  [static]

Definition at line 189 of file xdas.c.

References free, xdas_session_tag::org_info, and xdas_exit_laf().

Referenced by xdas_initialize_session(), and xdas_terminate_session().

static int xdas_is_valid_outcome ( unsigned  outcome  )  [static]

Definition at line 381 of file xdas.c.

References XDAS_OUT_DENIAL, XDAS_OUT_FAILURE, and XDAS_OUT_SUCCESS.

Referenced by xdas_put_event_info(), and xdas_start_record().

static void __exit xdas_module_exit ( void   )  [static]

Definition at line 115 of file xdas.c.

static int __init xdas_module_init ( void   )  [static]

Definition at line 107 of file xdas.c.

static int xdas_parse_info ( const char *  info,
char **  fields,
unsigned  maxflds 
) [static]

Definition at line 434 of file xdas.c.

References ESC_CHAR, FLD_DELIMS, strdup(), and xdas_tokenize().

static int xdas_send_record ( int *  minorp,
xdas_session xs,
xdas_record xr,
int  eval,
int  import 
) [static]

static int xdas_service_connect ( int *  minor,
xdas_session xs 
) [static]

static int xdas_session_has_rights ( xdas_session xs,
unsigned  rights 
) [static]

static void xdas_set_record_timestamp ( xdas_record xr  )  [static]

Definition at line 368 of file xdas.c.

References xdas_record_tag::time_offset.

Referenced by xdas_commit_record(), and xdas_timestamp_record().

static void xdas_set_session_rights ( xdas_session xs  )  [static]

static int xdas_set_time_info ( xdas_session xs  )  [static]

Todo:
Gather time source information, format into address string.

Todo:
Get time zone information, format into tz string.

Todo:
Properly set time uncertainty info.

Definition at line 152 of file xdas.c.

References xdas_session_tag::time_source, xdas_session_tag::time_uncert_ind, xdas_session_tag::time_uncert_int, and xdas_session_tag::time_zone.

Referenced by xdas_initialize_session().

static char* xdas_tokenize ( char *  str,
const char *  delims,
char  esc,
char **  nextok 
) [static]

Definition at line 416 of file xdas.c.

static xdas_record* xdas_validate_record ( xdas_audit_rec_desc_t  record_ref  )  [static]

static xdas_session* xdas_validate_session ( xdas_audit_ref_t  das_ref  )  [static]


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