Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Side by Side Diff: net/tools/quic/quic_packet_printer_bin.cc

Issue 2236973002: Landing Recent QUIC changes until 4AM, Aug 7, 2016 UTC-4 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: flip quic_sequencer_buffer_retire_block_in_time to true Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/tools/quic/quic_dispatcher_test.cc ('k') | net/tools/quic/quic_packet_reader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // clang-format off 5 // clang-format off
6 6
7 // Dumps out the decryptable contents of a QUIC packet in a human-readable way. 7 // Dumps out the decryptable contents of a QUIC packet in a human-readable way.
8 // If the packet is null encrypted, this will dump full packet contents. 8 // If the packet is null encrypted, this will dump full packet contents.
9 // Otherwise it will dump the public header, and fail with an error that the 9 // Otherwise it will dump the public header, and fail with an error that the
10 // packet is undecryptable. 10 // packet is undecryptable.
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 if (perspective_string == "client") { 177 if (perspective_string == "client") {
178 perspective = net::Perspective::IS_CLIENT; 178 perspective = net::Perspective::IS_CLIENT;
179 } else if (perspective_string == "server") { 179 } else if (perspective_string == "server") {
180 perspective = net::Perspective::IS_SERVER; 180 perspective = net::Perspective::IS_SERVER;
181 } else { 181 } else {
182 cerr << "Invalid perspective. " << perspective_string 182 cerr << "Invalid perspective. " << perspective_string
183 << " Usage: " << args[0] << " client|server <hex>\n"; 183 << " Usage: " << args[0] << " client|server <hex>\n";
184 return 1; 184 return 1;
185 } 185 }
186 string hex = net::QuicUtils::HexDecode(ArgToString(args[1])); 186 string hex = net::QuicUtils::HexDecode(ArgToString(args[1]));
187 net::QuicVersionVector versions = net::QuicSupportedVersions(); 187 net::QuicVersionVector versions = net::AllSupportedVersions();
188 // Fake a time since we're not actually generating acks. 188 // Fake a time since we're not actually generating acks.
189 net::QuicTime start(net::QuicTime::Zero()); 189 net::QuicTime start(net::QuicTime::Zero());
190 net::QuicFramer framer(versions, start, perspective); 190 net::QuicFramer framer(versions, start, perspective);
191 if (!FLAGS_quic_version.empty()) { 191 if (!FLAGS_quic_version.empty()) {
192 for (net::QuicVersion version : versions) { 192 for (net::QuicVersion version : versions) {
193 if (net::QuicVersionToString(version) == FLAGS_quic_version) { 193 if (net::QuicVersionToString(version) == FLAGS_quic_version) {
194 framer.set_version(version); 194 framer.set_version(version);
195 } 195 }
196 } 196 }
197 } 197 }
198 net::QuicPacketPrinter visitor(&framer); 198 net::QuicPacketPrinter visitor(&framer);
199 framer.set_visitor(&visitor); 199 framer.set_visitor(&visitor);
200 net::QuicEncryptedPacket encrypted(hex.c_str(), hex.length()); 200 net::QuicEncryptedPacket encrypted(hex.c_str(), hex.length());
201 return framer.ProcessPacket(encrypted); 201 return framer.ProcessPacket(encrypted);
202 } 202 }
OLDNEW
« no previous file with comments | « net/tools/quic/quic_dispatcher_test.cc ('k') | net/tools/quic/quic_packet_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698