XRootD
XrdConfig Class Reference

#include <XrdConfig.hh>

+ Collaboration diagram for XrdConfig:

Public Member Functions

 XrdConfig ()
 
 ~XrdConfig ()
 
int Configure (int argc, char **argv)
 
int ConfigXeq (char *var, XrdOucStream &Config, XrdSysError *eDest=0)
 

Public Attributes

XrdInetNetADM
 
std::vector< XrdInet * > NetTCP
 
XrdProtocol_Config ProtInfo
 

Detailed Description

Definition at line 47 of file XrdConfig.hh.

Constructor & Destructor Documentation

◆ XrdConfig()

XrdConfig::XrdConfig ( )

Definition at line 245 of file XrdConfig.cc.

246 {
247 
248 // Preset all variables with common defaults
249 //
250  PortTCP = -1;
251  PortUDP = -1;
252  PortTLS = -1;
253  ConfigFN = 0;
254  tmoInfo = 0;
255  myInsName= 0;
256  mySitName= 0;
257  AdminPath= strdup("/tmp");
258  HomePath = 0;
259  PidPath = strdup("/tmp");
260  tlsCert = 0;
261  tlsKey = 0;
262  caDir = 0;
263  caFile = 0;
264  AdminMode= S_IRWXU;
265  HomeMode = S_IRWXU;
266  Police = 0;
267  Net_Opts = XRDNET_KEEPALIVE;
268  TLS_Blen = 0; // Accept OS default (leave Linux autotune in effect)
269  TLS_Opts = XRDNET_KEEPALIVE | XRDNET_USETLS;
270  repDest[0] = 0;
271  repDest[1] = 0;
272  repInt = 600;
273  repOpts = 0;
274  ppNet = 0;
275  tlsOpts = 9ULL | XrdTlsContext::servr | XrdTlsContext::logVF;
276  tlsNoVer = false;
277  tlsNoCAD = true;
278  NetADM = 0;
279  coreV = 1;
280  Specs = 0;
281  isStrict = false;
282  maxFD = 256*1024; // 256K default
283 
284  Firstcp = Lastcp = 0;
285 
286  ProtInfo.eDest = &Log; // Stable -> Error Message/Logging Handler
287  ProtInfo.NetTCP = 0; // Stable -> Network Object
288  ProtInfo.BPool = &BuffPool; // Stable -> Buffer Pool Manager
289  ProtInfo.Sched = &Sched; // Stable -> System Scheduler
290  ProtInfo.ConfigFN= 0; // We will fill this in later
291  ProtInfo.Stats = 0; // We will fill this in later
292  ProtInfo.AdmPath = AdminPath; // Stable -> The admin path
293  ProtInfo.AdmMode = AdminMode; // Stable -> The admin path mode
294  ProtInfo.theEnv = &theEnv; // Additional information
295  ProtInfo.xrdFlags= 0; // Additional information
296 
298  memset(ProtInfo.rsvd3, 0, sizeof(ProtInfo.rsvd3));
299  ProtInfo.WSize = 0;
300  ProtInfo.ConnMax = -1; // Max connections (fd limit)
301  ProtInfo.readWait = 3*1000; // Wait time for data before we reschedule
302  ProtInfo.idleWait = 0; // Seconds connection may remain idle (0=off)
303  ProtInfo.hailWait =30*1000; // Wait time for data before we drop connection
304  ProtInfo.DebugON = 0; // 1 if started with -d
305  ProtInfo.argc = 0;
306  ProtInfo.argv = 0;
307  ProtInfo.tlsPort = 0;
308  ProtInfo.tlsCtx = 0;
310 
311  XrdNetAddr::SetCache(3*60*60); // Cache address resolutions for 3 hours
312 }
#define XrdFORMATB
Definition: XrdInfo.hh:36
#define XRDNET_KEEPALIVE
Definition: XrdNetOpts.hh:63
#define XRDNET_USETLS
Definition: XrdNetOpts.hh:91
XrdProtocol_Config ProtInfo
Definition: XrdConfig.hh:58
XrdInet * NetADM
Definition: XrdConfig.hh:59
static void SetCache(int keeptime)
Definition: XrdNetAddr.cc:507
XrdBuffManager * BPool
Definition: XrdProtocol.hh:63
XrdScheduler * Sched
Definition: XrdProtocol.hh:64
XrdTlsContext * tlsCtx
Definition: XrdProtocol.hh:99
const char * AdmPath
Definition: XrdProtocol.hh:76
XrdSysError * eDest
Definition: XrdProtocol.hh:61
XrdOucString * totalCF
Definition: XrdProtocol.hh:100
XrdOucEnv * theEnv
Definition: XrdProtocol.hh:66
XrdStats * Stats
Definition: XrdProtocol.hh:65
static const uint64_t servr
This is a server context.
static const uint64_t logVF
Log verify failures.
XrdOucEnv theEnv
XrdSysError Log
Definition: XrdConfig.cc:112
XrdScheduler Sched
Definition: XrdLinkCtl.cc:54
XrdOucString totalCF
Definition: XrdConfig.cc:110
XrdBuffManager BuffPool
Definition: XrdGlobals.cc:51

