| 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 #include "net/quic/core/quic_framer.h" | 5 #include "net/quic/core/quic_framer.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 4886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4897 QuicStreamFrame stream_frame(kStreamId, true, kStreamOffset, | 4897 QuicStreamFrame stream_frame(kStreamId, true, kStreamOffset, |
| 4898 StringPiece("hello world!")); | 4898 StringPiece("hello world!")); |
| 4899 | 4899 |
| 4900 QuicFrames frames; | 4900 QuicFrames frames; |
| 4901 frames.push_back(QuicFrame(&stream_frame)); | 4901 frames.push_back(QuicFrame(&stream_frame)); |
| 4902 | 4902 |
| 4903 // clang-format off | 4903 // clang-format off |
| 4904 unsigned char packet[] = { | 4904 unsigned char packet[] = { |
| 4905 // public flags (version, 8 byte connection_id) | 4905 // public flags (version, 8 byte connection_id) |
| 4906 static_cast<unsigned char>( | 4906 static_cast<unsigned char>( |
| 4907 (FLAGS_quic_remove_v33_hacks && | 4907 framer_.version() > QUIC_VERSION_32 ? 0x39 : 0x3D), |
| 4908 framer_.version() > QUIC_VERSION_32) ? 0x39 : 0x3D), | |
| 4909 // connection_id | 4908 // connection_id |
| 4910 0x10, 0x32, 0x54, 0x76, 0x98, 0xBA, 0xDC, 0xFE, | 4909 0x10, 0x32, 0x54, 0x76, 0x98, 0xBA, 0xDC, 0xFE, |
| 4911 // version tag | 4910 // version tag |
| 4912 'Q', '0', GetQuicVersionDigitTens(), GetQuicVersionDigitOnes(), | 4911 'Q', '0', GetQuicVersionDigitTens(), GetQuicVersionDigitOnes(), |
| 4913 // packet number | 4912 // packet number |
| 4914 0xBC, 0x9A, 0x78, 0x56, 0x34, 0x12, | 4913 0xBC, 0x9A, 0x78, 0x56, 0x34, 0x12, |
| 4915 // private flags (entropy) | 4914 // private flags (entropy) |
| 4916 0x01, | 4915 0x01, |
| 4917 | 4916 |
| 4918 // frame type (stream frame with fin and no length) | 4917 // frame type (stream frame with fin and no length) |
| 4919 0xDF, | 4918 0xDF, |
| 4920 // stream id | 4919 // stream id |
| 4921 0x04, 0x03, 0x02, 0x01, | 4920 0x04, 0x03, 0x02, 0x01, |
| 4922 // offset | 4921 // offset |
| 4923 0x54, 0x76, 0x10, 0x32, 0xDC, 0xFE, 0x98, 0xBA, | 4922 0x54, 0x76, 0x10, 0x32, 0xDC, 0xFE, 0x98, 0xBA, |
| 4924 // data | 4923 // data |
| 4925 'h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd', '!', | 4924 'h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd', '!', |
| 4926 }; | 4925 }; |
| 4927 unsigned char packet_34[] = { | 4926 unsigned char packet_34[] = { |
| 4928 // public flags (version, 8 byte connection_id) | 4927 // public flags (version, 8 byte connection_id) |
| 4929 static_cast<unsigned char>( | 4928 0x39, |
| 4930 FLAGS_quic_remove_v33_hacks ? 0x39 : 0x3D), | |
| 4931 // connection_id | 4929 // connection_id |
| 4932 0x10, 0x32, 0x54, 0x76, 0x98, 0xBA, 0xDC, 0xFE, | 4930 0x10, 0x32, 0x54, 0x76, 0x98, 0xBA, 0xDC, 0xFE, |
| 4933 // version tag | 4931 // version tag |
| 4934 'Q', '0', GetQuicVersionDigitTens(), GetQuicVersionDigitOnes(), | 4932 'Q', '0', GetQuicVersionDigitTens(), GetQuicVersionDigitOnes(), |
| 4935 // packet number | 4933 // packet number |
| 4936 0xBC, 0x9A, 0x78, 0x56, 0x34, 0x12, | 4934 0xBC, 0x9A, 0x78, 0x56, 0x34, 0x12, |
| 4937 | 4935 |
| 4938 // frame type (stream frame with fin and no length) | 4936 // frame type (stream frame with fin and no length) |
| 4939 0xDF, | 4937 0xDF, |
| 4940 // stream id | 4938 // stream id |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5052 QuicStreamFrame stream_frame(kStreamId, true, kStreamOffset, | 5050 QuicStreamFrame stream_frame(kStreamId, true, kStreamOffset, |
| 5053 StringPiece("hello world!")); | 5051 StringPiece("hello world!")); |
| 5054 | 5052 |
| 5055 QuicFrames frames; | 5053 QuicFrames frames; |
| 5056 frames.push_back(QuicFrame(&stream_frame)); | 5054 frames.push_back(QuicFrame(&stream_frame)); |
| 5057 | 5055 |
| 5058 // clang-format off | 5056 // clang-format off |
| 5059 unsigned char packet[] = { | 5057 unsigned char packet[] = { |
| 5060 // public flags (8 byte connection_id) | 5058 // public flags (8 byte connection_id) |
| 5061 static_cast<unsigned char>( | 5059 static_cast<unsigned char>( |
| 5062 (FLAGS_quic_remove_v33_hacks && | 5060 framer_.version() > QUIC_VERSION_32 ? 0x79 : 0x7D), |
| 5063 framer_.version() > QUIC_VERSION_32) ? 0x79 : 0x7D), | |
| 5064 // connection_id | 5061 // connection_id |
| 5065 0x10, 0x32, 0x54, 0x76, | 5062 0x10, 0x32, 0x54, 0x76, |
| 5066 0x98, 0xBA, 0xDC, 0xFE, | 5063 0x98, 0xBA, 0xDC, 0xFE, |
| 5067 // version tag | 5064 // version tag |
| 5068 'Q', '0', GetQuicVersionDigitTens(), GetQuicVersionDigitOnes(), | 5065 'Q', '0', GetQuicVersionDigitTens(), GetQuicVersionDigitOnes(), |
| 5069 // path_id | 5066 // path_id |
| 5070 0x42, | 5067 0x42, |
| 5071 // packet number | 5068 // packet number |
| 5072 0xBC, 0x9A, 0x78, 0x56, | 5069 0xBC, 0x9A, 0x78, 0x56, |
| 5073 0x34, 0x12, | 5070 0x34, 0x12, |
| 5074 // private flags (entropy) | 5071 // private flags (entropy) |
| 5075 0x01, | 5072 0x01, |
| 5076 | 5073 |
| 5077 // frame type (stream frame with fin and no length) | 5074 // frame type (stream frame with fin and no length) |
| 5078 0xDF, | 5075 0xDF, |
| 5079 // stream id | 5076 // stream id |
| 5080 0x04, 0x03, 0x02, 0x01, | 5077 0x04, 0x03, 0x02, 0x01, |
| 5081 // offset | 5078 // offset |
| 5082 0x54, 0x76, 0x10, 0x32, | 5079 0x54, 0x76, 0x10, 0x32, |
| 5083 0xDC, 0xFE, 0x98, 0xBA, | 5080 0xDC, 0xFE, 0x98, 0xBA, |
| 5084 // data | 5081 // data |
| 5085 'h', 'e', 'l', 'l', | 5082 'h', 'e', 'l', 'l', |
| 5086 'o', ' ', 'w', 'o', | 5083 'o', ' ', 'w', 'o', |
| 5087 'r', 'l', 'd', '!', | 5084 'r', 'l', 'd', '!', |
| 5088 }; | 5085 }; |
| 5089 unsigned char packet_34[] = { | 5086 unsigned char packet_34[] = { |
| 5090 // public flags (8 byte connection_id) | 5087 // public flags (8 byte connection_id) |
| 5091 static_cast<unsigned char>( | 5088 0x79, |
| 5092 FLAGS_quic_remove_v33_hacks ? 0x79 : 0x7D), | |
| 5093 // connection_id | 5089 // connection_id |
| 5094 0x10, 0x32, 0x54, 0x76, | 5090 0x10, 0x32, 0x54, 0x76, |
| 5095 0x98, 0xBA, 0xDC, 0xFE, | 5091 0x98, 0xBA, 0xDC, 0xFE, |
| 5096 // version tag | 5092 // version tag |
| 5097 'Q', '0', GetQuicVersionDigitTens(), GetQuicVersionDigitOnes(), | 5093 'Q', '0', GetQuicVersionDigitTens(), GetQuicVersionDigitOnes(), |
| 5098 // path_id | 5094 // path_id |
| 5099 0x42, | 5095 0x42, |
| 5100 // packet number | 5096 // packet number |
| 5101 0xBC, 0x9A, 0x78, 0x56, | 5097 0xBC, 0x9A, 0x78, 0x56, |
| 5102 0x34, 0x12, | 5098 0x34, 0x12, |
| (...skipping 2164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7267 'o', ' ', 'w', 'o', | 7263 'o', ' ', 'w', 'o', |
| 7268 'r', 'l', 'd', '!', | 7264 'r', 'l', 'd', '!', |
| 7269 }; | 7265 }; |
| 7270 // clang-format on | 7266 // clang-format on |
| 7271 | 7267 |
| 7272 QuicFramerFuzzFunc(packet, arraysize(packet)); | 7268 QuicFramerFuzzFunc(packet, arraysize(packet)); |
| 7273 } | 7269 } |
| 7274 | 7270 |
| 7275 } // namespace test | 7271 } // namespace test |
| 7276 } // namespace net | 7272 } // namespace net |
| OLD | NEW |