00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __RIOINTERFACETYPES_H_
00025 #define __RIOINTERFACETYPES_H_
00026
00027 #include "RioT.h"
00028
00029 #include <string>
00030
00031 #ifndef WINDOWS
00032
00033 #endif
00034
00035
00036
00037 #define MaxPathSize ( 256 )
00038
00039
00040
00041
00042
00043
00044
00045 #define MAXSTORAGEDISKSARRAY 10
00046
00047
00048
00049
00050
00051 #define MAXNUMSTORAGES sizeof(unsigned long long int) * 8
00052
00053
00054
00055
00056
00057 #define SEARCHINTRAFFICLOGS 0
00058 #define SEARCHINCLIENTSLOGS 1
00059
00060
00061
00062 #define INVALIDSEARCHTYPE -1
00063
00064
00065
00066 #define SEARCHLOGSFAILED 0 // Solicitacao feita com sucesso, mas a busca nos
00067
00068 #define SEARCHLOGSSUCESS 1 // Solicitacao feita com sucesso, e a busca nos logs
00069
00070 #define SEARCHLOGSERROR 2 // Ocorreu um erro na solicitacao da busca ou no
00071
00072
00073
00074
00075 const unsigned int MAXLOGFILESIZE = 1024*1024;
00076 const unsigned long long int MAXCOMBINEDLOGSFILESIZE = 1024*1024*1024;
00077
00078
00079
00080 const unsigned int MAXPASSWORDSIZE = 8;
00081
00082
00083
00084 const unsigned int MAXNUMBEROFBLOCKRETRYS = 5;
00085
00086
00087
00088
00089
00090
00091
00092
00093 typedef int RioResult;
00094
00095
00096
00097
00098
00099
00100
00101
00102 typedef int RioSecurity;
00103
00104
00105 typedef Rios64 RioObjectSize;
00106
00107
00108 const int MaxObjectInfoNameSize = 64;
00109
00110
00111 typedef struct
00112 {
00113 char DiskName[ MaxPathSize ];
00114 RioObjectSize Size;
00115 unsigned int NumberOfFreeBlocks;
00116 } RioDiskInfo;
00117
00118 typedef struct
00119 {
00120 char Hostname[60];
00121 short NumberOfDisks;
00122 RioDiskInfo Disks[ MAXSTORAGEDISKSARRAY ];
00123 } RioStorageNodeInfo;
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133 typedef enum
00134 {
00135 RIO_TRAFFIC_INVALID,
00136 RIO_TRAFFIC_CBR,
00137 RIO_TRAFFIC_NRT,
00138 RIO_TRAFFIC_VBR
00139 } RioTrafficType;
00140
00141
00142 typedef struct
00143 {
00144 unsigned int Reserved;
00145 } RioStreamTrafficNRT;
00146
00147
00148 typedef struct
00149 {
00150 double Rate;
00151 } RioStreamTrafficCBR;
00152
00153 typedef struct
00154 {
00155 double Rate;
00156 } RioStreamTrafficVBR;
00157
00158
00159 typedef enum
00160 {
00161 RioStreamDirectionRead = 0,
00162 RioStreamDirectionWrite = 1,
00163 RioStreamDirectionReadWrite = 2
00164 } RioStreamDirection;
00165
00166
00167 typedef struct
00168 {
00169 RioTrafficType Type;
00170 RioStreamDirection Direction;
00171 unsigned int LogicalBlockSize;
00172 int MaxRequests;
00173
00174 #ifdef __RIOTYPES_FORRPC_
00175 [switch_type(RioTrafficType), switch_is(Type)]
00176 #endif
00177
00178 union
00179 {
00180 #ifdef __RIOTYPES_FORRPC_
00181 [case (RIO_TRAFFIC_NRT)]
00182 #endif
00183
00184 RioStreamTrafficNRT TrafficNRT;
00185
00186 #ifdef __RIOTYPES_FORRPC_
00187 [case (RIO_TRAFFIC_CBR)]
00188 #endif
00189
00190 RioStreamTrafficCBR TrafficCBR;
00191 RioStreamTrafficVBR TrafficVBR;
00192 };
00193 } RioStreamTraffic;
00194
00195
00196
00197
00198
00199
00200
00201
00202 typedef unsigned int RioAccess;
00203
00204 const int RIO_READ_ACCESS = 0x1;
00205 const int RIO_WRITE_ACCESS = 0x2;
00206 const int RIO_RW_ACCESS = 0x3;
00207 const int RIO_SHARE_READ = 0x4;
00208 const int RIO_SHARE_WRITE = 0x8;
00209 const int RIO_SHARE_RW = 0xC;
00210
00211 const int RIO_READ_MASK = 0x5;
00212 const int RIO_WRITE_MASK = 0xA;
00213
00214
00215
00216
00217
00218 typedef unsigned int RioBlock;
00219
00220
00221 typedef enum
00222 {
00223 RIO_REQUEST_FREE = 0,
00224 RIO_REQUEST_PENDING,
00225 RIO_REQUEST_COMPLETED
00226 } RioRequestStatus;
00227
00228
00229 typedef struct RioRequest
00230 {
00231 int threadid;
00232 int BufferStatus;
00233 int session;
00234 int fragsnumber;
00235 RioBlock Block;
00236 unsigned int Size;
00237
00238 int reqid;
00239
00240 #ifndef __RIOTYPES_FORRPC_
00241 void* Buffer;
00242 #endif
00243
00244 #ifdef __RIOTYPES_FORRPC_
00245 byte* Buffer;
00246 #endif
00247
00248 RioRequestStatus Status;
00249
00250 #ifndef __RIOTYPES_FORRPC_
00251 void (*CallBackFunction)(struct RioRequest*);
00252 #endif
00253
00254 #ifdef __RIOTYPES_FORRPC_
00255 byte* CallBackFunction;
00256 #endif
00257
00258 RioResult Result;
00259
00260 #ifndef __RIOTYPES_FORRPC_
00261 void *User;
00262 #endif // structure (Not used by system)
00263
00264 #ifdef __RIOTYPES_FORRPC_
00265 byte *User;
00266 #endif // structure (Not used by system)
00267
00268 void *System;
00269 void *Who;
00270 } RioRequest;
00271
00272
00273
00274
00275
00276
00277 typedef enum
00278 {
00279 UNICASTTRAFFIC,
00280 MULTICASTTRAFFIC
00281 } RioStreamType;
00282
00283 typedef enum
00284 {
00285 PASSIVE,
00286 LEADER,
00287 SUBLEADER,
00288 INACTIVE,
00289 UNAVAILABLE
00290
00291
00292 } ClientMode;
00293
00294 typedef void (*callback_t)(void *callbackparm, int result);
00295 typedef void (*cmdcallback_t)(void *callbackparm, char *cmdp, int cmdl);
00296
00297 typedef struct
00298 {
00299 int block;
00300 char *data;
00301 callback_t callback;
00302 callback_t main_callback;
00303 void *object;
00304 void *stream;
00305 int num_frag;
00306 } RioCallBackTransport;
00307
00308 #endif // __RIOINTERFACETYPES_H_