#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_session * | xdas_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_record * | xdas_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. |
Definition in file xdas.c.
#define ESC_CHAR '%' |
#define FLD_DELIMS ":" |
#define free | ( | x | ) | kfree(x) |
Definition at line 63 of file xdas.c.
Referenced by ex_substitute_vars(), mcache_close(), mcache_create(), mcache_open(), mcache_read_record(), MtDestroy(), xdas_buffer_free(), xdas_format_record(), xdas_internal_close_audit_stream(), xdas_internal_discard_record(), xdas_internal_terminate_session(), xdas_put_event_info(), xdasd_conf_exit(), xdasd_conf_setstr(), xdasd_exec(), xdasd_mcache_destroy(), xdasd_mqueue_create(), xdasd_mqueue_destroy(), xdasd_parse_clear_actions(), xdasd_parse_free(), xdasd_parse_message(), xdasd_socket_free(), xf_cleanup_trigger_script(), xf_create_action(), xf_create_filter(), xf_create_match(), xf_free_action(), xf_free_filter(), xf_free_match(), xf_gather_text_data(), and xf_process_filter_attrs().
#define malloc | ( | x | ) | kmalloc(GFP_ATOMIC,(x)) |
Definition at line 62 of file xdas.c.
Referenced by ex_substitute_vars(), log_parsed_message(), mcache_create(), mcache_open(), mcache_read_record(), MtCreate(), strdup(), tr_put(), xdas_buffer_alloc(), xdas_format_record(), xdas_initialize_session(), xdas_open_audit_stream(), xdas_start_record(), xdas_strdup(), xdasd_conf_setstr(), xdasd_mcache_create(), xdasd_mqueue_create(), xdasd_parse_message(), xdasd_parse_set_trigger(), xdasd_socket_alloc(), xf_create_action(), xf_create_filter(), xf_create_match(), and xf_gather_text_data().
#define XDAS_AUDIT_CONTROL 0x00000008 |
Definition at line 59 of file xdas.c.
Referenced by xdas_create_filter(), xdas_delete_filter(), xdas_disable_filter(), xdas_enable_filter(), xdas_get_filter(), xdas_list_filters(), and xdas_set_session_rights().
#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 |
Definition at line 60 of file xdas.c.
Referenced by xdas_close_audit_stream(), xdas_get_next(), xdas_open_audit_stream(), xdas_parse_record(), xdas_rewind_audit_stream(), and xdas_set_session_rights().
#define XDAS_AUDIT_SERVICE 0x00000001 |
Definition at line 56 of file xdas.c.
Referenced by xdas_close_audit_stream(), xdas_commit_record(), xdas_create_filter(), xdas_delete_filter(), xdas_disable_filter(), xdas_discard_record(), xdas_enable_filter(), xdas_get_filter(), xdas_get_next(), xdas_import_event_records(), xdas_initialize_session(), xdas_list_filters(), xdas_open_audit_stream(), xdas_parse_record(), xdas_put_event_info(), xdas_rewind_audit_stream(), xdas_set_session_rights(), xdas_start_record(), and xdas_timestamp_record().
#define XDAS_AUDIT_SUBMIT 0x00000002 |
Definition at line 57 of file xdas.c.
Referenced by xdas_commit_record(), xdas_discard_record(), xdas_put_event_info(), xdas_set_session_rights(), xdas_start_record(), and xdas_timestamp_record().
#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 struct xdas_record_tag xdas_record |
typedef struct xdas_session_tag xdas_session |
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] |
Definition at line 196 of file xdas.c.
References xdas_record_tag::evt_info, xdas_record_tag::int_info, xdas_session_tag::org_info, xdas_record_tag::src_ref, xdas_record_tag::tgt_info, xdas_session_tag::time_source, xdas_session_tag::time_zone, xdas_elemcount, and XDAS_RECORD_VERSION.
Referenced by xdas_format_record().
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] |
Definition at line 263 of file xdas.c.
References xdas_record_tag::event_number, xdas_record_tag::evt_info, xdas_record_tag::fmt, xdas_record_tag::fmtlen, free, xdas_record_tag::int_info, malloc, xdas_session_tag::org_info, xdas_record_tag::outcome, xdas_record_tag::src_ref, xdas_record_tag::tgt_info, xdas_record_tag::time_offset, xdas_session_tag::time_source, xdas_session_tag::time_uncert_ind, xdas_session_tag::time_uncert_int, xdas_session_tag::time_zone, xdas_calc_max_record_len(), xdas_elemcount, and XDAS_RECORD_VERSION.
Referenced by xdas_send_record().
static unsigned xdas_get_next_record_number | ( | void | ) | [static] |
static void xdas_internal_discard_record | ( | xdas_record * | xr | ) | [static] |
Definition at line 392 of file xdas.c.
References xdas_record_tag::evt_info, xdas_record_tag::fmt, free, xdas_record_tag::int_info, xdas_record_tag::src_ref, and xdas_record_tag::tgt_info.
Referenced by xdas_commit_record(), xdas_discard_record(), xdas_put_event_info(), and xdas_start_record().
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 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] |
Definition at line 402 of file xdas.c.
References xdas_session_tag::ab, xdas_record_tag::fmt, OXDAS_MS_OUT_OF_MEMORY, xdas_format_record(), XDAS_S_COMPLETE, and XDAS_S_FAILURE.
Referenced by xdas_commit_record(), xdas_put_event_info(), and xdas_start_record().
static int xdas_service_connect | ( | int * | minor, | |
xdas_session * | xs | |||
) | [static] |
Definition at line 175 of file xdas.c.
References xdas_session_tag::ab, OXDAS_MS_UNKNOWN_ERROR, type, XDAS_LAF_TYPE, and XDAS_S_FAILURE.
Referenced by xdas_initialize_session(), and xdas_req_rsp().
static int xdas_session_has_rights | ( | xdas_session * | xs, | |
unsigned | rights | |||
) | [static] |
Definition at line 147 of file xdas.c.
References xdas_session_tag::security.
Referenced by xdas_close_audit_stream(), xdas_commit_record(), xdas_create_filter(), xdas_delete_filter(), xdas_disable_filter(), xdas_discard_record(), xdas_enable_filter(), xdas_get_filter(), xdas_get_next(), xdas_import_event_records(), xdas_initialize_session(), xdas_list_filters(), xdas_open_audit_stream(), xdas_parse_record(), xdas_put_event_info(), xdas_rewind_audit_stream(), xdas_start_record(), and xdas_timestamp_record().
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] |
Definition at line 141 of file xdas.c.
References xdas_session_tag::security, XDAS_AUDIT_CONTROL, XDAS_AUDIT_IMPORT, XDAS_AUDIT_READ, XDAS_AUDIT_SERVICE, and XDAS_AUDIT_SUBMIT.
Referenced by xdas_initialize_session().
static int xdas_set_time_info | ( | xdas_session * | xs | ) | [static] |
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] |
static xdas_record* xdas_validate_record | ( | xdas_audit_rec_desc_t | record_ref | ) | [static] |
Definition at line 356 of file xdas.c.
References xdas_record_tag::signature, and XDAS_RECORD_SIG.
Referenced by xdas_commit_record(), xdas_discard_record(), xdas_put_event_info(), and xdas_timestamp_record().
static xdas_session* xdas_validate_session | ( | xdas_audit_ref_t | das_ref | ) | [static] |
Definition at line 135 of file xdas.c.
References xdas_session_tag::signature, and XDAS_SESSION_SIG.
Referenced by xdas_close_audit_stream(), xdas_commit_record(), xdas_create_filter(), xdas_delete_filter(), xdas_disable_filter(), xdas_discard_record(), xdas_enable_filter(), xdas_get_filter(), xdas_get_next(), xdas_import_event_records(), xdas_list_filters(), xdas_open_audit_stream(), xdas_parse_record(), xdas_put_event_info(), xdas_rewind_audit_stream(), xdas_start_record(), xdas_terminate_session(), and xdas_timestamp_record().