OLD | NEW |
---|---|
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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_LINUX_H_ | 5 #ifndef NET_BASE_NET_UTIL_LINUX_H_ |
6 #define NET_BASE_NET_UTIL_LINUX_H_ | 6 #define NET_BASE_NET_UTIL_LINUX_H_ |
7 | 7 |
8 // This file is only used to expose some of the internals | 8 // This file is only used to expose some of the internals |
9 // of net_util_linux.cc to tests. | 9 // of net_util_linux.cc to tests. |
10 | 10 |
11 #include "base/containers/hash_tables.h" | 11 #include "base/containers/hash_tables.h" |
12 #include "net/base/address_tracker_linux.h" | 12 #include "net/base/address_tracker_linux.h" |
13 #include "net/base/net_util.h" | 13 #include "net/base/net_util.h" |
14 | 14 |
15 namespace net { | 15 namespace net { |
16 namespace internal { | 16 namespace internal { |
17 | 17 |
18 typedef char* (*GetInterfaceNameFunction)(unsigned int interface_index, | 18 typedef char* (*GetInterfaceNameFunction)(unsigned int interface_index, |
19 char* ifname); | 19 char* ifname); |
20 | 20 |
21 // Returns the name for the interface with interface index |interface_index|. | |
pauljensen
2015/01/13 13:14:31
This should mention how |buf| relates to the retur
derekjchow1
2015/01/13 21:32:39
Done.
| |
22 // |buf| should be a pointer to an array of size IFNAMSIZ. This function acts | |
23 // like if_indextoname which cannot be used as net/if.h cannot be mixed with | |
24 // linux/if.h. We'll stick with exclusively talking to the kernel and not the | |
25 // C library. | |
26 char* GetInterfaceName(unsigned int interface_index, char* buf); | |
27 | |
28 // Gets the connection type for interface |ifname| by checking for wireless | |
29 // extensions. | |
30 NetworkChangeNotifier::ConnectionType GetInterfaceConnectionType( | |
pauljensen
2015/01/13 13:14:31
This header should include "net/base/network_chang
derekjchow1
2015/01/13 21:32:39
Done.
| |
31 std::string ifname); | |
pauljensen
2015/01/13 13:14:30
I think this should be a const reference, not pass
pauljensen
2015/01/13 13:14:31
This header should include <string>
derekjchow1
2015/01/13 21:32:39
Done.
derekjchow1
2015/01/13 21:32:39
Done.
| |
32 | |
21 NET_EXPORT bool GetNetworkListImpl( | 33 NET_EXPORT bool GetNetworkListImpl( |
22 NetworkInterfaceList* networks, | 34 NetworkInterfaceList* networks, |
23 int policy, | 35 int policy, |
24 const base::hash_set<int>& online_links, | 36 const base::hash_set<int>& online_links, |
25 const internal::AddressTrackerLinux::AddressMap& address_map, | 37 const internal::AddressTrackerLinux::AddressMap& address_map, |
26 GetInterfaceNameFunction get_interface_name); | 38 GetInterfaceNameFunction get_interface_name); |
27 | 39 |
28 } // namespace internal | 40 } // namespace internal |
29 } // namespace net | 41 } // namespace net |
30 | 42 |
31 #endif // NET_BASE_NET_UTIL_LINUX_H_ | 43 #endif // NET_BASE_NET_UTIL_LINUX_H_ |
OLD | NEW |