xdas.h

Go to the documentation of this file.
00001 /*----------------------------------------------------------------------------
00002  * Copyright (c) 2006, Novell, Inc.
00003  * All rights reserved.
00004  * 
00005  * Redistribution and use in source and binary forms, with or without 
00006  * modification, are permitted provided that the following conditions are 
00007  * met:
00008  * 
00009  *     * Redistributions of source code must retain the above copyright 
00010  *       notice, this list of conditions and the following disclaimer.
00011  *     * Redistributions in binary form must reproduce the above copyright 
00012  *       notice, this list of conditions and the following disclaimer in the 
00013  *       documentation and/or other materials provided with the distribution.
00014  *     * Neither the name of the Novell nor the names of its contributors 
00015  *       may be used to endorse or promote products derived from this 
00016  *       software without specific prior written permission.
00017  * 
00018  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
00019  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
00020  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
00021  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
00022  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
00023  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
00024  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
00025  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 
00026  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
00027  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
00028  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029  *--------------------------------------------------------------------------*/
00030 
00039 #ifndef XDAS_H_INCLUDED
00040 #define XDAS_H_INCLUDED
00041 
00042 #include <xdasapi.h>
00043 #include <stddef.h>
00044 
00396 #define XDAS_RECORD_VERSION "0"
00397 
00425 #define XDAS_S_COMPLETE                   0
00426 #define XDAS_S_AUTHORIZATION_FAILURE      1
00427 #define XDAS_S_BUFF_TOO_SMALL             2
00428 #define XDAS_S_END                        3
00429 #define XDAS_S_FAILURE                    4
00430 #define XDAS_S_INCOMPLETE_RECORD          5
00431 #define XDAS_S_INVALID_ACTION_LIST        6
00432 #define XDAS_S_INVALID_AUDIT_STREAM       7
00433 #define XDAS_S_INVALID_DAS_REF            8
00434 #define XDAS_S_INVALID_EVENT_INFO         9
00435 #define XDAS_S_INVALID_EVENT_NO           10
00436 #define XDAS_S_INVALID_FILTER             11
00437 #define XDAS_S_INVALID_FILTER_EXPR        12
00438 #define XDAS_S_INVALID_FILTER_LIST        13
00439 #define XDAS_S_INVALID_FILTER_TYPE        14
00440 #define XDAS_S_INVALID_INITIATOR_INFO     15
00441 #define XDAS_S_INVALID_ORIG_INFO          16
00442 #define XDAS_S_INVALID_OUTCOME            17
00443 #define XDAS_S_INVALID_RECORD_DESCRIPTOR  18
00444 #define XDAS_S_INVALID_RECORD_NUMBER      19
00445 #define XDAS_S_INVALID_SECURITY_CONTEXT   20
00446 #define XDAS_S_INVALID_TARGET_INFO        21
00447 #define XDAS_S_NO_AUDIT                   22
00448 #define XDAS_S_NO_DECISION_YET            23
00449 #define XDAS_S_RECORD_SYNTAX_ERROR        24
00450 #define XDAS_S_STORAGE_FAILURE            25
00451 #define XDAS_S_SERVICE_FAILURE            26
00452 #define XDAS_S_NOT_SUPPORTED              27
00453 #define XDAS_S_INVALID_FILTER_ACTION      28
00454 /* @} */
00455 
00466 #define OXDAS_MS_NO_ERROR                 0
00467 #define OXDAS_MS_UNKNOWN_ERROR            1
00468 #define OXDAS_MS_OUT_OF_MEMORY            2
00469 #define OXDAS_MS_NET_INIT_FAILED          3
00470 #define OXDAS_MS_NET_GENERAL_ERROR        4
00471 #define OXDAS_MS_NET_BAD_SOCKET           5
00472 #define OXDAS_MS_NET_CONN_ABORTED         6
00473 #define OXDAS_MS_NET_CONN_RESET           7
00474 #define OXDAS_MS_NET_NOT_CONNECTED        8
00475 #define OXDAS_MS_NET_SHUTDOWN             9
00476 #define OXDAS_MS_NET_TIMEDOUT             10
00477 #define OXDAS_MS_NET_CONN_REFUSED         11
00478 #define OXDAS_MS_PROTOCOL                 12
00479 /* @} */
00480 
00490 #define XDAS_S_CALL_INACCESSIBLE_READ     (1 << 16)
00491 #define XDAS_S_CALL_INACCESSIBLE_WRITE    (2 << 16)
00492 #define XDAS_S_CALL_BAD_STRUCTURE         (3 << 16)
00493 /* @} */
00494 
00503 #define XDAS_ROUTINE_ERROR(e) ((e) & 0x0000FFFF)
00504 #define XDAS_CALLING_ERROR(e) ((e) & 0xFFFF0000)
00505 #define XDAS_ERROR(e)         ((e) ? 1 : 0)
00506 /* @} */
00507 
00544 #define XDAS_AE_CREATE_ACCOUNT                  0x01000001
00545 #define XDAS_AE_DELETE_ACCOUNT                  0x01000002
00546 #define XDAS_AE_DISABLE_ACCOUNT                 0x01000003
00547 #define XDAS_AE_ENABLE_ACCOUNT                  0x01000004
00548 #define XDAS_AE_QUERY_ACCOUNT                   0x01000005
00549 #define XDAS_AE_MODIFY_ACCOUNT                  0x01000006
00550 #define XDAS_AE_CREATE_SESSION                  0x01000007
00551 #define XDAS_AE_TERMINATE_SESSION               0x01000008
00552 #define XDAS_AE_QUERY_SESSION                   0x01000009
00553 #define XDAS_AE_MODIFY_SESSION                  0x0100000A
00554 #define XDAS_AE_CREATE_DATA_ITEM                0x0100000B
00555 #define XDAS_AE_DELETE_DATA_ITEM                0x0100000C
00556 #define XDAS_AE_QUERY_DATA_ITEM_ATT             0x0100000D
00557 #define XDAS_AE_MODIFY_DATA_ITEM_ATT            0x0100000E
00558 #define XDAS_AE_INSTALL_SERVICE                 0x0100000F
00559 #define XDAS_AE_REMOVE_SERVICE                  0x01000010
00560 #define XDAS_AE_QUERY_SERVICE_CONFIG            0x01000011
00561 #define XDAS_AE_MODIFY_SERVICE_CONFIG           0x01000012
00562 #define XDAS_AE_DISABLE_SERVICE                 0x01000013
00563 #define XDAS_AE_ENABLE_SERVICE                  0x01000014
00564 #define XDAS_AE_INVOKE_SERVICE                  0x01000015
00565 #define XDAS_AE_TERMINATE_SERVICE               0x01000016
00566 #define XDAS_AE_QUERY_PROCESS_CONTEXT           0x01000017
00567 #define XDAS_AE_MODIFY_PROCESS_CONTEXT          0x01000018
00568 #define XDAS_AE_CREATE_PEER_ASSOC               0x01000019
00569 #define XDAS_AE_TERMINATE_PEER_ASSOC            0x0100001A
00570 #define XDAS_AE_QUERY_ASSOC_CONTEXT             0x0100001B
00571 #define XDAS_AE_MODIFY_ASSOC_CONTEXT            0x0100001C
00572 #define XDAS_AE_RECEIVE_DATA_VIA_ASSOC          0x0100001D
00573 #define XDAS_AE_SEND_DATA_VIA_ASSOC             0x0100001E
00574 #define XDAS_AE_CREATE_DATA_ITEM_ASSOC          0x0100001F
00575 #define XDAS_AE_TERMINATE_DATA_ITEM_ASSOC       0x01000020
00576 #define XDAS_AE_QUERY_DATA_ITEM_ASSOC_CONTEXT   0x01000021
00577 #define XDAS_AE_MODIFY_DATA_ITEM_ASSOC_CONTEXT  0x01000022
00578 #define XDAS_AE_QUERY_DATA_ITEM_CONTENTS        0x01000023
00579 #define XDAS_AE_MODIFY_DATA_ITEM_CONTENTS       0x01000024
00580 #define XDAS_AE_START_SYS                       0x01000025
00581 #define XDAS_AE_SHUTDOWN_SYS                    0x01000026
00582 #define XDAS_AE_RESOURCE_EXHAUST                0x01000027
00583 #define XDAS_AE_RESOURCE_CORRUPT                0x01000028
00584 #define XDAS_AE_BACKUP_DATASTORE                0x01000029
00585 #define XDAS_AE_RECOVER_DATASTORE               0x0100002A
00586 #define XDAS_AE_AUD_CONFIG                      0x0100002B
00587 #define XDAS_AE_AUD_DS_FULL                     0x0100002C
00588 #define XDAS_AE_AUD_DS_CORR                     0x0100002D
00589 
00590 /* The following are added to the standard by OpenXDAS */
00591 #define XDAS_AE_MODIFY_AUTH_TOKEN               0x02000001
00592 #define XDAS_AE_APPROVAL_RECEIVED               0x02000002
00593 #define XDAS_AE_APPROVAL_REQUESTED              0x02000003
00594 #define XDAS_AE_REQUEST_ESCALATED               0x02000004
00595 #define XDAS_AE_NOTIFICATION_SENT               0x02000005
00596 #define XDAS_AE_CREATE_ROLE                     0x02000006
00597 #define XDAS_AE_DELETE_ROLE                     0x02000007
00598 #define XDAS_AE_DISABLE_ROLE                    0x02000008
00599 #define XDAS_AE_ENABLE_ROLE                     0x02000009
00600 #define XDAS_AE_QUERY_ROLE                      0x0200000A
00601 #define XDAS_AE_MODIFY_ROLE                     0x0200000B
00602 /* @} */
00603 
00633 #define XDAS_AEC_ACCOUNT_MANAGEMENT             0x01000001
00634 #define XDAS_AEC_USER_SESSION                   0x01000002
00635 #define XDAS_AEC_DATA_ITEM_MANAGEMENT           0x01000003
00636 #define XDAS_AEC_SERVICE_MANAGEMENT             0x01000004
00637 #define XDAS_AEC_SERVICE_UTILIZE                0x01000005
00638 #define XDAS_AEC_PEER_ASSOC_MANAGEMENT          0x01000006
00639 #define XDAS_AEC_DATA_ITEM_CONTENT_ACCESS       0x01000007
00640 #define XDAS_AEC_EXCEPTIONAL                    0x01000008
00641 #define XDAS_AEC_AUDIT_SERVICE                  0x01000009
00642 /* @} */
00643 
00678 #define XDAS_OUT_NOT_SPECIFIED                  0xFFFFFFFF
00679 
00680 #define XDAS_OUT_SUCCESS                        0x00000000
00681 #define XDAS_OUT_PRIV_USED                      0x00000100
00682 #define XDAS_OUT_PRIV_GRANTED                   0x00000200
00683 #define XDAS_OUT_PRIV_REVOKED                   0x00000400
00684 #define XDAS_OUT_PRESELECT_CRITERIA_SET         0x00000800
00685 #define XDAS_OUT_THRESHOLDS_SET                 0x00001000
00686 #define XDAS_OUT_ACTIONS_SET                    0x00002000
00687 
00688 #define XDAS_OUT_FAILURE                        0x00000001
00689 #define XDAS_OUT_SERVICE_UNAVAILABLE            0x00000101
00690 #define XDAS_OUT_SERVICE_FAILURE                0x00000201
00691 #define XDAS_OUT_HARDWARE_FAILURE               0x00000401
00692 #define XDAS_OUT_LOST_ASSOCIATION               0x00000801
00693 #define XDAS_OUT_ALREADY_ENABLED                0x00001001
00694 #define XDAS_OUT_ALREADY_DISABLED               0x00002001
00695 #define XDAS_OUT_SERVICE_ERROR                  0x00004001
00696 #define XDAS_OUT_BUSY                           0x00008001
00697 #define XDAS_OUT_DISABLED                       0x00010001
00698 #define XDAS_OUT_INVALID_INPUT                  0x00020001
00699 #define XDAS_OUT_ENTITY_EXISTS                  0x00040001
00700 #define XDAS_OUT_ENTITY_NON_EXISTENT            0x00080001
00701 
00702 #define XDAS_OUT_DENIAL                         0x00000002
00703 #define XDAS_OUT_INSUFFICIENT_PRIVILEGE         0x00000102
00704 #define XDAS_OUT_INVALID_IDENTITY               0x00000202
00705 #define XDAS_OUT_INVALID_CREDENTIALS            0x00000402
00706 /* @} */
00707 
00730 #define XDAS_C_SUBMIT   1
00731 #define XDAS_C_IMPORT   2
00732 /* @} */
00733 
00738 #define XDAS_C_INCLUDE  1
00739 #define XDAS_C_EXCLUDE  2
00740 /* @} */
00741 
00746 #define XDAS_VERSION                1
00747 #define XDAS_TIME_OFFSET            2
00748 #define XDAS_TIME_UNCERT_INTER      3
00749 #define XDAS_TIME_UNCERT_INDIC      4
00750 #define XDAS_TIME_SOURCE            5
00751 #define XDAS_TIME_TIME_ZONE         6
00752 #define XDAS_EVENT_NUMBER           7
00753 #define XDAS_OUTCOME                8
00754 #define XDAS_ORG_LOC_NAME           9
00755 #define XDAS_ORG_LOC_ADD            10
00756 #define XDAS_ORG_SERV_TYPE          11
00757 #define XDAS_ORG_AUTH_AUTH          12
00758 #define XDAS_ORG_PRINC_NAME         13
00759 #define XDAS_ORG_PRINC_IDENTITY     14
00760 #define XDAS_INT_AUTH_AUTH          15
00761 #define XDAS_INT_PRINC_NAME         16
00762 #define XDAS_INT_PRINC_IDENTITY     17
00763 #define XDAS_TGT_LOC_NAME           18
00764 #define XDAS_TGT_LOC_ADD            19
00765 #define XDAS_TGT_SERV_TYPE          20
00766 #define XDAS_TGT_AUTH_AUTH          21
00767 #define XDAS_TGT_PRINC_NAME         22
00768 #define XDAS_TGT_PRINC_IDENTITY     23
00769 /* @} */
00770 
00775 #define XDAS_O_EQ    1  
00776 #define XDAS_O_NE    2  
00777 #define XDAS_O_GT    3  
00778 #define XDAS_O_LT    4  
00779 #define XDAS_O_GE    5  
00780 #define XDAS_O_LE    6  
00781 #define XDAS_O_BT    7  
00782 #define XDAS_O_SS    8  
00783 /* @} */
00784 
00807 #define XDAS_ACT_LOG    1
00808 #define XDAS_ACT_ALARM  2
00809 #define XDAS_ACT_ACTION 4
00810 /* @} */
00811 
00831 typedef struct xdas_buffer_desc_struct
00832 {
00833    size_t length;    
00834    char * value;     
00835 } xdas_buffer_desc, * xdas_buffer_t;
00836 
00886 typedef struct xdas_audit_record_desc_struct
00887 {
00888    unsigned record_number;
00890    size_t length;
00892    unsigned time_offset;
00894    unsigned time_uncertainty_interval;
00896    unsigned time_uncertainty_indicator;
00898    xdas_buffer_t time_source;
00900    xdas_buffer_t time_zone;
00902    unsigned event_number;
00904    unsigned outcome;
00906    xdas_buffer_t org_location_name;
00908    xdas_buffer_t org_location_address;
00910    xdas_buffer_t org_service_type;
00912    xdas_buffer_t org_auth_authority;
00914    xdas_buffer_t org_principal_name;
00916    xdas_buffer_t org_principal_identity;
00918    xdas_buffer_t int_auth_authority;
00920    xdas_buffer_t int_principal_name;
00922    xdas_buffer_t int_principal_identity;
00924    xdas_buffer_t tgt_location_name;
00926    xdas_buffer_t tgt_location_address;
00928    xdas_buffer_t tgt_service_type;
00930    xdas_buffer_t tgt_auth_authority;
00932    xdas_buffer_t tgt_principal_name;
00934    xdas_buffer_t tgt_principal_identity;
00936    xdas_buffer_t source_reference;
00938    xdas_buffer_t event_info;
00940 } xdas_audit_record_desc, * xdas_audit_record_t;
00941 
00944 typedef void * xdas_audit_ref_t;
00945 
00948 typedef void * xdas_audit_stream_t;
00949 
00952 typedef void * xdas_audit_rec_desc_t;
00953 
01034 XDASXPC int XDASAPI xdas_initialize_session(
01035       int * minor_status,
01036       const char * org_info,
01037       xdas_audit_ref_t * das_ref);
01038 
01074 XDASXPC int XDASAPI xdas_terminate_session(
01075       int * minor_status,
01076       xdas_audit_ref_t * das_ref);
01077 
01078 /* @} */
01079 
01138 XDASXPC int XDASAPI xdas_close_audit_stream(
01139       int * minor_status,
01140       xdas_audit_ref_t das_ref,
01141       xdas_audit_stream_t * audit_stream_ref);
01142 
01214 XDASXPC int XDASAPI xdas_get_next(
01215       int * minor_status,
01216       xdas_audit_ref_t das_ref,
01217       xdas_audit_stream_t audit_stream_ref,
01218       unsigned max_records,
01219       xdas_buffer_t audit_record_buffer,
01220       unsigned * no_of_records);
01221 
01261 XDASXPC int XDASAPI xdas_open_audit_stream(
01262       int * minor_status,
01263       xdas_audit_ref_t das_ref,
01264       xdas_audit_stream_t * audit_stream_ref);
01265 
01325 XDASXPC int XDASAPI xdas_parse_record(
01326       int * minor_status,
01327       xdas_audit_ref_t das_ref,
01328       xdas_buffer_t audit_record_buffer,
01329       unsigned record_number,
01330       xdas_audit_record_t audit_record);
01331 
01369 XDASXPC int XDASAPI xdas_rewind_audit_stream(
01370       int * minor_status,
01371       xdas_audit_ref_t das_ref,
01372       xdas_audit_stream_t audit_stream_ref);
01373 
01374 /* @} */
01375 
01440 XDASXPC int XDASAPI xdas_import_event_records(
01441       int * minor_status,
01442       xdas_audit_ref_t das_ref,
01443       xdas_buffer_t audit_record_buffer,
01444       size_t * position_in_buffer);
01445 
01446 /* @} */
01447 
01521 XDASXPC int XDASAPI xdas_commit_record(
01522       int * minor_status,
01523       xdas_audit_ref_t das_ref,
01524       xdas_audit_rec_desc_t * audit_record_descriptor);
01525 
01572 XDASXPC int XDASAPI xdas_discard_record(
01573       int * minor_status,
01574       xdas_audit_ref_t das_ref,
01575       xdas_audit_rec_desc_t * audit_record_descriptor);
01576 
01710 XDASXPC int XDASAPI xdas_put_event_info(
01711       int * minor_status,
01712       xdas_audit_ref_t das_ref,
01713       xdas_audit_rec_desc_t * audit_record_descriptor,
01714       unsigned event_number,
01715       unsigned outcome,
01716       const char * initiator_information,
01717       const char * target_information,
01718       const char * event_information);
01719 
01826 XDASXPC int XDASAPI xdas_start_record(
01827       int * minor_status,
01828       xdas_audit_ref_t das_ref,
01829       xdas_audit_rec_desc_t * audit_record_descriptor,
01830       unsigned event_number,
01831       unsigned outcome,
01832       const char * initiator_information,
01833       const char * target_information,
01834       const char * event_information);
01835 
01875 XDASXPC int XDASAPI xdas_timestamp_record(
01876       int * minor_status,
01877       xdas_audit_ref_t das_ref,
01878       xdas_audit_rec_desc_t audit_record_descriptor);
01879 
01880 /* @} */
01881 
01974 XDASXPC int XDASAPI xdas_create_filter(
01975       int * minor_status,
01976       xdas_audit_ref_t das_ref,
01977       const char * name,
01978       unsigned filter_type,
01979       const char * filter_exp,
01980       const char * filter_act);
01981 
02025 XDASXPC int XDASAPI xdas_delete_filter(
02026       int * minor_status,
02027       xdas_audit_ref_t das_ref,
02028       const char * name);
02029 
02074 XDASXPC int XDASAPI xdas_disable_filter(
02075       int * minor_status,
02076       xdas_audit_ref_t das_ref,
02077       const char * name);
02078 
02123 XDASXPC int XDASAPI xdas_enable_filter(
02124       int * minor_status,
02125       xdas_audit_ref_t das_ref,
02126       const char * name);
02127 
02198 XDASXPC int XDASAPI xdas_get_filter(
02199       int * minor_status,
02200       xdas_audit_ref_t das_ref,
02201       const char * name,
02202       unsigned * filter_type,
02203       xdas_buffer_t filter_exp,
02204       xdas_buffer_t filter_act,
02205       unsigned * filter_status);
02206 
02290 XDASXPC int XDASAPI xdas_list_filters(
02291       int * minor_status,
02292       xdas_audit_ref_t das_ref,
02293       char ** filter_name_list,
02294       size_t * buffer_size);
02295 
02296 /* @} */
02297 
02301 #endif   /* XDAS_H_INCLUDED */
02302 

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