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 class XrdSfsGPInfo;
33 
35 {
36 public:
37 
38 uint16_t opts;
39 static const uint16_t delegate = 0x0008;
40 static const uint16_t keepErr = 0x0004;
41 static const uint16_t mkPath = 0x0002;
42 static const uint16_t replace = 0x0001;
43 static const uint16_t useTLS = 0x0080;
44 static const uint16_t verCKS = 0x0040;
45 
46 uint16_t rsvd1;
47 uint8_t pingsec;
48 uint8_t sources;
49 uint8_t streams;
50 uint8_t rsvd2;
51 
52 union {
53 XrdSfsGPInfo *gpfInfo;
54 uint32_t gpfID;
55  };
56 
57 const char *src;
58 const char *dst;
59 const char *lclCGI;
60 const char *csType;
61 const char *csVal;
62 const char *tident;
63 
64 void *rsvd3;
65 
66 //-----------------------------------------------------------------------------
77 //-----------------------------------------------------------------------------
78 
79 virtual void Finished(int rc, const char *emsg=0) = 0;
80 
81 //-----------------------------------------------------------------------------
87 //-----------------------------------------------------------------------------
88 
89 enum GPFState {gpfPend = 0,
91  gpfCSV
92  };
93 
94 virtual void Status(GPFState state, uint32_t cpct, uint64_t bytes) = 0;
95 
96 //-----------------------------------------------------------------------------
98 //-----------------------------------------------------------------------------
99 
100  XrdSfsGPFile(const char *tid="")
101  : opts(0), rsvd1(0),
102  pingsec(0), sources(0), streams(0), rsvd2(0),
103  gpfInfo(0), src(0), dst(0), lclCGI(0),
104  csType(0), csVal(0), tident(tid), rsvd3(0) {}
105 virtual ~XrdSfsGPFile() {}
106 };
107 #endif
XrdSfsGPFile::opts
uint16_t opts
Options as defined below.
Definition: XrdSfsGPFile.hh:38
XrdSfsGPFile::delegate
static const uint16_t delegate
Use delegation.
Definition: XrdSfsGPFile.hh:39
XrdSfsGPFile::GPFState
GPFState
Definition: XrdSfsGPFile.hh:89
XrdSfsGPFile::~XrdSfsGPFile
virtual ~XrdSfsGPFile()
Definition: XrdSfsGPFile.hh:105
XrdSfsGPFile::verCKS
static const uint16_t verCKS
Verify checksum after transfer.
Definition: XrdSfsGPFile.hh:44
XrdSfsGPFile::replace
static const uint16_t replace
Replace existing file.
Definition: XrdSfsGPFile.hh:42
XrdSfsGPFile::keepErr
static const uint16_t keepErr
Keep file after request failure.
Definition: XrdSfsGPFile.hh:40
XrdSfsGPFile::pingsec
uint8_t pingsec
Seconds between calls to Update() (0 -> no calls)
Definition: XrdSfsGPFile.hh:47
XrdSfsGPFile::src
const char * src
get: full URL, put: local path
Definition: XrdSfsGPFile.hh:57
XrdSfsGPFile::sources
uint8_t sources
Number of parallel sources (0 -> default)
Definition: XrdSfsGPFile.hh:48
XrdSfsGPFile::gpfID
uint32_t gpfID
Can be used by the implementation.
Definition: XrdSfsGPFile.hh:54
XrdSfsGPFile::gpfInfo
XrdSfsGPInfo * gpfInfo
Can be used by the implementation.
Definition: XrdSfsGPFile.hh:53
XrdSfsGPFile::rsvd1
uint16_t rsvd1
Definition: XrdSfsGPFile.hh:46
XrdSfsGPFile::Finished
virtual void Finished(int rc, const char *emsg=0)=0
XrdSfsGPFile::Status
virtual void Status(GPFState state, uint32_t cpct, uint64_t bytes)=0
XrdSfsGPFile::rsvd3
void * rsvd3
Reserved field.
Definition: XrdSfsGPFile.hh:64
XrdSfsGPFile::dst
const char * dst
get: local path, put: full URL
Definition: XrdSfsGPFile.hh:58
XrdSfsGPFile
Definition: XrdSfsGPFile.hh:35
XrdSfsGPFile::gpfCSV
@ gpfCSV
Request is doing checksum validation.
Definition: XrdSfsGPFile.hh:91
XrdSfsGPFile::streams
uint8_t streams
Number of parallel streams (0 -> default)
Definition: XrdSfsGPFile.hh:49
XrdSfsGPFile::XrdSfsGPFile
XrdSfsGPFile(const char *tid="")
Constructor and Destructor.
Definition: XrdSfsGPFile.hh:100
XrdSfsGPFile::gpfXfr
@ gpfXfr
Request is transfering data.
Definition: XrdSfsGPFile.hh:90
XrdSfsGPFile::csType
const char * csType
Checksum type.
Definition: XrdSfsGPFile.hh:60
XrdSfsGPFile::tident
const char * tident
Trace identifier.
Definition: XrdSfsGPFile.hh:62
XrdSfsGPFile::rsvd2
uint8_t rsvd2
Definition: XrdSfsGPFile.hh:50
XrdSfsGPFile::gpfPend
@ gpfPend
Request is pending.
Definition: XrdSfsGPFile.hh:89
XrdSfsGPFile::lclCGI
const char * lclCGI
The CGI, if any, for the local path.
Definition: XrdSfsGPFile.hh:59
XrdSfsGPFile::mkPath
static const uint16_t mkPath
Create destination path.
Definition: XrdSfsGPFile.hh:41
XrdSfsGPFile::csVal
const char * csVal
Checksum value as a hex string.
Definition: XrdSfsGPFile.hh:61
XrdSfsGPFile::useTLS
static const uint16_t useTLS
Use TLS for the data path.
Definition: XrdSfsGPFile.hh:43