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_SERVICE_ |
| 6 | #define SHILL_WIFI_SERVICE_ |
| 7 | |
| 8 | #include <string> |
| 9 | #include <vector> |
| 10 | |
Chris Masone | 2b10554 | 2011-06-22 10:58:09 -0700 | [diff] [blame] | 11 | #include "shill/refptr_types.h" |
mukesh agrawal | b54601c | 2011-06-07 17:39:22 -0700 | [diff] [blame] | 12 | #include "shill/service.h" |
Chris Masone | 2b10554 | 2011-06-22 10:58:09 -0700 | [diff] [blame] | 13 | #include "shill/shill_event.h" |
mukesh agrawal | b54601c | 2011-06-07 17:39:22 -0700 | [diff] [blame] | 14 | #include "shill/supplicant-interface.h" |
| 15 | |
| 16 | namespace shill { |
| 17 | |
| 18 | class WiFiService : public Service { |
| 19 | public: |
| 20 | WiFiService(ControlInterface *control_interface, |
| 21 | EventDispatcher *dispatcher, |
Chris Masone | 2b10554 | 2011-06-22 10:58:09 -0700 | [diff] [blame] | 22 | const WiFiRefPtr &device, |
mukesh agrawal | b54601c | 2011-06-07 17:39:22 -0700 | [diff] [blame] | 23 | const std::vector<uint8_t> ssid, |
| 24 | uint32_t mode, |
| 25 | const std::string &key_management, |
| 26 | const std::string &name); |
| 27 | ~WiFiService(); |
| 28 | void Connect(); |
| 29 | void Disconnect(); |
mukesh agrawal | 445e72c | 2011-06-22 11:13:50 -0700 | [diff] [blame] | 30 | uint32_t mode() const; |
| 31 | const std::string &key_management() const; |
| 32 | const std::vector<uint8_t> &ssid() const; |
mukesh agrawal | b54601c | 2011-06-07 17:39:22 -0700 | [diff] [blame] | 33 | |
Chris Masone | 3bd3c8c | 2011-06-13 08:20:26 -0700 | [diff] [blame] | 34 | protected: |
| 35 | virtual std::string CalculateState() { return "idle"; } |
| 36 | |
mukesh agrawal | b54601c | 2011-06-07 17:39:22 -0700 | [diff] [blame] | 37 | private: |
mukesh agrawal | b54601c | 2011-06-07 17:39:22 -0700 | [diff] [blame] | 38 | void RealConnect(); |
| 39 | |
Chris Masone | 3bd3c8c | 2011-06-13 08:20:26 -0700 | [diff] [blame] | 40 | // Properties |
| 41 | std::string passphrase_; |
| 42 | bool need_passphrase_; |
| 43 | std::string security_; |
| 44 | uint8 strength_; |
| 45 | const std::string type_; |
| 46 | // TODO(cmasone): see if the below can be pulled from the endpoint associated |
| 47 | // with this service instead. |
| 48 | std::string auth_mode_; |
| 49 | bool hidden_ssid_; |
| 50 | uint16 frequency_; |
| 51 | uint16 physical_mode_; |
| 52 | uint16 hex_ssid_; |
| 53 | |
mukesh agrawal | b54601c | 2011-06-07 17:39:22 -0700 | [diff] [blame] | 54 | ScopedRunnableMethodFactory<WiFiService> task_factory_; |
Chris Masone | 2b10554 | 2011-06-22 10:58:09 -0700 | [diff] [blame] | 55 | WiFiRefPtr wifi_; |
mukesh agrawal | b54601c | 2011-06-07 17:39:22 -0700 | [diff] [blame] | 56 | const std::vector<uint8_t> ssid_; |
mukesh agrawal | 445e72c | 2011-06-22 11:13:50 -0700 | [diff] [blame] | 57 | const uint32_t mode_; |
mukesh agrawal | b54601c | 2011-06-07 17:39:22 -0700 | [diff] [blame] | 58 | DISALLOW_COPY_AND_ASSIGN(WiFiService); |
| 59 | }; |
| 60 | |
| 61 | } // namespace shill |
| 62 | |
| 63 | #endif // SHILL_WIFI_SERVICE_ |