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 |
11 #if defined(WEBRTC_POSIX) | 11 #if defined(WEBRTC_POSIX) |
12 #include <sys/types.h> | 12 #include <sys/types.h> |
13 #include <sys/socket.h> | 13 #include <sys/socket.h> |
14 #include <netinet/in.h> | 14 #include <netinet/in.h> |
15 #ifdef OPENBSD | 15 #ifdef OPENBSD |
16 #include <netinet/in_systm.h> | 16 #include <netinet/in_systm.h> |
17 #endif | 17 #endif |
18 #ifndef __native_client__ | 18 #ifndef __native_client__ |
19 #include <netinet/ip.h> | 19 #include <netinet/ip.h> |
20 #endif | 20 #endif |
21 #include <arpa/inet.h> | 21 #include <arpa/inet.h> |
22 #include <netdb.h> | 22 #include <netdb.h> |
23 #include <unistd.h> | 23 #include <unistd.h> |
24 #endif | 24 #endif |
25 | 25 |
26 #include <stdio.h> | 26 #include <stdio.h> |
27 | 27 |
28 #include "webrtc/base/ipaddress.h" | 28 #include "webrtc/rtc_base/byteorder.h" |
29 #include "webrtc/base/byteorder.h" | 29 #include "webrtc/rtc_base/checks.h" |
30 #include "webrtc/base/checks.h" | 30 #include "webrtc/rtc_base/ipaddress.h" |
31 #include "webrtc/base/logging.h" | 31 #include "webrtc/rtc_base/logging.h" |
32 #include "webrtc/base/nethelpers.h" | 32 #include "webrtc/rtc_base/nethelpers.h" |
33 #include "webrtc/base/stringutils.h" | 33 #include "webrtc/rtc_base/stringutils.h" |
34 #include "webrtc/base/win32.h" | 34 #include "webrtc/rtc_base/win32.h" |
35 | 35 |
36 namespace rtc { | 36 namespace rtc { |
37 | 37 |
38 // Prefixes used for categorizing IPv6 addresses. | 38 // Prefixes used for categorizing IPv6 addresses. |
39 static const in6_addr kV4MappedPrefix = {{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 39 static const in6_addr kV4MappedPrefix = {{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
40 0xFF, 0xFF, 0}}}; | 40 0xFF, 0xFF, 0}}}; |
41 static const in6_addr k6To4Prefix = {{{0x20, 0x02, 0}}}; | 41 static const in6_addr k6To4Prefix = {{{0x20, 0x02, 0}}}; |
42 static const in6_addr kTeredoPrefix = {{{0x20, 0x01, 0x00, 0x00}}}; | 42 static const in6_addr kTeredoPrefix = {{{0x20, 0x01, 0x00, 0x00}}}; |
43 static const in6_addr kV4CompatibilityPrefix = {{{0}}}; | 43 static const in6_addr kV4CompatibilityPrefix = {{{0}}}; |
44 static const in6_addr k6BonePrefix = {{{0x3f, 0xfe, 0}}}; | 44 static const in6_addr k6BonePrefix = {{{0x3f, 0xfe, 0}}}; |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 if (family == AF_INET) { | 518 if (family == AF_INET) { |
519 return rtc::IPAddress(INADDR_ANY); | 519 return rtc::IPAddress(INADDR_ANY); |
520 } | 520 } |
521 if (family == AF_INET6) { | 521 if (family == AF_INET6) { |
522 return rtc::IPAddress(in6addr_any); | 522 return rtc::IPAddress(in6addr_any); |
523 } | 523 } |
524 return rtc::IPAddress(); | 524 return rtc::IPAddress(); |
525 } | 525 } |
526 | 526 |
527 } // namespace rtc | 527 } // namespace rtc |
OLD | NEW |