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 12 matching lines...) Expand all Loading... | |
23 #include "base/strings/utf_offset_string_conversions.h" | 23 #include "base/strings/utf_offset_string_conversions.h" |
24 #include "net/base/address_family.h" | 24 #include "net/base/address_family.h" |
25 #include "net/base/escape.h" | 25 #include "net/base/escape.h" |
26 #include "net/base/net_export.h" | 26 #include "net/base/net_export.h" |
27 #include "net/base/network_change_notifier.h" | 27 #include "net/base/network_change_notifier.h" |
28 | 28 |
29 class GURL; | 29 class GURL; |
30 | 30 |
31 namespace base { | 31 namespace base { |
32 class Time; | 32 class Time; |
33 class LifetimeInterface; | |
33 } | 34 } |
34 | 35 |
35 namespace url { | 36 namespace url { |
36 struct CanonHostInfo; | 37 struct CanonHostInfo; |
37 struct Parsed; | 38 struct Parsed; |
38 } | 39 } |
39 | 40 |
40 namespace net { | 41 namespace net { |
41 | 42 |
42 // Used by FormatUrl to specify handling of certain parts of the url. | 43 // Used by FormatUrl to specify handling of certain parts of the url. |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
491 // 802.11n, HT rates. | 492 // 802.11n, HT rates. |
492 WIFI_PHY_LAYER_PROTOCOL_N, | 493 WIFI_PHY_LAYER_PROTOCOL_N, |
493 // Unclassified mode or failure to identify. | 494 // Unclassified mode or failure to identify. |
494 WIFI_PHY_LAYER_PROTOCOL_UNKNOWN | 495 WIFI_PHY_LAYER_PROTOCOL_UNKNOWN |
495 }; | 496 }; |
496 | 497 |
497 // Characterize the PHY mode of the currently associated access point. | 498 // Characterize the PHY mode of the currently associated access point. |
498 // Currently only available on OS_WIN. | 499 // Currently only available on OS_WIN. |
499 NET_EXPORT WifiPHYLayerProtocol GetWifiPHYLayerProtocol(); | 500 NET_EXPORT WifiPHYLayerProtocol GetWifiPHYLayerProtocol(); |
500 | 501 |
502 enum WifiOptions { | |
503 // Disables background SSID scans. | |
504 WIFI_OPTIONS_DISABLE_SCAN = 1, | |
505 // Enables media streaming mode. | |
506 WIFI_OPTIONS_MEDIA_STREAMING_MODE = 2 | |
507 }; | |
508 | |
509 // Set temporary options on all interfaces. | |
pauljensen
2014/09/16 15:01:18
Can you clarify what interfaces is? WiFi network
hubbe
2014/09/16 21:06:50
Done.
| |
510 // |options| is an ORed bitfield of WifiOptions. | |
511 // Options are automatically disabled when the scoped pointer | |
512 // is freed. Currently only available on OS_WIN. | |
513 scoped_ptr<base::LifetimeInterface> SetWifiOptions(int options); | |
pauljensen
2014/09/16 15:01:18
Shouldn't this be NET_EXPORT?
hubbe
2014/09/16 21:06:50
Yes, yes it should. (Done)
| |
514 | |
501 // Returns number of matching initial bits between the addresses |a1| and |a2|. | 515 // Returns number of matching initial bits between the addresses |a1| and |a2|. |
502 unsigned CommonPrefixLength(const IPAddressNumber& a1, | 516 unsigned CommonPrefixLength(const IPAddressNumber& a1, |
503 const IPAddressNumber& a2); | 517 const IPAddressNumber& a2); |
504 | 518 |
505 // Computes the number of leading 1-bits in |mask|. | 519 // Computes the number of leading 1-bits in |mask|. |
506 unsigned MaskPrefixLength(const IPAddressNumber& mask); | 520 unsigned MaskPrefixLength(const IPAddressNumber& mask); |
507 | 521 |
508 // Differentiated Services Code Point. | 522 // Differentiated Services Code Point. |
509 // See http://tools.ietf.org/html/rfc2474 for details. | 523 // See http://tools.ietf.org/html/rfc2474 for details. |
510 enum DiffServCodePoint { | 524 enum DiffServCodePoint { |
(...skipping 20 matching lines...) Expand all Loading... | |
531 DSCP_CS5 = 40, // Video | 545 DSCP_CS5 = 40, // Video |
532 DSCP_EF = 46, // Voice | 546 DSCP_EF = 46, // Voice |
533 DSCP_CS6 = 48, // Voice | 547 DSCP_CS6 = 48, // Voice |
534 DSCP_CS7 = 56, // Control messages | 548 DSCP_CS7 = 56, // Control messages |
535 DSCP_LAST = DSCP_CS7 | 549 DSCP_LAST = DSCP_CS7 |
536 }; | 550 }; |
537 | 551 |
538 } // namespace net | 552 } // namespace net |
539 | 553 |
540 #endif // NET_BASE_NET_UTIL_H_ | 554 #endif // NET_BASE_NET_UTIL_H_ |
OLD | NEW |