mukesh agrawal | b54601c | 2011-06-07 17:39:22 -0700 | [diff] [blame] | 1 | // 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" |
mukesh agrawal | b54601c | 2011-06-07 17:39:22 -0700 | [diff] [blame] | 16 | #include "shill/shill_event.h" |
| 17 | |
| 18 | namespace shill { |
| 19 | |
| 20 | class WiFiEndpoint : public Endpoint { |
| 21 | public: |
| 22 | WiFiEndpoint(const std::map<std::string, ::DBus::Variant> &properties); |
| 23 | virtual ~WiFiEndpoint(); |
Chris Masone | 092df3e | 2011-08-22 09:41:39 -0700 | [diff] [blame] | 24 | |
| 25 | // Maps mode strings from flimflam's nomenclature, as defined |
| 26 | // in chromeos/dbus/service_constants.h, to uints used by supplicant |
| 27 | static uint32_t ModeStringToUint(const std::string &mode_string); |
| 28 | |
mukesh agrawal | b54601c | 2011-06-07 17:39:22 -0700 | [diff] [blame] | 29 | const std::vector<uint8_t> &ssid() const; |
| 30 | const std::string &ssid_string() const; |
| 31 | const std::string &ssid_hex() const; |
| 32 | const std::string &bssid_string() const; |
| 33 | const std::string &bssid_hex() const; |
| 34 | int16_t signal_strength() const; |
Chris Masone | 092df3e | 2011-08-22 09:41:39 -0700 | [diff] [blame] | 35 | const std::string &network_mode() const; |
mukesh agrawal | b54601c | 2011-06-07 17:39:22 -0700 | [diff] [blame] | 36 | |
| 37 | private: |
| 38 | static const uint32_t kSupplicantNetworkModeInfrastructureInt; |
| 39 | static const uint32_t kSupplicantNetworkModeAdHocInt; |
| 40 | static const uint32_t kSupplicantNetworkModeAccessPointInt; |
| 41 | |
| 42 | static const char kSupplicantPropertySSID[]; |
| 43 | static const char kSupplicantPropertyBSSID[]; |
| 44 | static const char kSupplicantPropertySignal[]; |
| 45 | static const char kSupplicantPropertyMode[]; |
| 46 | static const char kSupplicantNetworkModeInfrastructure[]; |
| 47 | static const char kSupplicantNetworkModeAdHoc[]; |
| 48 | static const char kSupplicantNetworkModeAccessPoint[]; |
| 49 | |
Chris Masone | 092df3e | 2011-08-22 09:41:39 -0700 | [diff] [blame] | 50 | // Maps mode strings from supplicant into flimflam's nomenclature, as defined |
| 51 | // in chromeos/dbus/service_constants.h |
| 52 | static const char *ParseMode(const std::string &mode_string); |
mukesh agrawal | b54601c | 2011-06-07 17:39:22 -0700 | [diff] [blame] | 53 | |
| 54 | std::vector<uint8_t> ssid_; |
| 55 | std::vector<uint8_t> bssid_; |
| 56 | std::string ssid_string_; |
| 57 | std::string ssid_hex_; |
| 58 | std::string bssid_string_; |
| 59 | std::string bssid_hex_; |
| 60 | int16_t signal_strength_; |
Chris Masone | 092df3e | 2011-08-22 09:41:39 -0700 | [diff] [blame] | 61 | std::string network_mode_; |
mukesh agrawal | b54601c | 2011-06-07 17:39:22 -0700 | [diff] [blame] | 62 | |
| 63 | DISALLOW_COPY_AND_ASSIGN(WiFiEndpoint); |
| 64 | }; |
| 65 | |
| 66 | } // namespace shill |
| 67 | |
| 68 | #endif // SHILL_WIFI_ENDPOINT_ |