| 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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 | 461 |
| 462 // struct that is used by GetNetworkList() to represent a network | 462 // struct that is used by GetNetworkList() to represent a network |
| 463 // interface. | 463 // interface. |
| 464 struct NET_EXPORT NetworkInterface { | 464 struct NET_EXPORT NetworkInterface { |
| 465 NetworkInterface(); | 465 NetworkInterface(); |
| 466 NetworkInterface(const std::string& name, | 466 NetworkInterface(const std::string& name, |
| 467 const std::string& friendly_name, | 467 const std::string& friendly_name, |
| 468 uint32 interface_index, | 468 uint32 interface_index, |
| 469 NetworkChangeNotifier::ConnectionType type, | 469 NetworkChangeNotifier::ConnectionType type, |
| 470 const IPAddressNumber& address, | 470 const IPAddressNumber& address, |
| 471 uint32 network_prefix, | 471 uint32 prefix_length, |
| 472 int ip_address_attributes); | 472 int ip_address_attributes); |
| 473 ~NetworkInterface(); | 473 ~NetworkInterface(); |
| 474 | 474 |
| 475 std::string name; | 475 std::string name; |
| 476 std::string friendly_name; // Same as |name| on non-Windows. | 476 std::string friendly_name; // Same as |name| on non-Windows. |
| 477 uint32 interface_index; // Always 0 on Android. | 477 uint32 interface_index; // Always 0 on Android. |
| 478 NetworkChangeNotifier::ConnectionType type; | 478 NetworkChangeNotifier::ConnectionType type; |
| 479 IPAddressNumber address; | 479 IPAddressNumber address; |
| 480 uint32 network_prefix; | 480 uint32 prefix_length; |
| 481 int ip_address_attributes; // Combination of |IPAddressAttributes|. | 481 int ip_address_attributes; // Combination of |IPAddressAttributes|. |
| 482 }; | 482 }; |
| 483 | 483 |
| 484 typedef std::vector<NetworkInterface> NetworkInterfaceList; | 484 typedef std::vector<NetworkInterface> NetworkInterfaceList; |
| 485 | 485 |
| 486 // Policy settings to include/exclude network interfaces. | 486 // Policy settings to include/exclude network interfaces. |
| 487 enum HostAddressSelectionPolicy { | 487 enum HostAddressSelectionPolicy { |
| 488 INCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES = 0x0, | 488 INCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES = 0x0, |
| 489 EXCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES = 0x1, | 489 EXCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES = 0x1, |
| 490 // Include temp address only when interface has both permanent and | |
| 491 // temp addresses. | |
| 492 INCLUDE_ONLY_TEMP_IPV6_ADDRESS_IF_POSSIBLE = 0x2, | |
| 493 }; | 490 }; |
| 494 | 491 |
| 495 // Returns list of network interfaces except loopback interface. If an | 492 // Returns list of network interfaces except loopback interface. If an |
| 496 // interface has more than one address, a separate entry is added to | 493 // interface has more than one address, a separate entry is added to |
| 497 // the list for each address. | 494 // the list for each address. |
| 498 // Can be called only on a thread that allows IO. | 495 // Can be called only on a thread that allows IO. |
| 499 NET_EXPORT bool GetNetworkList(NetworkInterfaceList* networks, | 496 NET_EXPORT bool GetNetworkList(NetworkInterfaceList* networks, |
| 500 int policy); | 497 int policy); |
| 501 | 498 |
| 502 // General category of the IEEE 802.11 (wifi) physical layer operating mode. | 499 // General category of the IEEE 802.11 (wifi) physical layer operating mode. |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 DSCP_CS5 = 40, // Video | 573 DSCP_CS5 = 40, // Video |
| 577 DSCP_EF = 46, // Voice | 574 DSCP_EF = 46, // Voice |
| 578 DSCP_CS6 = 48, // Voice | 575 DSCP_CS6 = 48, // Voice |
| 579 DSCP_CS7 = 56, // Control messages | 576 DSCP_CS7 = 56, // Control messages |
| 580 DSCP_LAST = DSCP_CS7 | 577 DSCP_LAST = DSCP_CS7 |
| 581 }; | 578 }; |
| 582 | 579 |
| 583 } // namespace net | 580 } // namespace net |
| 584 | 581 |
| 585 #endif // NET_BASE_NET_UTIL_H_ | 582 #endif // NET_BASE_NET_UTIL_H_ |
| OLD | NEW |