XRootD
XrdCmsClientConfig.cc
Go to the documentation of this file.
1 /******************************************************************************/
2 /* */
3 /* X r d C m s C l i e n t C o n f i g . c c */
4 /* */
5 /* (c) 2011 by the Board of Trustees of the Leland Stanford, Jr., University */
6 /* All Rights Reserved */
7 /* Produced by Andrew Hanushevsky for Stanford University under contract */
8 /* DE-AC02-76-SFO0515 with the Department of Energy */
9 /* */
10 /* This file is part of the XRootD software suite. */
11 /* */
12 /* XRootD is free software: you can redistribute it and/or modify it under */
13 /* the terms of the GNU Lesser General Public License as published by the */
14 /* Free Software Foundation, either version 3 of the License, or (at your */
15 /* option) any later version. */
16 /* */
17 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
18 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
19 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
20 /* License for more details. */
21 /* */
22 /* You should have received a copy of the GNU Lesser General Public License */
23 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
24 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
25 /* */
26 /* The copyright holder's institutional names and contributor's names may not */
27 /* be used to endorse or promote products derived from this software without */
28 /* specific prior written permission of the institution or contributor. */
29 /******************************************************************************/
30 
31 #include <unistd.h>
32 #include <strings.h>
33 #include <cstdio>
34 #include <sys/param.h>
35 #include <sys/types.h>
36 #include <sys/stat.h>
37 #include <fcntl.h>
38 
41 #include "XrdCms/XrdCmsPerfMon.hh"
42 #include "XrdCms/XrdCmsSecurity.hh"
43 #include "XrdCms/XrdCmsTrace.hh"
44 #include "XrdCms/XrdCmsUtils.hh"
45 
46 #include "XrdOuc/XrdOuca2x.hh"
47 #include "XrdOuc/XrdOucEnv.hh"
48 #include "XrdOuc/XrdOucStream.hh"
49 #include "XrdOuc/XrdOucTList.hh"
50 #include "XrdOuc/XrdOucUtils.hh"
51 #include "XrdSys/XrdSysHeaders.hh"
52 
53 /******************************************************************************/
54 /* G l o b a l s */
55 /******************************************************************************/
56 
57 namespace XrdCms
58 {
59 extern XrdVersionInfo myVersion;
60 }
61 
62 using namespace XrdCms;
63 
64 /******************************************************************************/
65 /* d e f i n e s */
66 /******************************************************************************/
67 
68 #define TS_Xeq(x,m) if (!strcmp(x,var)) return m(Config);
69 
70 /******************************************************************************/
71 /* D e s t r u c t o r */
72 /******************************************************************************/
73 
75 {
76  XrdOucTList *tp, *tpp;
77 
78  tpp = ManList;
79  while((tp = tpp)) {tpp = tp->next; delete tp;}
80  tpp = PanList;
81  while((tp = tpp)) {tpp = tp->next; delete tp;}
82 
83  if (VNID_Lib) free(VNID_Lib);
84  if (VNID_Parms) free(VNID_Parms);
85  if (prfLib) free(prfLib);
86  if (prfParms) free(prfParms);
87 }
88 
89 /******************************************************************************/
90 /* C o n f i g u r e */
91 /******************************************************************************/
92 
93 int XrdCmsClientConfig::Configure(const char *cfn, configWhat What,
94  configHow How)
95 {
96 /*
97  Function: Establish configuration at start up time.
98 
99  Input: None.
100 
101  Output: 0 upon success or !0 otherwise.
102 */
103  XrdOucTList *tpe, *tpl;
104  int i, NoGo = 0;
105  const char *eText = 0;
106  char buff[256], *slash, *temp, *bP, sfx;
107 
108 // Preset some values
109 //
110  myHost = getenv("XRDHOST");
111  if (!myHost) myHost = "localhost";
112  myName = XrdOucUtils::InstName(1);
113  CMSPath = getenv("XRDADMINPATH");
114  if (CMSPath && *CMSPath) CMSPath = strdup(CMSPath);
115  else CMSPath = XrdOucUtils::genPath("/tmp/",XrdOucUtils::InstName(myName,0));
116  isMeta = (How & configMeta) != 0;
117  isMan = (What& configMan) != 0;
118  isServer = What == configServer;
119 
120 // Process the configuration file
121 //
122  if (!(NoGo = ConfigProc(cfn)) && isMan)
123  {if (How & configProxy) eText = (PanList ? 0 : "Proxy manager");
124  else if (!ManList)
125  eText = (How & configMeta ? "Meta manager" : "Manager");
126  if (eText) {Say.Emsg("Config", eText, "not specified."); NoGo=1;}
127  }
128 
129 // Reset tracing options
130 //
131  if (getenv("XRDDEBUG")) Trace.What = TRACE_ALL;
132 
133 // Set proper local socket path
134 //
135  temp = XrdOucUtils::genPath(CMSPath, (const char *)0, ".olb");
136  free(CMSPath); CMSPath = temp;
137  XrdOucEnv::Export("XRDCMSPATH", temp);
138  XrdOucEnv::Export("XRDOLBPATH", temp); //Compatibility
139 
140 // Determine what type of role we are playing
141 //
142  if (What & configServer) sfx = 's';
143  else if (What & configSuper) sfx = 'u';
144  else sfx = 'm';
145 
146 // Determine which manager list we will be using
147 //
148  if (How & configProxy)
149  {sfx = toupper(sfx);
150  tpl = PanList;
151  } else tpl = ManList;
152 
153 // Generate the system ID for this configuration.
154 //
155  if (!ConfigSID(cfn, tpl, sfx)) NoGo = 1;
156 
157 // Export the manager list
158 //
159  if (tpl)
160  {i = 0; tpe = tpl;
161  while(tpe) {i += strlen(tpe->text) + 9; tpe = tpe->next;}
162  bP = temp = (char *)malloc(i);
163  while(tpl)
164  {bP += sprintf(bP, "%s:%d ", tpl->text, tpl->val);
165  tpl = tpl->next;
166  }
167  *(bP-1) = '\0';
168  XrdOucEnv::Export("XRDCMSMAN", temp); free(temp);
169  }
170 
171 // Construct proper communications path for a supervisor node
172 //
173  i = strlen(CMSPath);
174  if (What & configSuper)
175  {while((tpl = ManList)) {ManList = tpl->next; delete tpl;}
176  slash = (CMSPath[i-1] == '/' ? (char *)"" : (char *)"/");
177  sprintf(buff, "%s%solbd.super", CMSPath, slash);
178  ManList = new XrdOucTList(buff, -1, 0);
179  SMode = SModeP = FailOver;
180  }
181 
182 // Construct proper old communication path for a target node
183 //
184  temp = (What & (configMan|configSuper) ? (char *)"nimda" : (char *)"admin");
185  slash = (CMSPath[i-1] == '/' ? (char *)"" : (char *)"/");
186  sprintf(buff, "%s%solbd.%s", CMSPath, slash, temp);
187  free(CMSPath); CMSPath = strdup(buff);
188 
189  RepWaitMS = RepWait * 1000;
190 
191 // Initialize the msg queue
192 //
193  if (XrdCmsClientMsg::Init())
194  {Say.Emsg("Config", ENOMEM, "allocate initial msg objects");
195  NoGo = 1;
196  }
197 
198 // Load the performance monitor (server pre-screened) if specified.
199 //
200  if (prfLib && cmsMon)
201  {perfMon = XrdCmsUtils::loadPerfMon(&Say, prfLib, XrdCms::myVersion);
202  if (!perfMon || !perfMon->Configure(cfn, prfParms, *Say.logger(),
203  *cmsMon, 0, false))
204  {Say.Emsg("Config","Unable to configure performance monitor plugin.");
205  NoGo = 1;
206  }
207  }
208 
209  return NoGo;
210 }
211 
212 /******************************************************************************/
213 /* P r i v a t e F u n c t i o n s */
214 /******************************************************************************/
215 /******************************************************************************/
216 /* C o n f i g P r o c */
217 /******************************************************************************/
218 
219 int XrdCmsClientConfig::ConfigProc(const char *ConfigFN)
220 {
221  static int DoneOnce = 0;
222  char *var;
223  int cfgFD, retc, NoGo = 0;
224  XrdOucEnv myEnv;
225  XrdOucStream Config((DoneOnce ? 0 : &Say), getenv("XRDINSTANCE"),
226  &myEnv, "=====> ");
227 
228 // Make sure we have a config file
229 //
230  if (!ConfigFN || !*ConfigFN)
231  {Say.Emsg("Config", "cms configuration file not specified.");
232  return 1;
233  }
234 
235 // Try to open the configuration file.
236 //
237  if ( (cfgFD = open(ConfigFN, O_RDONLY, 0)) < 0)
238  {Say.Emsg("Config", errno, "open config file", ConfigFN);
239  return 1;
240  }
241  Config.Attach(cfgFD);
242  static const char *cvec[] = { "*** cms plugin config:", 0 };
243  Config.Capture(cvec);
244 
245 // Now start reading records until eof.
246 //
247  while((var = Config.GetMyFirstWord()))
248  {if (!strncmp(var, "cms.", 4)
249  || !strncmp(var, "odc.", 4) // Compatibility
250  || !strcmp(var, "all.manager")
251  || !strcmp(var, "all.adminpath")
252  || !strcmp(var, "olb.adminpath"))
253  if (ConfigXeq(var+4, Config)) {Config.Echo(); NoGo = 1;}
254  }
255 
256 // Now check if any errors occurred during file i/o
257 //
258  if ((retc = Config.LastError()))
259  NoGo = Say.Emsg("Config", retc, "read config file", ConfigFN);
260  Config.Close();
261 
262 // Return final return code
263 //
264  DoneOnce = 1;
265  return NoGo;
266 }
267 
268 /******************************************************************************/
269 /* C o n f i g S i d */
270 /******************************************************************************/
271 
272 bool XrdCmsClientConfig::ConfigSID(const char *cFN, XrdOucTList *tpl, char sfx)
273 {
274  char *sidVal;
275 
276 // Get the node ID if we need to
277 //
278  if (VNID_Lib)
279  {myVNID = XrdCmsSecurity::getVnId(Say, cFN, VNID_Lib, VNID_Parms, sfx);
280  if (!myVNID) return false;
281  }
282 
283 // Generate the system ID and set the cluster ID
284 //
285  sidVal = XrdCmsSecurity::setSystemID(tpl, myVNID, cidTag, sfx);
286  if (!sidVal || *sidVal == '!')
287  {const char *msg;
288  if (!sidVal) msg = "too many managers.";
289  else msg = sidVal+1;
290  Say.Emsg("Config ","Unable to generate system ID; ", msg);
291  return false;
292  }
293  else if (QTRACE(Debug))
294  Say.Say("Config ", "Global System Identification: ", sidVal);
295  return true;
296 }
297 
298 /******************************************************************************/
299 /* C o n f i g X e q */
300 /******************************************************************************/
301 
302 int XrdCmsClientConfig::ConfigXeq(char *var, XrdOucStream &Config)
303 {
304 
305  // Process items. for either a local or a remote configuration
306  //
307  TS_Xeq("adminpath", xapath);
308  TS_Xeq("cidtag", xcidt);
309  TS_Xeq("conwait", xconw);
310  TS_Xeq("manager", xmang);
311  TS_Xeq("perf", xperf);
312  TS_Xeq("request", xreqs);
313  TS_Xeq("trace", xtrac);
314  TS_Xeq("vnid", xvnid);
315  return 0;
316 }
317 
318 /******************************************************************************/
319 /* x a p a t h */
320 /******************************************************************************/
321 
322 /* Function: xapath
323 
324  Purpose: To parse the directive: adminpath <path> [ group ]
325 
326  <path> the path of the named socket to use for admin requests.
327  Only the path may be specified, not the filename.
328  group allow group access to the path.
329 
330  Type: Manager only, non-dynamic.
331 
332  Output: 0 upon success or !0 upon failure.
333 */
334 
335 int XrdCmsClientConfig::xapath(XrdOucStream &Config)
336 {
337  char *pval;
338 
339 // Get the path
340 //
341  pval = Config.GetWord();
342  if (!pval || !pval[0])
343  {Say.Emsg("Config", "cms admin path not specified"); return 1;}
344 
345 // Make sure it's an absolute path
346 //
347  if (*pval != '/')
348  {Say.Emsg("Config", "cms admin path not absolute"); return 1;}
349 
350 // Record the path
351 //
352  if (CMSPath) free(CMSPath);
353  CMSPath = XrdOucUtils::genPath(pval,XrdOucUtils::InstName(myName,0));
354  return 0;
355 }
356 
357 /******************************************************************************/
358 /* x c i d t */
359 /******************************************************************************/
360 
361 /* Function: xcidt
362 
363  Purpose: To parse the directive: cidtag <tag>
364 
365  <tag> a 1- to 16-character cluster ID tag.
366 
367  Output: 0 upon success or !0 upon failure.
368 */
369 
370 int XrdCmsClientConfig::xcidt(XrdOucStream &Config)
371 {
372  char *val;
373 
374 // Get the path
375 //
376  if (!(val = Config.GetWord()) || !val[0])
377  {Say.Emsg("Config", "tag not specified"); return 1;}
378 
379 // Make sure it is not too long
380 //
381  if ((int)strlen(val) > 16)
382  {Say.Emsg("Config", "tag is > 16 characters"); return 1;}
383 
384 // Record the tag
385 //
386  if (cidTag) free(cidTag);
387  cidTag = strdup(val);
388  return 0;
389 }
390 
391 /******************************************************************************/
392 /* x c o n w */
393 /******************************************************************************/
394 
395 /* Function: xconw
396 
397  Purpose: To parse the directive: conwait <sec>
398 
399  <sec> number of seconds to wait for a manager connection
400 
401  Type: Remote server only, dynamic.
402 
403  Output: 0 upon success or !0 upon failure.
404 */
405 
406 int XrdCmsClientConfig::xconw(XrdOucStream &Config)
407 {
408  char *val;
409  int cw;
410 
411  if (!(val = Config.GetWord()))
412  {Say.Emsg("Config", "conwait value not specified."); return 1;}
413 
414  if (XrdOuca2x::a2tm(Say,"conwait value",val,&cw,1)) return 1;
415 
416  ConWait = cw;
417  return 0;
418 }
419 
420 /******************************************************************************/
421 /* x m a n g */
422 /******************************************************************************/
423 
424 /* Function: xmang
425 
426  Purpose: Parse: manager [meta | peer | proxy] [all|any]
427  <host>[+][:<port>|<port>] [if ...]
428 
429  meta For cmsd: Specifies the manager when running as a manager
430  For xrootd: Specifies the manager when running as a meta
431  peer For cmsd: Specifies the manager when running as a peer
432  For xrootd: The directive is ignored.
433  proxy For cmsd: This directive is ignored.
434  For xrootd: Specifies the cms-proxy service manager
435  all Distribute requests across all managers.
436  any Choose different manager only when necessary (default).
437  <host> The dns name of the host that is the cache manager.
438  If the host name ends with a plus, all addresses that are
439  associated with the host are treated as managers.
440  <port> The port number to use for this host.
441  if Apply the manager directive if "if" is true. See
442  XrdOucUtils:doIf() for "if" syntax.
443 
444  Notes: Any number of manager directives can be given. When niether peer nor
445  proxy is specified, then regardless of role the following occurs:
446  cmsd: Subscribes to each manager whens role is not peer.
447  xrootd: Logins in as a redirector to each manager when role is not
448  proxy or server.
449 
450  Type: Remote server only, non-dynamic.
451 
452  Output: 0 upon success or !0 upon failure.
453 */
454 
455 int XrdCmsClientConfig::xmang(XrdOucStream &Config)
456 {
457  class StorageHelper
458  {public:
459  StorageHelper(char **v1, char **v2) : val1(v1), val2(v2) {}
460  ~StorageHelper() {if (*val1) free(*val1);
461  if (*val2) free(*val2);
462  }
463  char **val1, **val2;
464  };
465 
466  XrdOucTList **theList;
467  char *val, *hSpec = 0, *hPort = 0;
468  StorageHelper SHelp(&hSpec, &hPort);
469  int rc, xMeta = 0, xProxy = 0, smode = FailOver;
470 
471 // Process the optional "peer" or "proxy"
472 //
473  if ((val = Config.GetWord()))
474  {if (!strcmp("peer", val)) return Config.noEcho();
475  if ((xProxy = !strcmp("proxy", val))) val = Config.GetWord();
476  else if ((xMeta = !strcmp("meta", val)))
477  if (isMeta || isMan) val = Config.GetWord();
478  else return Config.noEcho();
479  else if (isMeta) return Config.noEcho();
480  }
481 
482 // We can accept this manager. Skip the optional "all" or "any"
483 //
484  if (val)
485  { if (!strcmp("any", val)) smode = FailOver;
486  else if (!strcmp("all", val)) smode = RoundRob;
487  else smode = 0;
488  if (smode)
489  {if (xProxy) SModeP = smode;
490  else SMode = smode;
491  val = Config.GetWord();
492  }
493  }
494 
495 // Get the actual manager
496 //
497  if (!val)
498  {Say.Emsg("Config","manager host name not specified"); return 1;}
499  else hSpec = strdup(val);
500 
501 // Grab the port number (either in hostname or following token)
502 //
503  if (!(hPort = XrdCmsUtils::ParseManPort(&Say, Config, hSpec))) return 1;
504 
505 // Process any "if" clause now
506 //
507  if ((val = Config.GetWord()) && !strcmp("if", val))
508  if ((rc = XrdOucUtils::doIf(&Say,Config,"manager directive",
509  myHost, myName, getenv("XRDPROG"))) <= 0)
510  {if (!rc) Config.noEcho(); return (rc < 0);}
511 
512 // If we are a manager and found a meta-manager indidicate it and bail.
513 //
514  if (xMeta && !isMeta) {haveMeta = 1; return 0;}
515  theList = (xProxy ? &PanList : &ManList);
516 
517 // Parse the manager list and return the result
518 //
519  return (XrdCmsUtils::ParseMan(&Say, theList, hSpec, hPort, 0) ? 0 : 1);
520 }
521 
522 
523 /******************************************************************************/
524 /* x p e r f */
525 /******************************************************************************/
526 
527 /* Function: xperf
528 
529  Purpose: To parse the directive: perf [xrootd] [int <sec>]
530  [lib <lib> [<parms>] | pgm <pgm>]
531 
532  int <time> estimated time (seconds, M, H) between reports by <pgm>
533  lib <lib> the shared library holding the XrdCmsPerf object that
534  reports perf values. It must be the last option.
535  pgm <pgm> program to start that will write perf values to standard
536  out. It must be the last option. This is not supported
537  when xrootd is specified.
538  xrootd This directive only applies to the cms xrootd plugin.
539 
540  Type: Server only, non-dynamic.
541 
542  Output: 0 upon success or !0 upon failure. Ignored by manager.
543 */
544 
545 int XrdCmsClientConfig::xperf(XrdOucStream &Config)
546 { char *val;
547 
548  if (!isServer) return Config.noEcho();
549 
550  if (!(val = Config.GetWord()))
551  {Say.Emsg("Config", "perf options not specified"); return 1;}
552 
553  if (strcmp("xrootd", val)) return Config.noEcho();
554  perfInt = 3*60;
555 
556  do { if (!strcmp("int", val))
557  {if (!(val = Config.GetWord()))
558  {Say.Emsg("Config", "perf int value not specified");
559  return 1;
560  }
561  if (XrdOuca2x::a2tm(Say,"perf int",val,&perfInt,0)) return 1;
562  }
563  else if (!strcmp("lib", val))
564  {return (XrdOucUtils::parseLib(Say, Config, "perf lib",
565  prfLib, &prfParms) ? 0 : 1);
566  break;
567  }
568  else if (!strcmp("pgm", val))
569  {Say.Emsg("Config", "perf pgm is not supported for xrootd.");
570  return 1;
571  }
572  else Say.Say("Config warning: ignoring invalid perf option '",val,"'.");
573  } while((val = Config.GetWord()));
574 
575 // All done.
576 //
577  return 0;
578 }
579 
580 /******************************************************************************/
581 /* x r e q s */
582 /******************************************************************************/
583 
584 /* Function: xreqs
585 
586  Purpose: To parse the directive: request [repwait <sec1>] [delay <sec2>]
587  [noresp <cnt>] [prep <ms>]
588  [fwd <ms>]
589 
590  <sec1> max number of seconds to wait for a cmsd reply
591  <sec2> number of seconds to delay a retry upon failure
592  <cnt> number of no-responses before cms fault declared.
593  <ms> milliseconds between prepare/forward requests
594 
595  Type: Remote server only, dynamic.
596 
597  Output: 0 upon success or !0 upon failure.
598 */
599 
600 int XrdCmsClientConfig::xreqs(XrdOucStream &Config)
601 {
602  char *val;
603  static struct reqsopts {const char *opname; int istime; int *oploc;}
604  rqopts[] =
605  {
606  {"delay", 1, &RepDelay},
607  {"fwd", 0, &FwdWait},
608  {"noresp", 0, &RepNone},
609  {"prep", 0, &PrepWait},
610  {"repwait", 1, &RepWait}
611  };
612  int i, ppp, numopts = sizeof(rqopts)/sizeof(struct reqsopts);
613 
614  if (!(val = Config.GetWord()))
615  {Say.Emsg("Config", "request arguments not specified"); return 1;}
616 
617  while (val)
618  do {for (i = 0; i < numopts; i++)
619  if (!strcmp(val, rqopts[i].opname))
620  { if (!(val = Config.GetWord()))
621  {Say.Emsg("Config","request argument value not specified");
622  return 1;}
623  if (rqopts[i].istime ?
624  XrdOuca2x::a2tm(Say,"request value",val,&ppp,1) :
625  XrdOuca2x::a2i( Say,"request value",val,&ppp,1))
626  return 1;
627  else *rqopts[i].oploc = ppp;
628  break;
629  }
630  if (i >= numopts) Say.Say("Config warning: ignoring invalid request option '",val,"'.");
631  } while((val = Config.GetWord()));
632  return 0;
633 }
634 
635 /******************************************************************************/
636 /* x t r a c e */
637 /******************************************************************************/
638 
639 /* Function: xtrace
640 
641  Purpose: To parse the directive: trace <events>
642 
643  <events> the blank separated list of events to trace. Trace
644  directives are cummalative.
645 
646  Output: retc upon success or -EINVAL upon failure.
647 */
648 
649 int XrdCmsClientConfig::xtrac(XrdOucStream &Config)
650 {
651  char *val;
652  static struct traceopts {const char *opname; int opval;} tropts[] =
653  {
654  {"all", TRACE_ALL},
655  {"debug", TRACE_Debug},
656  {"files", TRACE_Files},
657  {"forward", TRACE_Forward},
658  {"redirect", TRACE_Redirect},
659  {"defer", TRACE_Defer},
660  {"stage", TRACE_Stage}
661  };
662  int i, neg, trval = 0, numopts = sizeof(tropts)/sizeof(struct traceopts);
663 
664  if (!(val = Config.GetWord()))
665  {Say.Emsg("config", "trace option not specified"); return 1;}
666  while (val)
667  {if (!strcmp(val, "off")) trval = 0;
668  else {if ((neg = (val[0] == '-' && val[1]))) val++;
669  for (i = 0; i < numopts; i++)
670  {if (!strcmp(val, tropts[i].opname))
671  {if (neg) trval &= ~tropts[i].opval;
672  else trval |= tropts[i].opval;
673  break;
674  }
675  }
676  if (i >= numopts)
677  Say.Say("Config warning: ignoring invalid trace option '",val,"'.");
678  }
679  val = Config.GetWord();
680  }
681  Trace.What = trval;
682  return 0;
683 }
684 
685 /******************************************************************************/
686 /* x v n i d */
687 /******************************************************************************/
688 
689 /* Function: xvnid
690 
691  Purpose: To parse the directive: vnid {=|<|@}<vnarg> [<parms>]
692 
693  <vnarg> = - the actual vnid value
694  < - the path of the file to be read for the vnid.
695  @ - the path of the plugin library to be used.
696  <parms> optional parms to be passed
697 
698  Output: 0 upon success or !0 upon failure.
699 */
700 
701 int XrdCmsClientConfig::xvnid(XrdOucStream &Config)
702 {
703  char *val, parms[1024];
704 
705 // Get the argument
706 //
707  if (!(val = Config.GetWord()) || !val[0])
708  {Say.Emsg("Config", "vnid not specified"); return 1;}
709 
710 // Record the path
711 //
712  if (VNID_Lib) free(VNID_Lib);
713  VNID_Lib = strdup(val);
714 
715 // Record any parms (only if it starts with an @)
716 //
717  if (VNID_Parms) {free(VNID_Parms); VNID_Parms = 0;}
718  if (*VNID_Lib == '@')
719  {if (!Config.GetRest(parms, sizeof(parms)))
720  {Say.Emsg("Config", "vnid plug-in parameters too long"); return 1;}
721  if (*parms) VNID_Parms = strdup(parms);
722  }
723  return 0;
724 }
#define TS_Xeq(x, m)
#define TRACE_Stage
Definition: XrdCmsTrace.hh:38
#define TRACE_Debug
Definition: XrdCmsTrace.hh:37
#define TRACE_Files
Definition: XrdCmsTrace.hh:42
#define TRACE_Redirect
Definition: XrdCmsTrace.hh:41
#define QTRACE(act)
Definition: XrdCmsTrace.hh:49
#define TRACE_Forward
Definition: XrdCmsTrace.hh:40
#define TRACE_Defer
Definition: XrdCmsTrace.hh:39
int open(const char *path, int oflag,...)
#define TRACE_ALL
Definition: XrdTrace.hh:35
int Configure(const char *cfn, configWhat What, configHow How)
static int Init()
static char * getVnId(XrdSysError &eDest, const char *cfgFN, const char *nidlib, const char *nidparm, char nidType)
static char * setSystemID(XrdOucTList *tp, const char *iVNID, const char *iTag, char iType)
static XrdCmsPerfMon * loadPerfMon(XrdSysError *eDest, const char *libPath, XrdVersionInfo &urVer)
Load the performance monitor plugin.
Definition: XrdCmsUtils.cc:108
static char * ParseManPort(XrdSysError *eDest, XrdOucStream &CFile, char *hSpec)
Definition: XrdCmsUtils.cc:249
static bool ParseMan(XrdSysError *eDest, XrdOucTList **oldMans, char *hSpec, char *hPort, int *sPort=0, bool hush=false)
Definition: XrdCmsUtils.cc:123
static int Export(const char *Var, const char *Val)
Definition: XrdOucEnv.cc:188
XrdOucTList * next
Definition: XrdOucTList.hh:45
char * text
Definition: XrdOucTList.hh:46
static char * genPath(const char *path, const char *inst, const char *psfx=0)
Definition: XrdOucUtils.cc:417
static bool parseLib(XrdSysError &eDest, XrdOucStream &Config, const char *libName, char *&path, char **libparm)
Definition: XrdOucUtils.cc:989
static const char * InstName(int TranOpt=0)
Definition: XrdOucUtils.cc:732
static int doIf(XrdSysError *eDest, XrdOucStream &Config, const char *what, const char *hname, const char *nname, const char *pname)
Definition: XrdOucUtils.cc:231
static int a2i(XrdSysError &, const char *emsg, const char *item, int *val, int minv=-1, int maxv=-1)
Definition: XrdOuca2x.cc:45
static int a2tm(XrdSysError &, const char *emsg, const char *item, int *val, int minv=-1, int maxv=-1)
Definition: XrdOuca2x.cc:288
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
XrdVersionInfo myVersion
XrdSysError Say
XrdSysTrace Trace("cms")
XrdCmsConfig Config