OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 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_QUIC_QUIC_CONFIG_H_ |
| 6 #define NET_QUIC_QUIC_CONFIG_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "net/quic/crypto/crypto_handshake.h" |
| 11 #include "net/quic/crypto/crypto_utils.h" |
| 12 #include "net/quic/quic_time.h" |
| 13 |
| 14 namespace net { |
| 15 |
| 16 // QuicNegotiatedParameters contains non-crypto parameters that are agreed upon |
| 17 // during the crypto handshake. |
| 18 class NET_EXPORT_PRIVATE QuicNegotiatedParameters { |
| 19 public: |
| 20 QuicNegotiatedParameters(); |
| 21 |
| 22 CryptoTag congestion_control; |
| 23 QuicTime::Delta idle_connection_state_lifetime; |
| 24 QuicTime::Delta keepalive_timeout; |
| 25 }; |
| 26 |
| 27 // QuicConfig contains non-crypto configuration options that are negotiated in |
| 28 // the crypto handshake. |
| 29 class NET_EXPORT_PRIVATE QuicConfig { |
| 30 public: |
| 31 QuicConfig(); |
| 32 ~QuicConfig(); |
| 33 |
| 34 // SetDefaults sets the members to sensible, default values. |
| 35 void SetDefaults(); |
| 36 |
| 37 // SetFromMessage extracts the non-crypto configuration from |msg| and sets |
| 38 // the members of this object to match. This is expected to be called in the |
| 39 // case of a server which is loading a server config. The server config |
| 40 // contains the non-crypto parameters and so the server will need to keep its |
| 41 // QuicConfig in sync with the server config that it'll be sending to |
| 42 // clients. |
| 43 bool SetFromHandshakeMessage(const CryptoHandshakeMessage& scfg); |
| 44 |
| 45 // ToHandshakeMessage serializes the settings in this object as a series of |
| 46 // tags /value pairs and adds them to |out|. |
| 47 void ToHandshakeMessage(CryptoHandshakeMessage* out) const; |
| 48 |
| 49 QuicErrorCode ProcessFinalPeerHandshake( |
| 50 const CryptoHandshakeMessage& peer_handshake, |
| 51 CryptoUtils::Priority priority, |
| 52 QuicNegotiatedParameters* out_params, |
| 53 std::string* error_details) const; |
| 54 |
| 55 private: |
| 56 // Congestion control feedback type. |
| 57 CryptoTagVector congestion_control_; |
| 58 // Idle connection state lifetime |
| 59 QuicTime::Delta idle_connection_state_lifetime_; |
| 60 // Keepalive timeout, or 0 to turn off keepalive probes |
| 61 QuicTime::Delta keepalive_timeout_; |
| 62 }; |
| 63 |
| 64 } // namespace net |
| 65 |
| 66 #endif // NET_QUIC_QUIC_CONFIG_H_ |
OLD | NEW |