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 /*       All Rights Reserved. See XrdInfo.cc for complete License Terms       */
00009 /*   Produced by Andrew Hanushevsky for Stanford University under contract    */
00010 /*                DE-AC03-76-SFO0515 with the Deprtment of Energy             */
00011 /******************************************************************************/
00012 
00013 #include "Xrd/XrdBuffer.hh"
00014 #include "Xrd/XrdInet.hh"
00015 #include "Xrd/XrdProtLoad.hh"
00016 #include "Xrd/XrdProtocol.hh"
00017 #include "Xrd/XrdScheduler.hh"
00018 #define   XRD_TRACE Trace.
00019 #include "Xrd/XrdTrace.hh"
00020 
00021 #include "XrdOuc/XrdOucTrace.hh"
00022 #include "XrdSys/XrdSysError.hh"
00023 #include "XrdSys/XrdSysLogger.hh"
00024 
00025 class XrdNetSecurity;
00026 class XrdOucStream;
00027 class XrdConfigProt;
00028 
00029 class XrdConfig
00030 {
00031 public:
00032 
00033 int         Configure(int argc, char **argv);
00034 
00035 int         ConfigXeq(char *var, XrdOucStream &Config, XrdSysError *eDest=0);
00036 
00037          XrdConfig();
00038         ~XrdConfig() {}
00039 
00040 XrdProtocol_Config  ProtInfo;
00041 XrdInet            *NetADM;
00042 XrdInet            *NetTCP[XrdProtLoad::ProtoMax+1];
00043 
00044 private:
00045 
00046 int   ASocket(const char *path, const char *fname, mode_t mode);
00047 int   ConfigProc(void);
00048 int   getUG(char *parm, uid_t &theUid, gid_t &theGid);
00049 int   setFDL();
00050 int   Setup(char *dfltp);
00051 void  Usage(int rc);
00052 int   xallow(XrdSysError *edest, XrdOucStream &Config);
00053 int   xapath(XrdSysError *edest, XrdOucStream &Config);
00054 int   xbuf(XrdSysError *edest, XrdOucStream &Config);
00055 int   xnet(XrdSysError *edest, XrdOucStream &Config);
00056 int   xlog(XrdSysError *edest, XrdOucStream &Config);
00057 int   xport(XrdSysError *edest, XrdOucStream &Config);
00058 int   xprot(XrdSysError *edest, XrdOucStream &Config);
00059 int   xrep(XrdSysError *edest, XrdOucStream &Config);
00060 int   xsched(XrdSysError *edest, XrdOucStream &Config);
00061 int   xtrace(XrdSysError *edest, XrdOucStream &Config);
00062 int   xtmo(XrdSysError *edest, XrdOucStream &Config);
00063 int   yport(XrdSysError *edest, const char *ptyp, const char *pval);
00064 
00065 static const char  *TraceID;
00066 
00067 XrdSysLogger        Logger;
00068 XrdSysError         Log;
00069 XrdOucTrace         Trace;
00070 XrdScheduler        Sched;
00071 XrdBuffManager      BuffPool;
00072 XrdNetSecurity     *Police;
00073 const char         *myProg;
00074 const char         *myName;
00075 const char         *myDomain;
00076 const char         *myInsName;
00077 char               *myInstance;
00078 char               *AdminPath;
00079 char               *ConfigFN;
00080 char               *repDest[2];
00081 XrdConfigProt      *Firstcp;
00082 XrdConfigProt      *Lastcp;
00083 int                 Net_Blen;
00084 int                 Net_Opts;
00085 int                 Wan_Blen;
00086 int                 Wan_Opts;
00087 
00088 int                 PortTCP;      // TCP Port to listen on
00089 int                 PortUDP;      // UDP Port to listen on (currently unsupported)
00090 int                 PortWAN;      // TCP port to listen on for WAN connections
00091 int                 NetTCPlep;
00092 int                 AdminMode;
00093 int                 repInt;
00094 char                repOpts;
00095 char                isProxy;
00096 };
00097 #endif