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 #include "net/quic/crypto/crypto_handshake_message.h" | 5 #include "net/quic/crypto/crypto_handshake_message.h" |
6 | 6 |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "net/quic/crypto/crypto_framer.h" | 9 #include "net/quic/crypto/crypto_framer.h" |
10 #include "net/quic/crypto/crypto_protocol.h" | 10 #include "net/quic/crypto/crypto_protocol.h" |
| 11 #include "net/quic/quic_socket_address_coder.h" |
11 #include "net/quic/quic_utils.h" | 12 #include "net/quic/quic_utils.h" |
12 | 13 |
13 using base::StringPiece; | 14 using base::StringPiece; |
14 using base::StringPrintf; | 15 using base::StringPrintf; |
15 using std::string; | 16 using std::string; |
16 using std::vector; | 17 using std::vector; |
17 | 18 |
18 namespace net { | 19 namespace net { |
19 | 20 |
20 CryptoHandshakeMessage::CryptoHandshakeMessage() | 21 CryptoHandshakeMessage::CryptoHandshakeMessage() |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 QuicTag tag; | 272 QuicTag tag; |
272 memcpy(&tag, it->second.data() + j, sizeof(tag)); | 273 memcpy(&tag, it->second.data() + j, sizeof(tag)); |
273 if (j > 0) { | 274 if (j > 0) { |
274 ret += ","; | 275 ret += ","; |
275 } | 276 } |
276 ret += "'" + QuicUtils::TagToString(tag) + "'"; | 277 ret += "'" + QuicUtils::TagToString(tag) + "'"; |
277 } | 278 } |
278 done = true; | 279 done = true; |
279 } | 280 } |
280 break; | 281 break; |
| 282 case kCADR: |
| 283 // IP address and port |
| 284 if (!it->second.empty()) { |
| 285 QuicSocketAddressCoder decoder; |
| 286 if (decoder.Decode(it->second.data(), it->second.size())) { |
| 287 ret += IPAddressToStringWithPort(decoder.ip(), decoder.port()); |
| 288 done = true; |
| 289 } |
| 290 } |
| 291 break; |
281 case kSCFG: | 292 case kSCFG: |
282 // nested messages. | 293 // nested messages. |
283 if (!it->second.empty()) { | 294 if (!it->second.empty()) { |
284 scoped_ptr<CryptoHandshakeMessage> msg( | 295 scoped_ptr<CryptoHandshakeMessage> msg( |
285 CryptoFramer::ParseMessage(it->second)); | 296 CryptoFramer::ParseMessage(it->second)); |
286 if (msg.get()) { | 297 if (msg.get()) { |
287 ret += "\n"; | 298 ret += "\n"; |
288 ret += msg->DebugStringInternal(indent + 1); | 299 ret += msg->DebugStringInternal(indent + 1); |
289 | 300 |
290 done = true; | 301 done = true; |
(...skipping 13 matching lines...) Expand all Loading... |
304 ret += "0x" + base::HexEncode(it->second.data(), it->second.size()); | 315 ret += "0x" + base::HexEncode(it->second.data(), it->second.size()); |
305 } | 316 } |
306 ret += "\n"; | 317 ret += "\n"; |
307 } | 318 } |
308 --indent; | 319 --indent; |
309 ret += string(2 * indent, ' ') + ">"; | 320 ret += string(2 * indent, ' ') + ">"; |
310 return ret; | 321 return ret; |
311 } | 322 } |
312 | 323 |
313 } // namespace net | 324 } // namespace net |
OLD | NEW |