XrdLinkXeq Class Reference

#include <XrdLinkXeq.hh>

Inheritance diagram for XrdLinkXeq:
Inheritance graph
[legend]
Collaboration diagram for XrdLinkXeq:
Collaboration graph
[legend]

List of all members.

Public Member Functions

XrdNetAddrInfoAddrInfo ()
int Backlog ()
int Client (char *buff, int blen)
int Close (bool defer=false)
void DoIt ()
int getIOStats (long long &inbytes, long long &outbytes, int &numstall, int &numtardy)
XrdTlsPeerCertsgetPeerCerts ()
XrdProtocolgetProtocol ()
 Obtain current protocol object pointer.
const char * Name () const
const XrdNetAddrNetAddr () const
int Peek (char *buff, int blen, int timeout=-1)
int Recv (char *buff, int blen)
int Recv (char *buff, int blen, int timeout)
int RecvAll (char *buff, int blen, int timeout=-1)
bool Register (const char *hName)
int Send (const char *buff, int blen)
int Send (const struct iovec *iov, int iocnt, int bytes=0)
int Send (const sfVec *sdP, int sdn)
void setID (const char *userid, int procid)
void setLocation (XrdNetAddrInfo::LocInfo &loc)
bool setNB ()
XrdProtocolsetProtocol (XrdProtocol *pp, bool push)
void setProtName (const char *name)
bool setTLS (bool enable, XrdTlsContext *ctx=0)
 Enable or disable TLS on the link.
void Shutdown (bool getLock)
void syncStats (int *ctime=0)
int TLS_Peek (char *Buff, int Blen, int timeout)
int TLS_Recv (char *Buff, int Blen)
int TLS_Recv (char *Buff, int Blen, int timeout)
int TLS_RecvAll (char *Buff, int Blen, int timeout)
int TLS_Send (const char *Buff, int Blen)
int TLS_Send (const struct iovec *iov, int iocnt, int bytes)
int TLS_Send (const sfVec *sfP, int sfN)
const char * verTLS ()
 XrdLinkXeq ()
 ~XrdLinkXeq ()

Static Public Member Functions

static int getName (int &curr, char *bname, int blen, XrdLinkMatch *who=0)
static int Stats (char *buff, int blen, bool do_sync=false)

Public Attributes

XrdLinkInfo LinkInfo
XrdPollInfo PollInfo

Protected Member Functions

void Reset ()
int sendData (const char *Buff, int Blen)
int SendIOV (const struct iovec *iov, int iocnt, int bytes)
int SFError (int rc)
int TLS_Error (const char *act, XrdTls::RC rc)
bool TLS_Write (const char *Buff, int Blen)

Protected Attributes

long long BytesIn
long long BytesInTot
long long BytesOut
long long BytesOutTot
int stallCnt
int stallCntTot
int tardyCnt
int tardyCntTot
int SfIntr
XrdProtocolProtocol
XrdProtocolProtoAlt
XrdTlsSocket tlsIO
XrdNetAddr Addr
XrdSysMutex rdMutex
XrdSysMutex wrMutex
XrdSendQsendQ
int HNlen
bool LockReads
bool KeepFD
char isIdle
char Uname [24]
char Lname [256]

Static Protected Attributes

static const char * TraceID
static long long LinkBytesIn
static long long LinkBytesOut
static long long LinkConTime
static long long LinkCountTot
static int LinkCount
static int LinkCountMax
static int LinkTimeOuts
static int LinkStalls
static int LinkSfIntr
static XrdSysMutex statsMutex

Constructor & Destructor Documentation

XrdLinkXeq::XrdLinkXeq (  ) 
XrdLinkXeq::~XrdLinkXeq (  )  [inline]

Member Function Documentation

XrdNetAddrInfo* XrdLinkXeq::AddrInfo (  )  [inline]

Obtain the address information for this link.

Returns:
Pointer to the XrdAddrInfo object. The pointer is valid while the end-point is connected.

Reimplemented from XrdLink.

References Addr.

int XrdLinkXeq::Backlog (  ) 

Obtain the number of queued async requests.

Returns:
The number of async requests queued.

Reimplemented from XrdLink.

