Paul Stewart | fa11e28 | 2013-12-02 22:04:25 -0800 | [diff] [blame] | 1 | // Copyright (c) 2013 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef SHILL_TETHERING_H_ |
| 6 | #define SHILL_TETHERING_H_ |
| 7 | |
Ben Chan | cc67c52 | 2014-09-03 07:19:18 -0700 | [diff] [blame] | 8 | #include <stdint.h> |
| 9 | |
Paul Stewart | fa11e28 | 2013-12-02 22:04:25 -0800 | [diff] [blame] | 10 | #include <set> |
| 11 | #include <vector> |
| 12 | |
Paul Stewart | fa11e28 | 2013-12-02 22:04:25 -0800 | [diff] [blame] | 13 | namespace shill { |
| 14 | |
| 15 | class Tethering { |
| 16 | public: |
| 17 | // Modern Android phones in tethering mode provide DHCP option 43 even |
| 18 | // without a DHCP client requesting it. The constant below is the value |
| 19 | // that it provides for this propery. |
| 20 | static const char kAndroidVendorEncapsulatedOptions[]; |
| 21 | |
| 22 | // This 802.11 BSS prefix is provided by many Android-based devices. |
| 23 | static const uint8_t kAndroidBSSIDPrefix[]; |
| 24 | |
| 25 | // This OUI is provided in 802.11 vendor IEs by many IOS devices in |
| 26 | // tethering mode. |
| 27 | static const uint32_t kIosOui; |
| 28 | |
| 29 | // This bit, if set in the first octet of a MAC address, indicates that |
| 30 | // this address is not assigned by the IEEE, but was generated locally. |
| 31 | static const uint8_t kLocallyAdministratedMACBit; |
| 32 | |
| 33 | // Returns whether an 802.11 BSSID is likely to be owned by an Android device. |
Paul Stewart | 1a212a6 | 2015-06-16 13:13:10 -0700 | [diff] [blame] | 34 | static bool IsAndroidBSSID(const std::vector<uint8_t>& bssid); |
Paul Stewart | fa11e28 | 2013-12-02 22:04:25 -0800 | [diff] [blame] | 35 | |
| 36 | // Returns whether an 802.11 BSSID is a locally-administered address, as |
| 37 | // opposed to a unique IEEE-issued address. |
Paul Stewart | 1a212a6 | 2015-06-16 13:13:10 -0700 | [diff] [blame] | 38 | static bool IsLocallyAdministeredBSSID(const std::vector<uint8_t>& bssid); |
Paul Stewart | fa11e28 | 2013-12-02 22:04:25 -0800 | [diff] [blame] | 39 | |
| 40 | // Returns whether any of the organizationally unique identifiers in |
| 41 | // |oui_set| is commonly associated with IOS devices. |
Paul Stewart | 1a212a6 | 2015-06-16 13:13:10 -0700 | [diff] [blame] | 42 | static bool HasIosOui(const std::set<uint32_t>& oui_set); |
Paul Stewart | fa11e28 | 2013-12-02 22:04:25 -0800 | [diff] [blame] | 43 | }; |
| 44 | |
| 45 | } // namespace shill |
| 46 | |
| 47 | #endif // SHILL_TETHERING_H_ |