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_CRYPTO_CRYPTO_HANDSHAKE_MESSAGE_H_ | 5 #ifndef NET_QUIC_CRYPTO_CRYPTO_HANDSHAKE_MESSAGE_H_ |
6 #define NET_QUIC_CRYPTO_CRYPTO_HANDSHAKE_MESSAGE_H_ | 6 #define NET_QUIC_CRYPTO_CRYPTO_HANDSHAKE_MESSAGE_H_ |
7 | 7 |
| 8 #include <stddef.h> |
| 9 #include <stdint.h> |
| 10 |
8 #include <string> | 11 #include <string> |
9 #include <vector> | 12 #include <vector> |
10 | 13 |
11 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
12 #include "base/strings/string_piece.h" | 15 #include "base/strings/string_piece.h" |
13 #include "net/base/net_export.h" | 16 #include "net/base/net_export.h" |
14 #include "net/quic/quic_protocol.h" | 17 #include "net/quic/quic_protocol.h" |
15 | 18 |
16 namespace net { | 19 namespace net { |
17 | 20 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 size_t* out_len) const; | 84 size_t* out_len) const; |
82 | 85 |
83 bool GetStringPiece(QuicTag tag, base::StringPiece* out) const; | 86 bool GetStringPiece(QuicTag tag, base::StringPiece* out) const; |
84 | 87 |
85 // GetNthValue24 interprets the value with the given tag to be a series of | 88 // GetNthValue24 interprets the value with the given tag to be a series of |
86 // 24-bit, length prefixed values and it returns the subvalue with the given | 89 // 24-bit, length prefixed values and it returns the subvalue with the given |
87 // index. | 90 // index. |
88 QuicErrorCode GetNthValue24(QuicTag tag, | 91 QuicErrorCode GetNthValue24(QuicTag tag, |
89 unsigned index, | 92 unsigned index, |
90 base::StringPiece* out) const; | 93 base::StringPiece* out) const; |
91 QuicErrorCode GetUint32(QuicTag tag, uint32* out) const; | 94 QuicErrorCode GetUint32(QuicTag tag, uint32_t* out) const; |
92 QuicErrorCode GetUint64(QuicTag tag, uint64* out) const; | 95 QuicErrorCode GetUint64(QuicTag tag, uint64_t* out) const; |
93 | 96 |
94 // size returns 4 (message tag) + 2 (uint16, number of entries) + | 97 // size returns 4 (message tag) + 2 (uint16_t, number of entries) + |
95 // (4 (tag) + 4 (end offset))*tag_value_map_.size() + ∑ value sizes. | 98 // (4 (tag) + 4 (end offset))*tag_value_map_.size() + ∑ value sizes. |
96 size_t size() const; | 99 size_t size() const; |
97 | 100 |
98 // set_minimum_size sets the minimum number of bytes that the message should | 101 // set_minimum_size sets the minimum number of bytes that the message should |
99 // consume. The CryptoFramer will add a PAD tag as needed when serializing in | 102 // consume. The CryptoFramer will add a PAD tag as needed when serializing in |
100 // order to ensure this. Setting a value of 0 disables padding. | 103 // order to ensure this. Setting a value of 0 disables padding. |
101 // | 104 // |
102 // Padding is useful in order to ensure that messages are a minimum size. A | 105 // Padding is useful in order to ensure that messages are a minimum size. A |
103 // QUIC server can require a minimum size in order to reduce the | 106 // QUIC server can require a minimum size in order to reduce the |
104 // amplification factor of any mirror DoS attack. | 107 // amplification factor of any mirror DoS attack. |
(...skipping 23 matching lines...) Expand all Loading... |
128 size_t minimum_size_; | 131 size_t minimum_size_; |
129 | 132 |
130 // The serialized form of the handshake message. This member is constructed | 133 // The serialized form of the handshake message. This member is constructed |
131 // lasily. | 134 // lasily. |
132 mutable scoped_ptr<QuicData> serialized_; | 135 mutable scoped_ptr<QuicData> serialized_; |
133 }; | 136 }; |
134 | 137 |
135 } // namespace net | 138 } // namespace net |
136 | 139 |
137 #endif // NET_QUIC_CRYPTO_CRYPTO_HANDSHAKE_MESSAGE_H_ | 140 #endif // NET_QUIC_CRYPTO_CRYPTO_HANDSHAKE_MESSAGE_H_ |
OLD | NEW |