Bitcoin
|
#include <protocol.h>
Public Types | |
typedef unsigned char | MessageStartChars[MESSAGE_START_SIZE] |
Public Member Functions | |
CMessageHeader (const MessageStartChars &pchMessageStartIn) | |
CMessageHeader (const MessageStartChars &pchMessageStartIn, const char *pszCommand, unsigned int nMessageSizeIn) | |
std::string | GetCommand () const |
bool | IsValid (const MessageStartChars &messageStart) const |
template<typename Stream , typename Operation > | |
void | SerializationOp (Stream &s, Operation ser_action) |
Public Attributes | |
ADD_SERIALIZE_METHODS | |
char | pchMessageStart [MESSAGE_START_SIZE] |
char | pchCommand [COMMAND_SIZE] |
uint32_t | nMessageSize |
uint8_t | pchChecksum [CHECKSUM_SIZE] |
Static Public Attributes | |
static constexpr size_t | MESSAGE_START_SIZE = 4 |
static constexpr size_t | COMMAND_SIZE = 12 |
static constexpr size_t | MESSAGE_SIZE_SIZE = 4 |
static constexpr size_t | CHECKSUM_SIZE = 4 |
static constexpr size_t | MESSAGE_SIZE_OFFSET = MESSAGE_START_SIZE + COMMAND_SIZE |
static constexpr size_t | CHECKSUM_OFFSET = MESSAGE_SIZE_OFFSET + MESSAGE_SIZE_SIZE |
static constexpr size_t | HEADER_SIZE = MESSAGE_START_SIZE + COMMAND_SIZE + MESSAGE_SIZE_SIZE + CHECKSUM_SIZE |
Message header. (4) message start. (12) command. (4) size. (4) checksum.
typedef unsigned char CMessageHeader::MessageStartChars[MESSAGE_START_SIZE] |
|
explicit |
CMessageHeader::CMessageHeader | ( | const MessageStartChars & | pchMessageStartIn, |
const char * | pszCommand, | ||
unsigned int | nMessageSizeIn | ||
) |
std::string CMessageHeader::GetCommand | ( | ) | const |
bool CMessageHeader::IsValid | ( | const MessageStartChars & | messageStart | ) | const |
|
inline |
CMessageHeader::ADD_SERIALIZE_METHODS |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
uint32_t CMessageHeader::nMessageSize |
uint8_t CMessageHeader::pchChecksum[CHECKSUM_SIZE] |
char CMessageHeader::pchCommand[COMMAND_SIZE] |
char CMessageHeader::pchMessageStart[MESSAGE_START_SIZE] |