blob: 32448466c4c97f5cda07e3b50155a0c98daf9e5c [file] [log] [blame]
Darin Petkovd78ee7e2012-01-12 11:21:10 +01001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Chris Masoned7732e42011-05-20 11:08:56 -07002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Ben Chanc45688b2014-07-02 23:50:45 -07005#ifndef SHILL_ADAPTOR_INTERFACES_H_
6#define SHILL_ADAPTOR_INTERFACES_H_
Chris Masoned7732e42011-05-20 11:08:56 -07007
8#include <string>
mukesh agrawal32399322011-09-01 10:53:43 -07009#include <vector>
Chris Masoned7732e42011-05-20 11:08:56 -070010
Darin Petkov3cfbf212011-11-21 16:02:09 +010011#include "shill/accessor_interface.h"
12
Chris Masoned7732e42011-05-20 11:08:56 -070013namespace shill {
14
Darin Petkove5bc2cb2011-12-07 14:47:32 +010015class Error;
16
Chris Masone4e851612011-07-01 10:46:53 -070017// These are the functions that a Device adaptor must support
18class DeviceAdaptorInterface {
19 public:
20 virtual ~DeviceAdaptorInterface() {}
21
22 // Getter for the opaque identifier that represents this object on the
23 // RPC interface to which the implementation is adapting.
Paul Stewarta794cd62015-06-16 13:13:10 -070024 virtual const std::string& GetRpcIdentifier() = 0;
Chris Masone4e851612011-07-01 10:46:53 -070025
26 // Getter for the opaque identifier that represents this object's
27 // connection to the RPC interface to which the implementation is adapting.
Paul Stewarta794cd62015-06-16 13:13:10 -070028 virtual const std::string& GetRpcConnectionIdentifier() = 0;
Chris Masone4e851612011-07-01 10:46:53 -070029
Paul Stewarta794cd62015-06-16 13:13:10 -070030 virtual void EmitBoolChanged(const std::string& name, bool value) = 0;
31 virtual void EmitUintChanged(const std::string& name, uint32_t value) = 0;
32 virtual void EmitUint16Changed(const std::string& name, uint16_t value) = 0;
33 virtual void EmitIntChanged(const std::string& name, int value) = 0;
34 virtual void EmitStringChanged(const std::string& name,
35 const std::string& value) = 0;
36 virtual void EmitStringmapChanged(const std::string& name,
37 const Stringmap& value) = 0;
38 virtual void EmitStringmapsChanged(const std::string& name,
39 const Stringmaps& value) = 0;
40 virtual void EmitStringsChanged(const std::string& name,
41 const Strings& value) = 0;
42 virtual void EmitKeyValueStoreChanged(const std::string& name,
43 const KeyValueStore& value) = 0;
44 virtual void EmitRpcIdentifierChanged(const std::string& name,
45 const std::string& value) = 0;
Paul Stewartd4f26482014-04-25 19:12:03 -070046 virtual void EmitRpcIdentifierArrayChanged(
Paul Stewarta794cd62015-06-16 13:13:10 -070047 const std::string& name, const std::vector<std::string>& value) = 0;
Chris Masone4e851612011-07-01 10:46:53 -070048};
49
50// These are the functions that an IPConfig adaptor must support
51class IPConfigAdaptorInterface {
52 public:
53 virtual ~IPConfigAdaptorInterface() {}
54
55 // Getter for the opaque identifier that represents this object on the
56 // RPC interface to which the implementation is adapting.
Paul Stewarta794cd62015-06-16 13:13:10 -070057 virtual const std::string& GetRpcIdentifier() = 0;
Chris Masone4e851612011-07-01 10:46:53 -070058
Paul Stewarta794cd62015-06-16 13:13:10 -070059 virtual void EmitBoolChanged(const std::string& name, bool value) = 0;
60 virtual void EmitUintChanged(const std::string& name, uint32_t value) = 0;
61 virtual void EmitIntChanged(const std::string& name, int value) = 0;
62 virtual void EmitStringChanged(const std::string& name,
63 const std::string& value) = 0;
64 virtual void EmitStringsChanged(const std::string& name,
65 const std::vector<std::string>& value) = 0;
Chris Masone4e851612011-07-01 10:46:53 -070066};
67
Chris Masoned7732e42011-05-20 11:08:56 -070068// These are the functions that a Manager adaptor must support
69class ManagerAdaptorInterface {
70 public:
Chris Masoned7732e42011-05-20 11:08:56 -070071 virtual ~ManagerAdaptorInterface() {}
Chris Masone95207da2011-06-29 16:50:49 -070072
73 // Getter for the opaque identifier that represents this object on the
74 // RPC interface to which the implementation is adapting.
Paul Stewarta794cd62015-06-16 13:13:10 -070075 virtual const std::string& GetRpcIdentifier() = 0;
Chris Masone95207da2011-06-29 16:50:49 -070076
Chris Masoned0ceb8c2011-06-02 10:05:39 -070077 virtual void UpdateRunning() = 0;
78
Paul Stewarta794cd62015-06-16 13:13:10 -070079 virtual void EmitBoolChanged(const std::string& name, bool value) = 0;
80 virtual void EmitUintChanged(const std::string& name, uint32_t value) = 0;
81 virtual void EmitIntChanged(const std::string& name, int value) = 0;
82 virtual void EmitStringChanged(const std::string& name,
83 const std::string& value) = 0;
84 virtual void EmitStringsChanged(const std::string& name,
85 const std::vector<std::string>& value) = 0;
Paul Stewart49739c02012-08-08 17:24:03 -070086 virtual void EmitRpcIdentifierChanged(
Paul Stewarta794cd62015-06-16 13:13:10 -070087 const std::string& name,
88 const std::string& value) = 0;
mukesh agrawal32399322011-09-01 10:53:43 -070089 virtual void EmitRpcIdentifierArrayChanged(
Paul Stewarta794cd62015-06-16 13:13:10 -070090 const std::string& name,
91 const std::vector<std::string>& value) = 0;
Chris Masoned0ceb8c2011-06-02 10:05:39 -070092
Paul Stewarta794cd62015-06-16 13:13:10 -070093 virtual void EmitStateChanged(const std::string& new_state) = 0;
Chris Masoned7732e42011-05-20 11:08:56 -070094};
95
Chris Masone52cd19b2011-06-29 17:23:04 -070096// These are the functions that a Profile adaptor must support
97class ProfileAdaptorInterface {
98 public:
99 virtual ~ProfileAdaptorInterface() {}
100
Chris Masonec6c6c132011-06-30 11:29:52 -0700101 // Getter for the opaque identifier that represents this object on the
102 // RPC interface to which the implementation is adapting.
Paul Stewarta794cd62015-06-16 13:13:10 -0700103 virtual const std::string& GetRpcIdentifier() = 0;
Chris Masonec6c6c132011-06-30 11:29:52 -0700104
Paul Stewarta794cd62015-06-16 13:13:10 -0700105 virtual void EmitBoolChanged(const std::string& name, bool value) = 0;
106 virtual void EmitUintChanged(const std::string& name, uint32_t value) = 0;
107 virtual void EmitIntChanged(const std::string& name, int value) = 0;
108 virtual void EmitStringChanged(const std::string& name,
109 const std::string& value) = 0;
Chris Masonec6c6c132011-06-30 11:29:52 -0700110};
111
Darin Petkova9b1fed2012-02-29 11:49:05 +0100112// These are the functions that a RPCTask adaptor must support.
113class RPCTaskAdaptorInterface {
114 public:
115 virtual ~RPCTaskAdaptorInterface() {}
116
117 // Getter for the opaque identifier that represents this object on the
118 // RPC interface to which the implementation is adapting.
Paul Stewarta794cd62015-06-16 13:13:10 -0700119 virtual const std::string& GetRpcIdentifier() = 0;
Darin Petkova9b1fed2012-02-29 11:49:05 +0100120
Paul Stewarta794cd62015-06-16 13:13:10 -0700121 virtual const std::string& GetRpcInterfaceIdentifier() = 0;
Darin Petkova9b1fed2012-02-29 11:49:05 +0100122
123 // Getter for the opaque identifier that represents this object's
124 // connection to the RPC interface to which the implementation is adapting.
Paul Stewarta794cd62015-06-16 13:13:10 -0700125 virtual const std::string& GetRpcConnectionIdentifier() = 0;
Darin Petkova9b1fed2012-02-29 11:49:05 +0100126};
127
Chris Masone4e851612011-07-01 10:46:53 -0700128// These are the functions that a Service adaptor must support
129class ServiceAdaptorInterface {
Chris Masonec6c6c132011-06-30 11:29:52 -0700130 public:
Chris Masone4e851612011-07-01 10:46:53 -0700131 virtual ~ServiceAdaptorInterface() {}
Chris Masonec6c6c132011-06-30 11:29:52 -0700132
133 // Getter for the opaque identifier that represents this object on the
134 // RPC interface to which the implementation is adapting.
Paul Stewarta794cd62015-06-16 13:13:10 -0700135 virtual const std::string& GetRpcIdentifier() = 0;
Chris Masonec6c6c132011-06-30 11:29:52 -0700136
Chris Masone4e851612011-07-01 10:46:53 -0700137 virtual void UpdateConnected() = 0;
138
Paul Stewarta794cd62015-06-16 13:13:10 -0700139 virtual void EmitBoolChanged(const std::string& name, bool value) = 0;
140 virtual void EmitUint8Changed(const std::string& name, uint8_t value) = 0;
141 virtual void EmitUint16Changed(const std::string& name, uint16_t value) = 0;
142 virtual void EmitUint16sChanged(const std::string& name,
143 const Uint16s& value) = 0;
144 virtual void EmitUintChanged(const std::string& name, uint32_t value) = 0;
145 virtual void EmitIntChanged(const std::string& name, int value) = 0;
146 virtual void EmitRpcIdentifierChanged(const std::string& name,
147 const std::string& value) = 0;
148 virtual void EmitStringChanged(const std::string& name,
149 const std::string& value) = 0;
150 virtual void EmitStringmapChanged(const std::string& name,
151 const Stringmap& value) = 0;
Chris Masone52cd19b2011-06-29 17:23:04 -0700152};
153
Prabhu Kaliamoorthi127b3412014-10-16 13:00:25 +0200154class ThirdPartyVpnAdaptorInterface {
155 public:
156 virtual ~ThirdPartyVpnAdaptorInterface();
157
Paul Stewarta794cd62015-06-16 13:13:10 -0700158 virtual void EmitPacketReceived(const std::vector<uint8_t>& packet) = 0;
Prabhu Kaliamoorthi127b3412014-10-16 13:00:25 +0200159
160 virtual void EmitPlatformMessage(uint32_t message) = 0;
161};
162
Chris Masoned7732e42011-05-20 11:08:56 -0700163} // namespace shill
Ben Chanc45688b2014-07-02 23:50:45 -0700164
165#endif // SHILL_ADAPTOR_INTERFACES_H_