00001 //------------------------------------------------------------- 00002 // Go4 Release Package v3.04-01 (build 30401) 00003 // 28-November-2008 00004 //--------------------------------------------------------------- 00005 // The GSI Online Offline Object Oriented (Go4) Project 00006 // Experiment Data Processing at EE department, GSI 00007 //--------------------------------------------------------------- 00008 // 00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI 00010 // Planckstr. 1, 64291 Darmstadt, Germany 00011 //Contact: http://go4.gsi.de 00012 //---------------------------------------------------------------- 00013 //This software can be used under the license agreements as stated 00014 //in Go4License.txt file which is part of the distribution. 00015 //---------------------------------------------------------------- 00016 #ifndef MbsStruct 00017 #define MbsStruct 00018 00019 #define LMD__TYPE_FILE_HEADER_101_1 0x00010065 00020 #define LMD__TYPE_EVENT_HEADER_10_1 0x0001000a 00021 #define LMD__TYPE_FILE_INDEX_101_2 0x00020065 00022 #define LMD__TYPE_BUFFER_HEADER_10_1 0x0001000a 00023 #define LMD__TYPE_BUFFER_HEADER_100_1 0x00010064 00024 #define LMD__TYPE_TIME_STAMP_11_1 0x0001000b 00025 #define LMD__GET_EVENTS NULL 00026 #define LMD__STANDARD_HEADER NULL 00027 #define LMD__INTERNAL_HEADER NULL 00028 #define LMD__INDEX 1 00029 #define LMD__OVERWRITE 1 00030 #define LMD__LARGE_FILE 1 00031 #define LMD__MIN_BUFFER 0 00032 #define LMD__BUFFER 1 00033 #define LMD__VERBOSE 1 00034 #define LMD__NO_VERBOSE 0 00035 #define LMD__NO_BUFFER 0 00036 #define LMD__NO_INDEX 0 00037 #define LMD__NO_OVERWRITE 0 00038 #define LMD__NO_LARGE_FILE 0 00039 #define LMD__NO_VERBOSE 0 00040 #define LMD__VERBOSE 1 00041 #define LMD__ENDIAN_LITTLE 1 00042 #define LMD__ENDIAN_BIG 2 00043 #define LMD__ENDIAN_UNKNOWN 0 00044 00045 #include "s_stdint.h" 00046 00047 typedef uint64_t lmdoff_t; 00048 00049 // must #include <stdint.h> 00050 // on Lynx, define int32_t, uint32_t, int16_t 00051 // structure used to talk between client and server 00052 // Client connects to server (MBS) and reads this structure first 00053 00054 //-------------------------------------------------- 00055 // Structure maps the MBS transport info buffer 00056 typedef struct{ 00057 uint32_t iEndian; // byte order. Set to 1 by sender 00058 uint32_t iMaxBytes; // maximum buffer size 00059 uint32_t iBuffers; // buffers per stream 00060 uint32_t iStreams; // number of streams 00061 } sMbsTransportInfo; 00062 00063 //-------------------------------------------------- 00064 // Buffer header, maps s_bufhe, some fields used in different way 00065 typedef struct{ 00066 uint32_t iMaxWords; // compatible with s_bufhe (total buffer size - header) 00067 uint32_t iType; // compatible with s_bufhe, low=type (=100), high=subtype 00068 uint32_t iUsed; // not used for iMaxWords>MAX__DLEN (16360), low 16bits only 00069 uint32_t iBuffer; // compatible with s_bufhe 00070 uint32_t iElements; // compatible with s_bufhe 00071 uint32_t iTemp; // Used volatile 00072 uint32_t iTimeSpecSec; // compatible with s_bufhe (2*32bit) 00073 uint32_t iTimeSpecNanoSec; // compatible with s_bufhe (2*32bit) 00074 // struct timespec TimeSpec; 00075 uint32_t iEndian; // compatible with s_bufhe free[0] 00076 uint32_t iWrittenEndian;// one of LMD__ENDIAN_x 00077 uint32_t iUsedWords; // total words without header to read for type=100, free[2] 00078 uint32_t iFree3; // free[3] 00079 } sMbsBufferHeader; 00080 00081 //-------------------------------------------------- 00082 // Buffer header, maps s_bufhe 00083 typedef struct{ 00084 uint32_t iMaxWords; // compatible with s_bufhe (total buffer size - header) 00085 uint32_t iType; // compatible with s_bufhe, low=type (=100), high=subtype 00086 lmdoff_t iTableOffset; // optional offset to element offset table in file 00087 uint32_t iElements; // compatible with s_bufhe 00088 uint32_t iOffsetSize; // Offset size, 4 or 8 [bytes] 00089 uint32_t iTimeSpecSec; // compatible with s_bufhe (2*32bit) 00090 uint32_t iTimeSpecNanoSec; // compatible with s_bufhe (2*32bit) 00091 // struct timespec TimeSpec; 00092 uint32_t iEndian; // compatible with s_bufhe free[0] 00093 uint32_t iWrittenEndian;// one of LMD__ENDIAN_x 00094 uint32_t iUsedWords; // total words without header to read for type=100, free[2] 00095 uint32_t iFree3; // free[3] 00096 } sMbsFileHeader; 00097 00098 //-------------------------------------------------- 00099 typedef struct{ 00100 uint32_t iMaxWords; 00101 uint32_t iType; 00102 uint32_t iTimeSpecSec; 00103 uint32_t iTimeSpecNanoSec; 00104 } sMbsTimeStamp; 00105 00106 //-------------------------------------------------- 00107 // maps s_evhe 00108 typedef struct{ 00109 uint32_t iWords; // following data words 00110 uint32_t iType; // compatible with s_ve10_1, low=type (=10), high=subtype 00111 } sMbsHeader; 00112 00113 //-------------------------------------------------- 00114 // maps s_ve10_1 00115 typedef struct{ 00116 uint32_t iWords; // data words + 4 00117 uint32_t iType; // compatible with s_ve10_1, low=type (=10), high=subtype 00118 uint32_t iTrigger; 00119 uint32_t iEventNumber; 00120 } sMbsEventHeader; 00121 00122 //-------------------------------------------------- 00123 // maps s_ves10_1 00124 typedef struct{ 00125 uint32_t iWords; // data words + 2 00126 uint32_t iType; // compatible with s_ves10_1, low=type (=10), high=subtype 00127 uint32_t iSubeventID; // 2 low bytes=procid, next byte=subcrate, high byte control 00128 } sMbsSubeventHeader; 00129 #endif 00130 00131 //----------------------------END OF GO4 SOURCE FILE ---------------------