References XrdGlobal::BuffPool, XrdGlobal::Log, XrdTlsContext::logVF, XrdGlobal::Sched, XrdTlsContext::servr, XrdNetAddr::SetCache(), XrdScheduler::Stats(), XrdCms::theEnv, XrdGlobal::totalCF, XrdFORMATB, XRDNET_KEEPALIVE, and XRDNET_USETLS.

+ Here is the call graph for this function:

◆ ~XrdConfig()

XrdConfig::~XrdConfig ( )
inline

Definition at line 56 of file XrdConfig.hh.

56 {}

Member Function Documentation

◆ Configure()

int XrdConfig::Configure ( int  argc,
char **  argv 
)

Definition at line 318 of file XrdConfig.cc.

319 {
320 /*
321  Function: Establish configuration at start up time.
322 
323  Input: None.
324 
325  Output: 0 upon success or !0 otherwise.
326 */
327  const char *xrdInst="XRDINSTANCE=";
328 
329  int retc, NoGo = 0, clPort = -1;
330  const char *temp;
331  char c, buff[512], *dfltProt, *libProt = 0;
332  uid_t myUid = 0;
333  gid_t myGid = 0;
334  extern char *optarg;
335  extern int optind, opterr;
336  struct XrdOucLogging::configLogInfo LogInfo;
337  int pipeFD[2] = {-1, -1};
338  const char *pidFN = 0;
339  static const int myMaxc = 80;
340  char **urArgv, *myArgv[myMaxc], argBuff[myMaxc*3+8];
341  char *argbP = argBuff, *argbE = argbP+sizeof(argBuff)-4;
342  char *ifList = 0;
343  int myArgc = 1, urArgc = argc, i;
344  bool noV6, ipV4 = false, ipV6 = false, rootChk = true, optbg = false;
345 
346 // Reconstruct the command line so we can put it in the log
347 //
348  XrdOucString CmdLine(argv[0]);
349  for (int k = 1; k < argc; k++)
350  {CmdLine += ' '; CmdLine += argv[k];}
351 
352 // Obtain the program name we will be using
353 //
354  retc = strlen(argv[0]);
355  while(retc--) if (argv[0][retc] == '/') break;
356  myProg = &argv[0][retc+1];
357 
358 // Setup the initial required protocol. The program name matches the protocol
359 // name but may be arbitrarily suffixed. We need to ignore this suffix. So we
360 // look for it here and it it exists we duplicate argv[0] (yes, loosing some
361 // bytes - sorry valgrind) without the suffix.
362 //
363  {char *p = dfltProt = strdup(myProg);
364  while(*p && (*p == '.' || *p == '-')) p++;
365  if (*p)
366  {char *dot = index(p, '.'), *dash = index(p, '-');
367  if (dot && (dot < dash || !dash)) p = dot;
368  else if (dash) p = dash;
369  else p = 0;
370  if (p) *p = '\0';
371  if (!strcmp("xrootd", dfltProt)) dfltProt[5] = 0;
372  else if (!strcmp("cmsd", dfltProt)) dfltProt[3] = 0;
373  }
374  }
375  myArgv[0] = argv[0];
376 
377 // Prescan the argument list to see if there is a passthrough option. In any
378 // case, we will set the ephemeral argv/arg in the environment.
379 //
380  i = 1;
381  while(i < argc)
382  {if (*(argv[i]) == '-' && *(argv[i]+1) == '+')
383  {int n = strlen(argv[i]+2), j = i+1, k = 1;
384  if (urArgc == argc) urArgc = i;
385  if (n) memcpy(buff, argv[i]+2, (n > 256 ? 256 : n));
386  strcpy(&(buff[n]), ".argv**");
387  while(j < argc && (*(argv[j]) != '-' || *(argv[j]+1) != '+')) j++;
388  urArgv = new char*[j-i+1];
389  urArgv[0] = argv[0];
390  i++;
391  while(i < j) urArgv[k++] = argv[i++];
392  urArgv[k] = 0;
393  theEnv.PutPtr(buff, urArgv);
394  strcpy(&(buff[n]), ".argc");
395  theEnv.PutInt(buff, static_cast<long>(k));
396  } else i++;
397  }
398  theEnv.PutPtr("argv[0]", argv[0]);
399 
400 // Process the options. Note that we cannot passthrough long options or
401 // options that take arguments because getopt permutes the arguments.
402 //
403  opterr = 0;
404  if (argc > 1 && '-' == *argv[1])
405  while ((c = getopt(urArgc,argv,":a:A:bc:dhHI:k:l:L:n:N:p:P:R:s:S:vw:W:z"))
406  && ((unsigned char)c != 0xff))
407  { switch(c)
408  {
409  case 'a': if (AdminPath) free(AdminPath);
410  AdminPath = strdup(optarg);
411  AdminMode = ProtInfo.AdmMode = S_IRWXU;
413  break;
414  case 'A': if (AdminPath) free(AdminPath);
415  AdminPath = strdup(optarg);
416  AdminMode = ProtInfo.AdmMode = S_IRWXU | S_IRWXG;
418  break;
419  case 'b': optbg = true;
420  break;
421  case 'c': if (ConfigFN) free(ConfigFN);
422  ConfigFN = strdup(optarg);
423  break;
424  case 'd': XrdTrace.What |= TRACE_ALL;
425  ProtInfo.DebugON = 1;
426  XrdOucEnv::Export("XRDDEBUG", "1");
427  break;
428  case 'h': Usage(0);
429  break;
430  case 'H': Usage(-1);
431  break;
432  case 'I': if (!strcmp("v4", optarg)) {ipV4 = true; ipV6 = false;}
433  else if (!strcmp("v6", optarg)) {ipV4 = false; ipV6 = true;}
434  else {Log.Emsg("Config", "Invalid -I argument -",optarg);
435  Usage(1);
436  }
437  break;
438  case 'k': if (!(LogInfo.keepV = Log.logger()->ParseKeep(optarg)))
439  {Log.Emsg("Config","Invalid -k argument -",optarg);
440  Usage(1);
441  }
442  break;
443  case 'l': LogInfo.logArg = optarg;
444  break;
445  case 'L': if (!*optarg)
446  {Log.Emsg("Config", "Protocol library path not specified.");
447  Usage(1);
448  }
449  if (libProt) free(libProt);
450  libProt = strdup(optarg);
451  break;
452  case 'n': myInsName = (!strcmp(optarg,"anon")||!strcmp(optarg,"default")
453  ? 0 : optarg);
454  break;
455  case 'N': XrdNetIdentity::SetFQN(optarg);
456  break;
457  case 'p': if ((clPort = XrdOuca2x::a2p(Log,"tcp",optarg)) < 0) Usage(1);
458  break;
459  case 'P': if (dfltProt) free(dfltProt);
460  dfltProt = strdup(optarg);
461  break;
462  case 'R': if (!(getUG(optarg, myUid, myGid))) Usage(1);
463  rootChk = false;
464  break;
465  case 's': pidFN = optarg;
466  break;
467  case 'S': mySitName = optarg;
468  break;
469  case ':': buff[0] = '-'; buff[1] = optopt; buff[2] = 0;
470  Log.Emsg("Config", buff, "parameter not specified.");
471  Usage(1);
472  break;
473  case 'v': std::cerr <<XrdVSTRING <<std::endl;
474  _exit(0);
475  break;
476  case 'w': if (HomePath) free(HomePath);
477  HomePath = strdup(optarg);
478  HomeMode = S_IRWXU;
479  Specs |= hpSpec;
480  break;
481  case 'W': if (HomePath) free(HomePath);
482  HomePath = strdup(optarg);
483  HomeMode = S_IRWXU | S_IRGRP | S_IXGRP;
484  Specs |= hpSpec;
485  break;
486  case 'z': LogInfo.hiRes = true;
487  break;
488 
489  default: if (optopt == '-' && *(argv[optind]+1) == '-')
490  {Log.Emsg("Config", "Long options are not supported.");
491  Usage(1);
492  }
493  if (myArgc >= myMaxc || argbP >= argbE)
494  {Log.Emsg("Config", "Too many command line arguments.");
495  Usage(1);
496  }
497  myArgv[myArgc++] = argbP;
498  *argbP++ = '-'; *argbP++ = optopt; *argbP++ = 0;
499  break;
500  }
501  }
502 
503 // If an adminpath specified, make sure it's absolute
504 //
505  if ((ProtInfo.xrdFlags & XrdProtocol_Config::admPSet) && *AdminPath != '/')
506  {Log.Emsg("Config", "Command line adminpath is not absolute.");
507  exit(17);
508  }
509 
510 // If an homepath specified, make sure it's absolute
511 //
512  if (HomePath && *HomePath != '/')
513  {Log.Emsg("Config", "Command line home path is not absolute.");
514  exit(17);
515  }
516 
517 // If the configuration file is relative to where we are, get the absolute
518 // path as we may be changing the home path. This also starts capturing.
519 //
520  if (ConfigFN) setCFG(true);
521 
522 // The first thing we must do is to set the correct networking mode
523 //
524  noV6 = XrdNetAddr::IPV4Set();
525  if (ipV4) XrdNetAddr::SetIPV4();
526  else if (ipV6){if (noV6) Log.Say("Config warning: ipV6 appears to be broken;"
527  " forced ipV6 mode not advised!");
529  }
530  else if (noV6) Log.Say("Config warning: ipV6 is misconfigured or "
531  "unavailable; reverting to ipV4.");
532 
533 // Set the site name if we have one
534 //
535  if (mySitName) mySitName = XrdOucSiteName::Set(mySitName, 63);
536 
537 // Drop into non-privileged state if so requested
538 //
539  if (myGid && setegid(myGid))
540  {Log.Emsg("Config", errno, "set effective gid"); exit(17);}
541  if (myUid && seteuid(myUid))
542  {Log.Emsg("Config", errno, "set effective uid"); exit(17);}
543 
544 // Prohibit this program from executing as superuser unless -R was specified.
545 //
546  if (rootChk && geteuid() == 0)
547  {Log.Emsg("Config", "Security reasons prohibit running as "
548  "superuser; program is terminating.");
549  _exit(8);
550  }
551 
552 // Pass over any parameters
553 //
554  if (urArgc-optind+2 >= myMaxc)
555  {Log.Emsg("Config", "Too many command line arguments.");
556  Usage(1);
557  }
558  for ( ; optind < urArgc; optind++) myArgv[myArgc++] = argv[optind];
559 
560 // Record the actual arguments that we will pass on
561 //
562  myArgv[myArgc] = 0;
563  ProtInfo.argc = myArgc;
564  ProtInfo.argv = myArgv;
565 
566 // Resolve background/foreground issues
567 //
568  if (optbg)
569  {
570 #ifdef WIN32
571  XrdOucUtils::Undercover(&Log, !LogInfo.logArg);
572 #else
573  if (pipe( pipeFD ) == -1)
574  {Log.Emsg("Config", errno, "create a pipe"); exit(17);}
575  XrdOucUtils::Undercover(Log, !LogInfo.logArg, pipeFD);
576 #endif
577  }
578 
579 // Get the full host name. We must define myIPAddr here because we may need to
580 // run in v4 mode and that doesn't get set until after the options are scanned.
581 //
582  static XrdNetAddr *myIPAddr = new XrdNetAddr((int)0);
583  auto envName = getenv("XRDHOST");
584  const char *ipAddrName;
585  if (envName) {
586  myName = envName;
587  XrdOucEnv::Export("OVERRIDEXRDHOST", myName.c_str());
588  } else if ((ipAddrName = myIPAddr->Name(0, &temp))) {
589  myName = ipAddrName;
590  } else {
591  myName = "";
592  }
593 
594 // Get our IP address and FQN
595 //
596  ProtInfo.myName = myName.c_str();
597  ProtInfo.myAddr = myIPAddr->SockAddr();
599  ProtInfo.myProg = myProg;
600 
601 // Set the Environmental variable to hold the instance name
602 // XRDINSTANCE=<pgm> <instance name>@<host name>
603 // XrdOucEnv::Export("XRDINSTANCE")
604 //
605  sprintf(buff,"%s%s %s@%s", xrdInst, myProg, ProtInfo.myInst, myName.c_str());
606  myInstance = strdup(buff);
607  putenv(myInstance); // XrdOucEnv::Export("XRDINSTANCE",...)
608  myInstance += strlen(xrdInst);
609  XrdOucEnv::Export("XRDHOST", myName.c_str());
610  XrdOucEnv::Export("XRDNAME", ProtInfo.myInst);
611  XrdOucEnv::Export("XRDPROG", myProg);
612 
613 // Bind the log file if we have one
614 //
615  if (LogInfo.logArg)
616  {LogInfo.xrdEnv = &theEnv;
617  LogInfo.iName = myInsName;
618  LogInfo.cfgFn = ConfigFN;
619  if (!XrdOucLogging::configLog(Log, LogInfo)) _exit(16);
620  Log.logger()->AddMsg(CmdLine.c_str());
622  }
623 
624 // We now test for host name. In theory, we should always get some kind of name.
625 // We can't really continue without some kind of name at this point. Note that
626 // vriable temp should still be valid from the previous NetAddr call.
627 //
628  if (myName.empty())
629  {Log.Emsg("Config", "Unable to determine host name; ",
630  (temp ? temp : "reason unknown"),
631  "; execution terminated.");
632  _exit(16);
633  }
634 
635 // Tell NetIF what logger to use as it's been properly setup by now.
636 //
638 
639 // Put out the herald
640 //
641  strcpy(buff, "Starting on ");
642  retc = strlen(buff);
643  XrdSysUtils::FmtUname(buff+retc, sizeof(buff)-retc);
644  Log.Say(0, buff);
645  Log.Say(0, CmdLine.c_str());
646  Log.Say(XrdBANNER);
647 
648 // Verify that we have a real name. We've had problems with people setting up
649 // bad /etc/hosts files that can cause connection failures if "allow" is used.
650 // Otherwise, determine our domain name.
651 //
652  if (!myIPAddr->isRegistered())
653  {Log.Emsg("Config",myName.c_str(),"does not appear to be registered in the DNS.");
654  Log.Emsg("Config","Verify that the '/etc/hosts' file is correct and "
655  "this machine is registered in DNS.");
656  Log.Emsg("Config", "Execution continues but connection failures may occur.");
657  myDomain = 0;
658  } else if (!(myDomain = index(myName.c_str(), '.')))
659  Log.Say("Config warning: this hostname, ", myName.c_str(),
660  ", is registered without a domain qualification.");
661 
662 // Setup the initial required protocol.
663 //
664  Firstcp = Lastcp = new XrdConfigProt(strdup(dfltProt), libProt, 0);
665 
666 // Let start it up!
667 //
668  Log.Say("++++++ ", myInstance, " initialization started.");
669 
670 // Allocate /dev/null as we need it and can't live without it
671 //
672  devNull = XrdSysFD_Open("/dev/null", O_RDONLY);
673  if (devNull < 0)
674  {Log.Emsg("Config", errno, "open '/dev/null' which is required!");
675  NoGo = 1;
676  }
677 
678 // Process the configuration file, if one is present
679 //
680  if (ConfigFN)
681  {Log.Say("Config using configuration file ", ConfigFN);
682  ProtInfo.ConfigFN = ConfigFN;
683  NoGo = ConfigProc();
684  }
685  if (clPort >= 0) PortTCP = clPort;
686  if (ProtInfo.DebugON)
689  }
690 
691 // Setup the admin path now
692 //
693  NoGo |= SetupAPath();
694 
695 // If tls enabled, set it up. We skip this if we failed to avoid confusing msgs
696 //
697  if (!NoGo)
698  {if (!tlsCert) ProtInfo.tlsCtx= 0;
699  else {Log.Say("++++++ ", myInstance, " TLS initialization started.");
700  if (SetupTLS())
701  {Log.Say("------ ",myInstance," TLS initialization ended.");
703  theEnv.PutPtr("XrdTlsContext*", XrdGlobal::tlsCtx);
704  } else {
705  NoGo = 1;
706  Log.Say("------ ",myInstance," TLS initialization failed.");
707  }
708  }
709  }
710 
711 // If there is TLS port verify that it can be used. We ignore this if we
712 // will fail anyway so as to not issue confusing messages.
713 //
714  if (!NoGo)
715  {if (PortTLS > 0 && !XrdGlobal::tlsCtx)
716  {Log.Say("Config TLS port specification ignored; TLS not configured!");
717  PortTLS = -1;
718  } else {
720  ProtInfo.tlsPort = (PortTLS > 0 ? PortTLS : 0);
721  }
722  }
723 
724 // Put largest buffer size in the env
725 //
726  theEnv.PutInt("MaxBuffSize", XrdGlobal::xlBuff.MaxSize());
727 
728 // Export the network interface list at this point
729 //
730  if (ppNet && XrdNetIF::GetIF(ifList, 0, true))
731  XrdOucEnv::Export("XRDIFADDRS",ifList);
732 
733 // Configure network routing
734 //
735  if (!XrdInet::netIF.SetIF(myIPAddr, ifList))
736  {Log.Emsg("Config", "Unable to determine interface addresses!");
737  NoGo = 1;
738  }
739 
740 // If we have an instance name change the working directory
741 //
742  if ((myInsName || HomePath)
743  && !XrdOucUtils::makeHome(Log, myInsName, HomePath, HomeMode)) NoGo = 1;
744 
745 // Create the pid file
746 //
747  if (!PidFile(pidFN, optbg)) NoGo = 1;
748 
749 // Establish a manifest file for auto-collection
750 //
751  if (!NoGo) Manifest(pidFN);
752 
753 // Now initialize the protocols and other stuff
754 //
755  if (!NoGo) NoGo = Setup(dfltProt, libProt);
756 
757 // End config capture
758 //
759  setCFG(false);
760 
761 // If we have a tcpmon plug-in try loading it now. We won't do that unless
762 // tcp monitoring was enabled by the monitoring framework.
763 //
764  if (tmoInfo && !NoGo)
765  {void *theGS = theEnv.GetPtr("TcpMon.gStream*");
766  if (!theGS) Log.Say("Config warning: TCP monitoring not enabled; "
767  "tcpmonlib plugin not loaded!");
768  else {tmoInfo->theEnv.PutPtr("TcpMon.gStream*", theGS);
769  TcpMonPin = tmoInfo->KingPin.Load("TcpMonPin");
770  if (!TcpMonPin) NoGo = 1;
771  }
772  }
773 
774  // if we call this it means that the daemon has forked and we are
775  // in the child process
776 #ifndef WIN32
777  if (optbg)
778  {
779  int status = NoGo ? 1 : 0;
780  if(write( pipeFD[1], &status, sizeof( status ) )) {};
781  close( pipeFD[1]);
782  }
783 #endif
784 
785 // All done, close the stream and return the return code.
786 //
787  temp = (NoGo ? " initialization failed." : " initialization completed.");
788  sprintf(buff, "%s:%d", myInstance, PortTCP);
789  Log.Say("------ ", buff, temp);
790  if (LogInfo.logArg)
791  {strcat(buff, " running ");
792  retc = strlen(buff);
793  XrdSysUtils::FmtUname(buff+retc, sizeof(buff)-retc);
794  Log.logger()->AddMsg(buff);
795  }
796  return NoGo;
797 }
void Usage(const char *msg)
Definition: XrdAccTest.cc:105
#define XrdBANNER
Definition: XrdInfo.hh:38
int optopt
int optind
ssize_t write(int fildes, const void *buf, size_t nbyte)
#define close(a)
Definition: XrdPosix.hh:43
#define TRACE_ALL
Definition: XrdTrace.hh:35
static XrdNetIF netIF
Definition: XrdInet.hh:68
const sockaddr * SockAddr()
const char * Name(const char *eName=0, const char **eText=0)
static void SetIPV4()
Definition: XrdNetAddr.cc:527
static void SetIPV6()
Definition: XrdNetAddr.cc:553
static bool IPV4Set()
Definition: XrdNetAddr.hh:61
static int GetIF(XrdOucTList **ifList, const char **eText=0)
Definition: XrdNetIF.cc:429
static void SetMsgs(XrdSysError *erp)
Definition: XrdNetIF.cc:886
static void SetFQN(const char *fqn)
void PutInt(const char *varname, long value)
Definition: XrdOucEnv.cc:268
static int Export(const char *Var, const char *Val)
Definition: XrdOucEnv.cc:188
void * GetPtr(const char *varname)
Definition: XrdOucEnv.cc:281
void PutPtr(const char *varname, void *value)
Definition: XrdOucEnv.cc:316
static bool configLog(XrdSysError &eDest, configLogInfo &logInfo)
T * Load(const char *Symbol)
static const char * Set(const char *name, int maxlen=15)
static const char * InstName(int TranOpt=0)
Definition: XrdOucUtils.cc:732
static void makeHome(XrdSysError &eDest, const char *inst)
Definition: XrdOucUtils.cc:850
static void Undercover(XrdSysError &eDest, int noLog, int *pipeFD=0)
static int a2p(XrdSysError &, const char *ptype, const char *val, bool anyOK=true)
Definition: XrdOuca2x.cc:140
static const int admPSet
Definition: XrdProtocol.hh:79
const char * myName
Definition: XrdProtocol.hh:82
const char * myProg
Definition: XrdProtocol.hh:83
const char * myInst
Definition: XrdProtocol.hh:81
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
Definition: XrdSysError.cc:95
void Say(const char *text1, const char *text2=0, const char *txt3=0, const char *text4=0, const char *text5=0, const char *txt6=0)
Definition: XrdSysError.cc:141
XrdSysLogger * logger(XrdSysLogger *lp=0)
Definition: XrdSysError.hh:141
void AddMsg(const char *msg)
int ParseKeep(const char *arg)
static void setDebug(XrdSysError *erp)
static int FmtUname(char *buff, int blen)
Definition: XrdSysUtils.cc:117
XrdOucPinKing< XrdTcpMonPin > KingPin
Definition: XrdConfig.cc:230
XrdOucEnv theEnv
Definition: XrdConfig.cc:238
XrdTlsContext * tlsCtx
Definition: XrdGlobals.cc:52
XrdTcpMonPin * TcpMonPin
Definition: XrdLinkXeq.cc:80
XrdBuffXL xlBuff
Definition: XrdBuffer.cc:68
XrdSysTrace XrdTrace
Definition: XrdTrace.hh:56
int devNull
Definition: XrdGlobals.cc:55
const char * myDomain

