xrootd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
XrdConfig.hh
Go to the documentation of this file.
1 #ifndef _XRD_CONFIG_H
2 #define _XRD_CONFIG_H
3 /******************************************************************************/
4 /* */
5 /* X r d C o n f i g . h h */
6 /* */
7 /* (C) 2004 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 Deprtment 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 <vector>
33 #include <string>
34 
35 #include "Xrd/XrdProtLoad.hh"
36 #include "Xrd/XrdProtocol.hh"
37 
38 class XrdSysError;
39 class XrdTcpMonInfo;
40 class XrdNetSecurity;
41 class XrdOucStream;
42 class XrdInet;
43 class XrdConfigProt;
44 
45 class XrdConfig
46 {
47 public:
48 
49 int Configure(int argc, char **argv);
50 
51 int ConfigXeq(char *var, XrdOucStream &Config, XrdSysError *eDest=0);
52 
53  XrdConfig();
55 
58 std::vector<XrdInet*> NetTCP;
59 
60 private:
61 
62 int ASocket(const char *path, const char *fname, mode_t mode);
63 int ConfigProc(void);
64 XrdInet *getNet(int port, bool isTLS);
65 int getUG(char *parm, uid_t &theUid, gid_t &theGid);
66 void Manifest(const char *pidfn);
67 bool PidFile(const char *clpFN, bool optbg);
68 void setCFG(bool start);
69 int setFDL();
70 int Setup(char *dfltp, char *libProt);
71 int SetupAPath();
72 bool SetupTLS();
73 void Usage(int rc);
74 int xallow(XrdSysError *edest, XrdOucStream &Config);
75 int xapath(XrdSysError *edest, XrdOucStream &Config);
76 int xhpath(XrdSysError *edest, XrdOucStream &Config);
77 int xbuf(XrdSysError *edest, XrdOucStream &Config);
78 int xnet(XrdSysError *edest, XrdOucStream &Config);
79 int xnkap(XrdSysError *edest, char *val);
80 int xlog(XrdSysError *edest, XrdOucStream &Config);
81 int xpidf(XrdSysError *edest, XrdOucStream &Config);
82 int xport(XrdSysError *edest, XrdOucStream &Config);
83 int xprot(XrdSysError *edest, XrdOucStream &Config);
84 int xrep(XrdSysError *edest, XrdOucStream &Config);
85 int xsched(XrdSysError *edest, XrdOucStream &Config);
86 int xsit(XrdSysError *edest, XrdOucStream &Config);
87 int xtcpmon(XrdSysError *edest, XrdOucStream &Config);
88 int xtls(XrdSysError *edest, XrdOucStream &Config);
89 int xtlsca(XrdSysError *edest, XrdOucStream &Config);
90 int xtlsci(XrdSysError *edest, XrdOucStream &Config);
91 int xtrace(XrdSysError *edest, XrdOucStream &Config);
92 int xtmo(XrdSysError *edest, XrdOucStream &Config);
93 
94 static const char *TraceID;
96 XrdTcpMonInfo *tmoInfo;
97 const char *myProg;
98 std::string myName;
99 const char *myDomain;
100 const char *mySitName;
101 const char *myInsName;
103 char *AdminPath;
104 char *HomePath;
105 char *PidPath;
106 char *tlsCert;
107 char *tlsKey;
108 char *caDir;
109 char *caFile;
110 char *ConfigFN;
111 char *repDest[2];
112 XrdConfigProt *Firstcp;
113 XrdConfigProt *Lastcp;
118 
119 int PortTCP; // TCP Port to listen on
120 int PortUDP; // UDP Port to listen on (currently unsupported)
121 int PortTLS; // TCP port to listen on for TLS connections
122 
125 int repInt;
126 
127 uint64_t tlsOpts;
128 bool tlsNoVer;
129 bool tlsNoCAD;
130 
131 char repOpts;
132 char ppNet;
133 signed char coreV;
134 char Specs;
135 static const int hpSpec = 0x01;
136 };
137 #endif
int xtcpmon(XrdSysError *edest, XrdOucStream &Config)
char * caFile
Definition: XrdConfig.hh:109
int xtlsca(XrdSysError *edest, XrdOucStream &Config)
char * caDir
Definition: XrdConfig.hh:108
int Configure(int argc, char **argv)
char * tlsKey
Definition: XrdConfig.hh:107
int xhpath(XrdSysError *edest, XrdOucStream &Config)
int PortUDP
Definition: XrdConfig.hh:120
char * HomePath
Definition: XrdConfig.hh:104
std::string myName
Definition: XrdConfig.hh:98
Definition: XrdOucStream.hh:46
static const int hpSpec
Definition: XrdConfig.hh:135
int xtrace(XrdSysError *edest, XrdOucStream &Config)
static const char * TraceID
Definition: XrdConfig.hh:94
Definition: XrdConfig.hh:45
int xprot(XrdSysError *edest, XrdOucStream &Config)
int repInt
Definition: XrdConfig.hh:125
int Net_Opts
Definition: XrdConfig.hh:115
int TLS_Opts
Definition: XrdConfig.hh:117
bool tlsNoCAD
Definition: XrdConfig.hh:129
int ConfigProc(void)
~XrdConfig()
Definition: XrdConfig.hh:54
const char * mySitName
Definition: XrdConfig.hh:100
XrdTcpMonInfo * tmoInfo
Definition: XrdConfig.hh:96
int ASocket(const char *path, const char *fname, mode_t mode)
int xpidf(XrdSysError *edest, XrdOucStream &Config)
Definition: XrdSysError.hh:89
bool PidFile(const char *clpFN, bool optbg)
int TLS_Blen
Definition: XrdConfig.hh:116
const char * myDomain
Definition: XrdConfig.hh:99
char * PidPath
Definition: XrdConfig.hh:105
int Setup(char *dfltp, char *libProt)
void Usage(int rc)
XrdCmsConfig Config
int ConfigXeq(char *var, XrdOucStream &Config, XrdSysError *eDest=0)
char * AdminPath
Definition: XrdConfig.hh:103
XrdConfigProt * Firstcp
Definition: XrdConfig.hh:112
char repOpts
Definition: XrdConfig.hh:131
int SetupAPath()
char * tlsCert
Definition: XrdConfig.hh:106
Definition: XrdProtocol.hh:55
void setCFG(bool start)
int xtlsci(XrdSysError *edest, XrdOucStream &Config)
XrdNetSecurity * Police
Definition: XrdConfig.hh:95
XrdInet * getNet(int port, bool isTLS)
const char * myProg
Definition: XrdConfig.hh:97
int HomeMode
Definition: XrdConfig.hh:124
int xlog(XrdSysError *edest, XrdOucStream &Config)
int xrep(XrdSysError *edest, XrdOucStream &Config)
XrdProtocol_Config ProtInfo
Definition: XrdConfig.hh:56
int xsched(XrdSysError *edest, XrdOucStream &Config)
char * myInstance
Definition: XrdConfig.hh:102
int PortTCP
Definition: XrdConfig.hh:119
char ppNet
Definition: XrdConfig.hh:132
char Specs
Definition: XrdConfig.hh:134
int xnkap(XrdSysError *edest, char *val)
const char * myInsName
Definition: XrdConfig.hh:101
void Manifest(const char *pidfn)
char * repDest[2]
Definition: XrdConfig.hh:111
int xallow(XrdSysError *edest, XrdOucStream &Config)
int xbuf(XrdSysError *edest, XrdOucStream &Config)
int PortTLS
Definition: XrdConfig.hh:121
Definition: XrdNetSecurity.hh:43
std::vector< XrdInet * > NetTCP
Definition: XrdConfig.hh:58
bool tlsNoVer
Definition: XrdConfig.hh:128
XrdConfigProt * Lastcp
Definition: XrdConfig.hh:113
char * ConfigFN
Definition: XrdConfig.hh:110
int xapath(XrdSysError *edest, XrdOucStream &Config)
int AdminMode
Definition: XrdConfig.hh:123
bool SetupTLS()
int Net_Blen
Definition: XrdConfig.hh:114
int setFDL()
int xtmo(XrdSysError *edest, XrdOucStream &Config)
int xnet(XrdSysError *edest, XrdOucStream &Config)
uint64_t tlsOpts
Definition: XrdConfig.hh:127
int getUG(char *parm, uid_t &theUid, gid_t &theGid)
signed char coreV
Definition: XrdConfig.hh:133
int xsit(XrdSysError *edest, XrdOucStream &Config)
int xtls(XrdSysError *edest, XrdOucStream &Config)
XrdInet * NetADM
Definition: XrdConfig.hh:57
int xport(XrdSysError *edest, XrdOucStream &Config)
Definition: XrdInet.hh:47