00001 /********************************************************************* 00002 * Copyright: 00003 * GSI, Gesellschaft fuer Schwerionenforschung mbH 00004 * Planckstr. 1 00005 * D-64291 Darmstadt 00006 * Germany 00007 * created 25. 1.1996 by Horst Goeringer 00008 ********************************************************************* 00009 * rawcommn.h 00010 * communication structure tsmcli client - servers 00011 ********************************************************************* 00012 * 11. 9.1996, H.G.: alternate archive tape device "ARCH_TAPE_2" added 00013 * 26. 9.1996, H.G.: new archive tape device "ARCH_TAPE_MC" added 00014 * "ARCH_TAPE_2" changed to "ARCH_TAPE_MC_2" 00015 * 8. 1.1997, H.G.: new parameter MAX_FILE_SIZE 00016 * 21. 7.1997, H.G.: new parameter srawComm.cliNode 00017 * 10. 9.1997, H.G.: new ACTION value STAGE 00018 * 15. 9.1997, H.G.: new enum RETR_DEVICE 00019 * 26. 9.1997, H.G.: new ACTION value RETRIEVE_STAGE 00020 * 21.10.1997, H.G.: replace ARCHIVE_STAGE by ARCHIVE_OVER 00021 * 19. 1.1998, H.G.: new status flag STA_END_OF_FILE_NOT_STAGED 00022 * 8. 7.1998, H.G.: use MBUF_SOCK and MBUF_ADSM; set both to 16384 00023 * new filetype STREAM 00024 * 28. 7.1999, H.G.: new ACTION values UNSTAGE, QUERY_UNSTAGE 00025 * 16. 8.2000, H.G.: new ACTION values QUERY_WORKSPACE, QUERY_POOL 00026 * new structures srawPoolStatus, srawWorkSpace 00027 * 16. 8.2000, H.G.: mod srawPoolStatus, new srawPoolAttr 00028 * 5. 9.2000, H.G.: new ACTION value QUERY_STAGE 00029 * 22.11.2000, H.G.: enhance range of values for srawWorkSpace.iStatus 00030 * 1.12.2000, H.G.: new status id IDENT_NEXT_BUFFER 00031 * 21.12.2000, H.G.: new structure srawRequest for seek functionality 00032 * 1. 2.2001, H.G.: new action values ARCHIVE_STAGE, METADATA_MOD 00033 * 30. 5.2001, H.G.: increase MAX_TAPE_FILE from 16 to 17 00034 * 13. 6.2001, H.G.: new STATUS value ARCHIVE_AVAILABLE 00035 * 22. 6.2001, H.G.: new ACTION QUERY_RETRIEVE 00036 * replace MPORT by new def PORT_MASTER 00037 * 17. 7.2001, H.G.: enhance srawObjAttr by data mover info 00038 * new structure srawDataMover 00039 * 23. 8.2001, H.G.: enhance srawComm by stage info 00040 * 29.10.2001, H.G.: ported to W2000 00041 * 14.11.2001, H.G.: rename ACTION DELETE -> REMOVE (used in winnt.h) 00042 * 28. 2.2002, H.G.: new: IDENT_STAGE_xxx, IDENT_SPACE_xx 00043 * 15. 3.2002, H.G.: rename srawPoolAttr -> srawPoolStatusData, enhance 00044 * 18. 3.2002, H.G.: new define MAX_NUM_DM (<- rawservn.h) 00045 * 20. 3.2002, H.G.: new structure srawPoolStatusDMData 00046 * 27. 5.2002, H.G.: new ACTION QUERY_ARCHIVE_OVER 00047 * 6. 6.2002, H.G.: new identifier: IDENT_PURGE_INFO 00048 * 20. 8.2002, H.G.: new identifier: IDENT_SPACE_LOOK 00049 * 19. 9.2002, H.G.: new identifier: IDENT_CLEAN_REQUEST 00050 * 26. 9.2002, H.G.: new definition PORT_RFIO_SERV 00051 * 29.10.2002, H.G.: new identifier: IDENT_FILELIST_REQUEST, 00052 * new define MAX_STAGE_FILE_NO 00053 * 22.11.2002, H.G.: new status STA_INFO, STA_PURGED, STA_NOT_PURGED 00054 * 13. 1.2003, H.G.: add definition PORT_MOVER 00055 * 30. 1.2003, H.G.: add declarations cMasterNode(i), new: MAX_MASTER 00056 * 13. 2.2003, H.G.: add definition MAX_MOVER 00057 * 24. 2.2003, H.G.: new actions SPM_REQUEST_MOVER, QUERY_ARCHIVE_STAGE 00058 * 8. 5.2003, H.G.: add synchronization parameters to srawDataMoverAttr 00059 * 9. 5.2003, H.G.: add synchronization parameters to srawComm 00060 * 21. 8.2003, H.G.: srawComm: new string cTapeLib, 00061 * replace ACTION values: 00062 * ARCHIVE_STAGE -> ARCHIVE_TO_STAGE 00063 * METADATA_MOD -> ARCHIVE_FROM_STAGE 00064 * new ACTION values: QUERY_ARCHIVE_TO_STAGE, 00065 * QUERY_ARCHIVE_FROM_STAGE 00066 * 28. 8.2003, H.G.: srawObjAttr: add parameter cStageUser 00067 * 15. 9.2003, H.G.: increase MAX_NUM_DM: 5 -> 10 00068 * 6.10.2003, H.G.: cNodeMaster2 now gsitsma, depc134 is backup node 00069 * 10.10.2003, H.G.: new identifier: IDENT_QUERY_ARCHDB 00070 * 15.10.2003, H.G.: new action END_SESSION 00071 * 31.10.2003, H.G.: remove unused definition MAX_MOVER 00072 * 6.11.2003, H.G.: new action QUERY_ARCHIVE_RECORD 00073 * 18.11.2003, H.G.: new identifier: IDENT_FULL_ARCHDISK 00074 * 18.12.2003, H.G.: new identifier: IDENT_ARCHIVE_FILE 00075 * 22. 1.2004, H.G.: add cNodeMaster2A: gsitsmb 00076 * 20. 2.2004, H.G.: srawObjAttr: rename iPort (unused) -> iFS 00077 * new structure srawFileSystem 00078 * 24. 2.2004, H.G.: new ACTION values: 00079 * STAGE_FROM_CACHE, RETRIEVE_FROM_CACHE 00080 * replace ACTION values: 00081 * QUERY_ARCHIVE_TO_STAGE -> QUERY_ARCHIVE_TO_CACHE 00082 * QUERY_ARCHIVE_FROM_STAGE ->QUERY_ARCHIVE_FROM_CACHE 00083 * ARCHIVE_TO_STAGE -> ARCHIVE_TO_CACHE 00084 * ARCHIVE_FROM_STAGE -> ARCHIVE_FROM_CACHE 00085 * 5. 3.2004, H.G.: srawFileSystem: add cArchiveDate, cArchiveUser 00086 * new ACTION value READ_FROM_CACHE 00087 * 24. 6.2004, H.G.: new STATUS value STA_CACHE_FULL 00088 * 29. 6.2004, H.G.: new ARCH_DEVICE value ARCH_DAQ_DISK for DaqPool 00089 * 2. 7.2004, H.G.: new definitions: DEF_FILESIZE, 00090 * SLEEP_CACHE_FULL, MAXLOOP_CACHE_FULL 00091 * 18.10.2004, H.G.: new STATUS value STA_CACHE_FILE_AWAY 00092 * 24.11.2004, H.G.: STATUS value ARCHIVE_AVAILABLE -> STA_ARCHIVE_AVAIL 00093 * new: STA_ARCHIVE_NOT_AVAIL, STA_NO_ACCESS 00094 * 26. 1.2005, H.G.: new ACTION value QUERY_RETRIEVE_STAGE 00095 * 20.10.2005, H.G.: increase DEF_FILESIZE to nearly 2 GByte 00096 * 25.11.2005, H.G.: add cNodeMasterE1/2: new entry server lxha05/4 00097 * 7. 3.2006, H.G.: increase MAX_NUM_DM: 10 -> 16 00098 * 13. 3.2006, H.G.: new STATUS value STA_SWITCH_ENTRY (for HA), 00099 * new parameter srawComm.cNodeCacheMgr (for HA) 00100 * 15. 3.2006, H.G.: new STATUS value STA_ENTRY_INFO (for HA) 00101 * 17. 3.2006, H.G.: new entry server lxgstore 00102 * 28. 4.2006, H.G.: cleanup cNodeMasterxx strings 00103 * 9. 5.2006, H.G.: new actions for 2nd level DM: QUERY_FILESERVER, 00104 * SEND_TO_FILESERVER, RECEIVE_FROM_DM 00105 * rename QUERY_RETRIEVE_API -> QUERY_RETRIEVE_RECORD 00106 * new parameters srawComm: iPoolIdRC, cNodeRC, 00107 * iPoolIdWC, cNodeWC, iFSidWC, 00108 * iPoolIdFC, cNodeFC, iFSidFC, 00109 * 19. 5.2006, H.G.: new idents: IDENT_STAGE_LIST, IDENT_QUERY_FILEDB 00110 * 2.10.2006, H.G.: new parameters srawObjAttr: iATLServer, 00111 * iRestoHigh2, iRestoHighLow, iRestoHighLow2, 00112 * 5.10.2006, H.G.: new parameter srawComm: iATLServer 00113 * 28. 9.2006, H.G.: add MAX_ATLSERVER 00114 * 24.11.2006, H.G.: new ident IDENT_QUERY_DONE 00115 * 20.12.2006, H.G.: add ATLSERVER_ARCHIVE for API write to gStore 00116 * 14. 5.2007, H.G.: in srawObjAttr: iRestoHighLow2 -> iRestoLowHigh, 00117 * iRestoHigh2 -> iRestoHighHigh 00118 * 17. 7.2007, H.G.: new limit: MAX_STAGE_FILE_NO = 1000 00119 * 29. 2.2008, H.G.: new actions (for /lustre): 00120 * COPY_TO_FILESYSTEM, RETRIEVE_TO_FILESYSTEM 00121 * 6. 3.2008, H.G.: new parameter srawComm: iDataFS, cDataFS 00122 * 7. 4.2008, H.G.: new parameter srawComm: iReservation, 00123 * new action MIGRATE_CACHE_PATH 00124 * 17. 4.2008, H.G.: new action ARCHIVE_FROM_FILESYSTEM 00125 * 21. 4.2008, H.G.: change MAX_ATLSERVER, MAX_MASTER -> 1 00126 * 23. 4.2008, H.G.: new status STA_FILE_CACHED 00127 * 8. 5.2008, H.G.: move static declaration [p]cOS from rawclin.h 00128 * 9. 5.2008, H.G.: add typedef srawFileList 00129 * (replaces srawArchList in rawclin.h) 00130 * 19. 5.2008, H.G.: remove old declarations: cNodeMaster1, 00131 * cNodeMaster2A, cNodeMaster2B 00132 * 2. 6.2008, H.G.: replace long->int if 64 bit client (ifdef SYSTEM64) 00133 * server still 32 bit 00134 * 3. 6.2008, H.G.: replace MBUF_API (unused) by MBUF_RFIO 00135 * 19. 6.2008, H.G.: new ident: IDENT_CACHE_STATUS 00136 * decrease MAX_NUM_DM: 16 -> 10 (no more Windows) 00137 * 14. 8.2008, H.G.: new ACTION SHOW_ARCHIVES 00138 * 3. 9.2008, H.G.: new statics cDataFSHigh, iDataFSHigh 00139 * 12. 1.2008, H.G.: add definition PORT_MOVER_DATAFS 00140 * 16. 9.2008, H.G.: cDataFSHigh -> cDataFSHigh1, cDataFSHigh2 00141 * remove iDataFSHigh 00142 * 17. 9.2008, H.G.: set MBUF_SOCK, MBUF_ADSM to 32768 00143 * 12.12.2008, H.G.: add definition CUR_QUERY_LIMIT 00144 * 12. 2.2009, H.G.: new identifier: IDENT_COPY_CACHE 00145 * add structure srawCopyCache to srawAPIFile 00146 * 23. 2.2009, H.G.: new status: STA_CACHE_COPY, STA_CACHE_COPY_ERROR 00147 * 24. 2.2009, H.G.: add cDataFSType 00148 * 10. 3.2009, H.G.: add trailing '/' to cDataFSHigh1, cDataFSHigh2 00149 * new definition MIN_DATAFS_PATH 00150 * 8. 4.2009, H.G.: action COPY_TO_FILESYSTEM -> COPY_RC_TO_FILESYSTEM 00151 * new action COPY_WC_TO_FILESYSTEM 00152 * 25. 5.2009, H.G.: new global strings cAdminUser, cForceMigPath 00153 * 1. 7.2009, H.G.: new IDENT_ARCHIVE_LIST, srawArchiveList 00154 * 3. 9.2009, H.G.: move MAX_STAGE_FILE_NO to rawservn.h 00155 * 28. 9.2009, H.G.: rename READ_FROM_CACHE to SEND_FROM_CACHE 00156 * 27.11.2009, H.G.: adds new definitions: MAX_OBJ_FS_N, MAX_OBJ_HL_N, 00157 * MAX_OBJ_LL_N, MAX_MC_N 00158 * 4.12.2009, H.G.: enhanced structure srawObjAttr (version 5) 00159 * keep old structure as srawObjAttrOld (version 4) 00160 * 7.12.2009, H.G.: new definition: VERSION_SRAWOBJATTR 00161 * 18.12.2009, H.G.: overall usage of new object sizes in MAX_OBJ_FS_N, 00162 * MAX_OBJ_HL_N, MAX_OBJ_LL_N (but no trailing _N) 00163 * for srawObjAttrOld: 00164 * MAX_OBJ_HL -> MAX_OBJ_HL_O, 00165 * MAX_OBJ_LL -> MAX_OBJ_LL_O 00166 * 14. 1.2010, H.G.: MAX_MC -> MAX_MC_O (in srawObjAttrOld), 00167 * MAX_MC_N -> MAX_MC 00168 * srawObjAttr: cMgmtClass[MAX_MC+2] (padded 8 byte) 00169 * remove unused ARCH_TAPE_MC_2, RETR_STAGE_DATE 00170 * srawObjAttr: new mem iDM (for 8 byte padding) 00171 * 28. 1.2010, H.G.: new definition: MAX_FULL_FILE 00172 * enhance STATUS_LEN 256 -> 512 00173 * 29. 1.2010, H.G.: srawFileList.cFile: MAX_FILE -> MAX_FULL_FILE 00174 * srawComm.cDataFS: MAX_FILE -> MAX_FULL_FILE 00175 * srawCopyCache.cCopyPath: MAX_FILE -> MAX_FULL_FILE 00176 * 5. 2.2010, H.G.: mod. values: MAX_OBJ_HL 112, MAX_OBJ_LL 52 00177 * srawObjAttr: new mem iDummy (for 8 byte padding) 00178 * new: SIZE_CACHE_METADATA_5, SIZE_CACHE_METADATA_4 00179 * 11. 2.2010, H.G.: new definition: MAX_OBJ_HL_LEVEL 00180 * 22. 2.2010, H.G.: srawObjAttr.iFileSize[2]: two int for future 64 bit: 00181 * 4 byte padding, ident struct size 32/64 bit env 00182 * if long in 64 bit env: 8 byte padding, diff struct 00183 * sizes (also in V1, V2 metadata structures) 00184 * 16. 4.2010, H.G.: srawDataMoverAttr: iSynchId -> iATLServer 00185 * 9. 6.2010, H.G.: IDENT_PROC_INFO, MAX_ITEM added 00186 * 3. 9.2010, H.G.: srawComm: enable 8 byte filesize in 64 bit OS 00187 * new iFileSize2, MAX_APPLTYPE: 32 -> 28 00188 * 10. 9.2010, H.G.: discard SYSTEM64, srawObjAttrOld: 4 byte iFileSize 00189 * 6.10.2010, H.G.: srawComm: new iClient32 00190 * new definition: MAX_FILE_SIZE_U 00191 * 26.11.2010, H.G.: string cTooBig: substitute for filesizes >= 4 GB 00192 * ********************************************************************* 00193 */ 00194 00195 #define PORT_MASTER 1996 /* default port number master server */ 00196 #define PORT_MOVER 1994 /* default port number data mover */ 00197 #define PORT_MOVER_DATAFS 1998 00198 /* default port number data mover writing to central data FS */ 00199 #define PORT_RFIO_SERV 1974 /* default port number RFIO server */ 00200 00201 #define ATLSERVER_ARCHIVE 1 /* API write: 1: IBM 3494, 2: SANLB2 */ 00202 #define MAX_ATLSERVER 1 /* max no. of ATL servers */ 00203 #define MAX_MASTER 1 /* max number of master servers */ 00204 #define MAX_NUM_DM 10 /* max no. of data movers on platform */ 00205 00206 #define MBUF_SOCK 32768 /* default buffer size sockets */ 00207 #define MBUF_ADSM 32768 /* default buffer size ADSM */ 00208 #define MBUF_RFIO 32768 /* max currently possible in MBS */ 00209 #define CUR_QUERY_LIMIT 0 00210 /* no. of entries in query buffer 00211 =0: current no. has default value (MBUF_SOCK - HEAD_LEN)/iObjAttr 00212 >0 in any case limited by default value */ 00213 00214 #define SLEEP_CACHE_FULL 600 /* wait time/iter, if write cache full */ 00215 #define MAXLOOP_CACHE_FULL 3 /* max no of iter, if write cache full */ 00216 00217 #define DEF_FILESIZE 2044000000 /* assume <2GByte, if unavailable */ 00218 #define MAX_FILE_SIZE 2147483647 /* max filesize 2GByte-1 (signed) */ 00219 #define MAX_FILE_SIZE_U 4294967295 /* max size 4GByte-1 (unsigned) */ 00220 #define MAX_FILE_NO 1024 /* max number of file names in list */ 00221 00222 static const char cTooBig[8] = "(>=4GB)"; 00223 /* for 32 bit clients: substitute for filesize >= 4GB */ 00224 00225 #define MAX_NODE 16 /* max length node name */ 00226 static char cNodeMaster0[MAX_NODE] = "lxgstore"; /* entry server */ 00227 static char cNodeMasterE1[MAX_NODE] = "lxha05"; /* def entry server */ 00228 static char cNodeMasterE2[MAX_NODE] = "lxha04"; /* bkp entry server */ 00229 00230 #define MIN_DATAFS_PATH 12 /* min path length in lustre */ 00231 static char cDataFSType[16] = "lustre"; /* general name */ 00232 static char cDataFSHigh1[16] = "/lustre_alpha/"; /* 1st instance */ 00233 static char cDataFSHigh2[16] = "/lustre/"; /* prod instance */ 00234 00235 #define MAX_OWNER 16 /* max length object owner */ 00236 static char cAdminUser[MAX_OWNER] = "goeri"; /* special user */ 00237 static char cForceMigPath[32] = "/ArchiveNow"; /* special path name */ 00238 00239 /* query client operating system */ 00240 #define MAX_OS 8 /* max length operating system name */ 00241 static char *pcOS; 00242 #ifdef _AIX 00243 static char cOS[MAX_OS] = "AIX "; 00244 #endif 00245 #ifdef Linux 00246 static char cOS[MAX_OS] = "Linux "; 00247 #endif 00248 #ifdef Lynx 00249 static char cOS[MAX_OS] = "Lynx "; 00250 #endif 00251 #ifdef VMS 00252 static char cOS[MAX_OS] = "VMS "; 00253 #endif 00254 00255 #define MAX_FULL_FILE 256 /* max length full file name */ 00256 #define MAX_FILE 128 /* max length rel. file name */ 00257 #define MAX_TAPE_FILE 17 /* max length file name on tape */ 00258 00259 #define VERSION_SRAWOBJATTR 5 /* cur version of struct srawObjAttr */ 00260 #define SIZE_CACHE_METADATA_5 424 /* cur size of cacheDB entry */ 00261 #define SIZE_CACHE_METADATA_4 344 /* old size of cacheDB entry */ 00262 00263 #define MAX_OBJ_FS 32 00264 /* max len filespace name, in code limited to 26 due to MC */ 00265 #define MAX_OBJ_HL 112 /* max length object high level name */ 00266 #define MAX_OBJ_LL 52 /* max length object low level name */ 00267 #define MAX_OBJ_HL_O 92 /* max length object high level name */ 00268 #define MAX_OBJ_LL_O 36 /* max length object low level name */ 00269 #define MAX_OBJ_HL_LEVEL 14 00270 /* max no. gStore directory levels, if MAX_OBJ_xx fully utilized */ 00271 00272 #define MAX_MC 30 00273 /* length ManagementClass name: 00274 limited by TSM (V5.5) to DSM_MAX_MC_NAME_LENGTH = 30 00275 -> length filespace name (26) + length('TAPE') */ 00276 #define MAX_MC_O 12 /* max length Management class name */ 00277 00278 #define MAX_DATE 20 /* max length archive date and time */ 00279 #define MAX_APPLTYPE 28 /* max length application type */ 00280 #define MAX_ITEM 32 /* max length of process item */ 00281 00282 #define HEAD_OFFSET 3 /* offset common pre-header (ints) */ 00283 #define HEAD_LEN 12 /* length common pre-header (bytes) */ 00284 #define STATUS_LEN 512 /* max length status/error message */ 00285 #define WORK_LEN 20 /* length work space info */ 00286 00287 /* identifiers for buffer headers transfered via sockets */ 00288 /* at least IDENT_STATUS must be <0 to avoid confusion with data */ 00289 #define IDENT_COMM -1 /* communication control buffer */ 00290 #define IDENT_STATUS -2 /* status buffer from/to client */ 00291 #define IDENT_QUERY -3 /* query result buffer */ 00292 #define IDENT_POOL -4 /* stage pool info buffer */ 00293 #define IDENT_WORKSPACE -5 /* work space info buffer */ 00294 #define IDENT_NEXT_BUFFER -6 /* request next data buffer */ 00295 #define IDENT_MOVER_ATTR -7 /* data mover attributes */ 00296 #define IDENT_STAGE_FILE -8 /* stage file data (read cache) */ 00297 #define IDENT_SPACE_INFO -9 /* data mover space info */ 00298 #define IDENT_PURGE_INFO -10 /* purge request for data mover */ 00299 #define IDENT_SPACE_LOOK -11 /* meta data DB space info */ 00300 #define IDENT_CLEAN_REQUEST -12 /* clean request for stage pool */ 00301 #define IDENT_FILELIST_REQUEST -13 /* filelist request for stage FS */ 00302 #define IDENT_QUERY_ARCHDB -14 /* query result buffer archDB */ 00303 #define IDENT_FULL_ARCHDISK -15 /* buffer describing full disk */ 00304 #define IDENT_ARCHIVE_FILE -16 /* archive file data (write cache) */ 00305 #define IDENT_STAGE_LIST -17 /* list of read cache object data */ 00306 #define IDENT_QUERY_FILEDB -18 /* query result buffer fileDB */ 00307 #define IDENT_QUERY_DONE -19 /* last query result buffer */ 00308 #define IDENT_CACHE_STATUS -20 /* request query/set cache status */ 00309 #define IDENT_COPY_CACHE -21 /* copy DAQ stream data from cache */ 00310 #define IDENT_ARCHIVE_LIST -22 /* list of archive names */ 00311 #define IDENT_PROC_INFO -23 /* get/update proc no. in cacheDB */ 00312 #define IDENT_COMM64 -24 /* communication control buffer */ 00313 00314 enum ARCH_DEVICE /* logical archive device */ 00315 { 00316 ARCH_ANY, /* 0: any device (for query) */ 00317 ARCH_TAPE, /* 1: standard tape class */ 00318 ARCH_TAPE_MC, /* 2: user specific tape class for archive */ 00319 MGR_TAPE, /* 3: tape for system manager: special MC */ 00320 ARCH_DISK, /* 4: disk in ArchivePool */ 00321 ARCH_DAQ_DISK /* 5: disk in DaqPool (RFIO only) */ 00322 }; 00323 00324 enum RETR_DEVICE /* logical staging device */ 00325 { 00326 RETR_CLIENT, /* 0: no staging */ 00327 RETR_STAGE_TEMP, /* 1: no expiration date (retrieve) */ 00328 RETR_STAGE_PERM, /* 2: with expiration date (stage) */ 00329 RETR_FILESYSTEM /* 3: retrieve to central file system */ 00330 }; 00331 00332 enum FILETYPE /* describes data */ 00333 { 00334 FIXED_INTS4, /* 0: fixed records, 4 byte int (signed) */ 00335 STREAM /* 1: record length not defined */ 00336 }; 00337 00338 enum ACTION /* action */ 00339 { 00340 ARCHIVE, /* 0: archive files to TSM */ 00341 ARCHIVE_MGR, /* 1: archive sysmgr: set owner, special MC */ 00342 ARCHIVE_RECORD, /* 2: archive file from client program to WC */ 00343 ARCHIVE_OVER, /* 3: archive file with overwrite (client only) 00344 on server: REMOVE + ARCHIVE_TO_CACHE */ 00345 CREATE_ARCHIVE, /* 4: sysmgr only: create new archive */ 00346 CLOSE, /* 5: close tape (client) */ 00347 REMOVE, /* 6: delete file from mass storage */ 00348 REMOVE_MGR, /* 7: delete file from mass storage (sysmgr) */ 00349 FILE_CHECK, /* 8: only needed for client side */ 00350 OPEN, /* 9: open tape (client) */ 00351 QUERY, /* 10: query for files in mass storage */ 00352 QUERY_ARCHIVE, /* 11: query files before ARCHIVE */ 00353 QUERY_ARCHIVE_MGR, /* 12: query files before ARCHIVE (sysmgr) */ 00354 QUERY_REMOVE, /* 13: query for files to be deleted */ 00355 QUERY_REMOVE_MGR, /* 14: query for files to be deleted (sysmgr) */ 00356 RETRIEVE, /* 15: retrieve file to client */ 00357 RETRIEVE_RECORD, /* 16: retrieve file via client api (via RC) */ 00358 RETRIEVE_STAGE, /* 17: retrieve file to client via read cache */ 00359 STAGE, /* 18: stage file to read cache */ 00360 QUERY_UNSTAGE, /* 19: query for files to be unstaged */ 00361 UNSTAGE, /* 20: remove file from read cache */ 00362 QUERY_POOL, /* 21: query for status of disk pools */ 00363 QUERY_WORKSPACE, /* 22: query files to be staged, get RC status*/ 00364 QUERY_STAGE, /* 23: query for files to be staged */ 00365 ARCHIVE_TO_CACHE, /* 24: arch. files from client to write cache */ 00366 ARCHIVE_FROM_CACHE, /* 25: archive files from write cache to TSM */ 00367 QUERY_RETRIEVE, /* 26: query for files to be retrieved */ 00368 QUERY_ARCHIVE_OVER, /* 27: query for files before ARCHIVE_OVER */ 00369 QUERY_ARCHIVE_TO_CACHE, /* 28: query before ARCHIVE_TO_CACHE */ 00370 SPM_REQUEST_MOVER, /* 29: request data mover for action */ 00371 QUERY_RETRIEVE_RECORD, /* 30: query before RETRIEVE_RECORD */ 00372 QUERY_ARCHIVE_FROM_CACHE, /* 31: query before ARCHIVE_FROM_CACHE */ 00373 END_SESSION, /* 32: end session on server */ 00374 QUERY_ARCHIVE_RECORD, /* 33: query before ARCHIVE_RECORD */ 00375 STAGE_FROM_CACHE, /* 34: copy files from WC to RC */ 00376 RETRIEVE_FROM_CACHE, /* 35: retr. files from WC via RC */ 00377 SEND_FROM_CACHE, /* 36: read from write cache, send to DM */ 00378 QUERY_RETRIEVE_STAGE, /* 37: query before RETRIEVE_STAGE */ 00379 COPY_RC_TO_FILESYSTEM, /* 38: copy from read cache to mounted FS */ 00380 RETRIEVE_TO_FILESYSTEM, /* 39: retrieve from TSM to mounted FS */ 00381 ARCHIVE_FROM_FILESYSTEM, /* 40: archive from mounted FS */ 00382 COPY_WC_TO_FILESYSTEM, /* 41: copy from write cache to mounted FS */ 00383 MIGRATE_CACHE_PATH, /* 42: migrate complete write cache path */ 00384 QUERY_FILESERVER, /* 43: query files in specified 2nd level DM */ 00385 SEND_TO_FILESERVER, /* 44: read from RC, send to FileServer */ 00386 RECEIVE_FROM_DM, /* 45: on FileServer: recv from DM, write to FS */ 00387 SHOW_ARCHIVES /* 46 show list of matching archives */ 00388 }; 00389 00390 typedef struct /* info for file list */ 00391 { 00392 char cFile[MAX_FULL_FILE]; /* fully qualified file name */ 00393 } srawFileList; 00394 00395 /* command buffer with object attributes, used only for 32 bit OS */ 00396 typedef struct 00397 { 00398 int iIdent; /* IDENT_COMM identifies command buffer */ 00399 int iAction; /* see definition of ACTION */ 00400 int iCommLen; /* length of following data */ 00401 char cNamefs[MAX_OBJ_FS]; /* filespace name */ 00402 char cNamehl[MAX_OBJ_HL]; /* object high level name */ 00403 char cNamell[MAX_OBJ_LL]; /* file name / object low level name */ 00404 char cOwner[MAX_OWNER]; /* account name of requestor */ 00405 char cOS[MAX_OS]; /* user operating system */ 00406 char cApplType[MAX_APPLTYPE]; /* application type */ 00407 int iFileType; /* see definition of FILETYPE */ 00408 int iBufsizeFile; /* buffer size file */ 00409 unsigned int iFileSize; /* file size (byte), overlaid with 'long' */ 00410 unsigned int iFileSize2; /* both together 8 byte */ 00411 int iArchDev; /* = ARCH_DEVICE or RETR_DEVICE */ 00412 unsigned int iObjHigh; /* upper four bytes object Id */ 00413 unsigned int iObjLow; /* lower four bytes object Id */ 00414 char cliNode[MAX_NODE]; /* client node name */ 00415 int iExecStatus; /* execution status set by LockManager: 00416 = 1: active, = 2 waiting, = 3 suppressed */ 00417 int iWaitTime; /* time to wait before execution (seconds) */ 00418 int iSynchId; /* = 1: RFIO write in DAQ mode (1st: select DM) */ 00419 /* =11: requested action recursive */ 00420 char cTapeLib[16]; /* name of ATL: "" default, "*" all */ 00421 char cNodeCacheMgr[MAX_NODE]; /* name of node with cache mgrs */ 00422 int iATLServer; /* =1: aixtsm1(AIX), =2: gsitsma(Win), 00423 < 0: test system */ 00424 int iPoolIdRC; /* read cache PoolId (= 0: not in RC) */ 00425 char cNodeRC[MAX_NODE]; /* read cache DM name (= "": not in RC) */ 00426 int iStageFSid; /* stage FS no. on read cache DM (= 0: not in RC) */ 00427 int iPoolIdWC; /* write cache PoolId (= 0: not in WC) */ 00428 char cNodeWC[MAX_NODE]; /* write cache DM name (= "": not in WC) */ 00429 int iFSidWC; /* FS no. on write cache DM (= 0: not in WC) */ 00430 char cNodeFC[MAX_NODE]; /* file server cache node ("": not in FC) */ 00431 int iFSidFC; /* FS no. on file server cache node (= 0: not in FC) */ 00432 int iDataFS; /* =1: retrieve directly to central data FS */ 00433 char cDataFS[MAX_FULL_FILE]; /* full path in central data FS */ 00434 int iClient32; /* =1: 32 bit gstore/RFIO client */ 00435 int iReservation; /* >0: current object belongs to workspace with 00436 specified space reservation number */ 00437 } srawComm; 00438 00439 enum STATUS /* status of action */ 00440 { 00441 STA_BEGIN_TRANS, /* 0: server ready for data transfer */ 00442 STA_NEXT_BUFFER, /* 1: API client: request next sequ. buffer */ 00443 STA_END_OF_FILE, /* 2: okay, handle next file */ 00444 STA_END_OF_SESSION, /* 3: okay, end session */ 00445 STA_ERROR, /* 4: error, end session */ 00446 STA_ERROR_EOF, /* 5: error, handle next file */ 00447 STA_FILE_STAGED, /* 6: file staged (RC) or written to data FS */ 00448 STA_END_OF_FILE_NOT_STAGED, /* 7: file retrieved, but not staged */ 00449 STA_SEEK_BUFFER, /* 8: API client: seek new buffer */ 00450 STA_ARCHIVE_AVAIL, /* 9: archive already available on server */ 00451 STA_SWITCH_SERVER, /* 10: switch data mover */ 00452 STA_INFO, /* 11: informatory message */ 00453 STA_PURGED, /* 12: some/all requested files purged on DM */ 00454 STA_NOT_PURGED, /* 13: no file could be purged on DM */ 00455 STA_CACHE_FULL, /* 14: write cache currently full */ 00456 STA_CACHE_FILE_AWAY, 00457 /* 15: file no longer in write cache, probably archived */ 00458 STA_ARCHIVE_NOT_AVAIL, /* 16: archive not available on server */ 00459 STA_NO_ACCESS, /* 17: requested access to archive not allowed */ 00460 STA_SWITCH_ENTRY, /* 18: switch entry server */ 00461 STA_ENTRY_INFO, /* 19: info: name of entry server */ 00462 STA_FILE_CACHED, /* 20: file cached (WC) from central data FS */ 00463 STA_CACHE_COPY, /* 21: successfull copy from WC to central dataFS */ 00464 STA_CACHE_COPY_ERROR 00465 /* 22: error status for copy from WC to central data FS */ 00466 }; 00467 00468 typedef struct /* Status buffer */ 00469 { 00470 int iIdent; /* IDENT_STATUS identifies status buffer */ 00471 int iStatus; /* see definition of STATUS */ 00472 int iStatusLen; /* length of following message */ 00473 char cStatus[STATUS_LEN]; /* status message */ 00474 } srawStatus; 00475 00476 typedef struct /* Request buffer for API client */ 00477 { 00478 int iIdent; /* IDENT_NEXT_BUFFER identifies request buffer */ 00479 int iStatus; /* see definition of STATUS */ 00480 int iStatusLen; /* length of following info */ 00481 int iSeekMode; /* byte offset mode (see lseek C function): 00482 SEEK_SET: set offset to iOffset bytes 00483 SEEK_CUR: increase current offset for iOffset bytes 00484 SEEK_END: set offset to file size plus iOffset bytes */ 00485 int iOffset; /* requested byte offset */ 00486 int iBufferSize; /* length of requested buffer */ 00487 } srawRequest; 00488 00489 typedef struct /* object attribute buffer version 4 */ 00490 { 00491 int iVersion; /* structure version: 4, 304 byte */ 00492 char cNamefs[MAX_OBJ_FS]; /* filespace name */ 00493 char cNamehl[MAX_OBJ_HL_O]; /* object high level name */ 00494 char cNamell[MAX_OBJ_LL_O]; /* file name / object low level name */ 00495 int iFileType; /* see definition of FILETYPE */ 00496 int iBufsizeFile; /* buffer size file */ 00497 unsigned int iFileSize; /* file size in bytes, old: 4 byte okay */ 00498 char cDate[MAX_DATE]; /* archive date and time */ 00499 char cOwner[MAX_OWNER]; /* account name of owner */ 00500 char cOS[MAX_OS]; /* operating system archiving client */ 00501 char cMgmtClass[MAX_MC_O]; /* management class */ 00502 int iMediaClass; /* media class */ 00503 unsigned int iObjHigh; /* upper four bytes object Id */ 00504 unsigned int iObjLow; /* lower four bytes object Id */ 00505 unsigned int iRestoHigh; /* top four bytes restore order */ 00506 unsigned int iRestoLow; /* lo_lo four bytes restore order */ 00507 int iFS; /* filesystem number if file on disk */ 00508 char cNode[MAX_NODE]; /* node name data mover */ 00509 char cStageUser[MAX_OWNER]; /* account name of staging user */ 00510 int iATLServer; /* =1: aixtsm1(AIX), =2: gsitsma(Win), 00511 < 0: test system */ 00512 unsigned int iRestoHighHigh;/* hi_hi four bytes restore order */ 00513 unsigned int iRestoHighLow; /* hi_lo four bytes restore order */ 00514 unsigned int iRestoLowHigh; /* lo_hi four bytes restore order */ 00515 } srawObjAttrOld; 00516 00517 typedef struct /* query info of gStore object version 5 from server, 00518 part of cacheDB buffer relevant for client */ 00519 { 00520 int iVersion; /* structure version: VERSION_SRAWOBJATTR */ 00521 int iSize; /* size of this structure (version 5: 384 byte) */ 00522 char cNamefs[MAX_OBJ_FS]; /* filespace name */ 00523 char cNamehl[MAX_OBJ_HL]; /* object high level name */ 00524 char cNamell[MAX_OBJ_LL]; /* file name / object low level name */ 00525 int iFileType; /* see definition of FILETYPE */ 00526 int iBufsizeFile; /* buffer size */ 00527 unsigned int iFileSize; /* file size (byte), overlaid with 'long' */ 00528 unsigned int iFileSize2; /* both together 8 byte */ 00529 char cDateCreate[MAX_DATE]; /* creation date/time in gStore */ 00530 char cOwner[MAX_OWNER]; /* account name of owner */ 00531 char cOS[MAX_OS]; /* operating system archiving client */ 00532 char cMgmtClass[MAX_MC+2]; /* TSM management class, padded 8 byte */ 00533 int iMediaClass; /* media class */ 00534 unsigned int iObjHigh; /* upper four bytes object Id */ 00535 unsigned int iObjLow; /* lower four bytes object Id */ 00536 unsigned int iRestoHigh; /* top four bytes restore order */ 00537 unsigned int iRestoHighHigh; /* hi_hi four bytes restore order */ 00538 unsigned int iRestoHighLow; /* hi_lo four bytes restore order */ 00539 unsigned int iRestoLowHigh; /* lo_hi four bytes restore order */ 00540 unsigned int iRestoLow; /* lo_lo four bytes restore order */ 00541 int iATLServer; 00542 /* =1: aixtsm1 (AIX), =2: gsitsma (Win), < 0: test system */ 00543 int iPoolId; 00544 /* disk pool identifier: 00545 1: RetrievePool ATLServer1 (created by retrieve) 00546 2: StagePool ATLServer1 (created by stage) 00547 3: ArchivePool ATLServer1 (write cache) 00548 4: DAQPool ATLServer1 (write cache) 00549 11: RetrievePool ATLServer2 (created by retrieve) 00550 12: StagePool ATLServer2 (created by stage) 00551 13: ArchivePool ATLServer2 (write cache) 00552 14: DAQPool ATLServer2 (write cache) 00553 */ 00554 char cNode[MAX_NODE]; /* node name data mover */ 00555 int iDM; /* cache data mover number, =0: not in cache */ 00556 int iFS; /* cache filesystem number, =0: not in cache */ 00557 int iFileSet; /* Id of file set (handled parallel) */ 00558 int iDummy; /* for 8 byte padding */ 00559 char cStageUser[MAX_OWNER]; /* account name of staging user */ 00560 } srawObjAttr; 00561 00562 typedef struct /* Query response buffer */ 00563 { 00564 int iIdent; /* IDENT_QUERY, IDENT_QUERY_ARCHDB, IDENT_QUERY_DONE */ 00565 int iObjCount; /* no. of objects matching */ 00566 int iAttrLen; /* length attributes buffer of object */ 00567 srawObjAttr objAttr; /* attributes of object found */ 00568 /* appended for each object */ 00569 } srawQueryResult; 00570 00571 /* stage pool attributes for one data mover */ 00572 typedef struct 00573 { 00574 char cNodeName[MAX_NODE]; /* node name data mover */ 00575 int iMaxSizeMover; /* max size of pool on this data mover (MByte) */ 00576 int iFreeSizeHW; /* current free size in hardware (MByte) */ 00577 int iFreeSize; /* current free size in pool (MByte) */ 00578 int iFiles; /* current no. of files in pool */ 00579 int iFileSystems; /* no. of FS on this data mover: 00580 = 0: all FS, > 0: list follows (srawStageFS) */ 00581 } srawPoolStatusDMData; 00582 00583 /* stage pool attributes */ 00584 typedef struct 00585 { 00586 char cPoolName[32]; /* pool name */ 00587 char cPoolOS[MAX_OS]; /* name of OS where pool resides */ 00588 int iPoolId; /* pool identification number */ 00589 int iMaxSizeHW; /* overall size of HW (MByte) */ 00590 int iFreeSizeHW; /* current free size in HW (MByte) */ 00591 int iMaxSize; /* overall size of pool (MByte) */ 00592 int iFreeSize; /* current free size in pool (MByte) */ 00593 int iMaxWorkSize; /* max size of work space in pool (MByte) */ 00594 int iFileAvail; /* guaranteed availability of files (days) */ 00595 int iCheckSize; 00596 /* threshold work space size for check of pool status (MByte) */ 00597 int iFiles; /* current no. of files in pool */ 00598 int iDataMover; /* number of data movers in pool */ 00599 } srawPoolStatusData; 00600 00601 /* for exchange with client: status buffers stage pool + WS */ 00602 typedef struct 00603 { 00604 int iIdent; /* IDENT_POOL identifies pool status header */ 00605 int iPoolNo; /* no. of pool + WS buffers following */ 00606 int iStatusLen; /* size of following data (n pools, opt. 1 WS) */ 00607 srawPoolStatusData sPoolStatusData; /* stage pool attributes */ 00608 } srawPoolStatus; 00609 00610 typedef struct /* server infos on requ. work space */ 00611 { 00612 int iIdent;/* IDENT_WORKSPACE identifies work space status header */ 00613 int iWorkId; /* work space identification number */ 00614 int iStatusLen; /* length of following data */ 00615 int iWorkSizeAll; /* size of requ. work space (MByte) */ 00616 int iWorkFilesAll; /* total no. of files in work space */ 00617 int iWorkSizeSta; /* part of requ. work space already staged */ 00618 int iWorkFilesSta; /* no. of files in work space already staged */ 00619 int iWorkSizeStaTemp; /* part of staged work space in temp pool */ 00620 int iWorkFilesStaTemp; /* no. of staged files in temp pool */ 00621 int iWorkSizeEst; /* part of requ. work space size estimated */ 00622 int iWorkFilesEst; 00623 /* no. of files in work space with size estimated */ 00624 int iStatus; /* work space status flag: 00625 = -1: problem, can't create 00626 = 0: okay, space available 00627 = 1: lack of space in pool 00628 = 2: above allowed limit of work space 00629 = 3: work space larger than pool 00630 = 9: lack of space -> clean job, no sleep 00631 >= 10: lack of space -> clean job, sleep iStatus min. 00632 */ 00633 } srawWorkSpace; 00634 00635 typedef struct /* attributes of data mover */ 00636 { 00637 char cNode[MAX_NODE]; /* node name */ 00638 int iPort; /* port no. */ 00639 int iSocket; /* socket no. */ 00640 int iExecStatus; /* execution status set by LockManager (unused): 00641 = 1: active, = 2 waiting, = 3 suppressed */ 00642 int iWaitTime; /* time to wait before execution (seconds) */ 00643 int iATLServer; /* number of ATL Server */ 00644 } srawDataMoverAttr; 00645 00646 typedef struct /* communication buffer with data mover attributes */ 00647 { 00648 int iIdent; /* IDENT_STATUS identifies status buffer */ 00649 int iStatus; /* see definition of STATUS */ 00650 int iStatusLen; /* length of following message */ 00651 srawDataMoverAttr sDataMoverAttr; /* attributes of data mover */ 00652 } srawDataMover; 00653 00654 typedef struct /* filesystem infos */ 00655 { 00656 char cOS[MAX_OS]; /* operating system */ 00657 char cNode[MAX_NODE]; /* node name */ 00658 int iFileSystem; /* no. of filesystem on node */ 00659 char cArchiveDate[MAX_DATE]; /* creation date in ArchivePool */ 00660 char cArchiveUser[MAX_OWNER]; /* account name of archiving user */ 00661 } srawFileSystem; 00662 00663 typedef struct /* for copy of DAQ data stream to dataFS */ 00664 { 00665 int iIdent; /* IDENT_COPY_CACHE */ 00666 int iCopyMode; 00667 /* = 0: ignore this buffer 00668 = 1: copy to pcCopyPath AFTER file written to WC 00669 (for high data rates, don't interfere writing to cache) 00670 = 2: for dataFS only: 00671 write each data buffer to WC and pcCopyPath 00672 (for low data rates, anyhow first buffers quickly 00673 available in lustre) 00674 */ 00675 int iCopyLen; /* length following data (byte) */ 00676 char cCopyPath[MAX_FULL_FILE]; 00677 /* destination where to be copied 00678 = "/lustre..." => fully qualified path name in lustre 00679 if not existing: will be created (see iPathConvention) 00680 = "RC" => read cache 00681 */ 00682 int iCopyFraction; 00683 /* = i>0: copy each ith file to pcCopyPath 00684 if tape migration fails: ignore iCopyFraction, copy 00685 each file 00686 */ 00687 int iMaxFile; 00688 /* for dataFS only: 00689 = 0: no file limit 00690 > 0: max no. of files to be written to directory 00691 files already existing are ignored 00692 if iMaxFile reached, new directory will be created 00693 (same level as previous directory) 00694 */ 00695 int iPathConvention; 00696 /* rules for creation of initial/new path 00697 = 0: default convention 00698 initially specified .../xxx => .../xxx 00699 last .../xxx => create ...xxx1 00700 last .../xxxi => create ...xxxj j=i+1 00701 = 1: Hades convention: path name contains time stamp 00702 initially specified .../xxx => .../xxxyydddhhmm 00703 new => .../xxxyydddhhmm 00704 */ 00705 } srawCopyCache; 00706 00707 typedef struct /* list of archives */ 00708 { 00709 int iIdent; /* IDENT_ARCHIVE_LIST */ 00710 int iArchCount; /* no. of archives names following */ 00711 int iArchSize; /* length of following data (byte) */ 00712 char cArchive[MAX_OBJ_FS]; /* archive name */ 00713 } srawArchiveList; 00714