xrootd
XrdConfig.hh
Go to the documentation of this file.
00001 #ifndef _XRD_CONFIG_H
00002 #define _XRD_CONFIG_H
00003 /******************************************************************************/
00004 /*                                                                            */
00005 /*                          X r d C o n f i g . h h                           */
00006 /*                                                                            */
00007 /* (C) 2004 by the Board of Trustees of the Leland Stanford, Jr., University  */
00008 /*   Produced by Andrew Hanushevsky for Stanford University under contract    */
00009 /*                DE-AC02-76-SFO0515 with the Deprtment of Energy             */
00010 /*                                                                            */
00011 /* This file is part of the XRootD software suite.                            */
00012 /*                                                                            */
00013 /* XRootD is free software: you can redistribute it and/or modify it under    */
00014 /* the terms of the GNU Lesser General Public License as published by the     */
00015 /* Free Software Foundation, either version 3 of the License, or (at your     */
00016 /* option) any later version.                                                 */
00017 /*                                                                            */
00018 /* XRootD is distributed in the hope that it will be useful, but WITHOUT      */
00019 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or      */
00020 /* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public       */
00021 /* License for more details.                                                  */
00022 /*                                                                            */
00023 /* You should have received a copy of the GNU Lesser General Public License   */
00024 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file  */
00025 /* COPYING (GPL license).  If not, see <http://www.gnu.org/licenses/>.        */
00026 /*                                                                            */
00027 /* The copyright holder's institutional names and contributor's names may not */
00028 /* be used to endorse or promote products derived from this software without  */
00029 /* specific prior written permission of the institution or contributor.       */
00030 /******************************************************************************/
00031 
00032 #include "Xrd/XrdBuffer.hh"
00033 #include "Xrd/XrdInet.hh"
00034 #include "Xrd/XrdProtLoad.hh"
00035 #include "Xrd/XrdProtocol.hh"
00036 #include "Xrd/XrdScheduler.hh"
00037 #define   XRD_TRACE Trace.
00038 #include "Xrd/XrdTrace.hh"
00039 
00040 #include "XrdOuc/XrdOucTrace.hh"
00041 #include "XrdSys/XrdSysError.hh"
00042 #include "XrdSys/XrdSysLogger.hh"
00043 
00044 class XrdNetSecurity;
00045 class XrdOucStream;
00046 class XrdConfigProt;
00047 
00048 class XrdConfig
00049 {
00050 public:
00051 
00052 int         Configure(int argc, char **argv);
00053 
00054 int         ConfigXeq(char *var, XrdOucStream &Config, XrdSysError *eDest=0);
00055 
00056          XrdConfig();
00057         ~XrdConfig() {}
00058 
00059 XrdProtocol_Config  ProtInfo;
00060 XrdInet            *NetADM;
00061 XrdInet            *NetTCP[XrdProtLoad::ProtoMax+1];
00062 
00063 private:
00064 
00065 int   ASocket(const char *path, const char *fname, mode_t mode);
00066 int   ConfigProc(void);
00067 int   getUG(char *parm, uid_t &theUid, gid_t &theGid);
00068 int   setFDL();
00069 int   Setup(char *dfltp);
00070 void  Usage(int rc);
00071 int   xallow(XrdSysError *edest, XrdOucStream &Config);
00072 int   xapath(XrdSysError *edest, XrdOucStream &Config);
00073 int   xbuf(XrdSysError *edest, XrdOucStream &Config);
00074 int   xnet(XrdSysError *edest, XrdOucStream &Config);
00075 int   xlog(XrdSysError *edest, XrdOucStream &Config);
00076 int   xport(XrdSysError *edest, XrdOucStream &Config);
00077 int   xprot(XrdSysError *edest, XrdOucStream &Config);
00078 int   xrep(XrdSysError *edest, XrdOucStream &Config);
00079 int   xsched(XrdSysError *edest, XrdOucStream &Config);
00080 int   xsit(XrdSysError *edest, XrdOucStream &Config);
00081 int   xtrace(XrdSysError *edest, XrdOucStream &Config);
00082 int   xtmo(XrdSysError *edest, XrdOucStream &Config);
00083 int   yport(XrdSysError *edest, const char *ptyp, const char *pval);
00084 
00085 static const char  *TraceID;
00086 
00087 XrdSysLogger        Logger;
00088 XrdSysError         Log;
00089 XrdOucTrace         Trace;
00090 XrdScheduler        Sched;
00091 XrdBuffManager      BuffPool;
00092 XrdNetSecurity     *Police;
00093 const char         *myProg;
00094 const char         *myName;
00095 const char         *myDomain;
00096 const char         *mySitName;
00097 const char         *myInsName;
00098 char               *myInstance;
00099 char               *AdminPath;
00100 char               *ConfigFN;
00101 char               *repDest[2];
00102 XrdConfigProt      *Firstcp;
00103 XrdConfigProt      *Lastcp;
00104 int                 Net_Blen;
00105 int                 Net_Opts;
00106 int                 Wan_Blen;
00107 int                 Wan_Opts;
00108 
00109 int                 PortTCP;      // TCP Port to listen on
00110 int                 PortUDP;      // UDP Port to listen on (currently unsupported)
00111 int                 PortWAN;      // TCP port to listen on for WAN connections
00112 int                 NetTCPlep;
00113 int                 AdminMode;
00114 int                 repInt;
00115 char                repOpts;
00116 char                isProxy;
00117 };
00118 #endif