libxdas_impl.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00043 #ifndef LIBXDAS_IMPL_H_INCLUDED
00044 #define LIBXDAS_IMPL_H_INCLUDED
00045
00046 #include <xdas.h>
00047 #include <xdas_base.h>
00048 #include <xdas_buf.h>
00049
00050 #include <stddef.h>
00051 #include <string.h>
00052 #include <stdlib.h>
00053
00054 #ifdef _WIN32
00055 # define strdup _strdup
00056 #endif
00057
00076 #define XDAS_AUDIT_SERVICE 0x00000001
00077 #define XDAS_AUDIT_SUBMIT 0x00000002
00078 #define XDAS_AUDIT_IMPORT 0x00000004
00079 #define XDAS_AUDIT_CONTROL 0x00000008
00080 #define XDAS_AUDIT_READ 0x00000010
00081
00082
00091 #define ORG_FLD_LOC_NAME 0
00092 #define ORG_FLD_LOC_ADDR 1
00093 #define ORG_FLD_SVC_TYPE 2
00094 #define ORG_FLD_ATH_AUTH 3
00095 #define ORG_FLD_PRN_NAME 4
00096 #define ORG_FLD_PRN_ID 5
00097 #define ORG_FLD_COUNT 6
00098
00099
00100 #define MAX_TIME_SRC 1024
00101 #define MAX_TIME_ZONE 128
00113 typedef struct xdas_session_tag
00114 {
00115 #define XDAS_SESSION_SIG 0x58444153
00116 unsigned signature;
00117 unsigned security;
00118 unsigned time_uncert_int;
00119 unsigned time_uncert_ind;
00120 char time_source[MAX_TIME_SRC];
00121 char time_zone[MAX_TIME_ZONE];
00122 sockfd_t s;
00123 xdas_buffer req;
00124 xdas_buffer rsp;
00125 char * org_info[ORG_FLD_COUNT];
00126 } xdas_session;
00127
00141 typedef struct xdas_stream_tag
00142 {
00143 #define XDAS_STREAM_SIG 0x5354524D
00144 unsigned signature;
00148 } xdas_stream;
00149
00165 #define INT_FLD_ATH_AUTH 0
00166 #define INT_FLD_PRN_NAME 1
00167 #define INT_FLD_PRN_ID 2
00168 #define INT_FLD_COUNT 3
00169
00170
00179 #define TGT_FLD_LOC_NAME 0
00180 #define TGT_FLD_LOC_ADDR 1
00181 #define TGT_FLD_SVC_TYPE 2
00182 #define TGT_FLD_ATH_AUTH 3
00183 #define TGT_FLD_PRN_NAME 4
00184 #define TGT_FLD_PRN_ID 5
00185 #define TGT_FLD_COUNT 6
00186
00187
00198 typedef struct xdas_record_tag
00199 {
00200 #define XDAS_RECORD_SIG 0x52435244
00201 unsigned signature;
00202 unsigned record_number;
00203 unsigned event_number;
00204 unsigned outcome;
00205 unsigned time_offset;
00206 char * int_info[INT_FLD_COUNT];
00207 char * tgt_info[TGT_FLD_COUNT];
00208 char * src_ref;
00209 char * evt_info;
00210 unsigned fmtlen;
00211 char * fmt;
00212 int last_status;
00213 int fmt_cache_dirty;
00214 } xdas_record;
00215
00219 int xdas_internal_create_filter(int * minor, const char * name,
00220 unsigned type, const char * exp, const char * act);
00221 int xdas_internal_delete_filter(int * minor, const char * name);
00222 int xdas_internal_enable_filter(int * minor, const char * name,
00223 int enable);
00224 int xdas_internal_get_filter(int * minor, const char * name,
00225 unsigned * type, xdas_buffer_t exp, xdas_buffer_t act,
00226 unsigned * status);
00227 int xdas_internal_list_filters(int * minor, char ** names,
00228 size_t * bufszp);
00229
00230 xdas_session * xdas_validate_session(xdas_audit_ref_t das_ref);
00231 void xdas_set_session_rights(xdas_session * xs);
00232 int xdas_session_has_rights(xdas_session * xs, unsigned rights);
00233 int xdas_set_time_info(xdas_session * xs);
00234 void xdas_internal_terminate_session(xdas_session * xs);
00235
00236 xdas_stream * xdas_validate_stream(xdas_audit_stream_t stream_ref);
00237 void xdas_internal_close_audit_stream(xdas_stream * xt);
00238 int xdas_internal_get_next(int * minor, xdas_stream * xt,
00239 unsigned maxrecs, xdas_buffer_t bufp, unsigned * recsoutp);
00240 int xdas_internal_parse_record(int * minor,
00241 xdas_buffer_t bufp, unsigned recno, xdas_audit_record_t recp);
00242 int xdas_internal_rewind_audit_stream(int * minor, xdas_stream * xt);
00243 int xdas_internal_open_audit_stream(int * minor,
00244 xdas_session * xs, xdas_stream * xt);
00245
00246 int xdas_internal_import_event_records(int * minor,
00247 xdas_session * xs, xdas_buffer_t bufp, size_t * bufposp);
00248
00249 xdas_record * xdas_validate_record(xdas_audit_rec_desc_t record_ref);
00250 unsigned xdas_get_next_record_number(void);
00251 void xdas_set_record_timestamp(xdas_record * xr);
00252 void xdas_internal_discard_record(xdas_record * xr);
00253 int xdas_is_valid_outcome(unsigned outcome);
00254 int xdas_send_record(int * minor, xdas_session * xs,
00255 xdas_record * xr, int eval, int import);
00256
00257 void xdas_service_disconnect(xdas_session * xs);
00258 int xdas_service_connect(int * minor, xdas_session * xs);
00259 int xdas_req_rsp(int * minorp, xdas_session * xs);
00260
00261 int xdas_library_init(int * minorp);
00262
00263 #endif
00264