XRootD
XrdXrootdMonitor::User Class Reference

#include <XrdXrootdMonitor.hh>

+ Inheritance diagram for XrdXrootdMonitor::User:
+ Collaboration diagram for XrdXrootdMonitor::User:

Public Member Functions

 User ()
 
 ~User ()
 
int Auths ()
 
void Clear ()
 
void Disable ()
 
void Enable ()
 
int Files ()
 
int Fstat ()
 
int Info ()
 
int InOut ()
 
int Logins ()
 
kXR_unt32 MapInfo (const char *Info)
 
kXR_unt32 MapPath (const char *Path)
 
int Ready ()
 
void Register (const char *Uname, const char *Hname, const char *Pname, unsigned int xSID=0)
 
void Report (const char *Info)
 
void Report (int eCode, int aCode)
 
bool Report (WhatInfo infoT, const char *info) override
 
- Public Member Functions inherited from XrdSecMonitor
 XrdSecMonitor ()
 
virtual ~XrdSecMonitor ()
 

Public Attributes

XrdXrootdMonitor * Agent
 
kXR_unt32 Did
 
char Fops
 
char Iops
 
short Len
 
char * Name
 

Additional Inherited Members

- Public Types inherited from XrdSecMonitor
enum  WhatInfo { TokenInfo = 0 }
 

Detailed Description

Definition at line 187 of file XrdXrootdMonitor.hh.

Constructor & Destructor Documentation

◆ User()

XrdXrootdMonitor::User::User ( )
inline

◆ ~User()

XrdXrootdMonitor::User::~User ( )
inline

Definition at line 242 of file XrdXrootdMonitor.hh.

References Clear().

+ Here is the call graph for this function:

Member Function Documentation

◆ Auths()

int XrdXrootdMonitor::User::Auths ( )
inline

Definition at line 198 of file XrdXrootdMonitor.hh.

198 {return XrdXrootdMonitor::monAUTH;}

◆ Clear()

void XrdXrootdMonitor::User::Clear ( )
inline

Definition at line 200 of file XrdXrootdMonitor.hh.

200  {if (Name) {free(Name); Name = 0; Len = 0;}
201  if (Agent) {Agent->unAlloc(Agent); Agent = 0;}
202  Did = 0; Iops = Fops = 0;
203  }

References Agent, Did, Fops, Iops, Len, and Name.

Referenced by ~User(), and XrdXrootdProtocol::Recycle().

+ Here is the caller graph for this function:

◆ Disable()

void XrdXrootdMonitor::User::Disable ( )

Definition at line 269 of file XrdXrootdMonitor.cc.

270 {
271  if (Agent)
272  {XrdXrootdMonitor::unAlloc(Agent); Agent = 0;}
273  Fops = Iops = 0;
274 }

◆ Enable()

void XrdXrootdMonitor::User::Enable ( )

Definition at line 280 of file XrdXrootdMonitor.cc.

281 {
282  if (Agent || (Agent = XrdXrootdMonitor::Alloc(1)))
283  {Iops = XrdXrootdMonitor::monIO;
284  Fops = XrdXrootdMonitor::monFILE;
285  } else Iops = Fops = 0;
286 }

◆ Files()

int XrdXrootdMonitor::User::Files ( )
inline

Definition at line 209 of file XrdXrootdMonitor.hh.

209 {return (Agent ? Fops : 0);}

References Agent, and Fops.

◆ Fstat()

int XrdXrootdMonitor::User::Fstat ( )
inline

Definition at line 211 of file XrdXrootdMonitor.hh.

211 {return monFSTAT;}

Referenced by XrdXrootdProtocol::Recycle().

+ Here is the caller graph for this function:

◆ Info()

int XrdXrootdMonitor::User::Info ( )
inline

Definition at line 213 of file XrdXrootdMonitor.hh.

213 {return (Agent ? XrdXrootdMonitor::monINFO : 0);}

References Agent.

Referenced by MapInfo(), and Report().

+ Here is the caller graph for this function:

◆ InOut()

int XrdXrootdMonitor::User::InOut ( )
inline

Definition at line 215 of file XrdXrootdMonitor.hh.

215 {return (Agent ? Iops : 0);}

References Agent, and Iops.

Referenced by XrdXrootdProtocol::do_WriteSpan().

+ Here is the caller graph for this function:

◆ Logins()

int XrdXrootdMonitor::User::Logins ( )
inline

Definition at line 217 of file XrdXrootdMonitor.hh.

217 {return (Agent ? XrdXrootdMonitor::monUSER : 0);}

References Agent.

Referenced by XrdXrootdProtocol::Recycle().

+ Here is the caller graph for this function:

◆ MapInfo()

kXR_unt32 XrdXrootdMonitor::User::MapInfo ( const char *  Info)
inline

Definition at line 219 of file XrdXrootdMonitor.hh.

220  {return XrdXrootdMonitor::Map(XROOTD_MON_MAPINFO,
221  *this, Info);
222  }
const kXR_char XROOTD_MON_MAPINFO

References Info(), and XROOTD_MON_MAPINFO.

Referenced by XrdXrootdGSReal::GetDictID().

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

◆ MapPath()

kXR_unt32 XrdXrootdMonitor::User::MapPath ( const char *  Path)
inline

Definition at line 224 of file XrdXrootdMonitor.hh.

225  {return XrdXrootdMonitor::Map(XROOTD_MON_MAPPATH,
226  *this, Path);
227  }
XrdOucString Path
const kXR_char XROOTD_MON_MAPPATH

References Path, and XROOTD_MON_MAPPATH.

Referenced by XrdXrootdGSReal::GetDictID().

