1 /*
2 * This file is auto-generated. DO NOT MODIFY.
3 * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -t --min_sdk_version 30 --ninja -d out/soong/.intermediates/external/ot-br-posix/src/android/aidl/ot-daemon-aidl-ndk-source/gen/staging/com/android/server/thread/openthread/IOtDaemon.cpp.d -h out/soong/.intermediates/external/ot-br-posix/src/android/aidl/ot-daemon-aidl-ndk-source/gen/include/staging -o out/soong/.intermediates/external/ot-br-posix/src/android/aidl/ot-daemon-aidl-ndk-source/gen/staging -Nexternal/ot-br-posix/src/android/aidl -Npackages/modules/Connectivity/thread/framework/java external/ot-br-posix/src/android/aidl/com/android/server/thread/openthread/IOtDaemon.aidl
4 *
5 * DO NOT CHECK THIS FILE INTO A CODE TREE (e.g. git, etc..).
6 * ALWAYS GENERATE THIS FILE FROM UPDATED AIDL COMPILER
7 * AS A BUILD INTERMEDIATE ONLY. THIS IS NOT SOURCE CODE.
8 */
9 #pragma once
10
11 #include <array>
12 #include <cstdint>
13 #include <memory>
14 #include <optional>
15 #include <string>
16 #include <vector>
17 #include <android/binder_enums.h>
18 #include <android/binder_interface_utils.h>
19 #include <aidl/android/net/thread/ChannelMaxPower.h>
20 #include <aidl/com/android/server/thread/openthread/IChannelMasksReceiver.h>
21 #include <aidl/com/android/server/thread/openthread/INsdPublisher.h>
22 #include <aidl/com/android/server/thread/openthread/IOtDaemonCallback.h>
23 #include <aidl/com/android/server/thread/openthread/IOtOutputReceiver.h>
24 #include <aidl/com/android/server/thread/openthread/IOtStatusReceiver.h>
25 #include <aidl/com/android/server/thread/openthread/MeshcopTxtAttributes.h>
26 #include <aidl/com/android/server/thread/openthread/OtDaemonConfiguration.h>
27 #ifdef BINDER_STABILITY_SUPPORT
28 #include <android/binder_stability.h>
29 #endif // BINDER_STABILITY_SUPPORT
30
31 namespace aidl::android::net::thread {
32 class ChannelMaxPower;
33 } // namespace aidl::android::net::thread
34 namespace aidl::com::android::server::thread::openthread {
35 class IChannelMasksReceiver;
36 class INsdPublisher;
37 class IOtDaemonCallback;
38 class IOtOutputReceiver;
39 class IOtStatusReceiver;
40 class MeshcopTxtAttributes;
41 class OtDaemonConfiguration;
42 } // namespace aidl::com::android::server::thread::openthread
43 namespace aidl {
44 namespace com {
45 namespace android {
46 namespace server {
47 namespace thread {
48 namespace openthread {
49 class IOtDaemonDelegator;
50
51 class IOtDaemon : public ::ndk::ICInterface {
52 public:
53 typedef IOtDaemonDelegator DefaultDelegator;
54 static const char* descriptor;
55 IOtDaemon();
56 virtual ~IOtDaemon();
57
58 enum class ErrorCode : int8_t {
59 OT_ERROR_FAILED_PRECONDITION = -3,
60 OT_ERROR_THREAD_DISABLED = -2,
61 OT_ERROR_UNSUPPORTED_CHANNEL = -1,
62 OT_ERROR_NO_BUFS = 3,
63 OT_ERROR_BUSY = 5,
64 OT_ERROR_PARSE = 6,
65 OT_ERROR_ABORT = 11,
66 OT_ERROR_NOT_IMPLEMENTED = 12,
67 OT_ERROR_INVALID_STATE = 13,
68 OT_ERROR_RESPONSE_TIMEOUT = 28,
69 OT_ERROR_REASSEMBLY_TIMEOUT = 30,
70 OT_ERROR_REJECTED = 37,
71 };
72
73 static const char* TUN_IF_NAME;
74 enum : int32_t { OT_STATE_DISABLED = 0 };
75 enum : int32_t { OT_STATE_ENABLED = 1 };
76 enum : int32_t { OT_STATE_DISABLING = 2 };
77 enum : int32_t { OT_EPHEMERAL_KEY_DISABLED = 0 };
78 enum : int32_t { OT_EPHEMERAL_KEY_ENABLED = 1 };
79 enum : int32_t { OT_EPHEMERAL_KEY_IN_USE = 2 };
80 static constexpr uint32_t TRANSACTION_initialize = FIRST_CALL_TRANSACTION + 0;
81 static constexpr uint32_t TRANSACTION_terminate = FIRST_CALL_TRANSACTION + 1;
82 static constexpr uint32_t TRANSACTION_setThreadEnabled = FIRST_CALL_TRANSACTION + 2;
83 static constexpr uint32_t TRANSACTION_registerStateCallback = FIRST_CALL_TRANSACTION + 3;
84 static constexpr uint32_t TRANSACTION_join = FIRST_CALL_TRANSACTION + 4;
85 static constexpr uint32_t TRANSACTION_leave = FIRST_CALL_TRANSACTION + 5;
86 static constexpr uint32_t TRANSACTION_scheduleMigration = FIRST_CALL_TRANSACTION + 6;
87 static constexpr uint32_t TRANSACTION_setCountryCode = FIRST_CALL_TRANSACTION + 7;
88 static constexpr uint32_t TRANSACTION_setConfiguration = FIRST_CALL_TRANSACTION + 8;
89 static constexpr uint32_t TRANSACTION_setInfraLinkInterfaceName = FIRST_CALL_TRANSACTION + 9;
90 static constexpr uint32_t TRANSACTION_setInfraLinkNat64Prefix = FIRST_CALL_TRANSACTION + 10;
91 static constexpr uint32_t TRANSACTION_setNat64Cidr = FIRST_CALL_TRANSACTION + 11;
92 static constexpr uint32_t TRANSACTION_setInfraLinkDnsServers = FIRST_CALL_TRANSACTION + 12;
93 static constexpr uint32_t TRANSACTION_getChannelMasks = FIRST_CALL_TRANSACTION + 13;
94 static constexpr uint32_t TRANSACTION_setChannelMaxPowers = FIRST_CALL_TRANSACTION + 14;
95 static constexpr uint32_t TRANSACTION_runOtCtlCommand = FIRST_CALL_TRANSACTION + 15;
96 static constexpr uint32_t TRANSACTION_activateEphemeralKeyMode = FIRST_CALL_TRANSACTION + 16;
97 static constexpr uint32_t TRANSACTION_deactivateEphemeralKeyMode = FIRST_CALL_TRANSACTION + 17;
98
99 static std::shared_ptr<IOtDaemon> fromBinder(const ::ndk::SpAIBinder& binder);
100 static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IOtDaemon>& instance);
101 static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IOtDaemon>* instance);
102 static bool setDefaultImpl(const std::shared_ptr<IOtDaemon>& impl);
103 static const std::shared_ptr<IOtDaemon>& getDefaultImpl();
104 virtual ::ndk::ScopedAStatus initialize(bool in_enabled, const ::aidl::com::android::server::thread::openthread::OtDaemonConfiguration& in_configuration, const ::ndk::ScopedFileDescriptor& in_tunFd, const std::shared_ptr<::aidl::com::android::server::thread::openthread::INsdPublisher>& in_nsdPublisher, const ::aidl::com::android::server::thread::openthread::MeshcopTxtAttributes& in_meshcopTxts, const std::string& in_countryCode, bool in_trelEnabled, const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtDaemonCallback>& in_callback) = 0;
105 virtual ::ndk::ScopedAStatus terminate() = 0;
106 virtual ::ndk::ScopedAStatus setThreadEnabled(bool in_enabled, const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtStatusReceiver>& in_receiver) = 0;
107 virtual ::ndk::ScopedAStatus registerStateCallback(const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtDaemonCallback>& in_callback, int64_t in_listenerId) = 0;
108 virtual ::ndk::ScopedAStatus join(const std::vector<uint8_t>& in_activeOpDatasetTlvs, const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtStatusReceiver>& in_receiver) = 0;
109 virtual ::ndk::ScopedAStatus leave(bool in_eraseDataset, const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtStatusReceiver>& in_receiver) = 0;
110 virtual ::ndk::ScopedAStatus scheduleMigration(const std::vector<uint8_t>& in_pendingOpDatasetTlvs, const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtStatusReceiver>& in_receiver) = 0;
111 virtual ::ndk::ScopedAStatus setCountryCode(const std::string& in_countryCode, const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtStatusReceiver>& in_receiver) = 0;
112 virtual ::ndk::ScopedAStatus setConfiguration(const ::aidl::com::android::server::thread::openthread::OtDaemonConfiguration& in_config, const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtStatusReceiver>& in_receiver) = 0;
113 virtual ::ndk::ScopedAStatus setInfraLinkInterfaceName(const std::optional<std::string>& in_interfaceName, const ::ndk::ScopedFileDescriptor& in_icmp6Socket, const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtStatusReceiver>& in_receiver) = 0;
114 virtual ::ndk::ScopedAStatus setInfraLinkNat64Prefix(const std::optional<std::string>& in_nat64Prefix, const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtStatusReceiver>& in_receiver) = 0;
115 virtual ::ndk::ScopedAStatus setNat64Cidr(const std::optional<std::string>& in_nat64Cidr, const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtStatusReceiver>& in_receiver) = 0;
116 virtual ::ndk::ScopedAStatus setInfraLinkDnsServers(const std::vector<std::string>& in_dnsServers, const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtStatusReceiver>& in_receiver) = 0;
117 virtual ::ndk::ScopedAStatus getChannelMasks(const std::shared_ptr<::aidl::com::android::server::thread::openthread::IChannelMasksReceiver>& in_receiver) = 0;
118 virtual ::ndk::ScopedAStatus setChannelMaxPowers(const std::vector<::aidl::android::net::thread::ChannelMaxPower>& in_channelMaxPowers, const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtStatusReceiver>& in_receiver) = 0;
119 virtual ::ndk::ScopedAStatus runOtCtlCommand(const std::string& in_command, bool in_isInteractive, const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtOutputReceiver>& in_receiver) = 0;
120 virtual ::ndk::ScopedAStatus activateEphemeralKeyMode(int64_t in_lifetimeMillis, const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtStatusReceiver>& in_receiver) = 0;
121 virtual ::ndk::ScopedAStatus deactivateEphemeralKeyMode(const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtStatusReceiver>& in_receiver) = 0;
122 private:
123 static std::shared_ptr<IOtDaemon> default_impl;
124 };
125 class IOtDaemonDefault : public IOtDaemon {
126 public:
127 ::ndk::ScopedAStatus initialize(bool in_enabled, const ::aidl::com::android::server::thread::openthread::OtDaemonConfiguration& in_configuration, const ::ndk::ScopedFileDescriptor& in_tunFd, const std::shared_ptr<::aidl::com::android::server::thread::openthread::INsdPublisher>& in_nsdPublisher, const ::aidl::com::android::server::thread::openthread::MeshcopTxtAttributes& in_meshcopTxts, const std::string& in_countryCode, bool in_trelEnabled, const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtDaemonCallback>& in_callback) override;
128 ::ndk::ScopedAStatus terminate() override;
129 ::ndk::ScopedAStatus setThreadEnabled(bool in_enabled, const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtStatusReceiver>& in_receiver) override;
130 ::ndk::ScopedAStatus registerStateCallback(const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtDaemonCallback>& in_callback, int64_t in_listenerId) override;
131 ::ndk::ScopedAStatus join(const std::vector<uint8_t>& in_activeOpDatasetTlvs, const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtStatusReceiver>& in_receiver) override;
132 ::ndk::ScopedAStatus leave(bool in_eraseDataset, const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtStatusReceiver>& in_receiver) override;
133 ::ndk::ScopedAStatus scheduleMigration(const std::vector<uint8_t>& in_pendingOpDatasetTlvs, const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtStatusReceiver>& in_receiver) override;
134 ::ndk::ScopedAStatus setCountryCode(const std::string& in_countryCode, const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtStatusReceiver>& in_receiver) override;
135 ::ndk::ScopedAStatus setConfiguration(const ::aidl::com::android::server::thread::openthread::OtDaemonConfiguration& in_config, const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtStatusReceiver>& in_receiver) override;
136 ::ndk::ScopedAStatus setInfraLinkInterfaceName(const std::optional<std::string>& in_interfaceName, const ::ndk::ScopedFileDescriptor& in_icmp6Socket, const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtStatusReceiver>& in_receiver) override;
137 ::ndk::ScopedAStatus setInfraLinkNat64Prefix(const std::optional<std::string>& in_nat64Prefix, const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtStatusReceiver>& in_receiver) override;
138 ::ndk::ScopedAStatus setNat64Cidr(const std::optional<std::string>& in_nat64Cidr, const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtStatusReceiver>& in_receiver) override;
139 ::ndk::ScopedAStatus setInfraLinkDnsServers(const std::vector<std::string>& in_dnsServers, const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtStatusReceiver>& in_receiver) override;
140 ::ndk::ScopedAStatus getChannelMasks(const std::shared_ptr<::aidl::com::android::server::thread::openthread::IChannelMasksReceiver>& in_receiver) override;
141 ::ndk::ScopedAStatus setChannelMaxPowers(const std::vector<::aidl::android::net::thread::ChannelMaxPower>& in_channelMaxPowers, const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtStatusReceiver>& in_receiver) override;
142 ::ndk::ScopedAStatus runOtCtlCommand(const std::string& in_command, bool in_isInteractive, const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtOutputReceiver>& in_receiver) override;
143 ::ndk::ScopedAStatus activateEphemeralKeyMode(int64_t in_lifetimeMillis, const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtStatusReceiver>& in_receiver) override;
144 ::ndk::ScopedAStatus deactivateEphemeralKeyMode(const std::shared_ptr<::aidl::com::android::server::thread::openthread::IOtStatusReceiver>& in_receiver) override;
145 ::ndk::SpAIBinder asBinder() override;
146 bool isRemote() override;
147 };
148 } // namespace openthread
149 } // namespace thread
150 } // namespace server
151 } // namespace android
152 } // namespace com
153 } // namespace aidl
154 namespace aidl {
155 namespace com {
156 namespace android {
157 namespace server {
158 namespace thread {
159 namespace openthread {
toString(IOtDaemon::ErrorCode val)160 [[nodiscard]] static inline std::string toString(IOtDaemon::ErrorCode val) {
161 switch(val) {
162 case IOtDaemon::ErrorCode::OT_ERROR_FAILED_PRECONDITION:
163 return "OT_ERROR_FAILED_PRECONDITION";
164 case IOtDaemon::ErrorCode::OT_ERROR_THREAD_DISABLED:
165 return "OT_ERROR_THREAD_DISABLED";
166 case IOtDaemon::ErrorCode::OT_ERROR_UNSUPPORTED_CHANNEL:
167 return "OT_ERROR_UNSUPPORTED_CHANNEL";
168 case IOtDaemon::ErrorCode::OT_ERROR_NO_BUFS:
169 return "OT_ERROR_NO_BUFS";
170 case IOtDaemon::ErrorCode::OT_ERROR_BUSY:
171 return "OT_ERROR_BUSY";
172 case IOtDaemon::ErrorCode::OT_ERROR_PARSE:
173 return "OT_ERROR_PARSE";
174 case IOtDaemon::ErrorCode::OT_ERROR_ABORT:
175 return "OT_ERROR_ABORT";
176 case IOtDaemon::ErrorCode::OT_ERROR_NOT_IMPLEMENTED:
177 return "OT_ERROR_NOT_IMPLEMENTED";
178 case IOtDaemon::ErrorCode::OT_ERROR_INVALID_STATE:
179 return "OT_ERROR_INVALID_STATE";
180 case IOtDaemon::ErrorCode::OT_ERROR_RESPONSE_TIMEOUT:
181 return "OT_ERROR_RESPONSE_TIMEOUT";
182 case IOtDaemon::ErrorCode::OT_ERROR_REASSEMBLY_TIMEOUT:
183 return "OT_ERROR_REASSEMBLY_TIMEOUT";
184 case IOtDaemon::ErrorCode::OT_ERROR_REJECTED:
185 return "OT_ERROR_REJECTED";
186 default:
187 return std::to_string(static_cast<int8_t>(val));
188 }
189 }
190 } // namespace openthread
191 } // namespace thread
192 } // namespace server
193 } // namespace android
194 } // namespace com
195 } // namespace aidl
196 namespace ndk {
197 namespace internal {
198 #pragma clang diagnostic push
199 #pragma clang diagnostic ignored "-Wc++17-extensions"
200 template <>
201 constexpr inline std::array<aidl::com::android::server::thread::openthread::IOtDaemon::ErrorCode, 12> enum_values<aidl::com::android::server::thread::openthread::IOtDaemon::ErrorCode> = {
202 aidl::com::android::server::thread::openthread::IOtDaemon::ErrorCode::OT_ERROR_FAILED_PRECONDITION,
203 aidl::com::android::server::thread::openthread::IOtDaemon::ErrorCode::OT_ERROR_THREAD_DISABLED,
204 aidl::com::android::server::thread::openthread::IOtDaemon::ErrorCode::OT_ERROR_UNSUPPORTED_CHANNEL,
205 aidl::com::android::server::thread::openthread::IOtDaemon::ErrorCode::OT_ERROR_NO_BUFS,
206 aidl::com::android::server::thread::openthread::IOtDaemon::ErrorCode::OT_ERROR_BUSY,
207 aidl::com::android::server::thread::openthread::IOtDaemon::ErrorCode::OT_ERROR_PARSE,
208 aidl::com::android::server::thread::openthread::IOtDaemon::ErrorCode::OT_ERROR_ABORT,
209 aidl::com::android::server::thread::openthread::IOtDaemon::ErrorCode::OT_ERROR_NOT_IMPLEMENTED,
210 aidl::com::android::server::thread::openthread::IOtDaemon::ErrorCode::OT_ERROR_INVALID_STATE,
211 aidl::com::android::server::thread::openthread::IOtDaemon::ErrorCode::OT_ERROR_RESPONSE_TIMEOUT,
212 aidl::com::android::server::thread::openthread::IOtDaemon::ErrorCode::OT_ERROR_REASSEMBLY_TIMEOUT,
213 aidl::com::android::server::thread::openthread::IOtDaemon::ErrorCode::OT_ERROR_REJECTED,
214 };
215 #pragma clang diagnostic pop
216 } // namespace internal
217 } // namespace ndk
218