File indexing completed on 2025-01-18 09:29:02
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_ASIO_SSL_ERROR_HPP
0012 #define BOOST_ASIO_SSL_ERROR_HPP
0013
0014 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
0015 # pragma once
0016 #endif
0017
0018 #include <boost/asio/detail/config.hpp>
0019 #include <boost/system/error_code.hpp>
0020 #include <boost/asio/ssl/detail/openssl_types.hpp>
0021
0022 #include <boost/asio/detail/push_options.hpp>
0023
0024 namespace boost {
0025 namespace asio {
0026 namespace error {
0027
0028 enum ssl_errors
0029 {
0030
0031 };
0032
0033 extern BOOST_ASIO_DECL
0034 const boost::system::error_category& get_ssl_category();
0035
0036 static const boost::system::error_category&
0037 ssl_category BOOST_ASIO_UNUSED_VARIABLE
0038 = boost::asio::error::get_ssl_category();
0039
0040 }
0041 namespace ssl {
0042 namespace error {
0043
0044 enum stream_errors
0045 {
0046 #if defined(GENERATING_DOCUMENTATION)
0047
0048 stream_truncated,
0049
0050
0051
0052 unspecified_system_error,
0053
0054
0055
0056 unexpected_result
0057 #else
0058 # if (OPENSSL_VERSION_NUMBER < 0x10100000L) \
0059 && !defined(OPENSSL_IS_BORINGSSL) \
0060 && !defined(BOOST_ASIO_USE_WOLFSSL)
0061 stream_truncated = ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SHORT_READ),
0062 # else
0063 stream_truncated = 1,
0064 # endif
0065 unspecified_system_error = 2,
0066 unexpected_result = 3
0067 #endif
0068 };
0069
0070 extern BOOST_ASIO_DECL
0071 const boost::system::error_category& get_stream_category();
0072
0073 static const boost::system::error_category&
0074 stream_category BOOST_ASIO_UNUSED_VARIABLE
0075 = boost::asio::ssl::error::get_stream_category();
0076
0077 }
0078 }
0079 }
0080 }
0081
0082 namespace boost {
0083 namespace system {
0084
0085 template<> struct is_error_code_enum<boost::asio::error::ssl_errors>
0086 {
0087 static const bool value = true;
0088 };
0089
0090 template<> struct is_error_code_enum<boost::asio::ssl::error::stream_errors>
0091 {
0092 static const bool value = true;
0093 };
0094
0095 }
0096 }
0097
0098 namespace boost {
0099 namespace asio {
0100 namespace error {
0101
0102 inline boost::system::error_code make_error_code(ssl_errors e)
0103 {
0104 return boost::system::error_code(
0105 static_cast<int>(e), get_ssl_category());
0106 }
0107
0108 }
0109 namespace ssl {
0110 namespace error {
0111
0112 inline boost::system::error_code make_error_code(stream_errors e)
0113 {
0114 return boost::system::error_code(
0115 static_cast<int>(e), get_stream_category());
0116 }
0117
0118 }
0119 }
0120 }
0121 }
0122
0123 #include <boost/asio/detail/pop_options.hpp>
0124
0125 #if defined(BOOST_ASIO_HEADER_ONLY)
0126 # include <boost/asio/ssl/impl/error.ipp>
0127 #endif
0128
0129 #endif