20 #ifndef INC_caServerID_H 21 #define INC_caServerID_H 35 struct sockaddr_in addr;
40 const struct sockaddr_in & addrIn,
unsigned priorityIn ) :
41 addr ( addrIn ), pri ( static_cast <
ca_uint8_t> ( priorityIn ) )
43 assert ( priorityIn <= 0xff );
48 if ( this->addr.sin_addr.s_addr == rhs.addr.sin_addr.s_addr &&
49 this->addr.sin_port == rhs.addr.sin_port &&
50 this->pri == rhs.pri ) {
61 const unsigned caServerMinIndexBitWidth = 2u;
62 const unsigned caServerMaxIndexBitWidth = 32u;
65 index = this->addr.sin_addr.s_addr;
66 index ^= this->addr.sin_port;
67 index ^= this->addr.sin_port >> 8u;
70 caServerMaxIndexBitWidth, index );
85 #endif // ifdef INC_caServerID_H
#define assert(exp)
Declare that a condition should be true.
unsigned priority() const
bool operator==(const caServerID &) const
resTableIndex hash() const
caServerID(const struct sockaddr_in &addrIn, unsigned priority)
resTableIndex integerHash(unsigned MIN_INDEX_WIDTH, unsigned MAX_ID_WIDTH, const T &id)
osiSockAddr address() const