xdas_stub.c File Reference

OpenXDAS static stub library. More...

#include <xdas.h>
#include <config.h>
#include <dlfcn.h>

Go to the source code of this file.

Data Structures

struct  fptable_t

Defines

#define XDAS_STATIC
#define libhandle_t   void *
#define LOAD_LIBRARY(n)   dlopen((n), RTLD_NOW)
#define FREE_LIBRARY(h)   dlclose((h))
#define IMPORT_SYMBOL(h, n)   (fptr_t)dlsym((h),(n))
#define LN_XDAS_CLIENT   "libxdas.so"
#define FN_XDAS_INITIALIZE_SESSION   "xdas_initialize_session"
#define FN_XDAS_TERMINATE_SESSION   "xdas_terminate_session"
#define FN_XDAS_CLOSE_AUDIT_STREAM   "xdas_close_audit_stream"
#define FN_XDAS_GET_NEXT   "xdas_get_next"
#define FN_XDAS_OPEN_AUDIT_STREAM   "xdas_open_audit_stream"
#define FN_XDAS_PARSE_RECORD   "xdas_parse_record"
#define FN_XDAS_REWIND_AUDIT_STREAM   "xdas_rewind_audit_stream"
#define FN_XDAS_IMPORT_EVENT_RECORDS   "xdas_import_event_records"
#define FN_XDAS_COMMIT_RECORD   "xdas_commit_record"
#define FN_XDAS_DISCARD_RECORD   "xdas_discard_record"
#define FN_XDAS_PUT_EVENT_INFO   "xdas_put_event_info"
#define FN_XDAS_START_RECORD   "xdas_start_record"
#define FN_XDAS_TIMESTAMP_RECORD   "xdas_timestamp_record"
#define FN_XDAS_CREATE_FILTER   "xdas_create_filter"
#define FN_XDAS_DELETE_FILTER   "xdas_delete_filter"
#define FN_XDAS_DISABLE_FILTER   "xdas_disable_filter"
#define FN_XDAS_ENABLE_FILTER   "xdas_enable_filter"
#define FN_XDAS_GET_FILTER   "xdas_get_filter"
#define FN_XDAS_LIST_FILTERS   "xdas_list_filters"

Typedefs

typedef void(* fptr_t )(void)
typedef int XDASAPI xdas_initialize_session_t (int *minor_status, const char *org_info, xdas_audit_ref_t *das_ref)
typedef int XDASAPI xdas_terminate_session_t (int *minor_status, xdas_audit_ref_t *das_ref)
typedef int XDASAPI xdas_close_audit_stream_t (int *minor_status, xdas_audit_ref_t das_ref, xdas_audit_stream_t *audit_stream_ref)
typedef int XDASAPI xdas_get_next_t (int *minor_status, xdas_audit_ref_t das_ref, xdas_audit_stream_t audit_stream_ref, unsigned max_records, xdas_buffer_t audit_record_buffer, unsigned *no_of_records)
typedef int XDASAPI xdas_open_audit_stream_t (int *minor_status, xdas_audit_ref_t das_ref, xdas_audit_stream_t *audit_stream_ref)
typedef int XDASAPI xdas_parse_record_t (int *minor_status, xdas_audit_ref_t das_ref, xdas_buffer_t audit_record_buffer, unsigned record_number, xdas_audit_record_t audit_record)
typedef int XDASAPI xdas_rewind_audit_stream_t (int *minor_status, xdas_audit_ref_t das_ref, xdas_audit_stream_t audit_stream_ref)
typedef int XDASAPI xdas_import_event_records_t (int *minor_status, xdas_audit_ref_t das_ref, xdas_buffer_t audit_record_buffer, size_t *position_in_buffer)
typedef int XDASAPI xdas_commit_record_t (int *minor_status, xdas_audit_ref_t das_ref, xdas_audit_rec_desc_t *audit_record_descriptor)
typedef int XDASAPI xdas_discard_record_t (int *minor_status, xdas_audit_ref_t das_ref, xdas_audit_rec_desc_t *audit_record_descriptor)
typedef int XDASAPI xdas_put_event_info_t (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)
typedef int XDASAPI xdas_start_record_t (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)
typedef int XDASAPI xdas_timestamp_record_t (int *minor_status, xdas_audit_ref_t das_ref, xdas_audit_rec_desc_t audit_record_descriptor)
typedef int XDASAPI xdas_create_filter_t (int *minor_status, xdas_audit_ref_t das_ref, const char *name, unsigned filter_type, const char *filter_exp, const char *filter_act)
typedef int XDASAPI xdas_delete_filter_t (int *minor_status, xdas_audit_ref_t das_ref, const char *name)
typedef int XDASAPI xdas_disable_filter_t (int *minor_status, xdas_audit_ref_t das_ref, const char *name)
typedef int XDASAPI xdas_enable_filter_t (int *minor_status, xdas_audit_ref_t das_ref, const char *name)
typedef int XDASAPI xdas_get_filter_t (int *minor_status, xdas_audit_ref_t das_ref, const char *name, unsigned *filter_type, xdas_buffer_t filter_exp, xdas_buffer_t filter_act, unsigned *filter_status)
typedef int XDASAPI xdas_list_filters_t (int *minor_status, xdas_audit_ref_t das_ref, char **filter_name_list, size_t *buffer_size)

