00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <vector>
00022
00023 #ifndef CERTI_HH_INCLUDED
00024 #define CERTI_HH_INCLUDED
00025 #if defined(_WIN32)
00026 #include <windows.h>
00027 #include <algorithm>
00028 #include <process.h>
00029 #define sleep(a) Sleep(a * 1000)
00030 #define usleep(a) Sleep(a / 1000)
00031 typedef unsigned short ushort;
00032 typedef int pid_t;
00033 #define strcasecmp strcmp
00034 #define STAT_FUNCTION _stat
00035 #define STAT_STRUCT struct _stat
00036
00037 #ifndef _WINSOCK2API_
00038 #ifndef _WINSOCKAPI_
00039 #include <winsock2.h>
00040 #endif
00041 #endif
00042 typedef u_long in_addr_t;
00043 typedef unsigned short in_port_t;
00044 #ifdef _MSC_VER
00045 typedef unsigned __int64 uint64_t;
00046 typedef __int64 int64_t;
00047 typedef unsigned __int32 uint32_t;
00048 typedef __int32 int32_t;
00049 typedef unsigned __int16 uint16_t;
00050 typedef __int16 int16_t;
00051 typedef unsigned __int8 uint8_t;
00052 typedef __int8 int8_t;
00053 #ifdef _M_X64
00054 #define CERTI_INT64_CONSTANT(val) (val##L)
00055 #define CERTI_INT64_FORMAT "l"
00056 #else
00057 #define CERTI_INT64_CONSTANT(val) (val##LL)
00058 #define CERTI_INT64_FORMAT "ll"
00059 #endif
00060 #ifndef __func__
00061 #define __func__ "<unknown>"
00062 #endif
00063 #else
00064 #include <inttypes.h>
00065 #ifdef __x86_64__
00066 #define CERTI_INT64_CONSTANT(val) (val##L)
00067 #define CERTI_INT64_FORMAT "l"
00068 #else
00069 #define CERTI_INT64_CONSTANT(val) (val##LL)
00070 #define CERTI_INT64_FORMAT "ll"
00071 #endif
00072 #endif
00073 #if defined(CERTI_EXPORTS)
00074 #define CERTI_EXPORT __declspec(dllexport)
00075 #else
00076 #define CERTI_EXPORT __declspec(dllimport)
00077 #endif
00078 #else
00079 #include <inttypes.h>
00080 #define STAT_FUNCTION stat
00081 #define STAT_STRUCT struct stat
00082 #ifdef __x86_64__
00083 #define CERTI_INT64_CONSTANT(val) (val##L)
00084 #define CERTI_INT64_FORMAT "l"
00085 #else
00086 #define CERTI_INT64_CONSTANT(val) (val##LL)
00087 #define CERTI_INT64_FORMAT "ll"
00088 #endif
00089 #define CERTI_EXPORT
00090 #endif
00091
00092 #include "RTI.hh"
00093
00100
00101 #define BUFFER_EXCEPTION_REASON_SIZE 256
00102
00103 namespace certi {
00104
00105 typedef unsigned short UShort;
00106 typedef unsigned long ULong;
00107 typedef long Long;
00108 typedef ULong Handle;
00109 typedef Handle ObjectClassHandle;
00110 typedef Handle InteractionClassHandle;
00111 typedef ULong ExtentIndex;
00112 typedef Handle AttributeHandle;
00113 typedef Handle ParameterHandle;
00114 typedef Handle ObjectHandle;
00115 typedef Handle DimensionHandle;
00116 typedef Handle FederateHandle;
00117 typedef Handle OrderType;
00118 typedef Long SpaceHandle;
00119 typedef Handle TransportType;
00120
00121 typedef RTI::EventRetractionHandle EventRetractionHandle;
00122
00123 typedef UShort ObjectHandlecount ;
00124 typedef std::string ObjectName_t ;
00125 typedef std::string AttributeValue_t;
00126 typedef std::string ParameterValue_t;
00127
00128 enum ObjectRemovalReason {
00129 OUT_OF_REGION = 1,
00130 OBJECT_DELETED,
00131 NO_LONGER_SUBSCRIBED
00132 };
00133 typedef Handle RegionHandle ;
00134
00135
00136 const TransportType RELIABLE = 1 ;
00137 const TransportType BEST_EFFORT = 2 ;
00138 const OrderType RECEIVE = 1 ;
00139 const OrderType TIMESTAMP = 2 ;
00140
00141
00142 const int MAX_BACKLOG = 256 ;
00143
00144 }
00145
00146
00147
00148
00149
00150
00151
00152 #define RTI_PRINTS_STATISTICS
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165 #define RTIG_AUDIT_FILENAME "RTIG.log"
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177 #define AUDIT_CURRENT_LEVEL 5
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188 #define HLA_SERVER_PRINCIPAL_NAME "RTIG@server"
00189
00190
00191
00192 #define HLA_GSS_SESSION_DURATION 3600
00193
00194
00195
00196
00197
00198
00199 #define RTI_GSS_NOTHING 0
00200 #define RTI_GSS_SIGN_ONLY 1
00201 #define RTI_GSS_ENCRYPT 2
00202
00203 #define RTI_GSSAPI_USAGE RTI_GSS_NOTHING
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214 #define HLA_GSS_FLAGS 0
00215
00216
00217
00218
00219
00220 #define CERTI_UINT16_SWAP_BYTES(val) ((uint16_t) ( \
00221 (((uint16_t) (val) & (uint16_t) 0x00ffU) << 8) | \
00222 (((uint16_t) (val) & (uint16_t) 0xff00U) >> 8)))
00223
00224 #define CERTI_UINT32_SWAP_BYTES(val) ((uint32_t) ( \
00225 (((uint32_t) (val) & (uint32_t) 0x000000ffU) << 24) | \
00226 (((uint32_t) (val) & (uint32_t) 0x0000ff00U) << 8) | \
00227 (((uint32_t) (val) & (uint32_t) 0x00ff0000U) >> 8) | \
00228 (((uint32_t) (val) & (uint32_t) 0xff000000U) >> 24)))
00229
00230 #define CERTI_UINT64_SWAP_BYTES(val) ((uint64_t) ( \
00231 (((uint64_t) (val) & \
00232 (uint64_t) CERTI_INT64_CONSTANT(0x00000000000000ffU)) << 56) | \
00233 (((uint64_t) (val) & \
00234 (uint64_t) CERTI_INT64_CONSTANT(0x000000000000ff00U)) << 40) | \
00235 (((uint64_t) (val) & \
00236 (uint64_t) CERTI_INT64_CONSTANT(0x0000000000ff0000U)) << 24) | \
00237 (((uint64_t) (val) & \
00238 (uint64_t) CERTI_INT64_CONSTANT(0x00000000ff000000U)) << 8) | \
00239 (((uint64_t) (val) & \
00240 (uint64_t) CERTI_INT64_CONSTANT(0x000000ff00000000U)) >> 8) | \
00241 (((uint64_t) (val) & \
00242 (uint64_t) CERTI_INT64_CONSTANT(0x0000ff0000000000U)) >> 24) | \
00243 (((uint64_t) (val) & \
00244 (uint64_t) CERTI_INT64_CONSTANT(0x00ff000000000000U)) >> 40) | \
00245 (((uint64_t) (val) & \
00246 (uint64_t) CERTI_INT64_CONSTANT(0xff00000000000000U)) >> 56)))
00247 #endif // CERTI_HH_INCLUDED
00248
00249