rippled
Loading...
Searching...
No Matches
ProtocolVersion.h
1#ifndef XRPL_OVERLAY_PROTOCOLVERSION_H_INCLUDED
2#define XRPL_OVERLAY_PROTOCOLVERSION_H_INCLUDED
3
4#include <boost/beast/core/string.hpp>
5
6#include <cstdint>
7#include <optional>
8#include <string>
9#include <utility>
10#include <vector>
11
12namespace ripple {
13
20
21inline constexpr ProtocolVersion
23{
24 return {major, minor};
25}
26
30
43parseProtocolVersions(boost::beast::string_view const& s);
44
48
51negotiateProtocolVersion(boost::beast::string_view const& versions);
52
54std::string const&
56
58bool
60
61} // namespace ripple
62
63#endif
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
std::optional< ProtocolVersion > negotiateProtocolVersion(std::vector< ProtocolVersion > const &versions)
Given a list of supported protocol versions, choose the one we prefer.
std::pair< std::uint16_t, std::uint16_t > ProtocolVersion
Represents a particular version of the peer-to-peer protocol.
std::vector< ProtocolVersion > parseProtocolVersions(boost::beast::string_view const &value)
Parse a set of protocol versions.
constexpr ProtocolVersion make_protocol(std::uint16_t major, std::uint16_t minor)
std::string const & supportedProtocolVersions()
The list of all the protocol versions we support.
std::string to_string(base_uint< Bits, Tag > const &a)
Definition base_uint.h:611
bool isProtocolSupported(ProtocolVersion const &v)
Determine whether we support a specific protocol version.