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 #ifndef NET_QUIC_QUIC_PROTOCOL_H_ | 5 #ifndef NET_QUIC_QUIC_PROTOCOL_H_ |
6 #define NET_QUIC_QUIC_PROTOCOL_H_ | 6 #define NET_QUIC_QUIC_PROTOCOL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <limits> | 9 #include <limits> |
10 #include <map> | 10 #include <map> |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 // representation of the name of the tag. For example | 311 // representation of the name of the tag. For example |
312 // the client hello tag (CHLO) will be written as the | 312 // the client hello tag (CHLO) will be written as the |
313 // following 4 bytes: 'C' 'H' 'L' 'O'. Since it is | 313 // following 4 bytes: 'C' 'H' 'L' 'O'. Since it is |
314 // stored in memory as a little endian uint32, we need | 314 // stored in memory as a little endian uint32, we need |
315 // to reverse the order of the bytes. | 315 // to reverse the order of the bytes. |
316 | 316 |
317 // MakeQuicTag returns a value given the four bytes. For example: | 317 // MakeQuicTag returns a value given the four bytes. For example: |
318 // MakeQuicTag('C', 'H', 'L', 'O'); | 318 // MakeQuicTag('C', 'H', 'L', 'O'); |
319 NET_EXPORT_PRIVATE QuicTag MakeQuicTag(char a, char b, char c, char d); | 319 NET_EXPORT_PRIVATE QuicTag MakeQuicTag(char a, char b, char c, char d); |
320 | 320 |
| 321 // Returns true if the tag vector contains the specified tag. |
| 322 bool ContainsQuicTag(QuicTagVector tag_vector, QuicTag tag); |
| 323 |
321 // Size in bytes of the data or fec packet header. | 324 // Size in bytes of the data or fec packet header. |
322 NET_EXPORT_PRIVATE size_t GetPacketHeaderSize(const QuicPacketHeader& header); | 325 NET_EXPORT_PRIVATE size_t GetPacketHeaderSize(const QuicPacketHeader& header); |
323 | 326 |
324 NET_EXPORT_PRIVATE size_t GetPacketHeaderSize( | 327 NET_EXPORT_PRIVATE size_t GetPacketHeaderSize( |
325 QuicConnectionIdLength connection_id_length, | 328 QuicConnectionIdLength connection_id_length, |
326 bool include_version, | 329 bool include_version, |
327 QuicSequenceNumberLength sequence_number_length, | 330 QuicSequenceNumberLength sequence_number_length, |
328 InFecGroup is_in_fec_group); | 331 InFecGroup is_in_fec_group); |
329 | 332 |
330 // Index of the first byte in a QUIC packet of FEC protected data. | 333 // Index of the first byte in a QUIC packet of FEC protected data. |
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1076 WriteStatus status; | 1079 WriteStatus status; |
1077 union { | 1080 union { |
1078 int bytes_written; // only valid when status is OK | 1081 int bytes_written; // only valid when status is OK |
1079 int error_code; // only valid when status is ERROR | 1082 int error_code; // only valid when status is ERROR |
1080 }; | 1083 }; |
1081 }; | 1084 }; |
1082 | 1085 |
1083 } // namespace net | 1086 } // namespace net |
1084 | 1087 |
1085 #endif // NET_QUIC_QUIC_PROTOCOL_H_ | 1088 #endif // NET_QUIC_QUIC_PROTOCOL_H_ |
OLD | NEW |