![]() |
Dash Core
0.12.2.1
P2P Digital Currency
|
#include <protocol.h>
Public Types | |
enum | { COMMAND_SIZE = 12, MESSAGE_SIZE_SIZE = 4, CHECKSUM_SIZE = 4, MESSAGE_SIZE_OFFSET = MESSAGE_START_SIZE + COMMAND_SIZE, CHECKSUM_OFFSET = MESSAGE_SIZE_OFFSET + MESSAGE_SIZE_SIZE, HEADER_SIZE = MESSAGE_START_SIZE + COMMAND_SIZE + MESSAGE_SIZE_SIZE + CHECKSUM_SIZE } |
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, int nType, int nVersion) |
Public Attributes | |
ADD_SERIALIZE_METHODS | |
char | pchMessageStart [MESSAGE_START_SIZE] |
char | pchCommand [COMMAND_SIZE] |
uint32_t | nMessageSize |
uint8_t | pchChecksum [CHECKSUM_SIZE] |
Message header. (4) message start. (12) command. (4) size. (4) checksum.
Definition at line 29 of file protocol.h.
typedef unsigned char CMessageHeader::MessageStartChars[MESSAGE_START_SIZE] |
Definition at line 32 of file protocol.h.
anonymous enum |
Enumerator | |
---|---|
COMMAND_SIZE | |
MESSAGE_SIZE_SIZE | |
CHECKSUM_SIZE | |
MESSAGE_SIZE_OFFSET | |
CHECKSUM_OFFSET | |
HEADER_SIZE |
Definition at line 53 of file protocol.h.
CMessageHeader::CMessageHeader | ( | const MessageStartChars & | pchMessageStartIn | ) |
Definition at line 150 of file protocol.cpp.
CMessageHeader::CMessageHeader | ( | const MessageStartChars & | pchMessageStartIn, |
const char * | pszCommand, | ||
unsigned int | nMessageSizeIn | ||
) |
Definition at line 158 of file protocol.cpp.
std::string CMessageHeader::GetCommand | ( | ) | const |
Definition at line 167 of file protocol.cpp.
Referenced by IsValid(), and ProcessMessages().
bool CMessageHeader::IsValid | ( | const MessageStartChars & | messageStart | ) | const |
Definition at line 172 of file protocol.cpp.
Referenced by ProcessMessages().
|
inline |
Definition at line 43 of file protocol.h.
CMessageHeader::ADD_SERIALIZE_METHODS |
Definition at line 40 of file protocol.h.
uint32_t CMessageHeader::nMessageSize |
Definition at line 64 of file protocol.h.
Referenced by CMessageHeader(), CNetMessage::complete(), IsValid(), ProcessMessages(), CNetMessage::readData(), CNetMessage::readHeader(), and SerializationOp().
uint8_t CMessageHeader::pchChecksum[CHECKSUM_SIZE] |
Definition at line 65 of file protocol.h.
Referenced by CMessageHeader(), ProcessMessages(), and SerializationOp().
char CMessageHeader::pchCommand[COMMAND_SIZE] |
Definition at line 63 of file protocol.h.
Referenced by CMessageHeader(), GetCommand(), IsValid(), and SerializationOp().
char CMessageHeader::pchMessageStart[MESSAGE_START_SIZE] |
Definition at line 62 of file protocol.h.
Referenced by CMessageHeader(), IsValid(), and SerializationOp().