20 #include <ripple/overlay/impl/ProtocolVersion.h>
21 #include <ripple/beast/core/LexicalCast.h>
22 #include <ripple/beast/rfc2616.h>
23 #include <boost/function_output_iterator.hpp>
24 #include <boost/regex.hpp>
47 []() constexpr ->
bool
61 for (
auto i = 0; i != len - 1; ++i)
69 }(),
"The list of supported protocols isn't properly sorted.");
86 static boost::regex re(
89 "([2-9]|(?:[1-9][0-9]+))"
93 , boost::regex_constants::optimize);
107 if (boost::regex_match(s, m, re))
133 boost::optional<ProtocolVersion>
136 boost::optional<ProtocolVersion> result;
152 boost::make_function_output_iterator(pickVersion));
157 boost::optional<ProtocolVersion>
constexpr ProtocolVersion make_protocol(std::uint16_t major, std::uint16_t minor)
std::vector< ProtocolVersion > parseProtocolVersions(boost::beast::string_view const &value)
Parse a set of protocol versions.
std::pair< std::uint16_t, std::uint16_t > ProtocolVersion
Represents a particular version of the peer-to-peer protocol.
std::string to_string(ListDisposition disposition)
boost::optional< ProtocolVersion > negotiateProtocolVersion(std::vector< ProtocolVersion > const &versions)
Given a list of supported protocol versions, choose the one we prefer.
constexpr const ProtocolVersion supportedProtocolList[]
The list of protocol versions we speak and we prefer to use.
Result split_commas(FwdIt first, FwdIt last)
std::string const & supportedProtocolVersions()
The list of all the protocol versions we support.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
bool lexicalCastChecked(Out &out, In in)
Intelligently convert from one type to another.
bool isProtocolSupported(ProtocolVersion const &v)
Determine whether we support a specific protocol version.
T set_intersection(T... args)