Darin Petkov | d78ee7e | 2012-01-12 11:21:10 +0100 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
Ben Chan | c45688b | 2014-07-02 23:50:45 -0700 | [diff] [blame] | 5 | #ifndef SHILL_ADAPTOR_INTERFACES_H_ |
| 6 | #define SHILL_ADAPTOR_INTERFACES_H_ |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 7 | |
| 8 | #include <string> |
mukesh agrawal | 3239932 | 2011-09-01 10:53:43 -0700 | [diff] [blame] | 9 | #include <vector> |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 10 | |
Darin Petkov | 3cfbf21 | 2011-11-21 16:02:09 +0100 | [diff] [blame] | 11 | #include "shill/accessor_interface.h" |
| 12 | |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 13 | namespace shill { |
| 14 | |
Darin Petkov | e5bc2cb | 2011-12-07 14:47:32 +0100 | [diff] [blame] | 15 | class Error; |
| 16 | |
Chris Masone | 4e85161 | 2011-07-01 10:46:53 -0700 | [diff] [blame] | 17 | // These are the functions that a Device adaptor must support |
| 18 | class 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. |
| 24 | virtual const std::string &GetRpcIdentifier() = 0; |
| 25 | |
| 26 | // Getter for the opaque identifier that represents this object's |
| 27 | // connection to the RPC interface to which the implementation is adapting. |
| 28 | virtual const std::string &GetRpcConnectionIdentifier() = 0; |
| 29 | |
Darin Petkov | 3cfbf21 | 2011-11-21 16:02:09 +0100 | [diff] [blame] | 30 | virtual void EmitBoolChanged(const std::string &name, bool value) = 0; |
Ben Chan | 7fab897 | 2014-08-10 17:14:46 -0700 | [diff] [blame] | 31 | virtual void EmitUintChanged(const std::string &name, uint32_t value) = 0; |
| 32 | virtual void EmitUint16Changed(const std::string &name, uint16_t value) = 0; |
Darin Petkov | 3cfbf21 | 2011-11-21 16:02:09 +0100 | [diff] [blame] | 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; |
Prathmesh Prabhu | 9f06c87 | 2013-11-21 14:08:23 -0800 | [diff] [blame] | 36 | virtual void EmitStringmapChanged(const std::string &name, |
| 37 | const Stringmap &value) = 0; |
Darin Petkov | 3cfbf21 | 2011-11-21 16:02:09 +0100 | [diff] [blame] | 38 | virtual void EmitStringmapsChanged(const std::string &name, |
| 39 | const Stringmaps &value) = 0; |
Prathmesh Prabhu | 700ff4d | 2014-01-16 15:59:33 -0800 | [diff] [blame] | 40 | virtual void EmitStringsChanged(const std::string &name, |
| 41 | const Strings &value) = 0; |
Darin Petkov | 63138a9 | 2012-02-06 14:09:15 +0100 | [diff] [blame] | 42 | virtual void EmitKeyValueStoreChanged(const std::string &name, |
| 43 | const KeyValueStore &value) = 0; |
Christopher Wiley | 674598d | 2014-12-12 10:21:39 -0800 | [diff] [blame] | 44 | virtual void EmitRpcIdentifierChanged(const std::string &name, |
| 45 | const std::string &value) = 0; |
Paul Stewart | d4f2648 | 2014-04-25 19:12:03 -0700 | [diff] [blame] | 46 | virtual void EmitRpcIdentifierArrayChanged( |
| 47 | const std::string &name, const std::vector<std::string> &value) = 0; |
Chris Masone | 4e85161 | 2011-07-01 10:46:53 -0700 | [diff] [blame] | 48 | }; |
| 49 | |
| 50 | // These are the functions that an IPConfig adaptor must support |
| 51 | class 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. |
| 57 | virtual const std::string &GetRpcIdentifier() = 0; |
| 58 | |
Gaurav Shah | 435de2c | 2011-11-17 19:01:07 -0800 | [diff] [blame] | 59 | virtual void EmitBoolChanged(const std::string &name, bool value) = 0; |
Ben Chan | 7fab897 | 2014-08-10 17:14:46 -0700 | [diff] [blame] | 60 | virtual void EmitUintChanged(const std::string &name, uint32_t value) = 0; |
Gaurav Shah | 435de2c | 2011-11-17 19:01:07 -0800 | [diff] [blame] | 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; |
mukesh agrawal | 7aed61c | 2013-04-22 16:01:24 -0700 | [diff] [blame] | 64 | virtual void EmitStringsChanged(const std::string &name, |
| 65 | const std::vector<std::string> &value) = 0; |
Chris Masone | 4e85161 | 2011-07-01 10:46:53 -0700 | [diff] [blame] | 66 | }; |
| 67 | |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 68 | // These are the functions that a Manager adaptor must support |
| 69 | class ManagerAdaptorInterface { |
| 70 | public: |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 71 | virtual ~ManagerAdaptorInterface() {} |
Chris Masone | 95207da | 2011-06-29 16:50:49 -0700 | [diff] [blame] | 72 | |
| 73 | // Getter for the opaque identifier that represents this object on the |
| 74 | // RPC interface to which the implementation is adapting. |
| 75 | virtual const std::string &GetRpcIdentifier() = 0; |
| 76 | |
Chris Masone | d0ceb8c | 2011-06-02 10:05:39 -0700 | [diff] [blame] | 77 | virtual void UpdateRunning() = 0; |
| 78 | |
Gaurav Shah | 435de2c | 2011-11-17 19:01:07 -0800 | [diff] [blame] | 79 | virtual void EmitBoolChanged(const std::string &name, bool value) = 0; |
Ben Chan | 7fab897 | 2014-08-10 17:14:46 -0700 | [diff] [blame] | 80 | virtual void EmitUintChanged(const std::string &name, uint32_t value) = 0; |
Gaurav Shah | 435de2c | 2011-11-17 19:01:07 -0800 | [diff] [blame] | 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 Stewart | 49739c0 | 2012-08-08 17:24:03 -0700 | [diff] [blame] | 86 | virtual void EmitRpcIdentifierChanged( |
| 87 | const std::string &name, |
| 88 | const std::string &value) = 0; |
mukesh agrawal | 3239932 | 2011-09-01 10:53:43 -0700 | [diff] [blame] | 89 | virtual void EmitRpcIdentifierArrayChanged( |
| 90 | const std::string &name, |
| 91 | const std::vector<std::string> &value) = 0; |
Chris Masone | d0ceb8c | 2011-06-02 10:05:39 -0700 | [diff] [blame] | 92 | |
Gaurav Shah | 435de2c | 2011-11-17 19:01:07 -0800 | [diff] [blame] | 93 | virtual void EmitStateChanged(const std::string &new_state) = 0; |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 94 | }; |
| 95 | |
Chris Masone | 52cd19b | 2011-06-29 17:23:04 -0700 | [diff] [blame] | 96 | // These are the functions that a Profile adaptor must support |
| 97 | class ProfileAdaptorInterface { |
| 98 | public: |
| 99 | virtual ~ProfileAdaptorInterface() {} |
| 100 | |
Chris Masone | c6c6c13 | 2011-06-30 11:29:52 -0700 | [diff] [blame] | 101 | // Getter for the opaque identifier that represents this object on the |
| 102 | // RPC interface to which the implementation is adapting. |
| 103 | virtual const std::string &GetRpcIdentifier() = 0; |
| 104 | |
Gaurav Shah | 435de2c | 2011-11-17 19:01:07 -0800 | [diff] [blame] | 105 | virtual void EmitBoolChanged(const std::string &name, bool value) = 0; |
Ben Chan | 7fab897 | 2014-08-10 17:14:46 -0700 | [diff] [blame] | 106 | virtual void EmitUintChanged(const std::string &name, uint32_t value) = 0; |
Gaurav Shah | 435de2c | 2011-11-17 19:01:07 -0800 | [diff] [blame] | 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 Masone | c6c6c13 | 2011-06-30 11:29:52 -0700 | [diff] [blame] | 110 | }; |
| 111 | |
Darin Petkov | a9b1fed | 2012-02-29 11:49:05 +0100 | [diff] [blame] | 112 | // These are the functions that a RPCTask adaptor must support. |
| 113 | class 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. |
| 119 | virtual const std::string &GetRpcIdentifier() = 0; |
| 120 | |
| 121 | virtual const std::string &GetRpcInterfaceIdentifier() = 0; |
| 122 | |
| 123 | // Getter for the opaque identifier that represents this object's |
| 124 | // connection to the RPC interface to which the implementation is adapting. |
| 125 | virtual const std::string &GetRpcConnectionIdentifier() = 0; |
| 126 | }; |
| 127 | |
Chris Masone | 4e85161 | 2011-07-01 10:46:53 -0700 | [diff] [blame] | 128 | // These are the functions that a Service adaptor must support |
| 129 | class ServiceAdaptorInterface { |
Chris Masone | c6c6c13 | 2011-06-30 11:29:52 -0700 | [diff] [blame] | 130 | public: |
Chris Masone | 4e85161 | 2011-07-01 10:46:53 -0700 | [diff] [blame] | 131 | virtual ~ServiceAdaptorInterface() {} |
Chris Masone | c6c6c13 | 2011-06-30 11:29:52 -0700 | [diff] [blame] | 132 | |
| 133 | // Getter for the opaque identifier that represents this object on the |
| 134 | // RPC interface to which the implementation is adapting. |
| 135 | virtual const std::string &GetRpcIdentifier() = 0; |
| 136 | |
Chris Masone | 4e85161 | 2011-07-01 10:46:53 -0700 | [diff] [blame] | 137 | virtual void UpdateConnected() = 0; |
| 138 | |
Gaurav Shah | 435de2c | 2011-11-17 19:01:07 -0800 | [diff] [blame] | 139 | virtual void EmitBoolChanged(const std::string &name, bool value) = 0; |
Ben Chan | 7fab897 | 2014-08-10 17:14:46 -0700 | [diff] [blame] | 140 | virtual void EmitUint8Changed(const std::string &name, uint8_t value) = 0; |
| 141 | virtual void EmitUint16Changed(const std::string &name, uint16_t value) = 0; |
mukesh agrawal | e7c7e65 | 2013-06-18 17:19:39 -0700 | [diff] [blame] | 142 | virtual void EmitUint16sChanged(const std::string &name, |
| 143 | const Uint16s &value) = 0; |
Ben Chan | 7fab897 | 2014-08-10 17:14:46 -0700 | [diff] [blame] | 144 | virtual void EmitUintChanged(const std::string &name, uint32_t value) = 0; |
Gaurav Shah | 435de2c | 2011-11-17 19:01:07 -0800 | [diff] [blame] | 145 | virtual void EmitIntChanged(const std::string &name, int value) = 0; |
Paul Stewart | 1e3bc496 | 2012-09-14 12:20:22 -0700 | [diff] [blame] | 146 | virtual void EmitRpcIdentifierChanged(const std::string &name, |
| 147 | const std::string &value) = 0; |
Gaurav Shah | 435de2c | 2011-11-17 19:01:07 -0800 | [diff] [blame] | 148 | virtual void EmitStringChanged(const std::string &name, |
| 149 | const std::string &value) = 0; |
Darin Petkov | 9cb0268 | 2012-01-28 00:17:38 +0100 | [diff] [blame] | 150 | virtual void EmitStringmapChanged(const std::string &name, |
| 151 | const Stringmap &value) = 0; |
Chris Masone | 52cd19b | 2011-06-29 17:23:04 -0700 | [diff] [blame] | 152 | }; |
| 153 | |
Prabhu Kaliamoorthi | 127b341 | 2014-10-16 13:00:25 +0200 | [diff] [blame] | 154 | class ThirdPartyVpnAdaptorInterface { |
| 155 | public: |
| 156 | virtual ~ThirdPartyVpnAdaptorInterface(); |
| 157 | |
| 158 | virtual void EmitPacketReceived(const std::vector<uint8_t> &packet) = 0; |
| 159 | |
| 160 | virtual void EmitPlatformMessage(uint32_t message) = 0; |
| 161 | }; |
| 162 | |
Chris Masone | d7732e4 | 2011-05-20 11:08:56 -0700 | [diff] [blame] | 163 | } // namespace shill |
Ben Chan | c45688b | 2014-07-02 23:50:45 -0700 | [diff] [blame] | 164 | |
| 165 | #endif // SHILL_ADAPTOR_INTERFACES_H_ |