File indexing completed on 2025-01-18 09:29:33
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_BEAST_WEBSOCKET_DETAIL_MASK_HPP
0011 #define BOOST_BEAST_WEBSOCKET_DETAIL_MASK_HPP
0012
0013 #include <boost/beast/core/detail/config.hpp>
0014 #include <boost/beast/core/buffers_range.hpp>
0015 #include <boost/asio/buffer.hpp>
0016 #include <array>
0017 #include <climits>
0018 #include <cstdint>
0019 #include <random>
0020 #include <type_traits>
0021
0022 namespace boost {
0023 namespace beast {
0024 namespace websocket {
0025 namespace detail {
0026
0027 using prepared_key = std::array<unsigned char, 4>;
0028
0029 BOOST_BEAST_DECL
0030 void
0031 prepare_key(prepared_key& prepared, std::uint32_t key);
0032
0033
0034
0035 BOOST_BEAST_DECL
0036 void
0037 mask_inplace(net::mutable_buffer const& b, prepared_key& key);
0038
0039
0040
0041 template<class MutableBufferSequence>
0042 void
0043 mask_inplace(
0044 MutableBufferSequence const& buffers,
0045 prepared_key& key)
0046 {
0047 for(net::mutable_buffer b :
0048 beast::buffers_range_ref(buffers))
0049 detail::mask_inplace(b, key);
0050 }
0051
0052 }
0053 }
0054 }
0055 }
0056
0057
0058 #if BOOST_BEAST_HEADER_ONLY
0059 #include <boost/beast/websocket/detail/mask.ipp>
0060 #endif
0061
0062
0063 #endif