XRootD
XrdSecsssCon Class Referenceabstract

#include <XrdSecsssCon.hh>

+ Collaboration diagram for XrdSecsssCon:

Public Member Functions

 XrdSecsssCon ()
 
virtual ~XrdSecsssCon ()
 
virtual void Cleanup (const std::set< std::string > &Contacts, const XrdSecEntity &Entity)=0
 
bool Contact (const std::string &lgnid, const std::string &hostID)
 

Detailed Description

Definition at line 45 of file XrdSecsssCon.hh.

Constructor & Destructor Documentation

◆ XrdSecsssCon()

XrdSecsssCon::XrdSecsssCon ( )
inline

Definition at line 76 of file XrdSecsssCon.hh.

76 {}

◆ ~XrdSecsssCon()

virtual XrdSecsssCon::~XrdSecsssCon ( )
inlinevirtual

Definition at line 77 of file XrdSecsssCon.hh.

77 {}

Member Function Documentation

◆ Cleanup()

virtual void XrdSecsssCon::Cleanup ( const std::set< std::string > &  Contacts,
const XrdSecEntity Entity 
)
pure virtual

Cleanup connections established by the passed entity.

Parameters
ContactsReference to a set of connections created by the entity. Each entry in the form of 'user[:pswd]@host:port'.
EntityReference to the entity object responsible for the contacts.
Note
1) This object is passed to the XrdSecsssID constructor. 2) It is expected that the callee will disconnect each connection. 3) Upon return the Contacts and Entity objects are deleted.

Referenced by XrdSecsssEnt::Delete().

+ Here is the caller graph for this function:

◆ Contact()

bool XrdSecsssCon::Contact ( const std::string &  lgnid,
const std::string &  hostID 
)

Add a contact for the indicated loginid entity.

Parameters
lgnid- The loginid used to to register an Entity via XrdSecsssID.
hostID- The hostID (i.e. lgnid[:pswd]@host:port).
Returns
true - Contact added.
false - Contact not added as the lgnid is not registered.

Definition at line 44 of file XrdSecsssCon.cc.

45 {
46  EntityMap::iterator it;
47  char *colon, lid[256];
48  size_t n;
49 
50 // Don't bother we are not tracking contacts
51 //
52  if (this != conTrack) return false;
53 
54 // Extract out the loginid
55 //
56  n = hostID.find('@');
57  if (n == std::string::npos || n < 1 || n >= sizeof(lid)) return false;
58  strncpy(lid, hostID.c_str(), n);
59  lid[n] = 0;
60  if ((colon = index(lid, ':')))
61  {if (colon == lid) return false;
62  *colon = 0;
63  }
64 
65 // Find the id in the registry
66 //
67  sssMutex.Lock();
68  it = Registry.find(lid);
69  if (it == Registry.end()) {sssMutex.UnLock(); return false;}
70 
71 // Add this contact to the set of contacts
72 //
73  it->second->AddContact(hostID);
74  sssMutex.UnLock();
75  return true;
76 }
XrdSysMutex sssMutex
Definition: XrdSecsssID.cc:62
XrdSecsssCon * conTrack
Definition: XrdSecsssID.cc:64
EntityMap Registry
Definition: XrdSecsssID.cc:68

References XrdSecsssMap::conTrack, XrdSysMutex::Lock(), XrdSecsssMap::Registry, XrdSecsssMap::sssMutex, and XrdSysMutex::UnLock().

+ Here is the call graph for this function:

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