summaryrefslogtreecommitdiffstats
path: root/components/metrics/net/wifi_access_point_info_provider.h
blob: 349375695b7d1a20383c7c37e9175185483ab75d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_METRICS_NET_WIFI_ACCESS_POINT_INFO_PROVIDER_H_
#define COMPONENTS_METRICS_NET_WIFI_ACCESS_POINT_INFO_PROVIDER_H_

#include <string>
#include "base/basictypes.h"

namespace metrics {

// Interface for accessing connected wireless access point information.
class WifiAccessPointInfoProvider {
 public:
  // Wifi access point security mode definitions.
  enum WifiSecurityMode {
    WIFI_SECURITY_UNKNOWN = 0,
    WIFI_SECURITY_WPA = 1,
    WIFI_SECURITY_WEP = 2,
    WIFI_SECURITY_RSN = 3,
    WIFI_SECURITY_802_1X = 4,
    WIFI_SECURITY_PSK = 5,
    WIFI_SECURITY_NONE
  };

  // Information of the currently connected wifi access point.
  struct WifiAccessPointInfo {
    WifiAccessPointInfo();
    ~WifiAccessPointInfo();
    WifiSecurityMode security;
    std::string bssid;
    std::string model_number;
    std::string model_name;
    std::string device_name;
    std::string oui_list;
  };

  WifiAccessPointInfoProvider();
  virtual ~WifiAccessPointInfoProvider();

  // Fill in the wifi access point info if device is currently connected to a
  // wifi access point. Return true if device is connected to a wifi access
  // point, false otherwise.
  virtual bool GetInfo(WifiAccessPointInfo *info);

 private:
  DISALLOW_COPY_AND_ASSIGN(WifiAccessPointInfoProvider);
};

}  // namespace metrics

#endif  // COMPONENTS_METRICS_NET_WIFI_ACCESS_POINT_INFO_PROVIDER_H_