XRootD
XrdSfsGPFile.hh
Go to the documentation of this file.
1 #ifndef __SFS_GPFILE_H__
2 #define __SFS_GPFILE_H__
3 /******************************************************************************/
4 /* */
5 /* X r d S f s G P F i l e . h h */
6 /* */
7 /* (c) 2019 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* Produced by Andrew Hanushevsky for Stanford University under contract */
9 /* DE-AC02-76-SFO0515 with the Department of Energy */
10 /* */
11 /* This file is part of the XRootD software suite. */
12 /* */
13 /* XRootD is free software: you can redistribute it and/or modify it under */
14 /* the terms of the GNU Lesser General Public License as published by the */
15 /* Free Software Foundation, either version 3 of the License, or (at your */
16 /* option) any later version. */
17 /* */
18 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
19 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
20 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
21 /* License for more details. */
22 /* */
23 /* You should have received a copy of the GNU Lesser General Public License */
24 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
25 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
26 /* */
27 /* The copyright holder's institutional names and contributor's names may not */
28 /* be used to endorse or promote products derived from this software without */
29 /* specific prior written permission of the institution or contributor. */
30 /******************************************************************************/
31 
32 #include <cstdint>
33 
34 class XrdSfsGPInfo;
35 
37 {
38 public:
39 
40 uint16_t opts;
41 static const uint16_t delegate = 0x0008;
42 static const uint16_t keepErr = 0x0004;
43 static const uint16_t mkPath = 0x0002;
44 static const uint16_t replace = 0x0001;
45 static const uint16_t useTLS = 0x0080;
46 static const uint16_t verCKS = 0x0040;
47 
48 uint16_t rsvd1;
49 uint8_t pingsec;
50 uint8_t sources;
51 uint8_t streams;
52 uint8_t rsvd2;
53 
54 union {
55 XrdSfsGPInfo *gpfInfo;
56 uint32_t gpfID;
57  };
58 
59 const char *src;
60 const char *dst;
61 const char *lclCGI;
62 const char *csType;
63 const char *csVal;
64 const char *tident;
65 
66 void *rsvd3;
67 
68 //-----------------------------------------------------------------------------
79 //-----------------------------------------------------------------------------
80 
81 virtual void Finished(int rc, const char *emsg=0) = 0;
82 
83 //-----------------------------------------------------------------------------
89 //-----------------------------------------------------------------------------
90 
91 enum GPFState {gpfPend = 0,
93  gpfCSV
94  };
95 
96 virtual void Status(GPFState state, uint32_t cpct, uint64_t bytes) = 0;
97 
98 //-----------------------------------------------------------------------------
100 //-----------------------------------------------------------------------------
101 
102  XrdSfsGPFile(const char *tid="")
103  : opts(0), rsvd1(0),
104  pingsec(0), sources(0), streams(0), rsvd2(0),
105  gpfInfo(0), src(0), dst(0), lclCGI(0),
106  csType(0), csVal(0), tident(tid), rsvd3(0) {}
107 virtual ~XrdSfsGPFile() {}
108 };
109 #endif
int emsg(int rc, char *msg)
static const uint16_t verCKS
Verify checksum after transfer.
Definition: XrdSfsGPFile.hh:46
static const uint16_t useTLS
Use TLS for the data path.
Definition: XrdSfsGPFile.hh:45
virtual void Status(GPFState state, uint32_t cpct, uint64_t bytes)=0
void * rsvd3
Reserved field.
Definition: XrdSfsGPFile.hh:66
static const uint16_t replace
Replace existing file.
Definition: XrdSfsGPFile.hh:44
uint16_t opts
Options as defined below.
Definition: XrdSfsGPFile.hh:40
const char * csVal
Checksum value as a hex string.
Definition: XrdSfsGPFile.hh:63
uint8_t pingsec
Seconds between calls to Update() (0 -> no calls)
Definition: XrdSfsGPFile.hh:49
static const uint16_t delegate
Use delegation.
Definition: XrdSfsGPFile.hh:41
uint16_t rsvd1
Definition: XrdSfsGPFile.hh:48
virtual ~XrdSfsGPFile()
const char * lclCGI
The CGI, if any, for the local path.
Definition: XrdSfsGPFile.hh:61
virtual void Finished(int rc, const char *emsg=0)=0
const char * src
get: full URL, put: local path
Definition: XrdSfsGPFile.hh:59
static const uint16_t keepErr
Keep file after request failure.
Definition: XrdSfsGPFile.hh:42
const char * dst
get: local path, put: full URL
Definition: XrdSfsGPFile.hh:60
@ gpfXfr
Request is transfering data.
Definition: XrdSfsGPFile.hh:92
@ gpfPend
Request is pending.
Definition: XrdSfsGPFile.hh:91
@ gpfCSV
Request is doing checksum validation.
Definition: XrdSfsGPFile.hh:93
static const uint16_t mkPath
Create destination path.
Definition: XrdSfsGPFile.hh:43
uint8_t sources
Number of parallel sources (0 -> default)
Definition: XrdSfsGPFile.hh:50
XrdSfsGPFile(const char *tid="")
Constructor and Destructor.
uint8_t rsvd2
Definition: XrdSfsGPFile.hh:52
uint8_t streams
Number of parallel streams (0 -> default)
Definition: XrdSfsGPFile.hh:51
const char * tident
Trace identifier.
Definition: XrdSfsGPFile.hh:64
const char * csType
Checksum type.
Definition: XrdSfsGPFile.hh:62