blob: 94098a0968cca1269003fa0fd7dbe7f07a998658 [file] [log] [blame]
Paul Stewart35eff132013-04-12 12:08:40 -07001// Copyright (c) 2013 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#include "shill/ethernet_eap_service.h"
6
7#include <string>
8
Ben Chana0ddf462014-02-06 11:32:42 -08009#include <base/strings/stringprintf.h>
Paul Stewart35eff132013-04-12 12:08:40 -070010
11#include "shill/eap_credentials.h"
12#include "shill/ethernet_eap_provider.h"
13#include "shill/manager.h"
14#include "shill/technology.h"
15
16using std::string;
17
18namespace shill {
19
20EthernetEapService::EthernetEapService(ControlInterface *control_interface,
21 EventDispatcher *dispatcher,
22 Metrics *metrics,
23 Manager *manager)
24 : Service(control_interface, dispatcher, metrics, manager,
25 Technology::kEthernetEap) {
26 SetEapCredentials(new EapCredentials());
27 set_friendly_name("Ethernet EAP Parameters");
28}
29
30EthernetEapService::~EthernetEapService() {}
31
32string EthernetEapService::GetStorageIdentifier() const {
Ben Chana0ddf462014-02-06 11:32:42 -080033 return base::StringPrintf(
34 "%s_all", Technology::NameFromIdentifier(technology()).c_str());
Paul Stewart35eff132013-04-12 12:08:40 -070035}
36
Paul Stewart1cf7eb82013-12-03 19:34:36 -080037string EthernetEapService::GetDeviceRpcId(Error */*error*/) const {
Paul Stewart35eff132013-04-12 12:08:40 -070038 return "/";
39}
40
41void EthernetEapService::OnEapCredentialsChanged() {
Rebecca Silbersteinb6df8b12014-07-10 16:07:08 -070042 // Although the has_ever_connected_ field is not used in the
43 // same manner as the other services, we still make this call
44 // to maintain consistent behavior by the EAP Credential Change
45 // call.
46 SetHasEverConnected(false);
Paul Stewart35eff132013-04-12 12:08:40 -070047 manager()->ethernet_eap_provider()->OnCredentialsChanged();
48}
49
Paul Stewartbe9abfd2013-04-22 12:18:48 -070050bool EthernetEapService::Unload() {
51 Service::Unload();
52 manager()->ethernet_eap_provider()->OnCredentialsChanged();
53 return false;
54}
55
Paul Stewart35eff132013-04-12 12:08:40 -070056} // namespace shill