int XrdLinkXeq::Client ( char *  buff,
int  blen 
)

Get a copy of the client's name as known by the link.

Parameters:
buff Pointer to buffer to hold the name.
blen Length of the buffer.
Returns:
!0 The length of the name in gthe buffer. =0 The name could not be returned.

Reimplemented from XrdLink.

int XrdLinkXeq::Close ( bool  defer = false  ) 

Close the link.

Parameters:
defer If true, the link is made unaccessible but the link object not the file descriptor is released.
Returns:
!0 An error occurred, the return value is the errno. =0 Action successfully completed.

Reimplemented from XrdLink.

void XrdLinkXeq::DoIt (  )  [virtual]

Reimplemented from XrdLink.

int XrdLinkXeq::getIOStats ( long long &  inbytes,
long long &  outbytes,
int &  numstall,
int &  numtardy 
) [inline]

Get I/O statistics.

Parameters:
inbytes The number of bytes read.
outbytes The number of bytes written.
numstall The number of times the link was rescheduled due to unavailability.
numtardy The number of times the link was delayed due to unavailability.
Returns:
The link's reference count. The parameters will hold the indicated statistic.

Reimplemented from XrdLink.

References BytesIn, BytesInTot, BytesOut, BytesOutTot, XrdLinkInfo::InUse, LinkInfo, stallCnt, stallCntTot, tardyCnt, and tardyCntTot.

static int XrdLinkXeq::getName ( int &  curr,
char *  bname,
int  blen,
XrdLinkMatch who = 0 
) [static]

Find the next client name matching certain attributes.

Parameters:
cur Is an internal tracking value that allows repeated calls. It must be set to a value of 0 or less on the initial call and not touched therafter unless zero is returned.
bname Pointer to a buffer where the name is to be returned.
blen The length of the buffer.
who If the object use to check if the link matches the wanted criterea (typically, client name and host name). If the pointer is nil, a match always occurs.
Returns:
!0 The length of teh name placed in the buffer. =0 No more links exist with the specified criterea.

Reimplemented from XrdLink.

Reimplemented in XrdLinkCtl.

XrdTlsPeerCerts* XrdLinkXeq::getPeerCerts (  ) 

Get the x509 certificate information for this TLS enabled link.

Returns:
A pointer to the XrdTlsCerts object holding verified certificates if such certificates exist. Otherwise a nil pointer is returned.
Note:
Used by various protocols, so XrdTlsPeerCerts is a private header.

Reimplemented from XrdLink.

XrdProtocol* XrdLinkXeq::getProtocol (  )  [inline]

Obtain current protocol object pointer.

Reimplemented from XrdLink.

References Protocol.

const char* XrdLinkXeq::Name (  )  const [inline]

Obtain the domain trimmed name of the end-point. The returned value should only be used for display and not for security purposes.

Returns:
Pointer to the name that remains valid during the link's lifetime.

Reimplemented from XrdLink.

References Lname.

const XrdNetAddr* XrdLinkXeq::NetAddr (  )  const [inline]

Obtain the network address object for this link. The returned value is valid as long as the end-point is connected. Otherwise, it may change.

Returns:
Pointer to the object and remains valid during the link's lifetime.

Reimplemented from XrdLink.

References Addr.

int XrdLinkXeq::Peek ( char *  buff,
int  blen,
int  timeout = -1 
)

Issue a socket peek() and return result (do not use for TLS connections).

Parameters:
buff pointer to buffer to hold data.
blen length of buffer.
timeout milliseconds to wait for data. A negative value waits forever.
Returns:
>=0 buffer holds data equal to the returned value. < 0 an error or timeout occurred.

Reimplemented from XrdLink.

int XrdLinkXeq::Recv ( char *  buff,
int  blen,
int  timeout 
)

Read data from a link. Note that this call either reads all the data wanted or no data if the passed timeout occurs before any data is present.

Parameters:
buff pointer to buffer to hold data.
blen length of buffer (implies the actual bytes wanted).
timeout milliseconds to wait for data. A negative value waits forever.
Returns:
>=0 buffer holds data equal to the returned value. < 0 an error occurred. Note that a special error -ENOMSG is returned if poll() indicated data was present but no bytes were actually read.