Functions

static void unload_xdas_client (void)
 Unload the XDAS client library.
static void load_xdas_client (void)
 Try to load the OpenXDAS client library.
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_close_audit_stream (int *minor_status, xdas_audit_ref_t das_ref, xdas_audit_stream_t *audit_stream_ref)
 Closes an XDAS audit stream.
XDASXPC int XDASAPI xdas_get_next (int *minor_status, xdas_audit_ref_t das_ref, xdas_audit_stream_t audit_stream_ref, unsigned max_records, xdas_buffer_t audit_record_buffer, unsigned *no_of_records)
 Fill an output buffer with the next set of records in an audit stream.
XDASXPC int XDASAPI xdas_open_audit_stream (int *minor_status, xdas_audit_ref_t das_ref, xdas_audit_stream_t *audit_stream_ref)
 Opens an XDAS audit stream and associates it with an XDAS session.
XDASXPC int XDASAPI xdas_parse_record (int *minor_status, xdas_audit_ref_t das_ref, xdas_buffer_t audit_record_buffer, unsigned record_number, xdas_audit_record_t audit_record)
 Parse a specified XDAS record from an XDAS record buffer.
XDASXPC int XDASAPI xdas_rewind_audit_stream (int *minor_status, xdas_audit_ref_t das_ref, xdas_audit_stream_t audit_stream_ref)
 Rewind an audit stream read pointer.
XDASXPC int XDASAPI xdas_import_event_records (int *minor_status, xdas_audit_ref_t das_ref, xdas_buffer_t audit_record_buffer, size_t *position_in_buffer)
 Import event records from an external service into the XDAS common format.
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.
XDASXPC int XDASAPI xdas_create_filter (int *minor_status, xdas_audit_ref_t das_ref, const char *name, unsigned filter_type, const char *filter_exp, const char *filter_act)
 Create a named audit filter.
XDASXPC int XDASAPI xdas_delete_filter (int *minor_status, xdas_audit_ref_t das_ref, const char *name)
 Delete an audit filter by name.
XDASXPC int XDASAPI xdas_disable_filter (int *minor_status, xdas_audit_ref_t das_ref, const char *name)
 Disable an audit filter by name.
XDASXPC int XDASAPI xdas_enable_filter (int *minor_status, xdas_audit_ref_t das_ref, const char *name)
 Enable an audit filter by name.
XDASXPC int XDASAPI xdas_get_filter (int *minor_status, xdas_audit_ref_t das_ref, const char *name, unsigned *filter_type, xdas_buffer_t filter_exp, xdas_buffer_t filter_act, unsigned *filter_status)
 Get an audit filter by name.