+ Here is the caller graph for this function:

◆ Ready()

int XrdXrootdMonitor::User::Ready ( )
inline

Definition at line 239 of file XrdXrootdMonitor.hh.

239 {return XrdXrootdMonitor::monACTIVE;}

◆ Register()

void XrdXrootdMonitor::User::Register ( const char *  Uname,
const char *  Hname,
const char *  Pname,
unsigned int  xSID = 0 
)

Definition at line 292 of file XrdXrootdMonitor.cc.

295 {
296 #ifndef NODEBUG
297  const char *TraceID = "Monitor";
298 #endif
299  char *dotP, *colonP, *atP;
300  char uBuff[1024], tBuff[1024], sBuff[64];
301 
302 // Decode the user name as a.b:c@d and remap it for monitoring as
303 // <protocol>/a.{b|xSID}:<kySID>@host
304 //
305  snprintf(tBuff, sizeof(tBuff), "%s", Uname);
306  if ((dotP = index(tBuff, '.')) && (colonP = index(dotP+1, ':')) &&
307  (atP = index(colonP+1, '@')))
308  {*dotP = 0; *colonP = 0; *atP = 0;
309  if (xSID)
310  {snprintf(sBuff, sizeof(sBuff), " %u", xSID);
311  dotP = sBuff;
312  }
313 
314  int n = snprintf(uBuff, sizeof(uBuff), "%s/%s.%s:%s@%s", Pname, tBuff,
315  dotP+1, kySID, atP+1);
316 
317  if (n < 0 || n >= (int) sizeof(uBuff))
318  TRACE(LOGIN, "Login ID was truncated: " << uBuff);
319 
320  if (xSID) {TRACE(LOGIN,"Register remap "<<Uname<<" -> "<<uBuff);}
321  } else snprintf(uBuff, sizeof(uBuff), "%s/%s", Pname, Uname);
322 
323 // Generate a monitor identity for this user. We do not assign a dictioary
324 // identifier unless this entry is reported.
325 //
326  Agent = XrdXrootdMonitor::Alloc();
327  Did = 0;
328  Len = strlen(uBuff);
329  Name = strdup(uBuff);
330  Iops = XrdXrootdMonitor::monIO;
331  Fops = XrdXrootdMonitor::monFILE;
332 }
#define TRACE(act, x)
Definition: XrdTrace.hh:63

References XrdXrootdMonInfo::kySID, and TRACE.

Referenced by XrdXrootdGSReal::XrdXrootdGSReal().

+ Here is the caller graph for this function:

◆ Report() [1/3]

void XrdXrootdMonitor::User::Report ( const char *  Info)
inline

Definition at line 232 of file XrdXrootdMonitor.hh.

233  {Did=XrdXrootdMonitor::Map(XROOTD_MON_MAPUSER,*this,Info);}
const kXR_char XROOTD_MON_MAPUSER

References Did, Info(), and XROOTD_MON_MAPUSER.

Referenced by XrdXrootdProtocol::MonAuth().

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

◆ Report() [2/3]

void XrdXrootdMonitor::User::Report ( int  eCode,
int  aCode 
)

Definition at line 338 of file XrdXrootdMonitor.cc.

339 {
340  char buff[1024];
341 
342  snprintf(buff, sizeof(buff), "&Uc=%u&Ec=%d&Ac=%d", ntohl(Did), eCode, aCode);
343 
344  XrdXrootdMonitor::Map(XROOTD_MON_MAPUEAC,*this,buff);
345 }
const kXR_char XROOTD_MON_MAPUEAC

References XROOTD_MON_MAPUEAC.

◆ Report() [3/3]

bool XrdXrootdMonitor::User::Report ( WhatInfo  infoT,
const char *  info 
)
overridevirtual

Include extra information in the monitoring stream to be associated with the current mapped user. This object is pointed to via the XrdSecEntity secMon member.

Parameters
infoT- the enum describing what information is being reported
info- a null terminate string with the information in cgi format
Returns
true - Information reported.
false - Invalid infoT code or not enabled, call has been ignored.

Implements XrdSecMonitor.

Definition at line 349 of file XrdXrootdMonitor.cc.

350 {
351  char buff[4096];
352 
353 // Currently we support only the token external report
354 //
355  if (infoT != TokenInfo) return false;
356 
357  snprintf(buff, sizeof(buff), "&Uc=%u%s%s", ntohl(Did),
358  (*info == '&' ? "" : "&"), info);
359 
360  XrdXrootdMonitor::Map(XROOTD_MON_MAPTOKN,*this,buff);
361 
362  return true;
363 }
const kXR_char XROOTD_MON_MAPTOKN

References XROOTD_MON_MAPTOKN.

Member Data Documentation

◆ Agent

XrdXrootdMonitor* XrdXrootdMonitor::User::Agent

◆ Did

kXR_unt32 XrdXrootdMonitor::User::Did

Definition at line 192 of file XrdXrootdMonitor.hh.

Referenced by Clear(), XrdXrootdProtocol::Recycle(), and Report().

◆ Fops

char XrdXrootdMonitor::User::Fops

Definition at line 194 of file XrdXrootdMonitor.hh.

Referenced by Clear(), and Files().

◆ Iops

char XrdXrootdMonitor::User::Iops

Definition at line 193 of file XrdXrootdMonitor.hh.

Referenced by Clear(), and InOut().

◆ Len

short XrdXrootdMonitor::User::Len

Definition at line 195 of file XrdXrootdMonitor.hh.

Referenced by Clear().

◆ Name

char* XrdXrootdMonitor::User::Name

Definition at line 196 of file XrdXrootdMonitor.hh.

Referenced by Clear().


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