Reimplemented from XrdLink.

int XrdLinkXeq::Recv ( char *  buff,
int  blen 
)

Read data from a link. Note that this call blocks until some data is available. Use Recv() with a timeout to avoid blocking.

Parameters:
buff pointer to buffer to hold data.
blen length of buffer (implies the maximum bytes wanted).
Returns:
>=0 buffer holds data equal to the returned value. < 0 an error occurred.

Reimplemented from XrdLink.

int XrdLinkXeq::RecvAll ( char *  buff,
int  blen,
int  timeout = -1 
)

Read data from a link. Note that this call reads as much data as it can or until the passed timeout has occurred.

Parameters:
buff pointer to buffer to hold data.
blen length of buffer (implies the maximum bytes wanted).
timeout milliseconds to wait for data. A negative value waits forever.
Returns:
>=0 buffer holds data equal to the returned value. < 0 an error occurred or when -ETIMEDOUT is returned, no data arrived within the timeout period.

Reimplemented from XrdLink.

bool XrdLinkXeq::Register ( const char *  hName  ) 

Register a host name with this IP address. This is not MT-safe!

Parameters:
hName -> to a true host name which should be fully qualified. One of the IP addresses registered to this name must match the IP address associated with this object.
Returns:
True: Specified name is now associated with this link. False: Nothing changed, registration could not be verified.

Reimplemented from XrdLink.

void XrdLinkXeq::Reset (  )  [protected]
int XrdLinkXeq::Send ( const sfVec sdP,
int  sdn 
)

Reimplemented from XrdLink.

int XrdLinkXeq::Send ( const struct iovec *  iov,
int  iocnt,
int  bytes = 0 
)

Send data on a link. This calls may block unless the socket was marked nonblocking. If a block would occur, the data is copied for later sending.

Parameters:
iov pointer to the message vector.
iocnt number of iov elements in the vector.
bytes the sum of the sizes in the vector.
Returns:
>=0 number of bytes sent. < 0 an error occurred.

Reimplemented from XrdLink.

int XrdLinkXeq::Send ( const char *  buff,
int  blen 
)

Send data on a link. This calls may block unless the socket was marked nonblocking. If a block would occur, the data is copied for later sending.

Parameters:
buff pointer to buffer to send.
blen length of buffer.
Returns:
>=0 number of bytes sent. < 0 an error or occurred.

Reimplemented from XrdLink.

int XrdLinkXeq::sendData ( const char *  Buff,
int  Blen 
) [protected]
int XrdLinkXeq::SendIOV ( const struct iovec *  iov,
int  iocnt,
int  bytes 
) [protected]
void XrdLinkXeq::setID ( const char *  userid,
int  procid 
)

Set the client's link identity.

Parameters:
userid pointer to the client's username.
procid the client's process id (i.e. pid).

Reimplemented from XrdLink.

void XrdLinkXeq::setLocation ( XrdNetAddrInfo::LocInfo loc  )  [inline]

Set the client's location.

Parameters:
loc reference to the location information.

Reimplemented from XrdLink.

References Addr, and XrdNetAddr::SetLocation().

bool XrdLinkXeq::setNB (  ) 

Set the link to be non-blocking.

Returns:
true mode has been set.
false mode is not supported for this operating system.

Reimplemented from XrdLink.

void XrdLinkXeq::setProtName ( const char *  name  ) 

Set the link's protocol name.

Parameters:
name name of he protocol being used. The storage must be valid for the duration of the program.

Reimplemented from XrdLink.

XrdProtocol* XrdLinkXeq::setProtocol ( XrdProtocol pp,
bool  push 
)
bool XrdLinkXeq::setTLS ( bool  enable,
XrdTlsContext ctx = 0 
)

Enable or disable TLS on the link.

Parameters:
enable if true, TLS is enabled if not already enabled. Otherwise, TLS is disabled and the TLS logical connection torn down. statistics may be contradictory as they are collected async.
ctx The context to use when enabling TLS. When nil, the default context is used.
Returns:
True if successful, false otherwise.

Reimplemented from XrdLink.

