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

{}

## ~XrdSecsssCon()

virtual XrdSecsssCon::~XrdSecsssCon | ( |  | ) |

inline virtual

Definition at line 77 of file XrdSecsssCon.hh.

{}

## 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

  Contacts | Reference to a set of connections created by the entity. Each entry in the form of 'user[:pswd]@host:port'.
  Entity | Reference 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.

## 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.

{
EntityMap::iterator it;
char *colon, lid[256];
size_t n;
// Don't bother we are not tracking contacts
//
if (this != conTrack) return false;
// Extract out the loginid
//
n = hostID.find('@');
if (n == std::string::npos || n < 1 || n >= sizeof(lid)) return false;
strncpy(lid, hostID.c_str(), n);
lid[n] = 0;
if ((colon = index(lid, ':')))
{if (colon == lid) return false;
*colon = 0;
}
// Find the id in the registry
//
sssMutex.Lock();
it = Registry.find(lid);
if (it == Registry.end()) {sssMutex.UnLock(); return false;}
// Add this contact to the set of contacts
//
it->second->AddContact(hostID);
sssMutex.UnLock();
return true;
}
XrdSysMutex::Lock
void Lock()
Definition XrdSysPthread.hh:222
XrdSysMutex::UnLock
void UnLock()
Definition XrdSysPthread.hh:224
XrdSecsssMap::sssMutex
XrdSysMutex sssMutex
Definition XrdSecsssID.cc:62
XrdSecsssMap::conTrack
XrdSecsssCon * conTrack
Definition XrdSecsssID.cc:64
XrdSecsssMap::Registry
EntityMap Registry
Definition XrdSecsssID.cc:68

References XrdSecsssMap::conTrack, XrdSecsssMap::Registry, and XrdSecsssMap::sssMutex.

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

- XrdSecsssCon.hh
- XrdSecsssCon.cc