17 #ifndef KAASYNCREQUEST_HPP_
18 #define KAASYNCREQUEST_HPP_
22 #include <arpa/inet.h>
45 std::copy(reinterpret_cast<const boost::uint8_t *>(header),
46 reinterpret_cast<const boost::uint8_t *>(header + size),
49 auto messageIt = message_.begin() + size;
52 std::copy(reinterpret_cast<boost::uint8_t *>(&nameLengthNetworkOrder), reinterpret_cast<boost::uint8_t *>(&nameLengthNetworkOrder) + 2, messageIt);
61 boost::uint16_t messageIdNetworkOrder = htons(messageId);
62 std::copy(reinterpret_cast<boost::uint8_t *>(&messageIdNetworkOrder), reinterpret_cast<boost::uint8_t *>(&messageIdNetworkOrder) + 2, messageIt);
65 *messageIt |= (((boost::uint8_t)messageType) << 4);
76 std::copy(payload.begin(), payload.end(), messageIt);
81 const std::vector<boost::uint8_t>&
getRawMessage()
const {
return message_; }
84 std::vector<boost::uint8_t> message_;
86 static const boost::uint8_t KAA_SYNC_MESSAGE_TYPE_SYNC = 0x01;
87 static const boost::uint8_t KAA_SYNC_MESSAGE_TYPE_BOOTSTRAP = 0x02;
static const boost::uint8_t KAA_SYNC_ZIPPED_BIT
static boost::uint8_t createBasicHeader(boost::uint8_t messageType, boost::uint32_t length, char *message)
KaaSyncRequest(bool zipped, bool encrypted, boost::uint16_t messageId, const T &payload, KaaSyncMessageType messageType)
static const boost::uint8_t PROTOCOL_VERSION
static const boost::uint8_t KAA_SYNC_REQUEST_BIT
static const boost::uint16_t KAA_TCP_NAME_LENGTH
static const boost::uint8_t KAA_SYNC_HEADER_LENGTH
const std::vector< boost::uint8_t > & getRawMessage() const
static const boost::uint8_t KAA_SYNC_ENCRYPTED_BIT
static const char *const KAA_TCP_NAME