Loading...
Searching...
No Matches
XrdOfsTPC.hh
Go to the documentation of this file.
#ifndef __XRDOFSTPC_HH__
#define __XRDOFSTPC_HH__
/******************************************************************************/
/* */
/* X r d O f s T P C . h h */
/* */
/* (c) 2012 by the Board of Trustees of the Leland Stanford, Jr., University */
/* All Rights Reserved */
/* Produced by Andrew Hanushevsky for Stanford University under contract */
/* DE-AC02-76-SFO0515 with the Department of Energy */
/* */
/* This file is part of the XRootD software suite. */
/* */
/* XRootD is free software: you can redistribute it and/or modify it under */
/* the terms of the GNU Lesser General Public License as published by the */
/* Free Software Foundation, either version 3 of the License, or (at your */
/* option) any later version. */
/* */
/* XRootD is distributed in the hope that it will be useful, but WITHOUT */
/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
/* License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
/* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
/* */
/* The copyright holder's institutional names and contributor's names may not */
/* be used to endorse or promote products derived from this software without */
/* specific prior written permission of the institution or contributor. */
/******************************************************************************/
#include <cstdlib>
#include <cstring>
#include "XrdOfs/XrdOfsTPCInfo.hh"
class XrdAccAuthorize;
class XrdOfsTPCAllow;
class XrdOfsTPCJob;
class XrdOucEnv;
class XrdOucErrInfo;
class XrdOucPListAnchor;
class XrdOucTList;
class XrdSecEntity;
class XrdOfsTPC
{
public:
struct Facts
{const char *Key;
const char *Lfn;
const char *Pfn;
const char *Org;
const char *Dst;
const XrdSecEntity *Usr;
XrdOucErrInfo *eRR;
XrdOucEnv *Env;
Facts(const XrdSecEntity *vEnt, XrdOucErrInfo *vInf, XrdOucEnv *vEnv,
const char *vKey, const char *vLfn, const char *vPfn=0)
: Key(vKey), Lfn(vLfn), Pfn(vPfn), Org(0), Dst(0),
Usr(vEnt), eRR(vInf), Env(vEnv) {}
};
static
const char *AddAuth(const char *auth, const char *avar);
static void Allow(char *vDN, char *vGN, char *vHN, char *vVO);
static int Authorize(XrdOfsTPC **theTPC,
Facts &Args,
int isPLE=0);
static
const char *credPath() {return cPath;}
virtual void Del() {}
static void Init();
static void Init(XrdAccAuthorize *accP) {fsAuth = accP;}
static const int reqALL = 0;
static const int reqDST = 1;
static const int reqORG = 2;
static void Require(const char *Auth, int RType);
static int Restrict(const char *Path);
static int Start();
virtual int Sync(XrdOucErrInfo *error) {return 0;}
static int Validate (XrdOfsTPC **theTPC, Facts &Args);
XrdOfsTPC() : Refs(1), inQ(0) {}
XrdOfsTPC(const char *Url, const char *Org,
const char *Lfn, const char *Pfn, const char *Cks=0,
const char *Spr=0, const char *Tpr=0)
: Info(Url, Org, Lfn, Pfn, Cks, Spr, Tpr),
Refs(1), inQ(0) {}
virtual ~XrdOfsTPC() {}
XrdOfsTPCInfo Info;
protected:
static int Death(Facts &Args, const char *eMsg, int eCode, int nomsg=0);
static int Fatal(Facts &Args, const char *eMsg, int eCode, int nomsg=0);
static int genOrg(const XrdSecEntity *client, char *Buff, int Blen);
static int getTTL(XrdOucEnv *Env);
static int Screen(Facts &Args, XrdOucTList *tP, int wasEnc=0);
static char *Verify(const char *Who,const char *Name,char *Buf,int Blen);
static XrdAccAuthorize *fsAuth;
static XrdOucTList *AuthDst;
static XrdOucTList *AuthOrg;
static char *cPath;
static XrdOfsTPCAllow *ALList;
static XrdOucPListAnchor *RPList;
char Refs; // Reference count
char inQ; // Object in queue
};
#endif
Authorize
XrdAccAuthorize * Authorize
Definition XrdAccTest.cc:61
XrdOfsTPCInfo.hh
Path
XrdOucString Path
Definition XrdSecpwdSrvAdmin.cc:160
eMsg
#define eMsg(x)
Definition XrdSecsssAdmin.cc:53
XrdAccAuthorize
Definition XrdAccAuthorize.hh:68
XrdOfsTPCAllow
Definition XrdOfsTPC.cc:98
XrdOfsTPCInfo
Definition XrdOfsTPCInfo.hh:42
XrdOfsTPCJob
Definition XrdOfsTPCJob.hh:39
XrdOfsTPC
Definition XrdOfsTPC.hh:48
XrdOfsTPC::Restrict
static int Restrict(const char *Path)
Definition XrdOfsTPC.cc:465
XrdOfsTPC::AuthOrg
static XrdOucTList * AuthOrg
Definition XrdOfsTPC.hh:123
XrdOfsTPC::Sync
virtual int Sync(XrdOucErrInfo *error)
Definition XrdOfsTPC.hh:95
XrdOfsTPC::XrdOfsTPC
XrdOfsTPC()
Definition XrdOfsTPC.hh:99
XrdOfsTPC::reqDST
static const int reqDST
Definition XrdOfsTPC.hh:86
XrdOfsTPC::credPath
static const char * credPath()
Definition XrdOfsTPC.hh:77
XrdOfsTPC::AddAuth
static const char * AddAuth(const char *auth, const char *avar)
Definition XrdOfsTPC.cc:164
XrdOfsTPC::Verify
static char * Verify(const char *Who, const char *Name, char *Buf, int Blen)
Definition XrdOfsTPC.cc:683
XrdOfsTPC::Refs
char Refs
Definition XrdOfsTPC.hh:129
XrdOfsTPC::getTTL
static int getTTL(XrdOucEnv *Env)
Definition XrdOfsTPC.cc:396
XrdOfsTPC::fsAuth
static XrdAccAuthorize * fsAuth
Definition XrdOfsTPC.hh:120
XrdOfsTPC::Init
static void Init()
Definition XrdOfsTPC.cc:414
XrdOfsTPC::Fatal
static int Fatal(Facts &Args, const char *eMsg, int eCode, int nomsg=0)
Definition XrdOfsTPC.cc:334
XrdOfsTPC::XrdOfsTPC
XrdOfsTPC(const char *Url, const char *Org, const char *Lfn, const char *Pfn, const char *Cks=0, const char *Spr=0, const char *Tpr=0)
Definition XrdOfsTPC.hh:101
XrdOfsTPC::Start
static int Start()
Definition XrdOfsTPC.cc:520
XrdOfsTPC::~XrdOfsTPC
virtual ~XrdOfsTPC()
Definition XrdOfsTPC.hh:107
XrdOfsTPC::Death
static int Death(Facts &Args, const char *eMsg, int eCode, int nomsg=0)
Definition XrdOfsTPC.cc:319
XrdOfsTPC::Del
virtual void Del()
Definition XrdOfsTPC.hh:79
XrdOfsTPC::reqORG
static const int reqORG
Definition XrdOfsTPC.hh:87
XrdOfsTPC::Require
static void Require(const char *Auth, int RType)
Definition XrdOfsTPC.cc:445
XrdOfsTPC::Info
XrdOfsTPCInfo Info
Definition XrdOfsTPC.hh:109
XrdOfsTPC::Allow
static void Allow(char *vDN, char *vGN, char *vHN, char *vVO)
Definition XrdOfsTPC.cc:209
XrdOfsTPC::ALList
static XrdOfsTPCAllow * ALList
Definition XrdOfsTPC.hh:126
XrdOfsTPC::Validate
static int Validate(XrdOfsTPC **theTPC, Facts &Args)
Definition XrdOfsTPC.cc:550
XrdOfsTPC::cPath
static char * cPath
Definition XrdOfsTPC.hh:124
XrdOfsTPC::AuthDst
static XrdOucTList * AuthDst
Definition XrdOfsTPC.hh:122
XrdOfsTPC::Screen
static int Screen(Facts &Args, XrdOucTList *tP, int wasEnc=0)
Definition XrdOfsTPC.cc:497
XrdOfsTPC::inQ
char inQ
Definition XrdOfsTPC.hh:130
XrdOfsTPC::RPList
static XrdOucPListAnchor * RPList
Definition XrdOfsTPC.hh:127
XrdOfsTPC::Init
static void Init(XrdAccAuthorize *accP)
Definition XrdOfsTPC.hh:83
XrdOfsTPC::reqALL
static const int reqALL
Definition XrdOfsTPC.hh:85
XrdOfsTPC::genOrg
static int genOrg(const XrdSecEntity *client, char *Buff, int Blen)
Definition XrdOfsTPC.cc:359
XrdOucEnv
Definition XrdOucEnv.hh:42
XrdOucErrInfo
Definition XrdOucErrInfo.hh:101
XrdOucPListAnchor
Definition XrdOucPList.hh:89
XrdOucTList
Definition XrdOucTList.hh:42
XrdSecEntity
Definition XrdSecEntity.hh:65
XrdOfsTPC::Facts
Definition XrdOfsTPC.hh:52
XrdOfsTPC::Facts::Usr
const XrdSecEntity * Usr
Definition XrdOfsTPC.hh:57
XrdOfsTPC::Facts::Key
const char * Key
Definition XrdOfsTPC.hh:52
XrdOfsTPC::Facts::Env
XrdOucEnv * Env
Definition XrdOfsTPC.hh:59
XrdOfsTPC::Facts::Pfn
const char * Pfn
Definition XrdOfsTPC.hh:54
XrdOfsTPC::Facts::Org
const char * Org
Definition XrdOfsTPC.hh:55
XrdOfsTPC::Facts::Facts
Facts(const XrdSecEntity *vEnt, XrdOucErrInfo *vInf, XrdOucEnv *vEnv, const char *vKey, const char *vLfn, const char *vPfn=0)
Definition XrdOfsTPC.hh:61
XrdOfsTPC::Facts::Lfn
const char * Lfn
Definition XrdOfsTPC.hh:53
XrdOfsTPC::Facts::eRR
XrdOucErrInfo * eRR
Definition XrdOfsTPC.hh:58
XrdOfsTPC::Facts::Dst
const char * Dst
Definition XrdOfsTPC.hh:56