XDASXPC int XDASAPI xdas_list_filters (int *minor_status, xdas_audit_ref_t das_ref, char **filter_name_list, size_t *buffer_size)
 Return a list of all defined audit filter names.

Variables

static xdas_initialize_session_tfp_xdas_initialize_session
static xdas_terminate_session_tfp_xdas_terminate_session
static xdas_close_audit_stream_tfp_xdas_close_audit_stream
static xdas_get_next_tfp_xdas_get_next
static xdas_open_audit_stream_tfp_xdas_open_audit_stream
static xdas_parse_record_tfp_xdas_parse_record
static xdas_rewind_audit_stream_tfp_xdas_rewind_audit_stream
static
xdas_import_event_records_t
fp_xdas_import_event_records
static xdas_commit_record_tfp_xdas_commit_record
static xdas_discard_record_tfp_xdas_discard_record
static xdas_put_event_info_tfp_xdas_put_event_info
static xdas_start_record_tfp_xdas_start_record
static xdas_timestamp_record_tfp_xdas_timestamp_record
static xdas_create_filter_tfp_xdas_create_filter
static xdas_delete_filter_tfp_xdas_delete_filter
static xdas_disable_filter_tfp_xdas_disable_filter
static xdas_enable_filter_tfp_xdas_enable_filter
static xdas_get_filter_tfp_xdas_get_filter
static xdas_list_filters_tfp_xdas_list_filters
static fptable_t xdas_ftable []
static libhandle_t xdas_lib_handle = 0


Detailed Description

OpenXDAS static stub library.

This file is the only source file in a static stub library that is linked into an application (becomes part of the application binary). This stub code dynamically loads the xdas shared library and passes calls into it if it's available. If not, it simply returns XDAS_SERVICE_FAILURE.

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

Definition in file xdas_stub.c.


Define Documentation

#define FN_XDAS_CLOSE_AUDIT_STREAM   "xdas_close_audit_stream"

Definition at line 72 of file xdas_stub.c.

#define FN_XDAS_COMMIT_RECORD   "xdas_commit_record"

Definition at line 78 of file xdas_stub.c.

#define FN_XDAS_CREATE_FILTER   "xdas_create_filter"

Definition at line 83 of file xdas_stub.c.

#define FN_XDAS_DELETE_FILTER   "xdas_delete_filter"

Definition at line 84 of file xdas_stub.c.

#define FN_XDAS_DISABLE_FILTER   "xdas_disable_filter"

Definition at line 85 of file xdas_stub.c.

#define FN_XDAS_DISCARD_RECORD   "xdas_discard_record"

Definition at line 79 of file xdas_stub.c.

#define FN_XDAS_ENABLE_FILTER   "xdas_enable_filter"

Definition at line 86 of file xdas_stub.c.

#define FN_XDAS_GET_FILTER   "xdas_get_filter"

Definition at line 87 of file xdas_stub.c.

#define FN_XDAS_GET_NEXT   "xdas_get_next"

Definition at line 73 of file xdas_stub.c.

#define FN_XDAS_IMPORT_EVENT_RECORDS   "xdas_import_event_records"

Definition at line 77 of file xdas_stub.c.

#define FN_XDAS_INITIALIZE_SESSION   "xdas_initialize_session"

Definition at line 70 of file xdas_stub.c.

#define FN_XDAS_LIST_FILTERS   "xdas_list_filters"

Definition at line 88 of file xdas_stub.c.

#define FN_XDAS_OPEN_AUDIT_STREAM   "xdas_open_audit_stream"

Definition at line 74 of file xdas_stub.c.

#define FN_XDAS_PARSE_RECORD   "xdas_parse_record"

Definition at line 75 of file xdas_stub.c.

#define FN_XDAS_PUT_EVENT_INFO   "xdas_put_event_info"

Definition at line 80 of file xdas_stub.c.

#define FN_XDAS_REWIND_AUDIT_STREAM   "xdas_rewind_audit_stream"

