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_utils.h" | 5 #include "net/quic/core/quic_utils.h" |
6 | 6 |
7 #include <ctype.h> | 7 #include <ctype.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 RETURN_STRING_LITERAL(QUIC_CRYPTO_MESSAGE_AFTER_HANDSHAKE_COMPLETE); | 244 RETURN_STRING_LITERAL(QUIC_CRYPTO_MESSAGE_AFTER_HANDSHAKE_COMPLETE); |
245 RETURN_STRING_LITERAL(QUIC_CRYPTO_INTERNAL_ERROR); | 245 RETURN_STRING_LITERAL(QUIC_CRYPTO_INTERNAL_ERROR); |
246 RETURN_STRING_LITERAL(QUIC_CRYPTO_VERSION_NOT_SUPPORTED); | 246 RETURN_STRING_LITERAL(QUIC_CRYPTO_VERSION_NOT_SUPPORTED); |
247 RETURN_STRING_LITERAL(QUIC_CRYPTO_HANDSHAKE_STATELESS_REJECT); | 247 RETURN_STRING_LITERAL(QUIC_CRYPTO_HANDSHAKE_STATELESS_REJECT); |
248 RETURN_STRING_LITERAL(QUIC_CRYPTO_NO_SUPPORT); | 248 RETURN_STRING_LITERAL(QUIC_CRYPTO_NO_SUPPORT); |
249 RETURN_STRING_LITERAL(QUIC_INVALID_CRYPTO_MESSAGE_TYPE); | 249 RETURN_STRING_LITERAL(QUIC_INVALID_CRYPTO_MESSAGE_TYPE); |
250 RETURN_STRING_LITERAL(QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER); | 250 RETURN_STRING_LITERAL(QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER); |
251 RETURN_STRING_LITERAL(QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND); | 251 RETURN_STRING_LITERAL(QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND); |
252 RETURN_STRING_LITERAL(QUIC_CRYPTO_MESSAGE_PARAMETER_NO_OVERLAP); | 252 RETURN_STRING_LITERAL(QUIC_CRYPTO_MESSAGE_PARAMETER_NO_OVERLAP); |
253 RETURN_STRING_LITERAL(QUIC_CRYPTO_MESSAGE_INDEX_NOT_FOUND); | 253 RETURN_STRING_LITERAL(QUIC_CRYPTO_MESSAGE_INDEX_NOT_FOUND); |
| 254 RETURN_STRING_LITERAL(QUIC_UNSUPPORTED_PROOF_DEMAND); |
254 RETURN_STRING_LITERAL(QUIC_INVALID_STREAM_ID); | 255 RETURN_STRING_LITERAL(QUIC_INVALID_STREAM_ID); |
255 RETURN_STRING_LITERAL(QUIC_INVALID_PRIORITY); | 256 RETURN_STRING_LITERAL(QUIC_INVALID_PRIORITY); |
256 RETURN_STRING_LITERAL(QUIC_TOO_MANY_OPEN_STREAMS); | 257 RETURN_STRING_LITERAL(QUIC_TOO_MANY_OPEN_STREAMS); |
257 RETURN_STRING_LITERAL(QUIC_PUBLIC_RESET); | 258 RETURN_STRING_LITERAL(QUIC_PUBLIC_RESET); |
258 RETURN_STRING_LITERAL(QUIC_INVALID_VERSION); | 259 RETURN_STRING_LITERAL(QUIC_INVALID_VERSION); |
259 RETURN_STRING_LITERAL(QUIC_INVALID_HEADER_ID); | 260 RETURN_STRING_LITERAL(QUIC_INVALID_HEADER_ID); |
260 RETURN_STRING_LITERAL(QUIC_INVALID_NEGOTIATED_VALUE); | 261 RETURN_STRING_LITERAL(QUIC_INVALID_NEGOTIATED_VALUE); |
261 RETURN_STRING_LITERAL(QUIC_DECOMPRESSION_FAILURE); | 262 RETURN_STRING_LITERAL(QUIC_DECOMPRESSION_FAILURE); |
262 RETURN_STRING_LITERAL(QUIC_NETWORK_IDLE_TIMEOUT); | 263 RETURN_STRING_LITERAL(QUIC_NETWORK_IDLE_TIMEOUT); |
263 RETURN_STRING_LITERAL(QUIC_HANDSHAKE_TIMEOUT); | 264 RETURN_STRING_LITERAL(QUIC_HANDSHAKE_TIMEOUT); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 uint32_t option = 0; | 375 uint32_t option = 0; |
375 for (char token_char : base::Reversed(token)) { | 376 for (char token_char : base::Reversed(token)) { |
376 option <<= 8; | 377 option <<= 8; |
377 option |= static_cast<unsigned char>(token_char); | 378 option |= static_cast<unsigned char>(token_char); |
378 } | 379 } |
379 options.push_back(option); | 380 options.push_back(option); |
380 } | 381 } |
381 return options; | 382 return options; |
382 } | 383 } |
383 | 384 |
384 string QuicUtils::ListTags(QuicTagValueMap tag_map) { | |
385 string result; | |
386 for (auto entry : tag_map) { | |
387 result.append(TagToString(entry.first) + " "); | |
388 } | |
389 return result; | |
390 } | |
391 | |
392 string QuicUtils::PeerAddressChangeTypeToString(PeerAddressChangeType type) { | 385 string QuicUtils::PeerAddressChangeTypeToString(PeerAddressChangeType type) { |
393 switch (type) { | 386 switch (type) { |
394 RETURN_STRING_LITERAL(NO_CHANGE); | 387 RETURN_STRING_LITERAL(NO_CHANGE); |
395 RETURN_STRING_LITERAL(PORT_CHANGE); | 388 RETURN_STRING_LITERAL(PORT_CHANGE); |
396 RETURN_STRING_LITERAL(IPV4_SUBNET_CHANGE); | 389 RETURN_STRING_LITERAL(IPV4_SUBNET_CHANGE); |
397 RETURN_STRING_LITERAL(IPV4_TO_IPV6_CHANGE); | 390 RETURN_STRING_LITERAL(IPV4_TO_IPV6_CHANGE); |
398 RETURN_STRING_LITERAL(IPV6_TO_IPV4_CHANGE); | 391 RETURN_STRING_LITERAL(IPV6_TO_IPV4_CHANGE); |
399 RETURN_STRING_LITERAL(IPV6_TO_IPV6_CHANGE); | 392 RETURN_STRING_LITERAL(IPV6_TO_IPV6_CHANGE); |
400 RETURN_STRING_LITERAL(UNSPECIFIED_CHANGE); | 393 RETURN_STRING_LITERAL(UNSPECIFIED_CHANGE); |
401 } | 394 } |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 | 566 |
574 bytes_remaining -= line_bytes; | 567 bytes_remaining -= line_bytes; |
575 offset += line_bytes; | 568 offset += line_bytes; |
576 p += line_bytes; | 569 p += line_bytes; |
577 s += '\n'; | 570 s += '\n'; |
578 } | 571 } |
579 return s; | 572 return s; |
580 } | 573 } |
581 | 574 |
582 } // namespace net | 575 } // namespace net |
OLD | NEW |