| 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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 // 802.11b, DSSS or HR DSSS. | 482 // 802.11b, DSSS or HR DSSS. |
| 483 WIFI_PHY_LAYER_PROTOCOL_B, | 483 WIFI_PHY_LAYER_PROTOCOL_B, |
| 484 // 802.11g, same rates as 802.11a but compatible with 802.11b. | 484 // 802.11g, same rates as 802.11a but compatible with 802.11b. |
| 485 WIFI_PHY_LAYER_PROTOCOL_G, | 485 WIFI_PHY_LAYER_PROTOCOL_G, |
| 486 // 802.11n, HT rates. | 486 // 802.11n, HT rates. |
| 487 WIFI_PHY_LAYER_PROTOCOL_N, | 487 WIFI_PHY_LAYER_PROTOCOL_N, |
| 488 // Unclassified mode or failure to identify. | 488 // Unclassified mode or failure to identify. |
| 489 WIFI_PHY_LAYER_PROTOCOL_UNKNOWN | 489 WIFI_PHY_LAYER_PROTOCOL_UNKNOWN |
| 490 }; | 490 }; |
| 491 | 491 |
| 492 // Wifi access point security mode definitions. |
| 493 enum WifiSecurityMode { |
| 494 WIFI_SECURITY_UNKNOWN = 0, |
| 495 WIFI_SECURITY_WPA = 1, |
| 496 WIFI_SECURITY_WEP = 2, |
| 497 WIFI_SECURITY_RSN = 3, |
| 498 WIFI_SECURITY_802_1X = 4, |
| 499 WIFI_SECURITY_PSK = 5, |
| 500 WIFI_SECURITY_NONE |
| 501 }; |
| 502 |
| 503 // Information of the currently connected wifi access point. |
| 504 struct NET_EXPORT WifiAccessPointInfo { |
| 505 WifiAccessPointInfo(); |
| 506 ~WifiAccessPointInfo(); |
| 507 WifiSecurityMode security; |
| 508 std::string bssid; |
| 509 std::string model_number; |
| 510 std::string model_name; |
| 511 std::string device_name; |
| 512 std::string oui_list; |
| 513 }; |
| 514 |
| 492 // Characterize the PHY mode of the currently associated access point. | 515 // Characterize the PHY mode of the currently associated access point. |
| 493 // Currently only available on OS_WIN. | 516 // Currently only available on OS_WIN. |
| 494 NET_EXPORT WifiPHYLayerProtocol GetWifiPHYLayerProtocol(); | 517 NET_EXPORT WifiPHYLayerProtocol GetWifiPHYLayerProtocol(); |
| 495 | 518 |
| 496 // Returns number of matching initial bits between the addresses |a1| and |a2|. | 519 // Returns number of matching initial bits between the addresses |a1| and |a2|. |
| 497 unsigned CommonPrefixLength(const IPAddressNumber& a1, | 520 unsigned CommonPrefixLength(const IPAddressNumber& a1, |
| 498 const IPAddressNumber& a2); | 521 const IPAddressNumber& a2); |
| 499 | 522 |
| 500 // Computes the number of leading 1-bits in |mask|. | 523 // Computes the number of leading 1-bits in |mask|. |
| 501 unsigned MaskPrefixLength(const IPAddressNumber& mask); | 524 unsigned MaskPrefixLength(const IPAddressNumber& mask); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 526 DSCP_CS5 = 40, // Video | 549 DSCP_CS5 = 40, // Video |
| 527 DSCP_EF = 46, // Voice | 550 DSCP_EF = 46, // Voice |
| 528 DSCP_CS6 = 48, // Voice | 551 DSCP_CS6 = 48, // Voice |
| 529 DSCP_CS7 = 56, // Control messages | 552 DSCP_CS7 = 56, // Control messages |
| 530 DSCP_LAST = DSCP_CS7 | 553 DSCP_LAST = DSCP_CS7 |
| 531 }; | 554 }; |
| 532 | 555 |
| 533 } // namespace net | 556 } // namespace net |
| 534 | 557 |
| 535 #endif // NET_BASE_NET_UTIL_H_ | 558 #endif // NET_BASE_NET_UTIL_H_ |
| OLD | NEW |