Definition at line 76 of file xdas_stub.c.

#define FN_XDAS_START_RECORD   "xdas_start_record"

Definition at line 81 of file xdas_stub.c.

#define FN_XDAS_TERMINATE_SESSION   "xdas_terminate_session"

Definition at line 71 of file xdas_stub.c.

#define FN_XDAS_TIMESTAMP_RECORD   "xdas_timestamp_record"

Definition at line 82 of file xdas_stub.c.

#define FREE_LIBRARY (  )     dlclose((h))

Definition at line 63 of file xdas_stub.c.

Referenced by unload_xdas_client().

#define IMPORT_SYMBOL ( h,
 )     (fptr_t)dlsym((h),(n))

Definition at line 64 of file xdas_stub.c.

Referenced by load_xdas_client().

#define libhandle_t   void *

Definition at line 61 of file xdas_stub.c.

#define LN_XDAS_CLIENT   "libxdas.so"

Definition at line 65 of file xdas_stub.c.

Referenced by load_xdas_client().

#define LOAD_LIBRARY (  )     dlopen((n), RTLD_NOW)

Definition at line 62 of file xdas_stub.c.

Referenced by load_xdas_client().

#define XDAS_STATIC

Definition at line 44 of file xdas_stub.c.


Typedef Documentation

typedef void(* fptr_t)(void)

Definition at line 90 of file xdas_stub.c.

typedef int XDASAPI xdas_close_audit_stream_t(int *minor_status, xdas_audit_ref_t das_ref, xdas_audit_stream_t *audit_stream_ref)

Definition at line 100 of file xdas_stub.c.

typedef int XDASAPI xdas_commit_record_t(int *minor_status, xdas_audit_ref_t das_ref, xdas_audit_rec_desc_t *audit_record_descriptor)

Definition at line 106 of file xdas_stub.c.

typedef int XDASAPI xdas_create_filter_t(int *minor_status, xdas_audit_ref_t das_ref, const char *name, unsigned filter_type, const char *filter_exp, const char *filter_act)

Definition at line 111 of file xdas_stub.c.

typedef int XDASAPI xdas_delete_filter_t(int *minor_status, xdas_audit_ref_t das_ref, const char *name)

Definition at line 112 of file xdas_stub.c.

typedef int XDASAPI xdas_disable_filter_t(int *minor_status, xdas_audit_ref_t das_ref, const char *name)

Definition at line 113 of file xdas_stub.c.

typedef int XDASAPI xdas_discard_record_t(int *minor_status, xdas_audit_ref_t das_ref, xdas_audit_rec_desc_t *audit_record_descriptor)

Definition at line 107 of file xdas_stub.c.

typedef int XDASAPI xdas_enable_filter_t(int *minor_status, xdas_audit_ref_t das_ref, const char *name)

Definition at line 114 of file xdas_stub.c.

typedef int XDASAPI xdas_get_filter_t(int *minor_status, xdas_audit_ref_t das_ref, const char *name, unsigned *filter_type, xdas_buffer_t filter_exp, xdas_buffer_t filter_act, unsigned *filter_status)

Definition at line 115 of file xdas_stub.c.

typedef int XDASAPI xdas_get_next_t(int *minor_status, xdas_audit_ref_t das_ref, xdas_audit_stream_t audit_stream_ref, unsigned max_records, xdas_buffer_t audit_record_buffer, unsigned *no_of_records)

Definition at line 101 of file xdas_stub.c.

typedef int XDASAPI xdas_import_event_records_t(int *minor_status, xdas_audit_ref_t das_ref, xdas_buffer_t audit_record_buffer, size_t *position_in_buffer)

Definition at line 105 of file xdas_stub.c.

typedef int XDASAPI xdas_initialize_session_t(int *minor_status, const char *org_info, xdas_audit_ref_t *das_ref)

Definition at line 98 of file xdas_stub.c.

