OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file contains some protocol structures for use with Spdy. | 5 // This file contains some protocol structures for use with Spdy. |
6 | 6 |
7 #ifndef NET_SPDY_SPDY_PROTOCOL_H_ | 7 #ifndef NET_SPDY_SPDY_PROTOCOL_H_ |
8 #define NET_SPDY_SPDY_PROTOCOL_H_ | 8 #define NET_SPDY_SPDY_PROTOCOL_H_ |
9 #pragma once | 9 #pragma once |
10 | 10 |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 SETTINGS_MAX_CONCURRENT_STREAMS = 0x4, | 404 SETTINGS_MAX_CONCURRENT_STREAMS = 0x4, |
405 // TCP congestion window in packets. | 405 // TCP congestion window in packets. |
406 SETTINGS_CURRENT_CWND = 0x5, | 406 SETTINGS_CURRENT_CWND = 0x5, |
407 // Downstream byte retransmission rate in percentage. | 407 // Downstream byte retransmission rate in percentage. |
408 SETTINGS_DOWNLOAD_RETRANS_RATE = 0x6, | 408 SETTINGS_DOWNLOAD_RETRANS_RATE = 0x6, |
409 // Initial window size in bytes | 409 // Initial window size in bytes |
410 SETTINGS_INITIAL_WINDOW_SIZE = 0x7 | 410 SETTINGS_INITIAL_WINDOW_SIZE = 0x7 |
411 }; | 411 }; |
412 | 412 |
413 // Status codes, as used in control frames (primarily RST_STREAM). | 413 // Status codes, as used in control frames (primarily RST_STREAM). |
| 414 // TODO(hkhalil): Rename to SpdyRstStreamStatus |
414 enum SpdyStatusCodes { | 415 enum SpdyStatusCodes { |
415 INVALID = 0, | 416 INVALID = 0, |
416 PROTOCOL_ERROR = 1, | 417 PROTOCOL_ERROR = 1, |
417 INVALID_STREAM = 2, | 418 INVALID_STREAM = 2, |
418 REFUSED_STREAM = 3, | 419 REFUSED_STREAM = 3, |
419 UNSUPPORTED_VERSION = 4, | 420 UNSUPPORTED_VERSION = 4, |
420 CANCEL = 5, | 421 CANCEL = 5, |
421 INTERNAL_ERROR = 6, | 422 INTERNAL_ERROR = 6, |
422 FLOW_CONTROL_ERROR = 7, | 423 FLOW_CONTROL_ERROR = 7, |
423 STREAM_IN_USE = 8, | 424 STREAM_IN_USE = 8, |
(...skipping 12 matching lines...) Expand all Loading... |
436 }; | 437 }; |
437 | 438 |
438 // A SPDY stream id is a 31 bit entity. | 439 // A SPDY stream id is a 31 bit entity. |
439 typedef uint32 SpdyStreamId; | 440 typedef uint32 SpdyStreamId; |
440 | 441 |
441 // A SPDY priority is a number between 0 and 7 (inclusive). | 442 // A SPDY priority is a number between 0 and 7 (inclusive). |
442 // SPDY priority range is version-dependant. For SPDY 2 and below, priority is a | 443 // SPDY priority range is version-dependant. For SPDY 2 and below, priority is a |
443 // number between 0 and 3. | 444 // number between 0 and 3. |
444 typedef uint8 SpdyPriority; | 445 typedef uint8 SpdyPriority; |
445 | 446 |
446 // SPDY Priorities. (there are only 2 bits) | |
447 #define SPDY_PRIORITY_LOWEST 3 | |
448 #define SPDY_PRIORITY_HIGHEST 0 | |
449 | |
450 // ------------------------------------------------------------------------- | 447 // ------------------------------------------------------------------------- |
451 // These structures mirror the protocol structure definitions. | 448 // These structures mirror the protocol structure definitions. |
452 | 449 |
453 // For the control data structures, we pack so that sizes match the | 450 // For the control data structures, we pack so that sizes match the |
454 // protocol over-the-wire sizes. | 451 // protocol over-the-wire sizes. |
455 #pragma pack(push) | 452 #pragma pack(push) |
456 #pragma pack(1) | 453 #pragma pack(1) |
457 | 454 |
458 // A special structure for the 8 bit flags and 24 bit length fields. | 455 // A special structure for the 8 bit flags and 24 bit length fields. |
459 union FlagsAndLength { | 456 union FlagsAndLength { |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1050 struct SpdyWindowUpdateControlFrameBlock* mutable_block() { | 1047 struct SpdyWindowUpdateControlFrameBlock* mutable_block() { |
1051 return static_cast<SpdyWindowUpdateControlFrameBlock*>(frame_); | 1048 return static_cast<SpdyWindowUpdateControlFrameBlock*>(frame_); |
1052 } | 1049 } |
1053 | 1050 |
1054 DISALLOW_COPY_AND_ASSIGN(SpdyWindowUpdateControlFrame); | 1051 DISALLOW_COPY_AND_ASSIGN(SpdyWindowUpdateControlFrame); |
1055 }; | 1052 }; |
1056 | 1053 |
1057 } // namespace net | 1054 } // namespace net |
1058 | 1055 |
1059 #endif // NET_SPDY_SPDY_PROTOCOL_H_ | 1056 #endif // NET_SPDY_SPDY_PROTOCOL_H_ |
OLD | NEW |