xref: /aosp_15_r20/external/cronet/net/tools/quic/quic_simple_server_session_helper.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2012 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef NET_TOOLS_QUIC_QUIC_SIMPLE_SERVER_SESSION_HELPER_H_
6 #define NET_TOOLS_QUIC_QUIC_SIMPLE_SERVER_SESSION_HELPER_H_
7 
8 #include "net/third_party/quiche/src/quiche/quic/core/crypto/quic_random.h"
9 #include "net/third_party/quiche/src/quiche/quic/core/http/quic_server_session_base.h"
10 
11 namespace net {
12 
13 // Simple helper for server sessions which generates a new random
14 // connection ID for stateless rejects.
15 class QuicSimpleServerSessionHelper
16     : public quic::QuicCryptoServerStreamBase::Helper {
17  public:
18   explicit QuicSimpleServerSessionHelper(quic::QuicRandom* random);
19 
20   ~QuicSimpleServerSessionHelper() override;
21 
22   bool CanAcceptClientHello(const quic::CryptoHandshakeMessage& message,
23                             const quic::QuicSocketAddress& client_address,
24                             const quic::QuicSocketAddress& peer_address,
25                             const quic::QuicSocketAddress& self_address,
26                             std::string* error_details) const override;
27 };
28 
29 }  // namespace net
30 
31 #endif  // NET_TOOLS_QUIC_QUIC_SIMPLE_SERVER_SESSION_HELPER_H_
32