This is Unofficial EPICS BASE Doxygen Site
inetAddrID Class Reference

#include "inetAddrID.h"

+ Inheritance diagram for inetAddrID:

Public Member Functions

 inetAddrID (const struct sockaddr_in &addrIn)
 
bool operator== (const inetAddrID &) const
 
resTableIndex hash () const
 
void name (char *pBuf, unsigned bufSize) const
 

Detailed Description

Definition at line 27 of file inetAddrID.h.

Constructor & Destructor Documentation

inetAddrID::inetAddrID ( const struct sockaddr_in &  addrIn)
inline

Definition at line 37 of file inetAddrID.h.

37  :
38  addr ( addrIn )
39 {
40 }

Member Function Documentation

resTableIndex inetAddrID::hash ( ) const
inline

Definition at line 52 of file inetAddrID.h.

53 {
54  const unsigned inetAddrMinIndexBitWidth = 8u;
55  const unsigned inetAddrMaxIndexBitWidth = 32u;
56  unsigned index;
57  index = this->addr.sin_addr.s_addr;
58  index ^= this->addr.sin_port;
59  index ^= this->addr.sin_port >> 8u;
60  return integerHash ( inetAddrMinIndexBitWidth,
61  inetAddrMaxIndexBitWidth, index );
62 }
resTableIndex integerHash(unsigned MIN_INDEX_WIDTH, unsigned MAX_ID_WIDTH, const T &id)
Definition: resourceLib.h:1032
void inetAddrID::name ( char *  pBuf,
unsigned  bufSize 
) const
inline

Definition at line 64 of file inetAddrID.h.

65 {
66  ipAddrToDottedIP ( &this->addr, pBuf, bufSize );
67 }
unsigned epicsStdCall ipAddrToDottedIP(const struct sockaddr_in *paddr, char *pBuf, unsigned bufSize)
Definition: osiSock.c:144
bool inetAddrID::operator== ( const inetAddrID rhs) const
inline

Definition at line 42 of file inetAddrID.h.

43 {
44  if ( this->addr.sin_addr.s_addr == rhs.addr.sin_addr.s_addr ) {
45  if ( this->addr.sin_port == rhs.addr.sin_port ) {
46  return true;
47  }
48  }
49  return false;
50 }

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