xrootd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
XrdNetPMark.hh
Go to the documentation of this file.
1 #ifndef __XRDNETPMARK__
2 #define __XRDNETPMARK__
3 /******************************************************************************/
4 /* */
5 /* X r d N e t P M a r k . h h */
6 /* */
7 /* (c) 2021 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* All Rights Reserved */
9 /* Produced by Andrew Hanushevsky for Stanford University under contract */
10 /* DE-AC02-76-SFO0515 with the Department of Energy */
11 /* */
12 /* This file is part of the XRootD software suite. */
13 /* */
14 /* XRootD is free software: you can redistribute it and/or modify it under */
15 /* the terms of the GNU Lesser General Public License as published by the */
16 /* Free Software Foundation, either version 3 of the License, or (at your */
17 /* option) any later version. */
18 /* */
19 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
20 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
21 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
22 /* License for more details. */
23 /* */
24 /* You should have received a copy of the GNU Lesser General Public License */
25 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
26 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
27 /* */
28 /* The copyright holder's institutional names and contributor's names may not */
29 /* be used to endorse or promote products derived from this software without */
30 /* specific prior written permission of the institution or contributor. */
31 /******************************************************************************/
32 
33 class XrdNetAddrInfo;
34 class XrdSecEntity;
35 
37 {
38 public:
39 
40 class Handle
41  {public:
42 
43  bool getEA(int &ec, int &ac)
44  {if (eCode >= 0) {ec = eCode; ac = aCode; return true;}
45  ec = ac = 0; return false;
46  }
47 
48  bool Valid() {return eCode >= 0;}
49 
50  Handle(const char *app=0, int ecode=0, int acode=0)
51  : appName(app), eCode(ecode), aCode(acode) {}
52 
54  : appName(h.appName), eCode(h.eCode), aCode(h.aCode) {};
55 
56  virtual ~Handle() {};
57 
58  protected:
59  const char *appName;
60  int eCode;
61  int aCode;
62  };
63 
64 virtual Handle *Begin(XrdSecEntity &Client, const char *path=0,
65  const char *cgi=0,
66  const char *app=0) = 0;
67 
68 virtual Handle *Begin(XrdNetAddrInfo &addr, Handle &handle,
69  const char *tident) = 0;
70 
71 static bool getEA(const char *cgi, int &ecode, int &acode);
72 
74 protected:
75 
76 // ID limits and specifications
77 //
78 static const int btsActID = 6;
79 static const int mskActID = 63;
80 static const int maxActID = 63;
81 
82 static const int maxExpID = 511;
83 
84 virtual ~XrdNetPMark() {} // This object cannot be deleted!
85 };
86 #endif
static bool getEA(const char *cgi, int &ecode, int &acode)
Definition: XrdNetPMark.hh:36
bool getEA(int &ec, int &ac)
Definition: XrdNetPMark.hh:43
Handle(const char *app=0, int ecode=0, int acode=0)
Definition: XrdNetPMark.hh:50
XrdNetPMark()
Definition: XrdNetPMark.hh:73
Handle(Handle &h)
Definition: XrdNetPMark.hh:53
int eCode
Definition: XrdNetPMark.hh:60
virtual Handle * Begin(XrdSecEntity &Client, const char *path=0, const char *cgi=0, const char *app=0)=0
Definition: XrdNetPMark.hh:40
static const int btsActID
Definition: XrdNetPMark.hh:78
int aCode
Definition: XrdNetPMark.hh:61
virtual ~XrdNetPMark()
Definition: XrdNetPMark.hh:84
static const int maxActID
Definition: XrdNetPMark.hh:80
Definition: XrdNetAddrInfo.hh:53
bool Valid()
Definition: XrdNetPMark.hh:48
virtual ~Handle()
Definition: XrdNetPMark.hh:56
static const int mskActID
Definition: XrdNetPMark.hh:79
const char * appName
Definition: XrdNetPMark.hh:56
Definition: XrdSecEntity.hh:63
static const int maxExpID
Definition: XrdNetPMark.hh:82