References XrdOuca2x::a2p(), XrdSysLogger::AddMsg(), XrdProtocol_Config::admPSet, XrdOucString::c_str(), XrdOucLogging::configLogInfo::cfgFn, close, XrdOucLogging::configLog(), XrdGlobal::devNull, XrdSysError::Emsg(), XrdOucEnv::Export(), XrdSysUtils::FmtUname(), XrdNetIF::GetIF(), XrdOucEnv::GetPtr(), XrdOucLogging::configLogInfo::hiRes, XrdOucLogging::configLogInfo::iName, XrdOucUtils::InstName(), XrdNetAddr::IPV4Set(), XrdNetAddrInfo::isRegistered(), XrdOucLogging::configLogInfo::keepV, XrdGlobal::Log, XrdOucLogging::configLogInfo::logArg, XrdSysError::logger(), XrdOucUtils::makeHome(), XrdNetPMarkConfig::myDomain, XrdNetAddrInfo::Name(), XrdInet::netIF, optind, optopt, XrdSysLogger::ParseKeep(), XrdOucEnv::PutInt(), XrdOucEnv::PutPtr(), XrdSysError::Say(), XrdOucSiteName::Set(), XrdSysThread::setDebug(), XrdNetIdentity::SetFQN(), XrdNetAddr::SetIPV4(), XrdNetAddr::SetIPV6(), XrdNetIF::SetMsgs(), XrdNetAddrInfo::SockAddr(), XrdGlobal::TcpMonPin, XrdCms::theEnv, XrdGlobal::tlsCtx, TRACE_ALL, XrdOucUtils::Undercover(), Usage(), XrdSysTrace::What, write(), XrdGlobal::xlBuff, XrdBANNER, XrdOucLogging::configLogInfo::xrdEnv, and XrdGlobal::XrdTrace.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ConfigXeq()

