#include <ICP.h>

Collaboration diagram for icp_common_t:

Public Member Functions

 icp_common_t ()
 
 icp_common_t (char *buf, unsigned int len)
 
void handleReply (char *buf, Ip::Address &from)
 
icp_opcode getOpCode () const
 

Static Public Member Functions

static icp_common_tCreateMessage (icp_opcode opcode, int flags, const char *url, int reqnum, int pad)
 

Public Attributes

unsigned char opcode
 
unsigned char version
 
unsigned short length
 
uint32_t reqnum
 
uint32_t flags
 
uint32_t pad
 
uint32_t shostid
 

Detailed Description

Wire-level ICP header. DO NOT add or move fields. DO NOT add virtual methods.

Definition at line 35 of file ICP.h.

Constructor & Destructor Documentation

◆ icp_common_t() [1/2]

icp_common_t::icp_common_t ( )

Definition at line 104 of file icp_v2.cc.

Referenced by CreateMessage(), and handleReply().

◆ icp_common_t() [2/2]

icp_common_t::icp_common_t ( char *  buf,
unsigned int  len 
)

Definition at line 109 of file icp_v2.cc.

References flags, length, pad, and reqnum.

Member Function Documentation

◆ CreateMessage()

icp_common_t * icp_common_t::CreateMessage ( icp_opcode  opcode,
int  flags,
const char *  url,
int  reqnum,
int  pad 
)
static
Returns
newly allocated buffer with an ICP message, including header

Definition at line 271 of file icp_v2.cc.

References icp_common_t(), flags, ICP_QUERY, ICP_VERSION_CURRENT, length, opcode, pad, reqnum, shostid, version, and xcalloc().

Referenced by icpCreateAndSend().

◆ getOpCode()

icp_opcode icp_common_t::getOpCode ( ) const

Definition at line 129 of file icp_v2.cc.

References ICP_END, ICP_INVALID, and opcode.

Referenced by PeerSelector::handleIcpReply(), icpHandleIcpV2(), and icpHandleIcpV3().

◆ handleReply()

void icp_common_t::handleReply ( char *  buf,
Ip::Address from 
)

Member Data Documentation

◆ flags

uint32_t icp_common_t::flags

Definition at line 45 of file ICP.h.

Referenced by icp_common_t(), CreateMessage(), doV2Query(), and PeerSelector::handleIcpParentMiss().

◆ length

unsigned short icp_common_t::length

total length (bytes)

Definition at line 42 of file ICP.h.

Referenced by icp_common_t(), CreateMessage(), icpHandleIcpV2(), icpHandleIcpV3(), and icpUdpSend().

◆ opcode

unsigned char icp_common_t::opcode

◆ pad

uint32_t icp_common_t::pad

Definition at line 46 of file ICP.h.

Referenced by icp_common_t(), CreateMessage(), and PeerSelector::handleIcpParentMiss().

◆ reqnum

uint32_t icp_common_t::reqnum

req number (req'd for UDP)

Definition at line 44 of file ICP.h.

Referenced by icp_common_t(), CreateMessage(), doV2Query(), doV3Query(), and handleReply().

◆ shostid

uint32_t icp_common_t::shostid

sender host id

Definition at line 48 of file ICP.h.

Referenced by CreateMessage().

◆ version

unsigned char icp_common_t::version

version number

Definition at line 40 of file ICP.h.

Referenced by CreateMessage(), and neighborAlive().


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors