Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:29:33

0001 //
0002 // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
0003 //
0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0005 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 // Official repository: https://github.com/boostorg/beast
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 // Apply mask in place
0034 //
0035 BOOST_BEAST_DECL
0036 void
0037 mask_inplace(net::mutable_buffer const& b, prepared_key& key);
0038 
0039 // Apply mask in place
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 } // detail
0053 } // websocket
0054 } // beast
0055 } // boost
0056 
0057 
0058 #if BOOST_BEAST_HEADER_ONLY
0059 #include <boost/beast/websocket/detail/mask.ipp>
0060 #endif
0061 
0062 
0063 #endif