OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 121 |
122 // Parses hostname:port and [hostname]:port. | 122 // Parses hostname:port and [hostname]:port. |
123 bool FromString(const std::string& str); | 123 bool FromString(const std::string& str); |
124 | 124 |
125 friend std::ostream& operator<<(std::ostream& os, const SocketAddress& addr); | 125 friend std::ostream& operator<<(std::ostream& os, const SocketAddress& addr); |
126 | 126 |
127 // Determines whether this represents a missing / any IP address. | 127 // Determines whether this represents a missing / any IP address. |
128 // That is, 0.0.0.0 or ::. | 128 // That is, 0.0.0.0 or ::. |
129 // Hostname and/or port may be set. | 129 // Hostname and/or port may be set. |
130 bool IsAnyIP() const; | 130 bool IsAnyIP() const; |
131 inline bool IsAny() const { return IsAnyIP(); } // deprecated | |
132 | 131 |
133 // Determines whether the IP address refers to a loopback address. | 132 // Determines whether the IP address refers to a loopback address. |
134 // For v4 addresses this means the address is in the range 127.0.0.0/8. | 133 // For v4 addresses this means the address is in the range 127.0.0.0/8. |
135 // For v6 addresses this means the address is ::1. | 134 // For v6 addresses this means the address is ::1. |
136 bool IsLoopbackIP() const; | 135 bool IsLoopbackIP() const; |
137 | 136 |
138 // Determines whether the IP address is in one of the private ranges: | 137 // Determines whether the IP address is in one of the private ranges: |
139 // For v4: 127.0.0.0/8 10.0.0.0/8 192.168.0.0/16 172.16.0.0/12. | 138 // For v4: 127.0.0.0/8 10.0.0.0/8 192.168.0.0/16 172.16.0.0/12. |
140 // For v6: FE80::/16 and ::1. | 139 // For v6: FE80::/16 and ::1. |
141 bool IsPrivateIP() const; | 140 bool IsPrivateIP() const; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 bool literal_; // Indicates that 'hostname_' contains a literal IP string. | 204 bool literal_; // Indicates that 'hostname_' contains a literal IP string. |
206 }; | 205 }; |
207 | 206 |
208 bool SocketAddressFromSockAddrStorage(const sockaddr_storage& saddr, | 207 bool SocketAddressFromSockAddrStorage(const sockaddr_storage& saddr, |
209 SocketAddress* out); | 208 SocketAddress* out); |
210 SocketAddress EmptySocketAddressWithFamily(int family); | 209 SocketAddress EmptySocketAddressWithFamily(int family); |
211 | 210 |
212 } // namespace rtc | 211 } // namespace rtc |
213 | 212 |
214 #endif // WEBRTC_BASE_SOCKETADDRESS_H_ | 213 #endif // WEBRTC_BASE_SOCKETADDRESS_H_ |
OLD | NEW |