10#include <botan/tls_version.h>
12#include <botan/tls_exceptn.h>
20 if(maj == 3 && min == 0) {
24 if(maj == 3 && min >= 1) {
25 return "TLS v1." + std::to_string(min - 1);
29 return "DTLS v1." + std::to_string(255 - min);
33 return "Unknown " + std::to_string(maj) +
"." + std::to_string(min);
56 return m_version < other.m_version;
59 return m_version > other.m_version;
66 if(maj == 3 && min <= 4) {
75 if(maj == 254 && (min == 253 || min == 255)) {
85 return (m_version ==
static_cast<uint16_t
>(Protocol_Version::TLS_V12) ||
87 m_version ==
static_cast<uint16_t
>(Protocol_Version::TLS_V13) ||
89 m_version ==
static_cast<uint16_t
>(Protocol_Version::DTLS_V12));
bool operator>(const Protocol_Version &other) const
std::string to_string() const
bool is_tls_13_or_later() const
uint8_t major_version() const
bool known_version() const
bool is_datagram_protocol() const
uint8_t minor_version() const
bool is_pre_tls_13() const