OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2015 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 #include <memory> |
| 12 |
11 #include <net/if.h> | 13 #include <net/if.h> |
12 #include <sys/ioctl.h> | 14 #include <sys/ioctl.h> |
13 #include <unistd.h> | 15 #include <unistd.h> |
14 | 16 |
15 #include "webrtc/base/checks.h" | 17 #include "webrtc/base/checks.h" |
16 #include "webrtc/base/ifaddrs_converter.h" | 18 #include "webrtc/base/ifaddrs_converter.h" |
17 #include "webrtc/base/logging.h" | 19 #include "webrtc/base/logging.h" |
18 #include "webrtc/base/scoped_ptr.h" | |
19 | 20 |
20 #if !defined(WEBRTC_IOS) | 21 #if !defined(WEBRTC_IOS) |
21 #include <net/if_media.h> | 22 #include <net/if_media.h> |
22 #include <netinet/in_var.h> | 23 #include <netinet/in_var.h> |
23 #else // WEBRTC_IOS | 24 #else // WEBRTC_IOS |
24 #define SCOPE6_ID_MAX 16 | 25 #define SCOPE6_ID_MAX 16 |
25 | 26 |
26 struct in6_addrlifetime { | 27 struct in6_addrlifetime { |
27 time_t ia6t_expire; /* valid lifetime expiration time */ | 28 time_t ia6t_expire; /* valid lifetime expiration time */ |
28 time_t ia6t_preferred; /* preferred lifetime expiration time */ | 29 time_t ia6t_preferred; /* preferred lifetime expiration time */ |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 } | 263 } |
263 | 264 |
264 if (!ConvertNativeToIPAttributes(native_attributes, ip_attributes)) { | 265 if (!ConvertNativeToIPAttributes(native_attributes, ip_attributes)) { |
265 return false; | 266 return false; |
266 } | 267 } |
267 | 268 |
268 return true; | 269 return true; |
269 } | 270 } |
270 | 271 |
271 private: | 272 private: |
272 rtc::scoped_ptr<IPv6AttributesGetter> ip_attribute_getter_; | 273 std::unique_ptr<IPv6AttributesGetter> ip_attribute_getter_; |
273 }; | 274 }; |
274 | 275 |
275 } // namespace | 276 } // namespace |
276 | 277 |
277 IfAddrsConverter* CreateIfAddrsConverter() { | 278 IfAddrsConverter* CreateIfAddrsConverter() { |
278 return new MacIfAddrsConverter(); | 279 return new MacIfAddrsConverter(); |
279 } | 280 } |
280 | 281 |
281 } // namespace rtc | 282 } // namespace rtc |
OLD | NEW |