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 <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 struct QuicPacketHeader; | 42 struct QuicPacketHeader; |
43 class QuicAckListenerInterface; | 43 class QuicAckListenerInterface; |
44 | 44 |
45 // Version and Crypto tags are written to the wire with a big-endian | 45 // Version and Crypto tags are written to the wire with a big-endian |
46 // representation of the name of the tag. For example | 46 // representation of the name of the tag. For example |
47 // the client hello tag (CHLO) will be written as the | 47 // the client hello tag (CHLO) will be written as the |
48 // following 4 bytes: 'C' 'H' 'L' 'O'. Since it is | 48 // following 4 bytes: 'C' 'H' 'L' 'O'. Since it is |
49 // stored in memory as a little endian uint32_t, we need | 49 // stored in memory as a little endian uint32_t, we need |
50 // to reverse the order of the bytes. | 50 // to reverse the order of the bytes. |
51 | 51 |
52 // MakeQuicTag returns a value given the four bytes. For example: | |
53 // MakeQuicTag('C', 'H', 'L', 'O'); | |
54 NET_EXPORT_PRIVATE QuicTag MakeQuicTag(char a, char b, char c, char d); | |
55 | |
56 // Returns true if the tag vector contains the specified tag. | |
57 NET_EXPORT_PRIVATE bool ContainsQuicTag(const QuicTagVector& tag_vector, | |
58 QuicTag tag); | |
59 | |
60 // Size in bytes of the data packet header. | 52 // Size in bytes of the data packet header. |
61 NET_EXPORT_PRIVATE size_t GetPacketHeaderSize(QuicVersion version, | 53 NET_EXPORT_PRIVATE size_t GetPacketHeaderSize(QuicVersion version, |
62 const QuicPacketHeader& header); | 54 const QuicPacketHeader& header); |
63 | 55 |
64 NET_EXPORT_PRIVATE size_t | 56 NET_EXPORT_PRIVATE size_t |
65 GetPacketHeaderSize(QuicVersion version, | 57 GetPacketHeaderSize(QuicVersion version, |
66 QuicConnectionIdLength connection_id_length, | 58 QuicConnectionIdLength connection_id_length, |
67 bool include_version, | 59 bool include_version, |
68 bool include_path_id, | 60 bool include_path_id, |
69 bool include_diversification_nonce, | 61 bool include_diversification_nonce, |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 QuicPathId path_id; | 752 QuicPathId path_id; |
761 bool has_crypto_handshake; | 753 bool has_crypto_handshake; |
762 int num_padding_bytes; | 754 int num_padding_bytes; |
763 EncryptionLevel encryption_level; | 755 EncryptionLevel encryption_level; |
764 QuicPacketNumberLength packet_number_length; | 756 QuicPacketNumberLength packet_number_length; |
765 }; | 757 }; |
766 | 758 |
767 } // namespace net | 759 } // namespace net |
768 | 760 |
769 #endif // NET_QUIC_QUIC_PROTOCOL_H_ | 761 #endif // NET_QUIC_QUIC_PROTOCOL_H_ |
OLD | NEW |