OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_QUIC_QUIC_CONFIG_H_ | 5 #ifndef NET_QUIC_QUIC_CONFIG_H_ |
6 #define NET_QUIC_QUIC_CONFIG_H_ | 6 #define NET_QUIC_QUIC_CONFIG_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 QuicErrorCode ProcessPeerHello(const CryptoHandshakeMessage& peer_hello, | 107 QuicErrorCode ProcessPeerHello(const CryptoHandshakeMessage& peer_hello, |
108 HelloType hello_type, | 108 HelloType hello_type, |
109 std::string* error_details) override; | 109 std::string* error_details) override; |
110 | 110 |
111 private: | 111 private: |
112 uint32_t max_value_; | 112 uint32_t max_value_; |
113 uint32_t default_value_; | 113 uint32_t default_value_; |
114 uint32_t negotiated_value_; | 114 uint32_t negotiated_value_; |
115 }; | 115 }; |
116 | 116 |
117 class NET_EXPORT_PRIVATE QuicNegotiableTag : public QuicNegotiableValue { | |
118 public: | |
119 QuicNegotiableTag(QuicTag name, QuicConfigPresence presence); | |
120 ~QuicNegotiableTag() override; | |
121 | |
122 // Sets the possible values that |negotiated_tag_| can take after negotiation | |
123 // and the default value that |negotiated_tag_| takes if OPTIONAL and *HLO | |
124 // msg doesn't contain tag |name_|. | |
125 void set(const QuicTagVector& possible_values, QuicTag default_value); | |
126 | |
127 // Serialises |name_| and vector (either possible or negotiated) to |out|. If | |
128 // |negotiated_| is true then |negotiated_tag_| is serialised, otherwise | |
129 // |possible_values_| is serialised. | |
130 void ToHandshakeMessage(CryptoHandshakeMessage* out) const override; | |
131 | |
132 // Selects the tag common to both tags in |client_hello| for |name_| and | |
133 // |possible_values_| with preference to tag in |possible_values_|. The | |
134 // selected tag is set as |negotiated_tag_|. | |
135 QuicErrorCode ProcessPeerHello(const CryptoHandshakeMessage& peer_hello, | |
136 HelloType hello_type, | |
137 std::string* error_details) override; | |
138 | |
139 private: | |
140 // Reads the vector corresponding to |name_| from |msg| into |out|. If the | |
141 // |name_| is absent in |msg| and |presence_| is set to OPTIONAL |out| is set | |
142 // to |possible_values_|. | |
143 QuicErrorCode ReadVector(const CryptoHandshakeMessage& msg, | |
144 const QuicTag** out, | |
145 size_t* out_length, | |
146 std::string* error_details) const; | |
147 | |
148 QuicTag negotiated_tag_; | |
149 QuicTagVector possible_values_; | |
150 QuicTag default_value_; | |
151 }; | |
152 | |
153 // Stores uint32_t from CHLO or SHLO messages that are not negotiated. | 117 // Stores uint32_t from CHLO or SHLO messages that are not negotiated. |
154 class NET_EXPORT_PRIVATE QuicFixedUint32 : public QuicConfigValue { | 118 class NET_EXPORT_PRIVATE QuicFixedUint32 : public QuicConfigValue { |
155 public: | 119 public: |
156 QuicFixedUint32(QuicTag name, QuicConfigPresence presence); | 120 QuicFixedUint32(QuicTag name, QuicConfigPresence presence); |
157 ~QuicFixedUint32() override; | 121 ~QuicFixedUint32() override; |
158 | 122 |
159 bool HasSendValue() const; | 123 bool HasSendValue() const; |
160 | 124 |
161 uint32_t GetSendValue() const; | 125 uint32_t GetSendValue() const; |
162 | 126 |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 // An alternate server address the client could connect to. | 421 // An alternate server address the client could connect to. |
458 QuicFixedIPEndPoint alternate_server_address_; | 422 QuicFixedIPEndPoint alternate_server_address_; |
459 | 423 |
460 // Force HOL blocking for measurement purposes. | 424 // Force HOL blocking for measurement purposes. |
461 QuicFixedUint32 force_hol_blocking_; | 425 QuicFixedUint32 force_hol_blocking_; |
462 }; | 426 }; |
463 | 427 |
464 } // namespace net | 428 } // namespace net |
465 | 429 |
466 #endif // NET_QUIC_QUIC_CONFIG_H_ | 430 #endif // NET_QUIC_QUIC_CONFIG_H_ |
OLD | NEW |