| 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 // 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 22 matching lines...) Expand all Loading... |
| 33 // data seen } | 33 // data seen } |
| 34 | 34 |
| 35 // clang-format on | 35 // clang-format on |
| 36 | 36 |
| 37 #include <iostream> | 37 #include <iostream> |
| 38 #include <string> | 38 #include <string> |
| 39 | 39 |
| 40 #include "base/command_line.h" | 40 #include "base/command_line.h" |
| 41 #include "base/strings/string_number_conversions.h" | 41 #include "base/strings/string_number_conversions.h" |
| 42 #include "base/strings/utf_string_conversions.h" | 42 #include "base/strings/utf_string_conversions.h" |
| 43 #include "net/quic/quic_framer.h" | 43 #include "net/quic/core/quic_framer.h" |
| 44 #include "net/quic/quic_utils.h" | 44 #include "net/quic/core/quic_utils.h" |
| 45 | 45 |
| 46 using std::cerr; | 46 using std::cerr; |
| 47 using std::string; | 47 using std::string; |
| 48 | 48 |
| 49 // If set, specify the QUIC version to use. | 49 // If set, specify the QUIC version to use. |
| 50 string FLAGS_quic_version = ""; | 50 string FLAGS_quic_version = ""; |
| 51 | 51 |
| 52 namespace { | 52 namespace { |
| 53 | 53 |
| 54 string ArgToString(base::CommandLine::StringType arg) { | 54 string ArgToString(base::CommandLine::StringType arg) { |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| OLD | NEW |