tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

DbusWifiScanner.h (1199B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 #ifndef NSWIFIAPSCANNERDBUS_H_
      6 #define NSWIFIAPSCANNERDBUS_H_
      7 
      8 #include "WifiScanner.h"
      9 
     10 class nsIWifiAccessPoint;
     11 class nsWifiAccessPoint;
     12 
     13 namespace mozilla {
     14 
     15 using AccessPointArray = nsTArray<RefPtr<nsIWifiAccessPoint>>;
     16 
     17 class WifiScannerImpl final : public WifiScanner {
     18 public:
     19  explicit WifiScannerImpl();
     20  ~WifiScannerImpl();
     21 
     22  /**
     23   * GetAccessPointsFromWLAN
     24   *
     25   * Scans the available wireless interfaces for nearby access points and
     26   * populates the supplied collection with them
     27   *
     28   * @param accessPoints The collection to populate with available APs
     29   * @return NS_OK on success, failure codes on failure
     30   */
     31  nsresult GetAccessPointsFromWLAN(AccessPointArray& accessPoints);
     32 
     33 private:
     34  bool AddDevice(const char* aDevicePath, AccessPointArray& aAccessPoints);
     35  bool AddAPProperties(const char* aApPath, AccessPointArray& aAccessPoints);
     36  bool SetMac(char* aHwAddress, nsWifiAccessPoint* aAp);
     37 };
     38 
     39 }  // namespace mozilla
     40 
     41 #endif  // NSWIFIAPSCANNERDBUS_H_