]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/asio/ssl/error.hpp
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / boost / asio / ssl / error.hpp
1 //
2 // ssl/error.hpp
3 // ~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6 //
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 //
10
11 #ifndef BOOST_ASIO_SSL_ERROR_HPP
12 #define BOOST_ASIO_SSL_ERROR_HPP
13
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
15 # pragma once
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17
18 #include <boost/asio/detail/config.hpp>
19 #include <boost/system/error_code.hpp>
20 #include <boost/asio/ssl/detail/openssl_types.hpp>
21
22 #include <boost/asio/detail/push_options.hpp>
23
24 namespace boost {
25 namespace asio {
26 namespace error {
27
28 enum ssl_errors
29 {
30 // Error numbers are those produced by openssl.
31 };
32
33 extern BOOST_ASIO_DECL
34 const boost::system::error_category& get_ssl_category();
35
36 static const boost::system::error_category&
37 ssl_category BOOST_ASIO_UNUSED_VARIABLE
38 = boost::asio::error::get_ssl_category();
39
40 } // namespace error
41 namespace ssl {
42 namespace error {
43
44 enum stream_errors
45 {
46 #if defined(GENERATING_DOCUMENTATION)
47 /// The underlying stream closed before the ssl stream gracefully shut down.
48 stream_truncated
49 #elif (OPENSSL_VERSION_NUMBER < 0x10100000L) && !defined(OPENSSL_IS_BORINGSSL)
50 stream_truncated = ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SHORT_READ)
51 #else
52 stream_truncated = 1
53 #endif
54 };
55
56 extern BOOST_ASIO_DECL
57 const boost::system::error_category& get_stream_category();
58
59 static const boost::system::error_category&
60 stream_category BOOST_ASIO_UNUSED_VARIABLE
61 = boost::asio::ssl::error::get_stream_category();
62
63 } // namespace error
64 } // namespace ssl
65 } // namespace asio
66 } // namespace boost
67
68 namespace boost {
69 namespace system {
70
71 template<> struct is_error_code_enum<boost::asio::error::ssl_errors>
72 {
73 static const bool value = true;
74 };
75
76 template<> struct is_error_code_enum<boost::asio::ssl::error::stream_errors>
77 {
78 static const bool value = true;
79 };
80
81 } // namespace system
82 } // namespace boost
83
84 namespace boost {
85 namespace asio {
86 namespace error {
87
88 inline boost::system::error_code make_error_code(ssl_errors e)
89 {
90 return boost::system::error_code(
91 static_cast<int>(e), get_ssl_category());
92 }
93
94 } // namespace error
95 namespace ssl {
96 namespace error {
97
98 inline boost::system::error_code make_error_code(stream_errors e)
99 {
100 return boost::system::error_code(
101 static_cast<int>(e), get_stream_category());
102 }
103
104 } // namespace error
105 } // namespace ssl
106 } // namespace asio
107 } // namespace boost
108
109 #include <boost/asio/detail/pop_options.hpp>
110
111 #if defined(BOOST_ASIO_HEADER_ONLY)
112 # include <boost/asio/ssl/impl/error.ipp>
113 #endif // defined(BOOST_ASIO_HEADER_ONLY)
114
115 #endif // BOOST_ASIO_SSL_ERROR_HPP