00001 #ifndef __XRDXROOTDGPFILE_H__ 00002 #define __XRDXROOTDGPFILE_H__ 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d X r o o t d G P F i l e . h h */ 00006 /* */ 00007 /* (c) 2019 by the Board of Trustees of the Leland Stanford, Jr., University */ 00008 /* All Rights Reserved */ 00009 /* Produced by Andrew Hanushevsky for Stanford University under contract */ 00010 /* DE-AC02-76-SFO0515 with the Department of Energy */ 00011 /* */ 00012 /* This file is part of the XRootD software suite. */ 00013 /* */ 00014 /* XRootD is free software: you can redistribute it and/or modify it under */ 00015 /* the terms of the GNU Lesser General Public License as published by the */ 00016 /* Free Software Foundation, either version 3 of the License, or (at your */ 00017 /* option) any later version. */ 00018 /* */ 00019 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */ 00020 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */ 00021 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */ 00022 /* License for more details. */ 00023 /* */ 00024 /* You should have received a copy of the GNU Lesser General Public License */ 00025 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */ 00026 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */ 00027 /* */ 00028 /* The copyright holder's institutional names and contributor's names may not */ 00029 /* be used to endorse or promote products derived from this software without */ 00030 /* specific prior written permission of the institution or contributor. */ 00031 /******************************************************************************/ 00032 00035 00036 class XrdOucEnv; 00037 class XrdOucErrInfo; 00038 class XrdSecEntity; 00039 class XrdSfs; 00040 class XrdXrootdGPFAgent; 00041 00042 /******************************************************************************/ 00043 /* C l a s s X r d X r o o t d G P F i l e I n f o */ 00044 /******************************************************************************/ 00045 00046 //------------------------------------------------------------------------------ 00050 //------------------------------------------------------------------------------ 00051 00052 class XrdXrootdGPFileInfo 00053 { 00054 public: 00055 00056 const char *cksType; 00057 const char *cksValue; 00058 const char *src; 00059 const char *srcCgi; 00060 const char *dst; 00061 const char *srcCgi; 00062 uint16_t pingsec; 00063 uint16_t streams; 00064 00065 //------------------------------------------------------------------------------ 00076 //------------------------------------------------------------------------------ 00077 00078 bool Completed(const char *eMsg=0, int eNum=0); 00079 00080 //------------------------------------------------------------------------------ 00089 //------------------------------------------------------------------------------ 00090 00091 enum Status {isPending = 0, 00092 isCopying = 1, 00093 isProving = 2 00094 } 00095 00096 bool Update(uint64_t xfrsz, Status stat); 00097 00098 /******************************************************************************/ 00099 /* C o n s t r u c t o r & D e s t r u c t o r */ 00100 /******************************************************************************/ 00101 00102 XrdXrootdGPFileInfo(XrdXrootdGPFAgent &gpf) 00103 : cksType(0), cksValue(0), 00104 src(0), srcCgi(0), dst(0), dstCgi(0), 00105 pingSec(0), streams(0), 00106 gpfAgent(gpf) {} 00107 00108 ~XrdXrootdGPFileInfo() {} 00109 00110 private: 00111 00112 XrdXrootdGPFAgent &gpfAgent; 00113 }; 00114 00115 /******************************************************************************/ 00116 /* c l a s s X r d X r o o t d G P F i l e */ 00117 /******************************************************************************/ 00118 00119 class XrdXrootdGPFile 00120 { 00121 public: 00122 00123 //------------------------------------------------------------------------------ 00132 //----------------------------------------------------------------------------- 00133 00134 virtual void getFile(const XrdXrootdGPFileInfo &gargs, 00135 const XrdSecEntity *client=0) = 0; 00136 00137 //------------------------------------------------------------------------------ 00146 //----------------------------------------------------------------------------- 00147 00148 virtual void putFile(const XrdXrootdGPFileInfo &gargs, 00149 const XrdSecEntity *client=0) = 0; 00150 00151 //------------------------------------------------------------------------------ 00153 //------------------------------------------------------------------------------ 00154 00155 XrdXrootdGPFile() {} 00156 00157 //------------------------------------------------------------------------------ 00159 //------------------------------------------------------------------------------ 00160 00161 virtual ~XrdXrootdGPFile() {} 00162 }; 00163 00164 /******************************************************************************/ 00165 /* X r d X r o o t d g e t G P F i l e */ 00166 /******************************************************************************/ 00167 00168 //------------------------------------------------------------------------------ 00186 //------------------------------------------------------------------------------ 00187 00188 class XrdSysError; 00189 00190 typedef XrdXrootdGPFile *(*XrdOfsgetPrepare_t)(XrdSysError *eDest, 00191 const char *confg, 00192 const char *parms, 00193 XrdSfs *theSfs, 00194 XrdOucEnv *envP 00195 ); 00196 00197 #define XrdOfsgetPrepareArguments XrdSysError *eDest,\ 00198 const char *confg,\ 00199 const char *parms,\ 00200 XrdSfs *theSfs,\ 00201 XrdOucEnv *envP 00202 /* 00203 extern "C" XrdXrootdGPFile_t *XrdXrootdgetGPFile; 00204 */ 00205 00206 //------------------------------------------------------------------------------ 00212 //------------------------------------------------------------------------------ 00213 00219 #endif