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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 bool has_receive_values_; | 251 bool has_receive_values_; |
252 }; | 252 }; |
253 | 253 |
254 // QuicConfig contains non-crypto configuration options that are negotiated in | 254 // QuicConfig contains non-crypto configuration options that are negotiated in |
255 // the crypto handshake. | 255 // the crypto handshake. |
256 class NET_EXPORT_PRIVATE QuicConfig { | 256 class NET_EXPORT_PRIVATE QuicConfig { |
257 public: | 257 public: |
258 QuicConfig(); | 258 QuicConfig(); |
259 ~QuicConfig(); | 259 ~QuicConfig(); |
260 | 260 |
261 void set_congestion_feedback(const QuicTagVector& congestion_feedback, | 261 void SetCongestionFeedback(const QuicTagVector& congestion_feedback, |
262 QuicTag default_congestion_feedback); | 262 QuicTag default_congestion_feedback); |
263 | 263 |
264 QuicTag congestion_feedback() const; | 264 QuicTag CongestionFeedback() const; |
265 | 265 |
266 void SetConnectionOptionsToSend(const QuicTagVector& connection_options); | 266 void SetConnectionOptionsToSend(const QuicTagVector& connection_options); |
267 | 267 |
268 bool HasReceivedConnectionOptions() const; | 268 bool HasReceivedConnectionOptions() const; |
269 | 269 |
270 QuicTagVector ReceivedConnectionOptions() const; | 270 QuicTagVector ReceivedConnectionOptions() const; |
271 | 271 |
272 bool HasSendConnectionOptions() const; | 272 bool HasSendConnectionOptions() const; |
273 | 273 |
274 QuicTagVector SendConnectionOptions() const; | 274 QuicTagVector SendConnectionOptions() const; |
275 | 275 |
276 void set_idle_connection_state_lifetime( | 276 void SetIdleConnectionStateLifetime( |
277 QuicTime::Delta max_idle_connection_state_lifetime, | 277 QuicTime::Delta max_idle_connection_state_lifetime, |
278 QuicTime::Delta default_idle_conection_state_lifetime); | 278 QuicTime::Delta default_idle_conection_state_lifetime); |
279 | 279 |
280 QuicTime::Delta idle_connection_state_lifetime() const; | 280 QuicTime::Delta IdleConnectionStateLifetime() const; |
281 | 281 |
282 QuicTime::Delta keepalive_timeout() const; | 282 QuicTime::Delta KeepaliveTimeout() const; |
283 | 283 |
284 void set_max_streams_per_connection(size_t max_streams, | 284 void SetMaxStreamsPerConnection(size_t max_streams, size_t default_streams); |
285 size_t default_streams); | |
286 | 285 |
287 uint32 max_streams_per_connection() const; | 286 uint32 MaxStreamsPerConnection() const; |
288 | 287 |
289 void set_max_time_before_crypto_handshake( | 288 void set_max_time_before_crypto_handshake( |
290 QuicTime::Delta max_time_before_crypto_handshake); | 289 QuicTime::Delta max_time_before_crypto_handshake) { |
| 290 max_time_before_crypto_handshake_ = max_time_before_crypto_handshake; |
| 291 } |
291 | 292 |
292 QuicTime::Delta max_time_before_crypto_handshake() const; | 293 QuicTime::Delta max_time_before_crypto_handshake() const { |
| 294 return max_time_before_crypto_handshake_; |
| 295 } |
| 296 |
| 297 void set_max_idle_time_before_crypto_handshake( |
| 298 QuicTime::Delta max_idle_time_before_crypto_handshake) { |
| 299 max_idle_time_before_crypto_handshake_ = |
| 300 max_idle_time_before_crypto_handshake; |
| 301 } |
| 302 |
| 303 QuicTime::Delta max_idle_time_before_crypto_handshake() const { |
| 304 return max_idle_time_before_crypto_handshake_; |
| 305 } |
293 | 306 |
294 // Sets the peer's default initial congestion window in packets. | 307 // Sets the peer's default initial congestion window in packets. |
295 void SetInitialCongestionWindowToSend(size_t initial_window); | 308 void SetInitialCongestionWindowToSend(size_t initial_window); |
296 | 309 |
297 bool HasReceivedInitialCongestionWindow() const; | 310 bool HasReceivedInitialCongestionWindow() const; |
298 | 311 |
299 uint32 ReceivedInitialCongestionWindow() const; | 312 uint32 ReceivedInitialCongestionWindow() const; |
300 | 313 |
301 // Sets an estimated initial round trip time in us. | 314 // Sets an estimated initial round trip time in us. |
302 void SetInitialRoundTripTimeUsToSend(size_t rtt_us); | 315 void SetInitialRoundTripTimeUsToSend(size_t rtt_us); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 | 353 |
341 // Sets socket receive buffer to transmit to the peer. | 354 // Sets socket receive buffer to transmit to the peer. |
342 void SetSocketReceiveBufferToSend(uint32 window_bytes); | 355 void SetSocketReceiveBufferToSend(uint32 window_bytes); |
343 | 356 |
344 uint32 GetSocketReceiveBufferToSend() const; | 357 uint32 GetSocketReceiveBufferToSend() const; |
345 | 358 |
346 bool HasReceivedSocketReceiveBuffer() const; | 359 bool HasReceivedSocketReceiveBuffer() const; |
347 | 360 |
348 uint32 ReceivedSocketReceiveBuffer() const; | 361 uint32 ReceivedSocketReceiveBuffer() const; |
349 | 362 |
350 bool negotiated(); | 363 bool negotiated() const; |
351 | 364 |
352 // SetDefaults sets the members to sensible, default values. | 365 // SetDefaults sets the members to sensible, default values. |
353 void SetDefaults(); | 366 void SetDefaults(); |
354 | 367 |
355 // ToHandshakeMessage serialises the settings in this object as a series of | 368 // ToHandshakeMessage serialises the settings in this object as a series of |
356 // tags /value pairs and adds them to |out|. | 369 // tags /value pairs and adds them to |out|. |
357 void ToHandshakeMessage(CryptoHandshakeMessage* out) const; | 370 void ToHandshakeMessage(CryptoHandshakeMessage* out) const; |
358 | 371 |
359 // Calls ProcessPeerHello on each negotiable parameter. On failure returns | 372 // Calls ProcessPeerHello on each negotiable parameter. On failure returns |
360 // the corresponding QuicErrorCode and sets detailed error in |error_details|. | 373 // the corresponding QuicErrorCode and sets detailed error in |error_details|. |
361 QuicErrorCode ProcessPeerHello(const CryptoHandshakeMessage& peer_hello, | 374 QuicErrorCode ProcessPeerHello(const CryptoHandshakeMessage& peer_hello, |
362 HelloType hello_type, | 375 HelloType hello_type, |
363 std::string* error_details); | 376 std::string* error_details); |
364 | 377 |
365 private: | 378 private: |
366 friend class test::QuicConfigPeer; | 379 friend class test::QuicConfigPeer; |
367 | 380 |
| 381 // Configurations options that are not negotiated. |
| 382 // Maximum time the session can be alive before crypto handshake is finished. |
| 383 QuicTime::Delta max_time_before_crypto_handshake_; |
| 384 // Maximum idle time before the crypto handshake has completed. |
| 385 QuicTime::Delta max_idle_time_before_crypto_handshake_; |
| 386 |
368 // Congestion control feedback type. | 387 // Congestion control feedback type. |
369 QuicNegotiableTag congestion_feedback_; | 388 QuicNegotiableTag congestion_feedback_; |
370 // Connection options. | 389 // Connection options. |
371 QuicFixedTagVector connection_options_; | 390 QuicFixedTagVector connection_options_; |
372 // Idle connection state lifetime | 391 // Idle connection state lifetime |
373 QuicNegotiableUint32 idle_connection_state_lifetime_seconds_; | 392 QuicNegotiableUint32 idle_connection_state_lifetime_seconds_; |
374 // Keepalive timeout, or 0 to turn off keepalive probes | 393 // Keepalive timeout, or 0 to turn off keepalive probes |
375 QuicNegotiableUint32 keepalive_timeout_seconds_; | 394 QuicNegotiableUint32 keepalive_timeout_seconds_; |
376 // Maximum number of streams that the connection can support. | 395 // Maximum number of streams that the connection can support. |
377 QuicNegotiableUint32 max_streams_per_connection_; | 396 QuicNegotiableUint32 max_streams_per_connection_; |
378 // Maximum time till the session can be alive before crypto handshake is | |
379 // finished. (Not negotiated). | |
380 QuicTime::Delta max_time_before_crypto_handshake_; | |
381 // Initial congestion window in packets. | 397 // Initial congestion window in packets. |
382 QuicFixedUint32 initial_congestion_window_; | 398 QuicFixedUint32 initial_congestion_window_; |
383 // Initial round trip time estimate in microseconds. | 399 // Initial round trip time estimate in microseconds. |
384 QuicFixedUint32 initial_round_trip_time_us_; | 400 QuicFixedUint32 initial_round_trip_time_us_; |
385 | 401 |
386 // TODO(rjshade): Remove when removing QUIC_VERSION_19. | 402 // TODO(rjshade): Remove when removing QUIC_VERSION_19. |
387 // Initial flow control receive window in bytes. | 403 // Initial flow control receive window in bytes. |
388 QuicFixedUint32 initial_flow_control_window_bytes_; | 404 QuicFixedUint32 initial_flow_control_window_bytes_; |
389 | 405 |
390 // Initial stream flow control receive window in bytes. | 406 // Initial stream flow control receive window in bytes. |
391 QuicFixedUint32 initial_stream_flow_control_window_bytes_; | 407 QuicFixedUint32 initial_stream_flow_control_window_bytes_; |
392 // Initial session flow control receive window in bytes. | 408 // Initial session flow control receive window in bytes. |
393 QuicFixedUint32 initial_session_flow_control_window_bytes_; | 409 QuicFixedUint32 initial_session_flow_control_window_bytes_; |
394 | 410 |
395 // Socket receive buffer in bytes. | 411 // Socket receive buffer in bytes. |
396 QuicFixedUint32 socket_receive_buffer_; | 412 QuicFixedUint32 socket_receive_buffer_; |
397 }; | 413 }; |
398 | 414 |
399 } // namespace net | 415 } // namespace net |
400 | 416 |
401 #endif // NET_QUIC_QUIC_CONFIG_H_ | 417 #endif // NET_QUIC_QUIC_CONFIG_H_ |
OLD | NEW |