![]() |
Bitcoin ABC 0.33.5
P2P Digital Currency
|
Message header. More...
#include <protocol.h>
Public Types | |
| typedef std::array< uint8_t, MESSAGE_START_SIZE > | MessageMagic |
Public Member Functions | |
| CMessageHeader () | |
| CMessageHeader (const MessageMagic &pchMessageStartIn, const char *msg_type, unsigned int nMessageSizeIn) | |
| Construct a P2P message header from message-start characters, a message type and the size of the message. More... | |
| std::string | GetMessageType () const |
| bool | IsMessageTypeValid () const |
| bool | IsOversized (const Config &config) const |
| SERIALIZE_METHODS (CMessageHeader, obj) | |
Public Attributes | |
| MessageMagic | pchMessageStart |
| std::array< char, MESSAGE_TYPE_SIZE > | m_msg_type |
| uint32_t | nMessageSize |
| uint8_t | pchChecksum [CHECKSUM_SIZE] |
Static Public Attributes | |
| static constexpr size_t | MESSAGE_START_SIZE = 4 |
| static constexpr size_t | MESSAGE_TYPE_SIZE = 12 |
| static constexpr size_t | MESSAGE_SIZE_SIZE = 4 |
| static constexpr size_t | CHECKSUM_SIZE = 4 |
| static constexpr size_t | MESSAGE_SIZE_OFFSET |
| static constexpr size_t | CHECKSUM_OFFSET |
| static constexpr size_t | HEADER_SIZE |
Message header.
(4) message start. (12) message type. (4) size. (4) checksum.
Definition at line 34 of file protocol.h.
| typedef std::array<uint8_t, MESSAGE_START_SIZE> CMessageHeader::MessageMagic |
Definition at line 47 of file protocol.h.
|
explicit |
Definition at line 91 of file protocol.cpp.
| CMessageHeader::CMessageHeader | ( | const MessageMagic & | pchMessageStartIn, |
| const char * | msg_type, | ||
| unsigned int | nMessageSizeIn | ||
| ) |
Construct a P2P message header from message-start characters, a message type and the size of the message.
msg_type longer than MESSAGE_TYPE_SIZE will result in a run-time assertion error. Definition at line 98 of file protocol.cpp.
| std::string CMessageHeader::GetMessageType | ( | ) | const |
Definition at line 119 of file protocol.cpp.
| bool CMessageHeader::IsMessageTypeValid | ( | ) | const |
| bool CMessageHeader::IsOversized | ( | const Config & | config | ) | const |
Definition at line 144 of file protocol.cpp.
|
inline |
Definition at line 64 of file protocol.h.
|
staticconstexpr |
Definition at line 42 of file protocol.h.
|
staticconstexpr |
Definition at line 39 of file protocol.h.
|
staticconstexpr |
Definition at line 44 of file protocol.h.
| std::array<char, MESSAGE_TYPE_SIZE> CMessageHeader::m_msg_type |
Definition at line 70 of file protocol.h.
|
staticconstexpr |
Definition at line 40 of file protocol.h.
|
staticconstexpr |
Definition at line 38 of file protocol.h.
|
staticconstexpr |
Definition at line 36 of file protocol.h.
|
staticconstexpr |
Definition at line 37 of file protocol.h.
| uint32_t CMessageHeader::nMessageSize |
Definition at line 71 of file protocol.h.
| uint8_t CMessageHeader::pchChecksum[CHECKSUM_SIZE] |
Definition at line 72 of file protocol.h.
| MessageMagic CMessageHeader::pchMessageStart |
Definition at line 69 of file protocol.h.