int XrdConfig::ConfigXeq ( char *  var,
XrdOucStream Config,
XrdSysError eDest = 0 
)

Definition at line 803 of file XrdConfig.cc.

804 {
805  int dynamic;
806 
807  // Determine whether is is dynamic or not
808  //
809  if (eDest) dynamic = 1;
810  else {dynamic = 0; eDest = &Log;}
811 
812  // Process common items
813  //
814  TS_Xeq("buffers", xbuf);
815  TS_Xeq("network", xnet);
816  TS_Xeq("sched", xsched);
817  TS_Xeq("trace", xtrace);
818 
819  // Process items that can only be processed once
820  //
821  if (!dynamic)
822  {
823  TS_Xeq("adminpath", xapath);
824  TS_Xeq("allow", xallow);
825  TS_Xeq("homepath", xhpath);
826  TS_Xeq("maxfd", xmaxfd);
827  TS_Xeq("pidpath", xpidf);
828  TS_Xeq("port", xport);
829  TS_Xeq("protocol", xprot);
830  TS_Xeq("report", xrep);
831  TS_Xeq("sitename", xsit);
832  TS_Xeq("tcpmonlib", xtcpmon);
833  TS_Xeq("timeout", xtmo);
834  TS_Xeq("tls", xtls);
835  TS_Xeq("tlsca", xtlsca);
836  TS_Xeq("tlsciphers", xtlsci);
837  }
838 
839  // No match found, complain.
840  //
841  eDest->Say("Config warning: ignoring unknown xrd directive '",var,"'.");
842  Config.Echo();
843  return 0;
844 }
#define TS_Xeq(x, m)
Definition: XrdConfig.cc:156
static XrdSysError eDest(0,"crypto_")
XrdCmsConfig Config

References XrdCms::Config, eDest, XrdGlobal::Log, XrdSysError::Say(), and TS_Xeq.

+ Here is the call graph for this function:

Member Data Documentation

◆ NetADM

XrdInet* XrdConfig::NetADM

Definition at line 59 of file XrdConfig.hh.

Referenced by main().

◆ NetTCP

std::vector<XrdInet*> XrdConfig::NetTCP

Definition at line 60 of file XrdConfig.hh.

Referenced by main().

◆ ProtInfo

XrdProtocol_Config XrdConfig::ProtInfo

Definition at line 58 of file XrdConfig.hh.

Referenced by main(), mainAccept(), and mainAdmin().


The documentation for this class was generated from the following files: