3#include <xrpld/overlay/Compression.h>
5#include <xrpl/basics/ByteUtilities.h>
6#include <xrpl/protocol/PublicKey.h>
7#include <xrpl/server/Manifest.h>
9#include <google/protobuf/message.h>
86 ::google::protobuf::Message
const& message,
87 protocol::MessageType type,
97 messageSize(::google::protobuf::Message
const& message);
100 totalSize(::google::protobuf::Message
const& message);
std::size_t getCategory() const
Get the traffic category.
compression::Compressed Compressed
std::optional< PublicKey > validatorKey_
Message(::google::protobuf::Message const &message, protocol::MessageType type, std::optional< PublicKey > const &validator={})
Constructor.
compression::Algorithm Algorithm
static int getType(std::uint8_t const *in)
Get the message type from the payload header.
std::optional< PublicKey > const & getValidatorKey() const
Get the validator's key.
static std::size_t totalSize(::google::protobuf::Message const &message)
std::vector< uint8_t > const & getBuffer(Compressed tryCompressed)
Retrieve the packed message data.
std::vector< uint8_t > buffer_
static void setHeader(std::uint8_t *in, std::uint32_t payloadBytes, int type, Algorithm compression, std::uint32_t uncompressedBytes)
Set the payload header.
void compress()
Try to compress the payload.
static std::size_t messageSize(::google::protobuf::Message const &message)
std::size_t getBufferSize()
Retrieve the size of the packed but uncompressed message data.
std::vector< uint8_t > bufferCompressed_
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
constexpr std::size_t kMaximumMessageSize
constexpr std::size_t kMaximumPingMessageSize
constexpr std::size_t kMaxTrustedCount
Default number of trusted manifests allowed in a Manifest message.
constexpr std::size_t maximumManifestsMessageSize(std::size_t const trustedCount, std::size_t const untrustedCount)
Upper bound on the wire size of a TMManifests message.
constexpr std::size_t kMaxManifestBytes
Largest a valid manifest can be, in decoded bytes.
constexpr std::size_t kMaxUntrustedCount
Default number of untrusted manifests to store in cache and allowed in one Manifest message.
constexpr auto megabytes(T value) noexcept
constexpr auto kilobytes(T value) noexcept
constexpr std::size_t kManifestFramingBytes