00001 /********************************************************************* 00002 * Copyright: 00003 * GSI, Gesellschaft fuer Schwerionenforschung mbH 00004 * Planckstr. 1 00005 * D-64291 Darmstadt 00006 * Germany 00007 * created 1. 3.1996 by Horst Goeringer 00008 ********************************************************************* 00009 * rawclin.h 00010 * structures and definitions needed for rawserv clients only 00011 ********************************************************************* 00012 * 3. 2.1998, H.G.: add iFileSize to srawRetrList 00013 * 17. 1.2001, H.G.: add srawAPIFile for API clients 00014 * 22. 1.2001, H.G.: pad OS names with trailing blanks 00015 * 7. 2.2001, H.G.: in srawAPIFile: srawObjAttr added 00016 * 18. 7.2001, H.G.: add mover node name to srawRetrList 00017 * 24. 8.2001, H.G.: add stage flag to srawRetrList 00018 * 5. 8.2002, H.G.: srawAPIClient: replace iSockServ by iSockMaster 00019 * and iSockMover, add cNodeMover 00020 * 14.10.2002, H.G.: ported to Lynx 00021 * 27. 1.2003, H.G.: structure srawCliActionComm added 00022 * 3. 2.2003, H.G.: add master number to srawRetrList 00023 * 14. 2.2003, H.G.: srawCliActionComm: iDebug -> iReqMaster 00024 * 17. 2.2003, H.G.: srawCliActionComm: add tape infos 00025 * new statics iPortMaster, iPortMover 00026 * 18. 2.2003, H.G.: rename sTapeFileList->srawTapeFileList 00027 * 10. 4.2003, H.G.: add iFileType to srawRetrList 00028 * 11. 6.2003, H.G.: srawCliActionComm: new iAltQuery, iMaxQuery 00029 * 5.12.2003, H.G.: srawCliActionComm: new iFilesIgnore 00030 * 23. 2.2004, H.G.: srawCliActionComm: new iObjArchiveDB, 00031 * iObjStaged -> iObjStageDB 00032 * srawRetrList: new iArchiveFS, iStage -> iStageFS 00033 * 4. 3.2004, H.G.: srawRetrList: new cArchiveDate, cOwner 00034 * 20. 8.2004, H.G.: srawAPIFile: new iAction, iBufsizeServD->iMassSto 00035 * 15.12.2004, H.G.: srawAPIFile: iBufsizeServ->iOpMode 00036 * 13. 3.2006, H.G.: declare iPortMaster, iPortMover in sources 00037 * 9.10.2006, H.G.: srawCliActionComm: new iATLServer 00038 * 8. 2.2007, H.G.: srawRetrList: iMaster -> iATLServer 00039 * 19. 3.2008, H.G.: srawRetrList: cNodeMover -> cMoverStage, 00040 * iArchiveFS -> iCacheFS 00041 * new: cMoverCache, iRestoHighHigh, iRestoHighLow, 00042 * iRestoLowHigh 00043 * 8. 4.2008, H.G.: declare and set cPathPrefix,cDataFSHigh 00044 * declare iPathPrefix, iDataFSHigh 00045 * 8. 5.2008, H.G.: move static declaration [p]cOS -> rawcommn.h 00046 * 9. 5.2008, H.G.: remove srawArchList 00047 * (replaced by srawFileList in rawcommn.h) 00048 * 2. 6.2008, H.G.: replace long->int if 64bit client (ifdef SYSTEM64) 00049 * server still 32 bit 00050 * 3. 9.2008, H.G.: move cDataFSHigh, iDataFSHigh -> rawcommn.h 00051 * 16.10.2008, H.G.: srawRetrList: add iPoolId 00052 * 14.11.2008, H.G.: indicate display mode in srawAPIFile.iOpMode 00053 * 12. 2.2009, H.G.: add structure srawCopyCache to srawAPIFile 00054 * 13.11.2009, H.G.: srawRetrList: enhance for recursive/parallel stage: 00055 * add cNamehl, iFileSize2, iFileSet 00056 * enlarge cNamell (MAX_OBJ_LL -> MAX_OBJ_LL_N) and 00057 * cNamehl (MAX_OBJ_HL -> MAX_OBJ_HL_N) 00058 * 18.12.2009, H.G.: MAX_OBJ_HL_N -> MAX_OBJ_HL, 00059 * MAX_OBJ_LL_N -> MAX_OBJ_LL 00060 * 13. 9.2010, H.G.: srawCliActionComm: new iOS64 00061 * srawRetrList: 'long' iFileSize -> 2* 'int' 00062 * 15. 9.2010, H.G.: discard flag SYSTEM64, 00063 * srawTapeFileList: iFileSize 'long' -> 'int' 00064 ********************************************************************* 00065 * */ 00066 00067 static int iMB = 1024000; /* 1 MB */ 00068 static char cPathPrefix[16] = "@PATH:"; /* for filelist */ 00069 static int iPathPrefix = 0; /* >0: path for files in filelist */ 00070 00071 /* definitions for command interface */ 00072 #define MAX_CMDPARM 20 /* max number of command parameters */ 00073 #define MAX_CMDPARM_LEN 256 /* max length of command parameters */ 00074 00075 typedef struct /* list of tape file names and sizes */ 00076 { 00077 char cFileName[MAX_TAPE_FILE+1]; 00078 unsigned int iFileSize; /* file size (byte), clitape: 4 byte okay */ 00079 int iBufferSize; 00080 void *pNext; 00081 } srawTapeFileList; 00082 00083 /* communication buffer passed to client action routines */ 00084 typedef struct 00085 { 00086 int iAction; /* client action according to ACTION */ 00087 int iSocket; /* socket id for connection to server */ 00088 int iPort; /* port number entry server */ 00089 char cNode[MAX_NODE]; /* node name requested entry server */ 00090 int iReqMaster; /* used for requested ATL server */ 00091 srawComm sComm; /* communication structure client/server */ 00092 int iTapeFile; /* =0: disk file, =1: tape file, =2: tape filelist */ 00093 int iScanTape; /* =1: scan input tape before archive */ 00094 char *pcTape; /* logical tape volume name */ 00095 char *pcFile; /* specified file name on disk or tape */ 00096 int *piBuffer; /* ptr to query data area */ 00097 int *piDataMover; /* ptr to data mover list */ 00098 int *piObjBuf; /* buffer containing object list of TSM */ 00099 int *piFileList;/* buffer containing list of files to be archived */ 00100 int iBuffers; /* no. of filelist buffers in chain */ 00101 int iObjSelect; /* no. of TSM objects selected */ 00102 int iObjStageDB; /* no. of TSM objects in StagePool */ 00103 int iObjArchiveDB; /* no. of objects in ArchivePool */ 00104 int iPurge; /* no. of files to be removed from filelist */ 00105 int iStatus; /* output: status for caller */ 00106 int iAltQuery; /* query alternate entry server (not used) */ 00107 int iMaxQuery; /* max no. of queries per buffer */ 00108 int iFilesIgnore; /* 1st files in list to ignore */ 00109 int iATLServer; /* =1 aixtsm1, =2 gsitsma, =0 both */ 00110 char cMsg[STATUS_LEN]; /* message in case of error */ 00111 int iOS64; /* =0: 4 byte filesize, =1: 8 byte filesize */ 00112 } srawCliActionComm; 00113 00114 typedef struct /* info for TSM object list */ 00115 { 00116 int iFileSet; /* no. of file set (handled parallel) */ 00117 char cNamehl[MAX_OBJ_HL]; /* object high level name */ 00118 char cNamell[MAX_OBJ_LL]; /* object low level name */ 00119 unsigned int iObjHigh; /* upper four bytes object Id */ 00120 unsigned int iObjLow; /* lower four bytes object Id */ 00121 unsigned int iRestoHigh; /* top four bytes restore order */ 00122 unsigned int iRestoHighHigh; /* hi_hi four bytes restore order */ 00123 unsigned int iRestoHighLow; /* hi_lo four bytes restore order */ 00124 unsigned int iRestoLowHigh; /* lo_hi four bytes restore order */ 00125 unsigned int iRestoLow; /* lo_lo four bytes restore order */ 00126 int iFileType; /* fixed record or stream file */ 00127 int iBufsizeFile; /* record length */ 00128 unsigned int iFileSize; /* file size (byte), overlaid with 'long' */ 00129 unsigned int iFileSize2; /* both in total 8 byte */ 00130 int iATLServer; /* ATL server: =1: aixtsm1, =2: gsitsma */ 00131 int iPoolId;/* from query: RC poolId (staged), WC poolId (cached) */ 00132 char cMoverStage[MAX_NODE]; /* node name data mover if staged */ 00133 int iStageFS; /* > 0: in StagePool, no. of StageFS */ 00134 char cMoverCache[MAX_NODE]; /* name data mover if in write cache */ 00135 int iCacheFS; /* > 0: in write cache, no. of writeCacheFS */ 00136 char cArchiveDate[MAX_DATE]; /* creation date in ArchivePool */ 00137 char cOwner[MAX_OWNER]; /* account name of archiving user */ 00138 } srawRetrList; 00139 00140 typedef struct /* API file control block */ 00141 { 00142 int iFileId; /* API file identifier for server connection */ 00143 int iFlags; /* from open */ 00144 int iMode; /* from open */ 00145 char cNodeMaster[MAX_NODE]; /* node name of entry server */ 00146 int iSockMaster; /* socket for connection to entry server */ 00147 char cNodeMover[MAX_NODE]; /* node name of data mover */ 00148 int iSockMover; /* socket for connection to mover */ 00149 int iSeekMode; 00150 int iOffset; 00151 int iBufsizeAct; 00152 int iOpMode; 00153 /* =0: 'normal' RFIO mode 00154 =1: use rfio_endfile/rfio_newfile (GSI extension) 00155 =2: display only, no remote file open (GSI extension) */ 00156 int iAction; /* =1: read from server, =2 write to server */ 00157 int iMassSto; /* =1: connect to GSI mass storage (ArchivePool) 00158 =2: connect to GSI mass storage (DAQPool) 00159 =0: connect to RFIO read/write server */ 00160 int iBufnoServ; /* no. of buffers transfered from/to server */ 00161 int iDataServ; /* no. of bytes transfered from/to server */ 00162 srawComm sCommAPI; /* communication buffer for API procedures */ 00163 srawComm sCommServ; /* copy for server in net format */ 00164 srawObjAttr sQueryAPI; /* query information */ 00165 srawCopyCache sCopyCacheServ; 00166 /* info on DAQ data stream copy in net format */ 00167 } srawAPIFile; 00168