typedef int XDASAPI xdas_list_filters_t(int *minor_status, xdas_audit_ref_t das_ref, char **filter_name_list, size_t *buffer_size)

Definition at line 116 of file xdas_stub.c.

typedef int XDASAPI xdas_open_audit_stream_t(int *minor_status, xdas_audit_ref_t das_ref, xdas_audit_stream_t *audit_stream_ref)

Definition at line 102 of file xdas_stub.c.

typedef int XDASAPI xdas_parse_record_t(int *minor_status, xdas_audit_ref_t das_ref, xdas_buffer_t audit_record_buffer, unsigned record_number, xdas_audit_record_t audit_record)

Definition at line 103 of file xdas_stub.c.

typedef int XDASAPI xdas_put_event_info_t(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)

Definition at line 108 of file xdas_stub.c.

typedef int XDASAPI xdas_rewind_audit_stream_t(int *minor_status, xdas_audit_ref_t das_ref, xdas_audit_stream_t audit_stream_ref)

Definition at line 104 of file xdas_stub.c.

typedef int XDASAPI xdas_start_record_t(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)

Definition at line 109 of file xdas_stub.c.

typedef int XDASAPI xdas_terminate_session_t(int *minor_status, xdas_audit_ref_t *das_ref)

Definition at line 99 of file xdas_stub.c.

typedef int XDASAPI xdas_timestamp_record_t(int *minor_status, xdas_audit_ref_t das_ref, xdas_audit_rec_desc_t audit_record_descriptor)

Definition at line 110 of file xdas_stub.c.


Function Documentation

static void load_xdas_client ( void   )  [static]

Try to load the OpenXDAS client library.

Definition at line 172 of file xdas_stub.c.

References IMPORT_SYMBOL, LN_XDAS_CLIENT, LOAD_LIBRARY, and unload_xdas_client().

Referenced by xdas_initialize_session().

static void unload_xdas_client ( void   )  [static]

Unload the XDAS client library.

Definition at line 164 of file xdas_stub.c.

References FREE_LIBRARY.

Referenced by load_xdas_client(), and xdas_terminate_session().


Variable Documentation

Definition at line 120 of file xdas_stub.c.

Referenced by xdas_close_audit_stream().

Definition at line 126 of file xdas_stub.c.

Referenced by xdas_commit_record().

Definition at line 131 of file xdas_stub.c.

Referenced by xdas_create_filter().

Definition at line 132 of file xdas_stub.c.

Referenced by xdas_delete_filter().

Definition at line 133 of file xdas_stub.c.

Referenced by xdas_disable_filter().

Definition at line 127 of file xdas_stub.c.

Referenced by xdas_discard_record().

Definition at line 134 of file xdas_stub.c.

Referenced by xdas_enable_filter().

Definition at line 135 of file xdas_stub.c.

Referenced by xdas_get_filter().

Definition at line 121 of file xdas_stub.c.

Referenced by xdas_get_next().

Definition at line 125 of file xdas_stub.c.

Referenced by xdas_import_event_records().

Definition at line 118 of file xdas_stub.c.

Referenced by xdas_initialize_session().

Definition at line 136 of file xdas_stub.c.

Referenced by xdas_list_filters().

Definition at line 122 of file xdas_stub.c.

Referenced by xdas_open_audit_stream().

Definition at line 123 of file xdas_stub.c.

Referenced by xdas_parse_record().

Definition at line 128 of file xdas_stub.c.

Referenced by xdas_put_event_info().

Definition at line 124 of file xdas_stub.c.

Referenced by xdas_rewind_audit_stream().

Definition at line 129 of file xdas_stub.c.

Referenced by xdas_start_record().

Definition at line 119 of file xdas_stub.c.

Referenced by xdas_terminate_session().

Definition at line 130 of file xdas_stub.c.

Referenced by xdas_timestamp_record().

fptable_t xdas_ftable[] [static]

libhandle_t xdas_lib_handle = 0 [static]

Definition at line 160 of file xdas_stub.c.


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