2 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * Contact: Mateusz Malicki <m.malicki2@samsung.com>
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License
21 * @author Mateusz Malicki (m.malicki2@samsung.com)
22 * @brief HostIPCConnection class
26 #ifndef SERVER_HOST_IPC_CONNECTION_HPP
27 #define SERVER_HOST_IPC_CONNECTION_HPP
29 #include "api/messages.hpp"
30 #include "ipc/epoll/event-poll.hpp"
31 #include "ipc/service.hpp"
32 #include "ipc-callback-wrapper.hpp"
38 class HostIPCConnection {
40 template<typename ArgIn = const api::Void, typename ArgOut = api::Void>
43 typedef typename IPCMethodWrapper<ArgIn, ArgOut>::type type;
45 template<typename ArgIn>
48 typedef typename IPCSignalWrapper<ArgIn>::type type;
51 HostIPCConnection(ipc::epoll::EventPoll& eventPoll, ZonesManager* zm);
56 void signalZoneConnectionState(const api::ConnectionState& connectionState);
60 void setLockQueueCallback(const Method<api::Void>::type& callback);
61 void setUnlockQueueCallback(const Method<api::Void>::type& callback);
62 void setGetZoneIdsCallback(const Method<api::ZoneIds>::type& callback);
63 void setGetZoneConnectionsCallback(const Method<api::Connections>::type& callback);
64 void setGetActiveZoneIdCallback(const Method<api::ZoneId>::type& callback);
65 void setGetZoneInfoCallback(const Method<const api::ZoneId, api::ZoneInfoOut>::type& callback);
66 void setSetNetdevAttrsCallback(const Method<const api::SetNetDevAttrsIn>::type& callback);
67 void setGetNetdevAttrsCallback(const Method<const api::GetNetDevAttrsIn, api::GetNetDevAttrs>::type& callback);
68 void setGetNetdevListCallback(const Method<const api::ZoneId, api::NetDevList>::type& callback);
69 void setCreateNetdevVethCallback(const Method<const api::CreateNetDevVethIn>::type& callback);
70 void setCreateNetdevMacvlanCallback(const Method<const api::CreateNetDevMacvlanIn>::type& callback);
71 void setCreateNetdevPhysCallback(const Method<const api::CreateNetDevPhysIn>::type& callback);
72 void setDestroyNetdevCallback(const Method<const api::DestroyNetDevIn>::type& callback);
73 void setDeleteNetdevIpAddressCallback(const Method<const api::DeleteNetdevIpAddressIn>::type& callback);
74 void setDeclareFileCallback(const Method<const api::DeclareFileIn, api::Declaration>::type& callback);
75 void setDeclareMountCallback(const Method<const api::DeclareMountIn, api::Declaration>::type& callback);
76 void setDeclareLinkCallback(const Method<const api::DeclareLinkIn, api::Declaration>::type& callback);
77 void setGetDeclarationsCallback(const Method<const api::ZoneId, api::Declarations>::type& callback);
78 void setRemoveDeclarationCallback(const Method<const api::RemoveDeclarationIn>::type& callback);
79 void setSetActiveZoneCallback(const Method<const api::ZoneId>::type& callback);
80 void setCreateZoneCallback(const Method<const api::CreateZoneIn>::type& callback);
81 void setDestroyZoneCallback(const Method<const api::ZoneId>::type& callback);
82 void setShutdownZoneCallback(const Method<const api::ZoneId>::type& callback);
83 void setStartZoneCallback(const Method<const api::ZoneId>::type& callback);
84 void setLockZoneCallback(const Method<const api::ZoneId>::type& callback);
85 void setUnlockZoneCallback(const Method<const api::ZoneId>::type& callback);
86 void setGrantDeviceCallback(const Method<const api::GrantDeviceIn>::type& callback);
87 void setRevokeDeviceCallback(const Method<const api::RevokeDeviceIn>::type& callback);
88 void setSwitchToDefaultCallback(const Method<api::Void>::type& callback);
89 void setCreateFileCallback(const Method<const api::CreateFileIn, api::CreateFileOut>::type& callback);
90 void setCleanUpZonesRootCallback(const Method<api::Void>::type& callback);
92 std::unique_ptr<ipc::Service> mService;
93 ZonesManager* mZonesManagerPtr;
98 #endif // SERVER_HOST_IPC_CONNECTION_HPP