1// SPDX-License-Identifier: GPL-3.0-or-later
2// !! AUTOGENERATED FILE !!
3// This file is generated by protoc-gen-mosrpc, do not edit.
4// Any changes made to this file will be lost.
5
6#pragma once
7
8#if !defined(__MOS_KERNEL__) && defined(__cplusplus) && defined(__MOS_RPC_SERVER__)
9#define __rpc_have_cpp_server__
10#endif
11
12#if !defined(__MOS_KERNEL__) && defined(__cplusplus) && defined(__MOS_RPC_CLIENT__)
13#define __rpc_have_cpp_client__
14#endif
15
16// don't expose this to the kernel
17#ifdef __rpc_have_cpp_server__
18#include <librpc/rpc_server++.hpp>
19#endif
20
21#ifdef __rpc_have_cpp_client__
22#include <librpc/rpc_client.h>
23#include <string> // HACK
24#endif
25
26#include "proto/blockdev.pb.h"
27
28// BlockdevManager service
29#define BLOCKDEVMANAGER_SERVICE_X(ARGS, PB, xarg) \
30 PB(xarg, 1, register_device, REGISTER_DEVICE, mosrpc_blockdev_register_device_request, mosrpc_blockdev_register_device_response) \
31 PB(xarg, 2, register_layer_server, REGISTER_LAYER_SERVER, mosrpc_blockdev_register_layer_server_request, mosrpc_blockdev_register_layer_server_response) \
32 PB(xarg, 3, open_device, OPEN_DEVICE, mosrpc_blockdev_open_device_request, mosrpc_blockdev_open_device_response) \
33 PB(xarg, 4, read_block, READ_BLOCK, mosrpc_blockdev_read_block_request, mosrpc_blockdev_read_block_response) \
34 PB(xarg, 5, write_block, WRITE_BLOCK, mosrpc_blockdev_write_block_request, mosrpc_blockdev_write_block_response) \
35 /**/
36
37// Service stubs and interfaces for C++ clients and servers
38#ifdef __rpc_have_cpp_client__
39RPC_CLIENT_DEFINE_STUB_CLASS(BlockdevManagerStub, BLOCKDEVMANAGER_SERVICE_X);
40#endif
41
42#ifdef __rpc_have_cpp_server__
43RPC_DECL_SERVER_INTERFACE_CLASS(IBlockdevManagerService, BLOCKDEVMANAGER_SERVICE_X);
44#endif
45
46#ifdef __MOS_RPC_SERVER__
47#define MOS_RPC_BLOCKDEVMANAGER_SERVER(name) RPC_DECLARE_SERVER(name, BLOCKDEVMANAGER_SERVICE_X)
48#endif
49
50#ifdef __MOS_RPC_CLIENT__
51#define MOS_RPC_BLOCKDEVMANAGER_CLIENT(name) RPC_DECLARE_CLIENT(name, BLOCKDEVMANAGER_SERVICE_X)
52#endif
53
54// BlockdevDevice service
55#define BLOCKDEVDEVICE_SERVICE_X(ARGS, PB, xarg) \
56 PB(xarg, 1, read_block, READ_BLOCK, mosrpc_blockdev_read_block_request, mosrpc_blockdev_read_block_response) \
57 PB(xarg, 2, write_block, WRITE_BLOCK, mosrpc_blockdev_write_block_request, mosrpc_blockdev_write_block_response) \
58 /**/
59
60// Service stubs and interfaces for C++ clients and servers
61#ifdef __rpc_have_cpp_client__
62RPC_CLIENT_DEFINE_STUB_CLASS(BlockdevDeviceStub, BLOCKDEVDEVICE_SERVICE_X);
63#endif
64
65#ifdef __rpc_have_cpp_server__
66RPC_DECL_SERVER_INTERFACE_CLASS(IBlockdevDeviceService, BLOCKDEVDEVICE_SERVICE_X);
67#endif
68
69#ifdef __MOS_RPC_SERVER__
70#define MOS_RPC_BLOCKDEVDEVICE_SERVER(name) RPC_DECLARE_SERVER(name, BLOCKDEVDEVICE_SERVICE_X)
71#endif
72
73#ifdef __MOS_RPC_CLIENT__
74#define MOS_RPC_BLOCKDEVDEVICE_CLIENT(name) RPC_DECLARE_CLIENT(name, BLOCKDEVDEVICE_SERVICE_X)
75#endif
76
77// BlockdevLayer service
78#define BLOCKDEVLAYER_SERVICE_X(ARGS, PB, xarg) \
79 PB(xarg, 1, read_partition_block, READ_PARTITION_BLOCK, mosrpc_blockdev_read_partition_block_request, mosrpc_blockdev_read_block_response) \
80 PB(xarg, 2, write_partition_block, WRITE_PARTITION_BLOCK, mosrpc_blockdev_write_partition_block_request, mosrpc_blockdev_write_block_response) \
81 /**/
82
83// Service stubs and interfaces for C++ clients and servers
84#ifdef __rpc_have_cpp_client__
85RPC_CLIENT_DEFINE_STUB_CLASS(BlockdevLayerStub, BLOCKDEVLAYER_SERVICE_X);
86#endif
87
88#ifdef __rpc_have_cpp_server__
89RPC_DECL_SERVER_INTERFACE_CLASS(IBlockdevLayerService, BLOCKDEVLAYER_SERVICE_X);
90#endif
91
92#ifdef __MOS_RPC_SERVER__
93#define MOS_RPC_BLOCKDEVLAYER_SERVER(name) RPC_DECLARE_SERVER(name, BLOCKDEVLAYER_SERVICE_X)
94#endif
95
96#ifdef __MOS_RPC_CLIENT__
97#define MOS_RPC_BLOCKDEVLAYER_CLIENT(name) RPC_DECLARE_CLIENT(name, BLOCKDEVLAYER_SERVICE_X)
98#endif
99
100#undef __rpc_have_cpp_server__
101#undef __rpc_have_cpp_client__
102