SSX3LobbyServer/lib/aries/Message.hpp

29 lines
756 B
C++

#pragma once
#include <base/network_order.hpp>
#include <base/fourcc.hpp>
namespace ls::aries {
/// The Aries message header.
struct [[gnu::packed]] AriesMessageHeader {
/// Message FourCC.
base::FourCC32_t typeCode {};
/// Apparently a extra 4 bytes of FourCC?
base::FourCC32_t typeCodeHi {};
/// The size of the message payload. Is network order (big endian), and includes the size of this header
base::NetworkOrder<u32> messageSize {};
};
/// The raw components of an Aries message. Used by our I/O algoritms.
struct RawAriesMessage {
AriesMessageHeader header;
std::string tagFields;
};
// Sanity checking.
static_assert(sizeof(AriesMessageHeader) == 12, "Aries message header size is invalid");
} // namespace ls::proto