Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(301)

Side by Side Diff: net/quic/quic_config.h

Issue 2011933002: Add alternate server address to QuicConfig. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@122546126
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/crypto/crypto_protocol.h ('k') | net/quic/quic_config.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 HelloType hello_type, 208 HelloType hello_type,
209 std::string* error_details) override; 209 std::string* error_details) override;
210 210
211 private: 211 private:
212 QuicTagVector send_values_; 212 QuicTagVector send_values_;
213 bool has_send_values_; 213 bool has_send_values_;
214 QuicTagVector receive_values_; 214 QuicTagVector receive_values_;
215 bool has_receive_values_; 215 bool has_receive_values_;
216 }; 216 };
217 217
218 // Stores IPEndPoint from CHLO or SHLO messages that are not negotiated.
219 class QuicFixedIPEndPoint : public QuicConfigValue {
220 public:
221 QuicFixedIPEndPoint(QuicTag tag, QuicConfigPresence presence);
222 ~QuicFixedIPEndPoint() override;
223
224 bool HasSendValue() const;
225
226 const IPEndPoint& GetSendValue() const;
227
228 void SetSendValue(const IPEndPoint& value);
229
230 bool HasReceivedValue() const;
231
232 const IPEndPoint& GetReceivedValue() const;
233
234 void SetReceivedValue(const IPEndPoint& value);
235
236 void ToHandshakeMessage(CryptoHandshakeMessage* out) const override;
237
238 QuicErrorCode ProcessPeerHello(const CryptoHandshakeMessage& peer_hello,
239 HelloType hello_type,
240 std::string* error_details) override;
241
242 private:
243 IPEndPoint send_value_;
244 bool has_send_value_;
245 IPEndPoint receive_value_;
246 bool has_receive_value_;
247 };
248
218 // QuicConfig contains non-crypto configuration options that are negotiated in 249 // QuicConfig contains non-crypto configuration options that are negotiated in
219 // the crypto handshake. 250 // the crypto handshake.
220 class NET_EXPORT_PRIVATE QuicConfig { 251 class NET_EXPORT_PRIVATE QuicConfig {
221 public: 252 public:
222 QuicConfig(); 253 QuicConfig();
223 QuicConfig(const QuicConfig& other); 254 QuicConfig(const QuicConfig& other);
224 ~QuicConfig(); 255 ~QuicConfig();
225 256
226 void SetConnectionOptionsToSend(const QuicTagVector& connection_options); 257 void SetConnectionOptionsToSend(const QuicTagVector& connection_options);
227 258
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 uint32_t ReceivedSocketReceiveBuffer() const; 363 uint32_t ReceivedSocketReceiveBuffer() const;
333 364
334 void SetMultipathEnabled(bool multipath_enabled); 365 void SetMultipathEnabled(bool multipath_enabled);
335 366
336 bool MultipathEnabled() const; 367 bool MultipathEnabled() const;
337 368
338 void SetDisableConnectionMigration(); 369 void SetDisableConnectionMigration();
339 370
340 bool DisableConnectionMigration() const; 371 bool DisableConnectionMigration() const;
341 372
373 void SetAlternateServerAddressToSend(
374 const IPEndPoint& alternate_server_address);
375
376 bool HasReceivedAlternateServerAddress() const;
377
378 const IPEndPoint& ReceivedAlternateServerAddress() const;
379
342 bool negotiated() const; 380 bool negotiated() const;
343 381
344 // ToHandshakeMessage serialises the settings in this object as a series of 382 // ToHandshakeMessage serialises the settings in this object as a series of
345 // tags /value pairs and adds them to |out|. 383 // tags /value pairs and adds them to |out|.
346 void ToHandshakeMessage(CryptoHandshakeMessage* out) const; 384 void ToHandshakeMessage(CryptoHandshakeMessage* out) const;
347 385
348 // Calls ProcessPeerHello on each negotiable parameter. On failure returns 386 // Calls ProcessPeerHello on each negotiable parameter. On failure returns
349 // the corresponding QuicErrorCode and sets detailed error in |error_details|. 387 // the corresponding QuicErrorCode and sets detailed error in |error_details|.
350 QuicErrorCode ProcessPeerHello(const CryptoHandshakeMessage& peer_hello, 388 QuicErrorCode ProcessPeerHello(const CryptoHandshakeMessage& peer_hello,
351 HelloType hello_type, 389 HelloType hello_type,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 423
386 // Socket receive buffer in bytes. 424 // Socket receive buffer in bytes.
387 // TODO(ianswett): Deprecate once QUIC_VERSION_34 is deprecated. 425 // TODO(ianswett): Deprecate once QUIC_VERSION_34 is deprecated.
388 QuicFixedUint32 socket_receive_buffer_; 426 QuicFixedUint32 socket_receive_buffer_;
389 427
390 // Whether to support multipath for this connection. 428 // Whether to support multipath for this connection.
391 QuicNegotiableUint32 multipath_enabled_; 429 QuicNegotiableUint32 multipath_enabled_;
392 430
393 // Whether tell peer not to attempt connection migration. 431 // Whether tell peer not to attempt connection migration.
394 QuicFixedUint32 connection_migration_disabled_; 432 QuicFixedUint32 connection_migration_disabled_;
433
434 // An alternate server address the client could connect to.
435 QuicFixedIPEndPoint alternate_server_address_;
395 }; 436 };
396 437
397 } // namespace net 438 } // namespace net
398 439
399 #endif // NET_QUIC_QUIC_CONFIG_H_ 440 #endif // NET_QUIC_QUIC_CONFIG_H_
OLDNEW
« no previous file with comments | « net/quic/crypto/crypto_protocol.h ('k') | net/quic/quic_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698