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 #ifndef NET_BASE_NET_UTIL_H_ | 5 #ifndef NET_BASE_NET_UTIL_H_ |
6 #define NET_BASE_NET_UTIL_H_ | 6 #define NET_BASE_NET_UTIL_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 // Convenience for omitting all unecessary types. | 74 // Convenience for omitting all unecessary types. |
75 NET_EXPORT extern const FormatUrlType kFormatUrlOmitAll; | 75 NET_EXPORT extern const FormatUrlType kFormatUrlOmitAll; |
76 | 76 |
77 // Returns the number of explicitly allowed ports; for testing. | 77 // Returns the number of explicitly allowed ports; for testing. |
78 NET_EXPORT_PRIVATE extern size_t GetCountOfExplicitlyAllowedPorts(); | 78 NET_EXPORT_PRIVATE extern size_t GetCountOfExplicitlyAllowedPorts(); |
79 | 79 |
80 // Splits an input of the form <host>[":"<port>] into its consitituent parts. | 80 // Splits an input of the form <host>[":"<port>] into its consitituent parts. |
81 // Saves the result into |*host| and |*port|. If the input did not have | 81 // Saves the result into |*host| and |*port|. If the input did not have |
82 // the optional port, sets |*port| to -1. | 82 // the optional port, sets |*port| to -1. |
83 // Returns true if the parsing was successful, false otherwise. | 83 // Returns true if the parsing was successful, false otherwise. |
84 // The returned host is NOT canonicalized, and may be invalid. If <host> is | 84 // The returned host is NOT canonicalized, and may be invalid. |
85 // an IPv6 literal address, the returned host includes the square brackets. | 85 // |
| 86 // IPv6 literals must be specified in a bracketed form, for instance: |
| 87 // [::1]:90 and [::1] |
| 88 // |
| 89 // The resultant |*host| in both cases will be "::1" (not bracketed). |
86 NET_EXPORT bool ParseHostAndPort( | 90 NET_EXPORT bool ParseHostAndPort( |
87 std::string::const_iterator host_and_port_begin, | 91 std::string::const_iterator host_and_port_begin, |
88 std::string::const_iterator host_and_port_end, | 92 std::string::const_iterator host_and_port_end, |
89 std::string* host, | 93 std::string* host, |
90 int* port); | 94 int* port); |
91 NET_EXPORT bool ParseHostAndPort( | 95 NET_EXPORT bool ParseHostAndPort( |
92 const std::string& host_and_port, | 96 const std::string& host_and_port, |
93 std::string* host, | 97 std::string* host, |
94 int* port); | 98 int* port); |
95 | 99 |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 DSCP_CS5 = 40, // Video | 577 DSCP_CS5 = 40, // Video |
574 DSCP_EF = 46, // Voice | 578 DSCP_EF = 46, // Voice |
575 DSCP_CS6 = 48, // Voice | 579 DSCP_CS6 = 48, // Voice |
576 DSCP_CS7 = 56, // Control messages | 580 DSCP_CS7 = 56, // Control messages |
577 DSCP_LAST = DSCP_CS7 | 581 DSCP_LAST = DSCP_CS7 |
578 }; | 582 }; |
579 | 583 |
580 } // namespace net | 584 } // namespace net |
581 | 585 |
582 #endif // NET_BASE_NET_UTIL_H_ | 586 #endif // NET_BASE_NET_UTIL_H_ |
OLD | NEW |