(file) Return to Audit_zOS_SMF.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

  1 martin 1.2 //%LICENSE////////////////////////////////////////////////////////////////
  2            // 
  3            // Licensed to The Open Group (TOG) under one or more contributor license
  4            // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
  5            // this work for additional information regarding copyright ownership.
  6            // Each contributor licenses this file to you under the OpenPegasus Open
  7            // Source License; you may not use this file except in compliance with the
  8            // License.
  9            // 
 10            // Permission is hereby granted, free of charge, to any person obtaining a
 11            // copy of this software and associated documentation files (the "Software"),
 12            // to deal in the Software without restriction, including without limitation
 13            // the rights to use, copy, modify, merge, publish, distribute, sublicense,
 14            // and/or sell copies of the Software, and to permit persons to whom the
 15            // Software is furnished to do so, subject to the following conditions:
 16            // 
 17            // The above copyright notice and this permission notice shall be included
 18            // in all copies or substantial portions of the Software.
 19            // 
 20            // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 21            // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
 22 martin 1.2 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 23            // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 24            // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 25            // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 26            // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 27 thilo.boehm 1.1 // 
 28 martin      1.2 //////////////////////////////////////////////////////////////////////////
 29 thilo.boehm 1.1 //
 30                 //%/////////////////////////////////////////////////////////////////////////////
 31                 
 32                 #ifndef Audit_zOS_SMF_h
 33                 #define Audit_zOS_SMF_h
 34                 
 35                 
 36                 #include <Pegasus/Common/Audit_zOS_SMFStructures.h>
 37                 #include <Pegasus/Common/Mutex.h>
 38                 
 39                 PEGASUS_USING_STD;
 40                 
 41                 PEGASUS_NAMESPACE_BEGIN
 42                 
 43                 enum _smf_record_suptype {
 44                     AUTHENTICATION=1,
 45                     CONFIGURATION=2,
 46                     PROVIDER_STATUS=3,
 47                     CIM_OPERATION=4,
 48                     INDICATION_OPERATION=5
 49                 } ;
 50 thilo.boehm 1.1 
 51                 class PEGASUS_COMMON_LINKAGE Audit_zOS_SMF
 52                 {
 53                 
 54                 public:
 55                 
 56                     /** 
 57                      * Default constructor
 58                      */
 59                     Audit_zOS_SMF();
 60                 
 61                     /**
 62                      * Default destructor
 63                      */
 64                     ~Audit_zOS_SMF();
 65                 
 66                     /** 
 67                      * Initialize the SMF record header and product section with values 
 68                      * constant for all SMF records. It also set the SMF subtype and 
 69                      * the total size of the subtype section, including the size of the
 70                      * variable properties, into the header.
 71 thilo.boehm 1.1      * 
 72                      *  @param myRecProlog - Pointer to the start of the record.
 73                      * 
 74                      *  @param subtype - The SMF subtype value for the record.
 75                      * 
 76                      *  @param subTypeSize - The size of the subtype section including 
 77                      *                       the size of variable properties.
 78                      */
 79                     void initMyProlog( _smf86_record_prolog * myRecProlog,
 80                                                     _smf_record_suptype subtype,
 81                                                     int subTypeSize);
 82                     /**
 83                      * Check with SMF if this subtype is recorded by SMF.
 84                      * 
 85                      * @param subtype - The SMF subtype.
 86                      * 
 87                      */
 88                     Boolean isRecording(_smf_record_suptype subtype);
 89                 
 90                     /**
 91                      * Writes a record to SMF
 92 thilo.boehm 1.1      * 
 93                      * @param subtype - The SMF subtype.
 94                      * 
 95                      * @param record - Pointer to the record.
 96                      * 
 97                      */
 98                     static void  writeRecord(int subtype, char * record);
 99                 
100                     /**
101                      * Dumps a record as HEXDump to stdout.
102                      * 
103                      * @param subtype - The SMF subtype.
104                      * 
105                      * @param record - Pointer to the record.
106                      * 
107                      */
108                     static void  printRecord(int subtype, char * record);
109                 
110                     /** 
111                      *  Set a SMF record field in EBCDIC. If the value is smaller then the 
112                      *  filed, then the remaining field is filled with spaces.
113 thilo.boehm 1.1      * 
114                      * @param field - Pointer to the start of the field.
115                      * 
116                      * @param value - The value for the field 0x00 terminated.
117                      * 
118                      * @param size - The size of the filed. 
119                      * 
120                      * @param nullTerminated - If true, then the value is copied including
121                      *                         the 0x00 termination.
122                      * 
123                      */
124                     void    setEBCDICRecordField( unsigned char * field, const char * value, 
125                                 int size, bool nullTerminated );
126                 
127                 private:
128                 
129                     /**
130                      * Pointer to a SMF record prolog ( header + product section ) 
131                      * with initialized with constant values for all record subtypes.
132                      */
133                     _smf86_record_prolog * _recordProlog;
134 thilo.boehm 1.1     Mutex _protectProlog;
135                 
136                     /**
137                      * Initialize a SMF header with constant values.
138                      * 
139                      * @param smfRecord - The header to initialize.
140                      * 
141                      */
142                     void _preInitRecordHeaderSection( _smf86_header* smfRecord );
143                 
144                     /**
145                      * Initialize a SMF product section with constant values.
146                      * 
147                      * @param smfRecord - The product section to initialize.
148                      * 
149                      */
150                     void _preInitRecordProductSection( _smf86_product* smfRecord );
151                 
152                     /** 
153                      * Set the Sysplex name.
154                      * 
155 thilo.boehm 1.1      * @param field - The field for the sysplex name.
156                      * 
157                      */
158                     void _setSysplexName(unsigned char * field);
159                 
160                 };
161                 
162                 PEGASUS_NAMESPACE_END
163                 
164                 #endif // Audit_zOS_SMF_h
165                 

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2