XRootD
Loading...
Searching...
No Matches
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

XrdXrootdMonitorAgent
 
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 172 of file XrdXrootdMonitor.hh.

Constructor & Destructor Documentation

◆ User()

XrdXrootdMonitor::User::User ( )
inline

◆ ~User()

XrdXrootdMonitor::User::~User ( )
inline

Definition at line 227 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 183 of file XrdXrootdMonitor.hh.

183{return XrdXrootdMonitor::monAUTH;}

◆ Clear()

void XrdXrootdMonitor::User::Clear ( )
inline

Definition at line 185 of file XrdXrootdMonitor.hh.

185 {if (Name) {free(Name); Name = 0; Len = 0;}
186 if (Agent) {Agent->unAlloc(Agent); Agent = 0;}
187 Did = 0; Iops = Fops = 0;
188 }

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 267 of file XrdXrootdMonitor.cc.

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

◆ Enable()

void XrdXrootdMonitor::User::Enable ( )

Definition at line 278 of file XrdXrootdMonitor.cc.

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

◆ Files()

int XrdXrootdMonitor::User::Files ( )
inline

Definition at line 194 of file XrdXrootdMonitor.hh.

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

References Agent, and Fops.

◆ Fstat()

int XrdXrootdMonitor::User::Fstat ( )
inline

Definition at line 196 of file XrdXrootdMonitor.hh.

196{return monFSTAT;}

Referenced by XrdXrootdProtocol::Recycle().

+ Here is the caller graph for this function:

◆ Info()

int XrdXrootdMonitor::User::Info ( )
inline

Definition at line 198 of file XrdXrootdMonitor.hh.

198{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 200 of file XrdXrootdMonitor.hh.

200{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 202 of file XrdXrootdMonitor.hh.

202{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 204 of file XrdXrootdMonitor.hh.

205 {return XrdXrootdMonitor::Map(XROOTD_MON_MAPINFO,
206 *this, Info);
207 }
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 209 of file XrdXrootdMonitor.hh.

210 {return XrdXrootdMonitor::Map(XROOTD_MON_MAPPATH,
211 *this, Path);
212 }
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 224 of file XrdXrootdMonitor.hh.

224{return XrdXrootdMonitor::monACTIVE;}

◆ Register()

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

Definition at line 290 of file XrdXrootdMonitor.cc.

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

218 {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 336 of file XrdXrootdMonitor.cc.

337{
338 char buff[1024];
339
340 snprintf(buff, sizeof(buff), "&Uc=%d&Ec=%d&Ac=%d", ntohl(Did), eCode, aCode);
341
342 XrdXrootdMonitor::Map(XROOTD_MON_MAPUEAC,*this,buff);
343}
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 347 of file XrdXrootdMonitor.cc.

348{
349 char buff[4096];
350
351// Currently we support only the token external report
352//
353 if (infoT != TokenInfo) return false;
354
355 snprintf(buff, sizeof(buff), "&Uc=%d%s%s", ntohl(Did),
356 (*info == '&' ? "" : "&"), info);
357
358 XrdXrootdMonitor::Map(XROOTD_MON_MAPTOKN,*this,buff);
359
360 return true;
361}
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 177 of file XrdXrootdMonitor.hh.

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

◆ Fops

char XrdXrootdMonitor::User::Fops

Definition at line 179 of file XrdXrootdMonitor.hh.

Referenced by Clear(), and Files().

◆ Iops

char XrdXrootdMonitor::User::Iops

Definition at line 178 of file XrdXrootdMonitor.hh.

Referenced by Clear(), and InOut().

◆ Len

short XrdXrootdMonitor::User::Len

Definition at line 180 of file XrdXrootdMonitor.hh.

Referenced by Clear().

◆ Name

char* XrdXrootdMonitor::User::Name

Definition at line 181 of file XrdXrootdMonitor.hh.

Referenced by Clear().


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