XRootD
XrdXrootdConfigMon.cc
Go to the documentation of this file.
1 /******************************************************************************/
2 /* */
3 /* X r d X r o o t d M o n C o n f . h h */
4 /* */
5 /* (c) 2020 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 <limits>
32 #include <cstdio>
33 #include <cstring>
34 #include <strings.h>
35 
36 #include "XrdNet/XrdNetAddr.hh"
37 
38 #include "XrdOuc/XrdOuca2x.hh"
39 #include "XrdOuc/XrdOucEnv.hh"
40 #include "XrdOuc/XrdOucStream.hh"
41 
46 
47 /******************************************************************************/
48 /* L o c a l S t a t i c s */
49 /******************************************************************************/
50 
51 namespace
52 {
53 struct MonParms
54  {char *monDest[2];
55  int monMode[2];
56  int monFlash;
57  int monFlush;
58  int monGBval;
59  int monMBval;
60  int monRBval;
61  int monWWval;
62  int monFbsz;
63  int monIdent;
64  int monRnums;
65  int monFSint;
66  int monFSopt;
67  int monFSion;
68 
69  void Exported() {monDest[0] = monDest[1] = 0;}
70 
71  MonParms() : monDest{0,0}, monMode{0,0}, monFlash(0), monFlush(0),
72  monGBval(0), monMBval(0), monRBval(0), monWWval(0),
73  monFbsz(0), monIdent(3600),monRnums(0),
74  monFSint(0), monFSopt(0), monFSion(0) {}
75  ~MonParms() {if (monDest[0]) free(monDest[0]);
76  if (monDest[1]) free(monDest[1]);
77  }
78 };
79 
80 MonParms *MP = 0;
81 
82 struct XrdXrootdGSReal::GSParms gsObj[] =
83  {{"ccm", 0, XROOTD_MON_CCM, 0, -1, XROOTD_MON_GSCCM, 0,
85  {"pfc", 0, XROOTD_MON_PFC, 0, -1, XROOTD_MON_GSPFC, 0,
87  {"TcpMon", 0, XROOTD_MON_TCPMO, 0, -1, XROOTD_MON_GSTCP, 0,
89  {"Throttle", 0, XROOTD_MON_THROT, 0, -1, XROOTD_MON_GSTHR, 0,
91  {"Tpc", 0, XROOTD_MON_TPC, 0, -1, XROOTD_MON_GSTPC, 0,
93  };
94 }
95 
96 /******************************************************************************/
97 /* C o n f i g G S t r e a m */
98 /******************************************************************************/
99 
100 bool XrdXrootdProtocol::ConfigGStream(XrdOucEnv &myEnv, XrdOucEnv *urEnv)
101 {
102  XrdXrootdGStream *gs;
103  static const int numgs=sizeof(gsObj)/sizeof(struct XrdXrootdGSReal::GSParms);
104  char vbuff[64];
105  bool aOK, gXrd[numgs] = {false, false, true, false, true};
106 
107 // For each enabled monitoring provider, allocate a g-stream and put
108 // its address in our environment.
109 //
110  for (int i = 0; i < numgs; i++)
111  {if (gsObj[i].dest || XrdXrootdMonitor::ModeEnabled(gsObj[i].Mode))
112  {if (MP && gsObj[i].maxL <= 0) gsObj[i].maxL = MP->monGBval;
113  gs = new XrdXrootdGSReal(gsObj[i], aOK);
114  if (!aOK) return false;
115  snprintf(vbuff, sizeof(vbuff), "%s.gStream*", gsObj[i].pin);
116  if (!gXrd[i]) myEnv.PutPtr(vbuff, (void *)gs);
117  else if (urEnv) urEnv->PutPtr(vbuff, (void *)gs);
118  }
119  }
120 
121 // Configure the TPC monitor if we have a gStream for it
122 //
123  if (urEnv && (gs = (XrdXrootdGStream*)urEnv->GetPtr("Tpc.gStream*")))
124  {XrdXrootdTpcMon* tpcMon = new XrdXrootdTpcMon("xroot",eDest.logger(),*gs);
125  myEnv.PutPtr("TpcMonitor*", (void*)tpcMon);
126  }
127 
128 // All done
129 //
130  return true;
131 }
132 
133 /******************************************************************************/
134 /* C o n f i g M o n */
135 /******************************************************************************/
136 
137 bool XrdXrootdProtocol::ConfigMon(XrdProtocol_Config *pi, XrdOucEnv &xrootdEnv)
138 {
139  int i, numgs = sizeof(gsObj)/sizeof(struct XrdXrootdGSReal::GSParms);
140 
141 // Check if anything was configured.
142 //
143  for (i = 0; i < numgs && !gsObj[i].dest; i++);
144  if (i < numgs && !MP) MP = new MonParms;
145  else if (!MP) return true;
146 
147 // Set monitor defaults, this has to be done first
148 //
149  XrdXrootdMonitor::Defaults(MP->monMBval, MP->monRBval, MP->monWWval,
150  MP->monFlush, MP->monFlash, MP->monIdent,
151  MP->monRnums, MP->monFbsz,
152  MP->monFSint, MP->monFSopt, MP->monFSion);
153 
154 // Complete destination dependent setup
155 //
156  XrdXrootdMonitor::Defaults(MP->monDest[0], MP->monMode[0],
157  MP->monDest[1], MP->monMode[1]);
158 
159 // Initialize monitoring enough to construct gStream objects.
160 //
162 
163 // Config g-stream objects, as needed. This needs to be done before we
164 // load any plugins but after we initialize phase 1 monitoring.
165 //
166  ConfigGStream(xrootdEnv, pi->theEnv);
167 
168 // Enable monitoring (it won't do anything if it wasn't enabled)
169 //
170  if (!XrdXrootdMonitor::Init()) return false;
171 
172 // Cleanup
173 //
174  if (MP->monDest[0]) MP->Exported();
175  delete MP;
176 
177 // All done
178 //
179  return true;
180 }
181 
182 /******************************************************************************/
183 /* x m o n */
184 /******************************************************************************/
185 
186 /* Function: xmon
187 
188  Purpose: Parse directive: monitor [...] [all] [auth] [flush [io] <sec>]
189  [fstat <sec> [lfn] [ops] [ssq] [xfr <n>]
190  [{fbuff | fbsz} <sz>] [gbuff <sz>]
191  [ident {<sec>|off}] [mbuff <sz>]
192  [rbuff <sz>] [rnums <cnt>] [window <sec>]
193  [dest [Events] <host:port>]
194 
195  Events: [ccm] [files] [fstat] [info] [io] [iov] [pfc] [redir] [tcpmon] [throttle] [user]
196 
197  all enables monitoring for all connections.
198  auth add authentication information to "user".
199  flush [io] <sec> time (seconds, M, H) between auto flushes. When
200  io is given applies only to i/o events.
201  fstat <sec> produces an "f" stream for open & close events
202  <sec> specifies the flush interval (also see xfr)
203  lfn - adds lfn to the open event
204  ops - adds the ops record when the file is closed
205  ssq - computes the sum of squares for the ops rec
206  xfr <n>- inserts i/o stats for open files every
207  <sec>*<n>. Minimum is 1.
208  fbsz <sz> size of message buffer for file stream monitoring.
209  gbuff <sz> size of message buffer for g-stream monitoring.
210  ident {<sec>|off} time (seconds, M, H) between identification records.
211  The keyword "off" turns them off.
212  mbuff <sz> size of message buffer for event trace monitoring.
213  rbuff <sz> size of message buffer for redirection monitoring.
214  rnums <cnt> bumber of redirections monitoring streams.
215  window <sec> time (seconds, M, H) between timing marks.
216  dest specified routing information. Up to two dests
217  may be specified.
218  ccm monitor cache context management
219  files only monitors file open/close events.
220  fstats vectors the "f" stream to the destination
221  info monitors client appid and info requests.
222  io monitors I/O requests, and files open/close events.
223  iov like I/O but also unwinds vector reads.
224  pfc monitor proxy file cache
225  redir monitors request redirections
226  tcpmon monitors tcp connection closes.
227  throttle monitors I/O activity via the throttle plugin
228  tpc Third Party Copy
229  user monitors user login and disconnect events.
230  <host:port> where monitor records are to be sentvia UDP.
231 
232  Output: 0 upon success or !0 upon failure. Ignored by master.
233 */
234 
235 int XrdXrootdProtocol::xmon(XrdOucStream &Config)
236 {
237  char *val = 0;
238  long long tempval;
239  int i, xmode=0, *flushDest;
240  bool haveWord = true;
241 
242 // Check if this is a continuation
243 //
244  if ((val = Config.GetWord()) && !strcmp("...", val)) val = Config.GetWord();
245  else if (MP) {delete MP; MP = 0;}
246 
247 // Allocate a new parameter block if we don't have one
248 //
249  if (!MP) MP = new MonParms;
250 
251 // Make sure we have at least one option here
252 //
253  if (!val)
254  {eDest.Emsg("Config", "no monitor parameters specified");
255  return 1;
256  }
257 
258 // Process all the options
259 //
260  while(haveWord || (val = Config.GetWord()))
261  {haveWord = false;
262  if (!strcmp("all", val)) xmode = XROOTD_MON_ALL;
263  else if (!strcmp("auth", val))
264  MP->monMode[0] = MP->monMode[1] = XROOTD_MON_AUTH;
265  else if (!strcmp("flush", val))
266  {if ((val = Config.GetWord()) && !strcmp("io", val))
267  { flushDest = &MP->monFlash; val = Config.GetWord();}
268  else flushDest = &MP->monFlush;
269  if (!val)
270  {eDest.Emsg("Config", "monitor flush value not specified");
271  return 1;
272  }
273  if (XrdOuca2x::a2tm(eDest,"monitor flush",val,
274  flushDest,1)) return 1;
275  }
276  else if (!strcmp("fstat",val))
277  {if (!(val = Config.GetWord()))
278  {eDest.Emsg("Config", "monitor fstat value not specified");
279  return 1;
280  }
281  if (XrdOuca2x::a2tm(eDest,"monitor fstat",val,
282  &MP->monFSint,0)) return 1;
283  while((val = Config.GetWord()))
284  if (!strcmp("lfn", val)) MP->monFSopt |= XROOTD_MON_FSLFN;
285  else if (!strcmp("ops", val)) MP->monFSopt |= XROOTD_MON_FSOPS;
286  else if (!strcmp("ssq", val)) MP->monFSopt |= XROOTD_MON_FSSSQ;
287  else if (!strcmp("xfr", val))
288  {if (!(val = Config.GetWord()))
289  {eDest.Emsg("Config", "monitor fstat xfr count not specified");
290  return 1;
291  }
292  if (XrdOuca2x::a2i(eDest,"monitor fstat io count",
293  val, &MP->monFSion,1)) return 1;
294  MP->monFSopt |= XROOTD_MON_FSXFR;
295  }
296  else {haveWord = true; break;}
297  }
298  else if (!strcmp("mbuff", val) || !strcmp("rbuff", val) ||
299  !strcmp("gbuff", val) || !strcmp("fbuff", val) ||
300  !strcmp("fbsz", val))
301  {char bName[16], bType = *val;
302  snprintf(bName,sizeof(bName),"monitor %s",val);
303  if (!(val = Config.GetWord()))
304  {eDest.Emsg("Config", "value not specified"); return 1;}
305  if (XrdOuca2x::a2sz(eDest,bName,val,&tempval,1024,65535))
306  return 1;
307  int bVal = static_cast<int>(tempval);
308  switch(bType)
309  {case 'f': MP->monFbsz = bVal; break;
310  case 'g': MP->monGBval = bVal; break;
311  case 'm': MP->monMBval = bVal; break;
312  case 'r': MP->monRBval = bVal; break;
313  default: break;
314  }
315  }
316  else if (!strcmp("ident", val))
317  {if (!(val = Config.GetWord()))
318  {eDest.Emsg("Config", "monitor ident value not specified");
319  return 1;
320  }
321  if (!strcmp("off", val)) MP->monIdent = -1;
322  else if (XrdOuca2x::a2tm(eDest,"monitor ident",val,
323  &MP->monIdent,0)) return 1;
324  }
325  else if (!strcmp("rnums", val))
326  {if (!(val = Config.GetWord()))
327  {eDest.Emsg("Config", "monitor rnums value not specified");
328  return 1;
329  }
330  if (XrdOuca2x::a2i(eDest,"monitor rnums",val, &MP->monRnums,1,
331  XrdXrootdMonitor::rdrMax)) return 1;
332  }
333  else if (!strcmp("window", val))
334  {if (!(val = Config.GetWord()))
335  {eDest.Emsg("Config", "monitor window value not specified");
336  return 1;
337  }
338  if (XrdOuca2x::a2tm(eDest,"monitor window",val,
339  &MP->monWWval,1)) return 1;
340  }
341  else break;
342  }
343 
344  if (!val) return 0;
345 
346  for (i = 0; i < 2; i++)
347  {if (strcmp("dest", val)) break;
348  while((val = Config.GetWord()))
349  if (!strcmp("ccm", val)) MP->monMode[i] |= XROOTD_MON_CCM;
350  else if (!strcmp("files",val)) MP->monMode[i] |= XROOTD_MON_FILE;
351  else if (!strcmp("fstat",val)) MP->monMode[i] |= XROOTD_MON_FSTA;
352  else if (!strcmp("info", val)) MP->monMode[i] |= XROOTD_MON_INFO;
353  else if (!strcmp("io", val)) MP->monMode[i] |= XROOTD_MON_IO;
354  else if (!strcmp("iov", val)) MP->monMode[i] |= (XROOTD_MON_IO
355  |XROOTD_MON_IOV);
356  else if (!strcmp("pfc", val)) MP->monMode[i] |= XROOTD_MON_PFC;
357  else if (!strcmp("redir", val)) MP->monMode[i] |= XROOTD_MON_REDR;
358  else if (!strcmp("tcpmon", val)) MP->monMode[i] |= XROOTD_MON_TCPMO;
359  else if (!strcmp("throttle", val)) MP->monMode[i] |= XROOTD_MON_THROT;
360  else if (!strcmp("tpc", val)) MP->monMode[i] |= XROOTD_MON_TPC;
361  else if (!strcmp("user", val)) MP->monMode[i] |= XROOTD_MON_USER;
362  else break;
363 
364  if (!val) {eDest.Emsg("Config","monitor dest value not specified");
365  return 1;
366  }
367  if (MP->monDest[i]) free(MP->monDest[i]);
368  if (!(MP->monDest[i] = xmondest("monitor dest", val))) return 1;
369  if (!(val = Config.GetWord())) break;
370  }
371 
372  if (val)
373  {if (!strcmp("dest", val))
374  eDest.Emsg("Config", "Warning, a maximum of two dest values allowed.");
375  else eDest.Emsg("Config", "Warning, invalid monitor option", val);
376  }
377 
378 // Make sure dests differ
379 //
380  if (MP->monDest[0] && MP->monDest[1]
381  && !strcmp(MP->monDest[0], MP->monDest[1]))
382  {eDest.Emsg("Config", "Warning, monitor dests are identical.");
383  MP->monMode[0] |= MP->monMode[1]; MP->monMode[1] = 0;
384  free(MP->monDest[1]); MP->monDest[1] = 0;
385  }
386 
387 // Add files option if I/O is enabled
388 //
389  if (MP->monMode[0] & XROOTD_MON_IO) MP->monMode[0] |= XROOTD_MON_FILE;
390  if (MP->monMode[1] & XROOTD_MON_IO) MP->monMode[1] |= XROOTD_MON_FILE;
391 
392 // If ssq was specified, make sure we support IEEE754 floating point
393 //
394 #if !defined(__solaris__) || !defined(_IEEE_754)
395  if (MP->monFSopt & XROOTD_MON_FSSSQ && !(std::numeric_limits<double>::is_iec559))
396  {MP->monFSopt &= ~XROOTD_MON_FSSSQ;
397  eDest.Emsg("Config","Warning, 'fstat ssq' ignored; platform does not "
398  "use IEEE754 floating point.");
399  }
400 #endif
401 
402 // The caller may have deferred setting destinations. If so, don't upset what
403 // if currently set.
404 //
405  if (MP->monDest[0])
406  MP->monMode[0] |= (MP->monMode[0] ? xmode : XROOTD_MON_FILE|xmode);
407  if (MP->monDest[1])
408  MP->monMode[1] |= (MP->monMode[1] ? xmode : XROOTD_MON_FILE|xmode);
409 // All done
410 //
411  return 0;
412 }
413 
414 /******************************************************************************/
415 /* x m o n d e s t */
416 /******************************************************************************/
417 
418 char *XrdXrootdProtocol::xmondest(const char *what, char *val)
419 {
420  XrdNetAddr netdest;
421  const char *eText;
422  char netBuff[288];
423 
424 // Parse the host:port spec
425 //
426  if ((eText = netdest.Set(val)))
427  {eDest.Emsg("Config", what, "endpoint is invalid;", eText);
428  return 0;
429  }
430 
431 // Reformat it to get full host name
432 //
433  if (!netdest.Format(netBuff, sizeof(netBuff), XrdNetAddrInfo::fmtName))
434  {eDest.Emsg("Config", what, "endpoint is unreachable");
435  return 0;
436  }
437 
438 // Return a copy
439 //
440  return strdup(netBuff);
441 }
442 
443 /******************************************************************************/
444 /* x m o n g s */
445 /******************************************************************************/
446 
447 /* Function: xmongs
448 
449  Purpose: Parse directive: mongstream <strm> use <opts>
450 
451  <strm>: {all | ccm | pfc | tcpmon | tpc} [<strm>]
452 
453  <opts>: [flust <t>] [maxlen <l>] [send <fmt> [noident] <host:port>]
454 
455  <fmt> {cgi | json} <hdr> | nohdr
456 
457  <hdr> dflthdr | sitehdr | hosthdr | insthdr | fullhdr
458 
459  all applies options to all gstreams.
460  ccm gstream: cache context management
461  pfc gstream: proxy file cache
462  tcpmon gstream: tcp connection monitoring
463  throttle gstream: monitors I/O activity via the throttle plugin
464  tpc gstream: Third Party Copy
465 
466  noXXX do not include information.
467 
468  Output: 0 upon success or !0 upon failure. Ignored by master.
469 */
470 
471 int XrdXrootdProtocol::xmongs(XrdOucStream &Config)
472 {
473  static const int isFlush = 0;
474  static const int isMaxL = 1;
475  static const int isSend = 2;
476 
477  struct gsOpts {const char *opname; int opwhat;} gsopts[] =
478  {{"flush", isFlush},
479  {"maxlen", isMaxL},
480  {"send", isSend}
481  };
482  int numopts = sizeof(gsopts)/sizeof(struct gsOpts);
483 
484  int numgs = sizeof(gsObj)/sizeof(struct XrdXrootdGSReal::GSParms);
487  int i, selMon = 0, opt = -1, hdr = -1, fmt = -1, flushVal = -1;
488  long long maxlVal = -1;
489  char *val, *dest = 0;
490 
491 // Make sure we have something here
492 //
493  if (!(val = Config.GetWord()))
494  {eDest.Emsg("config", "gstream parameters not specified"); return 1;}
495 
496 // First tokens are the list of streams, at least one must be specified
497 //
498 do {if (!strcmp("all", val)) selMon = selAll;
499  else {for (i = 0; i < numgs; i++)
500  {if (!strcasecmp(val, gsObj[i].pin))
501  {selMon |= gsObj[i].Mode; break;}
502  }
503  if (i >= numgs) break;
504  }
505  } while((val = Config.GetWord()));
506 
507  if (!selMon)
508  {eDest.Emsg("config", "gstream name not specified"); return 1;}
509 
510 // The next token needs to be 'using' if there is is one.
511 //
512  if (val)
513  {if (strcmp(val, "use"))
514  {eDest.Emsg("config","mongstream expected 'use' not",val); return 1;}
515  if (!(val = Config.GetWord()))
516  {eDest.Emsg("config","gstream parameters not specified after 'use'");
517  return 1;
518  }
519  } else {
520  eDest.Emsg("config","mongstream expected 'use' verb not found");
521  return 1;
522  }
523 
524 // Process all the parameters now
525 //
526 do{for (i = 0; i < numopts; i++)
527  {if (!strcmp(val, gsopts[i].opname))
528  {if (!(val = Config.GetWord()))
529  {eDest.Emsg("Config", "gstream", gsopts[i].opname,
530  "value not specified");
531  return 1;
532  }
533  break;
534  }
535  }
536 
537 // Check if we actually found a keyword
538 //
539  if (i >= numopts)
540  {eDest.Emsg("config", "invalid gstream parameter", val);
541  return 1;
542  }
543 
544 // Handle each specific one
545 //
546  switch(gsopts[i].opwhat)
547  {case isFlush:
548  if (XrdOuca2x::a2tm(eDest, "gstream flush", val, &flushVal, 0))
549  return 1;
550  break;
551  case isMaxL:
552  if (XrdOuca2x::a2sz(eDest, "gstream maxlen",
553  val, &maxlVal, 1024, 65535)) return 1;
554  break;
555  case isSend:
556  if (dest) free(dest);
557  if (!xmongsend(Config, val, dest, opt, fmt, hdr)) return 1;
558  break;
559  default: break;
560  }
561 
562  } while((val = Config.GetWord()));
563 
564 // Set the values
565 //
566  for (i = 0; i < numgs; i++)
567  {if (gsObj[i].Mode & selMon)
568  {if (dest)
569  {if (gsObj[i].dest) free((void *)gsObj[i].dest);
570  gsObj[i].dest = dest;
571  }
572  if (flushVal >= 0) gsObj[i].flsT = flushVal;
573  if (maxlVal >= 0) gsObj[i].maxL = maxlVal;
574  if (opt >= 0) gsObj[i].Opt = opt;
575  if (fmt >= 0) gsObj[i].Fmt = fmt;
576  if (hdr >= 0) gsObj[i].Hdr = hdr;
577  }
578  }
579 
580  return 0;
581 }
582 
583 /******************************************************************************/
584 /* m o n g s e n d */
585 /******************************************************************************/
586 
587 bool XrdXrootdProtocol::xmongsend(XrdOucStream &Config, char *val, char *&dest,
588  int &opt, int &fmt, int &hdr)
589 {
590  struct gsFmts {const char *opname; int opval;} gsfmt[] =
591  {
592  {"cgi", XrdXrootdGSReal::fmtCgi},
593  {"json", XrdXrootdGSReal::fmtJson},
594  {"nohdr", XrdXrootdGSReal::fmtNone}
595  };
596  int numfmts = sizeof(gsfmt)/sizeof(struct gsFmts);
597 
598  struct gsHdrs {const char *opname; int opval;} gshdr[] =
599  {
600  {"dflthdr", XrdXrootdGSReal::hdrNorm},
601  {"sitehdr", XrdXrootdGSReal::hdrSite},
602  {"hosthdr", XrdXrootdGSReal::hdrHost},
603  {"insthdr", XrdXrootdGSReal::hdrInst},
604  {"fullhdr", XrdXrootdGSReal::hdrFull}
605  };
606  int numhdrs = sizeof(gshdr)/sizeof(struct gsHdrs);
607 
608  int i;
609 
610 // First token muxt be the format
611 //
612  for (i = 0; i < numfmts; i++)
613  if (!strcmp(val, gsfmt[i].opname))
614  {fmt = gsfmt[i].opval; break;}
615  if (i >= numfmts)
616  {eDest.Emsg("Config","gstream send format is invalid -", val);
617  return false;
618  }
619 
620 // The next one is the the optional hdr spec
621 //
622  val = Config.GetWord();
624  else if (val)
625  {for (i = 0; i < numhdrs; i++)
626  if (!strcmp(val, gshdr[i].opname))
627  {hdr = gshdr[i].opval;
628  val = Config.GetWord();
629  break;
630  }
631  }
632 
633 // The final token can be "noident"
634 //
635  if (val && !strcmp(val, "noident"))
637  val = Config.GetWord();
638  }
639 
640 // Finally, we must have the host and port
641 //
642  if (!val)
643  {eDest.Emsg("Config", "gstream send endpoint not specified");
644  return false;
645  }
646 
647 // Get the endpoint
648 //
649  dest = xmondest("gstream send", val);
650  return dest != 0;
651 }
#define XROOTD_MON_INFO
int Mode
if(Avsz)
const kXR_char XROOTD_MON_GSTPC
const kXR_char XROOTD_MON_GSTCP
const kXR_char XROOTD_MON_GSCCM
const kXR_char XROOTD_MON_GSTHR
const kXR_char XROOTD_MON_GSPFC
#define XROOTD_MON_IOV
#define XROOTD_MON_FSSSQ
#define XROOTD_MON_TPC
#define XROOTD_MON_ALL
#define XROOTD_MON_AUTH
#define XROOTD_MON_IO
#define XROOTD_MON_TCPMO
#define XROOTD_MON_PFC
#define XROOTD_MON_USER
#define XROOTD_MON_FSLFN
#define XROOTD_MON_CCM
#define XROOTD_MON_FSTA
#define XROOTD_MON_FSOPS
#define XROOTD_MON_FSXFR
#define XROOTD_MON_THROT
#define XROOTD_MON_FILE
#define XROOTD_MON_REDR
int Format(char *bAddr, int bLen, fmtUse fmtType=fmtAuto, int fmtOpts=0)
@ fmtName
Hostname if it is resolvable o/w use fmtAddr.
const char * Set(const char *hSpec, int pNum=PortInSpec)
Definition: XrdNetAddr.cc:208
void * GetPtr(const char *varname)
Definition: XrdOucEnv.cc:263
void PutPtr(const char *varname, void *value)
Definition: XrdOucEnv.cc:298
static int a2i(XrdSysError &, const char *emsg, const char *item, int *val, int minv=-1, int maxv=-1)
Definition: XrdOuca2x.cc:45
static int a2sz(XrdSysError &, const char *emsg, const char *item, long long *val, long long minv=-1, long long maxv=-1)
Definition: XrdOuca2x.cc:257
static int a2tm(XrdSysError &, const char *emsg, const char *item, int *val, int minv=-1, int maxv=-1)
Definition: XrdOuca2x.cc:288
const char * myName
Definition: XrdProtocol.hh:82
XrdOucEnv * theEnv
Definition: XrdProtocol.hh:66
const char * myProg
Definition: XrdProtocol.hh:83
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
Definition: XrdSysError.cc:95
XrdSysLogger * logger(XrdSysLogger *lp=0)
Definition: XrdSysError.hh:141
static const int hdrNone
Format as JSON info.
const char * dest
Destination for records.
static const int hdrInst
Include site, host, port, inst.
static const int fmtBin
Do not include info.
XrdXrootdGSReal(const GSParms &gsParms, bool &aOK)
static const int fmtJson
Format as CGI info.
int maxL
Maximum packet length (default 32K)
static const int hdrSite
Include site.
const char * pin
the plugin name.
static const int hdrHost
Include site, host.
static const int optNoID
Don't send ident records.
static const int hdrNorm
Include standard header.
static const int fmtNone
static const int fmtCgi
Format as binary info.
static const int hdrFull
Include site, host, port, inst, pgm.
static const int rdrMax
static void Defaults(char *dest1, int m1, char *dest2, int m2)
static bool ModeEnabled(int mode)
static const char * myInst
static XrdSysError & eDest
static XrdScheduler * Sched
XrdCmsConfig Config
XrdXrootdTpcMon * tpcMon
Definition: XrdOfsTPC.cc:84