DABC (Data Acquisition Backbone Core)  2.9.9
rawclin.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Copyright:
3  * GSI, Gesellschaft fuer Schwerionenforschung mbH
4  * Planckstr. 1
5  * D-64291 Darmstadt
6  * Germany
7  * created 1. 3.1996 by Horst Goeringer
8  *********************************************************************
9  * rawclin.h
10  * structures and definitions needed for gStore clients
11  *********************************************************************
12  * 3. 2.1998, H.G.: add iFileSize to srawRetrList
13  * 17. 1.2001, H.G.: add srawAPIFile for API clients
14  * 22. 1.2001, H.G.: pad OS names with trailing blanks
15  * 7. 2.2001, H.G.: in srawAPIFile: srawObjAttr added
16  * 18. 7.2001, H.G.: add mover node name to srawRetrList
17  * 24. 8.2001, H.G.: add stage flag to srawRetrList
18  * 5. 8.2002, H.G.: srawAPIClient: replace iSockServ by iSockMaster
19  * and iSockMover, add cNodeMover
20  * 14.10.2002, H.G.: ported to Lynx
21  * 27. 1.2003, H.G.: structure srawCliActionComm added
22  * 3. 2.2003, H.G.: add master number to srawRetrList
23  * 14. 2.2003, H.G.: srawCliActionComm: iDebug -> iReqMaster
24  * 17. 2.2003, H.G.: srawCliActionComm: add tape infos
25  * new statics iPortMaster, iPortMover
26  * 18. 2.2003, H.G.: rename sTapeFileList->srawTapeFileList
27  * 10. 4.2003, H.G.: add iFileType to srawRetrList
28  * 11. 6.2003, H.G.: srawCliActionComm: new iAltQuery, iMaxQuery
29  * 5.12.2003, H.G.: srawCliActionComm: new iFilesIgnore
30  * 23. 2.2004, H.G.: srawCliActionComm: new iObjArchiveDB,
31  * iObjStaged -> iObjStageDB
32  * srawRetrList: new iArchiveFS, iStage -> iStageFS
33  * 4. 3.2004, H.G.: srawRetrList: new cArchiveDate, cOwner
34  * 20. 8.2004, H.G.: srawAPIFile: new iAction, iBufsizeServD->iMassSto
35  * 15.12.2004, H.G.: srawAPIFile: iBufsizeServ->iOpMode
36  * 13. 3.2006, H.G.: declare iPortMaster, iPortMover in sources
37  * 9.10.2006, H.G.: srawCliActionComm: new iATLServer
38  * 8. 2.2007, H.G.: srawRetrList: iMaster -> iATLServer
39  * 19. 3.2008, H.G.: srawRetrList: cNodeMover -> cMoverStage,
40  * iArchiveFS -> iCacheFS
41  * new: cMoverCache, iRestoHighHigh, iRestoHighLow,
42  * iRestoLowHigh
43  * 8. 4.2008, H.G.: declare and set cPathPrefix,cDataFSHigh
44  * declare iPathPrefix, iDataFSHigh
45  * 8. 5.2008, H.G.: move static declaration [p]cOS -> rawcommn.h
46  * 9. 5.2008, H.G.: remove srawArchList
47  * (replaced by srawFileList in rawcommn.h)
48  * 2. 6.2008, H.G.: replace long->int if 64bit client (ifdef SYSTEM64)
49  * server still 32 bit
50  * 3. 9.2008, H.G.: move cDataFSHigh, iDataFSHigh -> rawcommn.h
51  * 16.10.2008, H.G.: srawRetrList: add iPoolId
52  * 14.11.2008, H.G.: indicate display mode in srawAPIFile.iOpMode
53  * 12. 2.2009, H.G.: add structure srawCopyCache to srawAPIFile
54  * 13.11.2009, H.G.: srawRetrList: enhance for recursive/parallel stage:
55  * add cNamehl, iFileSize2, iFileSet
56  * enlarge cNamell (MAX_OBJ_LL -> MAX_OBJ_LL_N) and
57  * cNamehl (MAX_OBJ_HL -> MAX_OBJ_HL_N)
58  * 18.12.2009, H.G.: MAX_OBJ_HL_N -> MAX_OBJ_HL,
59  * MAX_OBJ_LL_N -> MAX_OBJ_LL
60  * 13. 9.2010, H.G.: srawCliActionComm: new iOS64
61  * srawRetrList: 'long' iFileSize -> 2* 'int'
62  * 15. 9.2010, H.G.: discard flag SYSTEM64,
63  * srawTapeFileList: iFileSize 'long' -> 'int'
64  * 19. 1.2011, H.G.: srawCliActionComm: new iParallelStage,
65  * rename iAltQuery -> iTimeStamp
66  * 28. 7.2011, H.G.: srawCliActionComm: new iRecursive
67  * 26. 8.2011, H.G.: srawCliActionComm: new cTopDir
68  * 7. 9.2011, H.G.: srawCliActionComm: new iVarPath
69  * 1. 2.2012, H.G.: srawRetrList: iPoolId -> iPoolIdRC, new iPoolIdWC
70  * 4. 4.2012, H.G.: srawCliActionComm: iParallelStage cur. unused
71  * 2.10.2013, H.G.: new defines MIN_SEQUENTIAL_FILES, MAX_NUM_VOLUME
72  * 21. 2.2013, H.G.: move MIN_SEQUENTIAL_FILES -> rawcommn.h
73  *********************************************************************
74  */
75 
76 static int iMB = 1024000; /* 1 MB */
77 static char cPathPrefix[16] = "@PATH:"; /* for filelist */
78 static int iPathPrefix = 0; /* >0: path for files in filelist */
79 
80 /* definitions for command interface */
81 #define MAX_CMDPARM 20 /* max number of command parameters */
82 #define MAX_CMDPARM_LEN 256 /* max length of command parameters */
83 
84 /* definitions for parallel actions and sequ. stage */
85 #define MAX_NUM_VOLUME 100 /* max no of TSM volumes */
86 
87 typedef struct /* list of tape file names and sizes */
88 {
89  char cFileName[MAX_TAPE_FILE+1];
90  unsigned int iFileSize; /* file size (byte), clitape: 4 byte okay */
92  void *pNext;
94 
95 /* communication buffer passed to client action routines */
96 typedef struct
97 {
98  int iAction; /* client action according to ACTION */
99  int iSocket; /* socket id for connection to server */
100  int iPort; /* port number entry server */
101  char cNode[MAX_NODE]; /* node name requested entry server */
102  int iReqMaster; /* used for requested ATL server */
103  srawComm sComm; /* communication structure client/server */
104  int iTapeFile; /* =0: disk file, =1: tape file, =2: tape filelist */
105  int iScanTape; /* =1: scan input tape before archive */
106  char *pcTape; /* logical tape volume name */
107  char *pcFile; /* specified file name on disk or tape */
108  int *piBuffer; /* ptr to query data area */
109  int *piDataMover; /* ptr to data mover list */
110  int *piObjBuf; /* buffer containing object list of TSM */
111  int *piFileList;/* buffer containing list of files to be archived */
112  int iBuffers; /* no. of filelist buffers in chain */
113  int iObjSelect; /* no. of TSM objects selected */
114  int iObjStageDB; /* no. of TSM objects in StagePool */
115  int iObjArchiveDB; /* no. of objects in ArchivePool */
116  int iPurge; /* no. of files to be removed from filelist */
117  int iStatus; /* output: status for caller */
118  int iTimeStamp; /* =1: measure execution speeds of components */
119  int iMaxQuery; /* max no. of queries per buffer */
120  int iFilesIgnore; /* 1st files in list to ignore */
121  int iATLServer; /* =1: aixtsm1, =2: gsitsma, =0: both */
122  int iParallelStage; /* currently unused */
123  char cMsg[STATUS_LEN]; /* message in case of error */
124  int iOS64; /* =0: 4 byte filesize, =1: 8 byte filesize */
125  char cTopDir[MAX_FULL_FILE]; /* top directory (recursive archive) */
126  int iRecursive; /* > 0: recursive file handling */
127  int iVarPath; /* =1: archive source path with wildcard chars */
129 
130 typedef struct /* info for TSM object list */
131 {
132  int iFileSet; /* no. of file set (handled parallel) */
133  char cNamehl[MAX_OBJ_HL]; /* object high level name */
134  char cNamell[MAX_OBJ_LL]; /* object low level name */
135  unsigned int iObjHigh; /* upper four bytes object Id */
136  unsigned int iObjLow; /* lower four bytes object Id */
137  unsigned int iRestoHigh; /* top four bytes restore order */
138  unsigned int iRestoHighHigh; /* hi_hi four bytes restore order */
139  unsigned int iRestoHighLow; /* hi_lo four bytes restore order */
140  unsigned int iRestoLowHigh; /* lo_hi four bytes restore order */
141  unsigned int iRestoLow; /* lo_lo four bytes restore order */
142  int iFileType; /* fixed record or stream file */
143  int iBufsizeFile; /* record length */
144  unsigned int iFileSize; /* file size (byte), overlaid with 'long' */
145  unsigned int iFileSize2; /* both in total 8 byte */
146  int iATLServer; /* ATL server: =1: aixtsm1, =2: gsitsma */
147  int iPoolIdRC; /* poolId in read cache, =0: not staged */
148  char cMoverStage[MAX_NODE]; /* node name data mover if staged */
149  int iStageFS; /* > 0: in StagePool, no. of StageFS */
150  int iPoolIdWC; /* poolId in write cache, =0: not cached */
151  char cMoverCache[MAX_NODE]; /* name data mover if in write cache */
152  int iCacheFS; /* > 0: in write cache, no. of writeCacheFS */
153  char cArchiveDate[MAX_DATE]; /* creation date in ArchivePool */
154  char cOwner[MAX_OWNER]; /* account name of archiving user */
155 } srawRetrList;
156 
157 typedef struct /* API file control block */
158 {
159  int iFileId; /* API file identifier for server connection */
160  int iFlags; /* from open */
161  int iMode; /* from open */
162  char cNodeMaster[MAX_NODE]; /* node name of entry server */
163  int iSockMaster; /* socket for connection to entry server */
164  char cNodeMover[MAX_NODE]; /* node name of data mover */
165  int iSockMover; /* socket for connection to mover */
167  int iOffset;
169  int iOpMode;
170  /* =0: 'normal' RFIO mode
171  =1: use rfio_endfile/rfio_newfile (GSI extension)
172  =2: display only, no remote file open (GSI extension) */
173  int iAction; /* =1: read from server, =2 write to server */
174  int iMassSto; /* =1: connect to GSI mass storage (ArchivePool)
175  =2: connect to GSI mass storage (DAQPool)
176  =0: connect to RFIO read/write server */
177  int iBufnoServ; /* no. of buffers transfered from/to server */
178  int iDataServ; /* no. of bytes transfered from/to server */
179  srawComm sCommAPI; /* communication buffer for API procedures */
180  srawComm sCommServ; /* copy for server in net format */
181  srawObjAttr sQueryAPI; /* query information */
183  /* info on DAQ data stream copy in net format */
184 } srawAPIFile;
185 
static char cNamehl[MAX_OBJ_HL]
Definition: rawProcn.c:184
static char cNodeMaster[MAX_NODE]
Definition: rawapin.c:242
static char cNodeMover[MAX_NODE]
Definition: rawapin.c:243
static int iPathPrefix
Definition: rawclin.h:78
static char cPathPrefix[16]
Definition: rawclin.h:77
static int iMB
Definition: rawclin.h:76
#define MAX_NODE
Definition: rawcommn.h:295
#define MAX_FULL_FILE
Definition: rawcommn.h:327
#define MAX_OBJ_LL
Definition: rawcommn.h:338
#define MAX_OBJ_HL
Definition: rawcommn.h:337
#define MAX_DATE
Definition: rawcommn.h:350
#define STATUS_LEN
Definition: rawcommn.h:356
#define MAX_TAPE_FILE
Definition: rawcommn.h:329
#define MAX_OWNER
Definition: rawcommn.h:307
int iOffset
Definition: rawclin.h:167
srawComm sCommAPI
Definition: rawclin.h:179
srawObjAttr sQueryAPI
Definition: rawclin.h:181
int iMode
Definition: rawclin.h:161
int iSeekMode
Definition: rawclin.h:166
int iSockMaster
Definition: rawclin.h:163
int iMassSto
Definition: rawclin.h:174
srawComm sCommServ
Definition: rawclin.h:180
int iDataServ
Definition: rawclin.h:178
int iSockMover
Definition: rawclin.h:165
int iFileId
Definition: rawclin.h:159
int iAction
Definition: rawclin.h:173
int iFlags
Definition: rawclin.h:160
int iOpMode
Definition: rawclin.h:169
int iBufnoServ
Definition: rawclin.h:177
int iBufsizeAct
Definition: rawclin.h:168
srawCopyCache sCopyCacheServ
Definition: rawclin.h:182
int * piDataMover
Definition: rawclin.h:109
int * piFileList
Definition: rawclin.h:111
srawComm sComm
Definition: rawclin.h:103
int iFileType
Definition: rawclin.h:142
unsigned int iRestoLowHigh
Definition: rawclin.h:140
int iBufsizeFile
Definition: rawclin.h:143
int iStageFS
Definition: rawclin.h:149
unsigned int iRestoHighLow
Definition: rawclin.h:139
int iATLServer
Definition: rawclin.h:146
int iFileSet
Definition: rawclin.h:132
unsigned int iObjLow
Definition: rawclin.h:136
unsigned int iRestoHigh
Definition: rawclin.h:137
int iPoolIdWC
Definition: rawclin.h:150
int iCacheFS
Definition: rawclin.h:152
unsigned int iObjHigh
Definition: rawclin.h:135
unsigned int iRestoLow
Definition: rawclin.h:141
int iPoolIdRC
Definition: rawclin.h:147
unsigned int iFileSize2
Definition: rawclin.h:145
unsigned int iRestoHighHigh
Definition: rawclin.h:138
unsigned int iFileSize
Definition: rawclin.h:144
unsigned int iFileSize
Definition: rawclin.h:90
void * pNext
Definition: rawclin.h:92