Changeset View
Changeset View
Standalone View
Standalone View
src/protocol.h
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | enum { | ||||
MESSAGE_SIZE_OFFSET = MESSAGE_START_SIZE + COMMAND_SIZE, | MESSAGE_SIZE_OFFSET = MESSAGE_START_SIZE + COMMAND_SIZE, | ||||
CHECKSUM_OFFSET = MESSAGE_SIZE_OFFSET + MESSAGE_SIZE_SIZE, | CHECKSUM_OFFSET = MESSAGE_SIZE_OFFSET + MESSAGE_SIZE_SIZE, | ||||
HEADER_SIZE = MESSAGE_START_SIZE + COMMAND_SIZE + MESSAGE_SIZE_SIZE + | HEADER_SIZE = MESSAGE_START_SIZE + COMMAND_SIZE + MESSAGE_SIZE_SIZE + | ||||
CHECKSUM_SIZE | CHECKSUM_SIZE | ||||
}; | }; | ||||
typedef std::array<uint8_t, MESSAGE_START_SIZE> MessageMagic; | typedef std::array<uint8_t, MESSAGE_START_SIZE> MessageMagic; | ||||
CMessageHeader(const MessageMagic &pchMessageStartIn); | explicit CMessageHeader(const MessageMagic &pchMessageStartIn); | ||||
CMessageHeader(const MessageMagic &pchMessageStartIn, | CMessageHeader(const MessageMagic &pchMessageStartIn, | ||||
const char *pszCommand, unsigned int nMessageSizeIn); | const char *pszCommand, unsigned int nMessageSizeIn); | ||||
std::string GetCommand() const; | std::string GetCommand() const; | ||||
bool IsValid(const Config &config) const; | bool IsValid(const Config &config) const; | ||||
bool IsValidWithoutConfig(const MessageMagic &magic) const; | bool IsValidWithoutConfig(const MessageMagic &magic) const; | ||||
bool IsOversized(const Config &config) const; | bool IsOversized(const Config &config) const; | ||||
▲ Show 20 Lines • Show All 402 Lines • Show Last 20 Lines |