blob: 585c9b46e0dc6dc0c1c9262791ff87e7cca460b3 [file] [log] [blame]
Paul Stewartfa11e282013-12-02 22:04:25 -08001// 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 Chancc67c522014-09-03 07:19:18 -07008#include <stdint.h>
9
Paul Stewartfa11e282013-12-02 22:04:25 -080010#include <set>
11#include <vector>
12
Paul Stewartfa11e282013-12-02 22:04:25 -080013namespace shill {
14
15class 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 Stewart1a212a62015-06-16 13:13:10 -070034 static bool IsAndroidBSSID(const std::vector<uint8_t>& bssid);
Paul Stewartfa11e282013-12-02 22:04:25 -080035
36 // Returns whether an 802.11 BSSID is a locally-administered address, as
37 // opposed to a unique IEEE-issued address.
Paul Stewart1a212a62015-06-16 13:13:10 -070038 static bool IsLocallyAdministeredBSSID(const std::vector<uint8_t>& bssid);
Paul Stewartfa11e282013-12-02 22:04:25 -080039
40 // Returns whether any of the organizationally unique identifiers in
41 // |oui_set| is commonly associated with IOS devices.
Paul Stewart1a212a62015-06-16 13:13:10 -070042 static bool HasIosOui(const std::set<uint32_t>& oui_set);
Paul Stewartfa11e282013-12-02 22:04:25 -080043};
44
45} // namespace shill
46
47#endif // SHILL_TETHERING_H_