blob: 8a7e15a969b7ce5d6002972ade3dade9d49619f6 [file] [log] [blame]
mukesh agrawalb54601c2011-06-07 17:39:22 -07001// Copyright (c) 2011 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_WIFI_ENDPOINT_
6#define SHILL_WIFI_ENDPOINT_
7
8#include <map>
9#include <string>
10#include <vector>
11
12#include <base/memory/ref_counted.h>
13#include <dbus-c++/dbus.h>
14
15#include "shill/endpoint.h"
16#include "shill/service.h"
17#include "shill/shill_event.h"
18
19namespace shill {
20
21class WiFiEndpoint : public Endpoint {
22 public:
23 WiFiEndpoint(const std::map<std::string, ::DBus::Variant> &properties);
24 virtual ~WiFiEndpoint();
25 const std::vector<uint8_t> &ssid() const;
26 const std::string &ssid_string() const;
27 const std::string &ssid_hex() const;
28 const std::string &bssid_string() const;
29 const std::string &bssid_hex() const;
30 int16_t signal_strength() const;
31 uint32_t network_mode() const;
32
33 private:
34 static const uint32_t kSupplicantNetworkModeInfrastructureInt;
35 static const uint32_t kSupplicantNetworkModeAdHocInt;
36 static const uint32_t kSupplicantNetworkModeAccessPointInt;
37
38 static const char kSupplicantPropertySSID[];
39 static const char kSupplicantPropertyBSSID[];
40 static const char kSupplicantPropertySignal[];
41 static const char kSupplicantPropertyMode[];
42 static const char kSupplicantNetworkModeInfrastructure[];
43 static const char kSupplicantNetworkModeAdHoc[];
44 static const char kSupplicantNetworkModeAccessPoint[];
45
46 static int32_t parse_mode(const std::string &mode_string);
47
48 std::vector<uint8_t> ssid_;
49 std::vector<uint8_t> bssid_;
50 std::string ssid_string_;
51 std::string ssid_hex_;
52 std::string bssid_string_;
53 std::string bssid_hex_;
54 int16_t signal_strength_;
55 uint32_t network_mode_;
56
57 DISALLOW_COPY_AND_ASSIGN(WiFiEndpoint);
58};
59
60} // namespace shill
61
62#endif // SHILL_WIFI_ENDPOINT_