blob: f02aa908939e42e8d1b1ff7156e2ee7768a15b70 [file] [log] [blame]
Peter Qiu7e0ffcf2014-12-02 12:53:27 -08001// Copyright 2014 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 APMANAGER_SHILL_PROXY_H_
6#define APMANAGER_SHILL_PROXY_H_
7
8#include <set>
9#include <string>
10
11#include <base/macros.h>
12#include <base/memory/scoped_ptr.h>
13
14#include "shill/dbus-proxies.h"
15
16// Proxy for shill "org.chromium.flimflam" DBus service.
17namespace apmanager {
18
19class ShillProxy {
20 public:
21 ShillProxy();
22 virtual ~ShillProxy();
23
24 // Claim the given interface |interface_name| from shill.
25 virtual void ClaimInterface(const std::string& interface_name);
26 // Release the given interface |interface_name| to shill.
27 virtual void ReleaseInterface(const std::string& interface_name);
28
29 private:
30 static const char kManagerPath[];
31
32 // Bus object for system bus.
33 scoped_refptr<dbus::Bus> bus_;
34 // DBus proxy for shill manager.
35 std::unique_ptr<org::chromium::flimflam::ManagerProxy> manager_proxy_;
36 // List of interfaces apmanager have claimed.
37 std::set<std::string> claimed_interfaces_;
38
39 DISALLOW_COPY_AND_ASSIGN(ShillProxy);
40};
41
42} // namespace apmanager
43
44#endif // APMANAGER_SHILL_PROXY_H_