| 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. |
| 11 // | 11 // |
| 12 // Usage: quic_packet_printer server|client <hex dump of packet> | 12 // Usage: quic_packet_printer server|client <hex dump of packet> |
| 13 // | 13 // |
| 14 // Example input: | 14 // Example input: |
| 15 // quic_packet_printer server 0c6b810308320f24c004a939a38a2e3fd6ca589917f200400 | 15 // quic_packet_printer server 0c6b810308320f24c004a939a38a2e3fd6ca589917f200400 |
| 16 // 201b80b0100501c0700060003023d0000001c00556e656e637279707465642073747265616d2 | 16 // 201b80b0100501c0700060003023d0000001c00556e656e637279707465642073747265616d2 |
| 17 // 064617461207365656e | 17 // 064617461207365656e |
| 18 // | 18 // |
| 19 // Example output: | 19 // Example output: |
| 20 // OnPacket | 20 // OnPacket |
| 21 // OnUnauthenticatedPublicHeader | 21 // OnUnauthenticatedPublicHeader |
| 22 // OnUnauthenticatedHeader: { connection_id: 13845207862000976235, | 22 // OnUnauthenticatedHeader: { connection_id: 13845207862000976235, |
| 23 // connection_id_length:8, packet_number_length:1, multipath_flag: 0, | 23 // connection_id_length:8, packet_number_length:1, multipath_flag: 0, |
| 24 // reset_flag: 0, version_flag: 0, entropy_flag: 0, entropy hash: 0, path_id: , | 24 // reset_flag: 0, version_flag: 0, path_id: , packet_number: 4} |
| 25 // packet_number: 4} | |
| 26 // OnDecryptedPacket | 25 // OnDecryptedPacket |
| 27 // OnPacketHeader | 26 // OnPacketHeader |
| 28 // OnAckFrame: entropy_hash: 2 largest_observed: 1 ack_delay_time: 3000 | 27 // OnAckFrame: largest_observed: 1 ack_delay_time: 3000 |
| 29 // missing_packets: [ ] is_truncated: 0 received_packets: [ 1 at 466016 ] | 28 // missing_packets: [ ] is_truncated: 0 received_packets: [ 1 at 466016 ] |
| 30 // OnStopWaitingFrame | 29 // OnStopWaitingFrame |
| 31 // OnConnectionCloseFrame: error_code { 61 } error_details { Unencrypted stream | 30 // OnConnectionCloseFrame: error_code { 61 } error_details { Unencrypted stream |
| 32 // data seen } | 31 // data seen } |
| 33 | 32 |
| 34 // clang-format on | 33 // clang-format on |
| 35 | 34 |
| 36 #include <iostream> | 35 #include <iostream> |
| 37 #include <string> | 36 #include <string> |
| 38 | 37 |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 if (net::QuicVersionToString(version) == FLAGS_quic_version) { | 191 if (net::QuicVersionToString(version) == FLAGS_quic_version) { |
| 193 framer.set_version(version); | 192 framer.set_version(version); |
| 194 } | 193 } |
| 195 } | 194 } |
| 196 } | 195 } |
| 197 net::QuicPacketPrinter visitor(&framer); | 196 net::QuicPacketPrinter visitor(&framer); |
| 198 framer.set_visitor(&visitor); | 197 framer.set_visitor(&visitor); |
| 199 net::QuicEncryptedPacket encrypted(hex.c_str(), hex.length()); | 198 net::QuicEncryptedPacket encrypted(hex.c_str(), hex.length()); |
| 200 return framer.ProcessPacket(encrypted); | 199 return framer.ProcessPacket(encrypted); |
| 201 } | 200 } |
| OLD | NEW |