int XrdLinkXeq::SFError ( int  rc  )  [protected]
void XrdLinkXeq::Shutdown ( bool  getLock  ) 

Shutdown the link but otherwise keep it intact.

Parameters:
getlock if true, the operation is performed under a lock.

Reimplemented from XrdLink.

static int XrdLinkXeq::Stats ( char *  buff,
int  blen,
bool  do_sync = false 
) [static]

Obtain link statistics.

Parameters:
buff pointer to the buffer for the xml statistics.
blen length of the buffer.
do_sync if true, the statistics self-consistent. Otherwise, the statistics may be contradictory as they are collected async.
Returns:
number of bytes placed in the buffer excluding the null byte.

Reimplemented from XrdLink.

void XrdLinkXeq::syncStats ( int *  ctime = 0  ) 

Add all local statistics to the global counters.

Parameters:
ctime if not nil, return the total connect time in seconds.

Reimplemented from XrdLink.

int XrdLinkXeq::TLS_Error ( const char *  act,
XrdTls::RC  rc 
) [protected]
int XrdLinkXeq::TLS_Peek ( char *  Buff,
int  Blen,
int  timeout 
)
int XrdLinkXeq::TLS_Recv ( char *  Buff,
int  Blen,
int  timeout 
)
int XrdLinkXeq::TLS_Recv ( char *  Buff,
int  Blen 
)
int XrdLinkXeq::TLS_RecvAll ( char *  Buff,
int  Blen,
int  timeout 
)
int XrdLinkXeq::TLS_Send ( const sfVec sfP,
int  sfN 
)
int XrdLinkXeq::TLS_Send ( const struct iovec *  iov,
int  iocnt,
int  bytes 
)
int XrdLinkXeq::TLS_Send ( const char *  Buff,
int  Blen 
)
bool XrdLinkXeq::TLS_Write ( const char *  Buff,
int  Blen 
) [protected]
const char* XrdLinkXeq::verTLS (  ) 

Return TLS protocol version being used.

Returns:
The TLS protocol version number. If the link is not using TLS, a null string is returned;

Reimplemented from XrdLink.


Member Data Documentation

Referenced by AddrInfo(), NetAddr(), and setLocation().

long long XrdLinkXeq::BytesIn [protected]

Referenced by getIOStats().

long long XrdLinkXeq::BytesInTot [protected]

Referenced by getIOStats().

long long XrdLinkXeq::BytesOut [protected]

Referenced by getIOStats().

long long XrdLinkXeq::BytesOutTot [protected]

Referenced by getIOStats().

int XrdLinkXeq::HNlen [protected]
char XrdLinkXeq::isIdle [protected]
bool XrdLinkXeq::KeepFD [protected]
long long XrdLinkXeq::LinkBytesIn [static, protected]
long long XrdLinkXeq::LinkBytesOut [static, protected]
long long XrdLinkXeq::LinkConTime [static, protected]
int XrdLinkXeq::LinkCount [static, protected]
int XrdLinkXeq::LinkCountMax [static, protected]
long long XrdLinkXeq::LinkCountTot [static, protected]

Referenced by getIOStats().

int XrdLinkXeq::LinkSfIntr [static, protected]
int XrdLinkXeq::LinkStalls [static, protected]
int XrdLinkXeq::LinkTimeOuts [static, protected]
char XrdLinkXeq::Lname[256] [protected]

Referenced by Name().

bool XrdLinkXeq::LockReads [protected]

Referenced by XrdLinkCtl::fd2PollInfo().

Referenced by getProtocol().

int XrdLinkXeq::SfIntr [protected]
int XrdLinkXeq::stallCnt [protected]

Referenced by getIOStats().

int XrdLinkXeq::stallCntTot [protected]

Referenced by getIOStats().

XrdSysMutex XrdLinkXeq::statsMutex [static, protected]
int XrdLinkXeq::tardyCnt [protected]

Referenced by getIOStats().

int XrdLinkXeq::tardyCntTot [protected]

Referenced by getIOStats().

const char* XrdLinkXeq::TraceID [static, protected]

Reimplemented in XrdLinkCtl.

char XrdLinkXeq::Uname[24] [protected]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 7 Jul 2020 for xrootd by  doxygen 1.6.1