Motr  M0
rpc.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2012-2020 Seagate Technology LLC and/or its Affiliates
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * For any questions about this software or licensing,
18  * please email opensource@seagate.com or cortx-questions@seagate.com.
19  *
20  */
21 
22 
35 #pragma once
36 
37 #ifndef __MOTR_RPC_RPCCORE_H__
38 #define __MOTR_RPC_RPCCORE_H__
39 
40 #include "lib/arith.h" /* max32u */
41 #include "rpc/rpc_machine.h"
42 #include "rpc/conn.h"
43 #include "rpc/session.h"
44 #include "rpc/item.h"
45 #include "rpc/bulk.h"
46 #include "rpc/rpc_helpers.h"
47 #include "net/buffer_pool.h"
48 #include "rpc/item.h" /* m0_rpc_item_onwire_header_size */
49 #include "rpc/item_source.h"
50 
51 /* imports */
52 
53 M0_INTERNAL int m0_rpc_init(void);
54 M0_INTERNAL void m0_rpc_fini(void);
55 
98 M0_INTERNAL int m0_rpc_post(struct m0_rpc_item *item);
99 
109 void m0_rpc_reply_post(struct m0_rpc_item *request, struct m0_rpc_item *reply);
110 
111 M0_INTERNAL void m0_rpc_oneway_item_post(const struct m0_rpc_conn *conn,
112  struct m0_rpc_item *item);
113 
119 M0_INTERNAL int m0_rpc_net_buffer_pool_setup(struct m0_net_domain *ndom,
120  struct m0_net_buffer_pool
121  *app_pool, uint32_t bufs_nr,
122  uint32_t tm_nr);
123 
125 
132 M0_INTERNAL uint32_t m0_rpc_bufs_nr(uint32_t len, uint32_t tms_nr);
133 
135 M0_INTERNAL m0_bcount_t m0_rpc_max_seg_size(struct m0_net_domain *ndom);
136 
138 M0_INTERNAL uint32_t m0_rpc_max_segs_nr(struct m0_net_domain *ndom);
139 
141 M0_INTERNAL m0_bcount_t m0_rpc_max_msg_size(struct m0_net_domain *ndom,
142  m0_bcount_t rpc_size);
143 
148 M0_INTERNAL uint32_t m0_rpc_max_recv_msgs(struct m0_net_domain *ndom,
149  m0_bcount_t rpc_size);
150 
151 M0_INTERNAL m0_time_t m0_rpc__down_timeout(void);
152 
155 #endif /* __MOTR_RPC_RPCCORE_H__ */
156 
157 /*
158  * Local variables:
159  * c-indentation-style: "K&R"
160  * c-basic-offset: 8
161  * tab-width: 8
162  * fill-column: 80
163  * scroll-step: 1
164  * End:
165  */
M0_INTERNAL uint32_t m0_rpc_max_segs_nr(struct m0_net_domain *ndom)
Definition: rpc.c:293
M0_INTERNAL int m0_rpc_post(struct m0_rpc_item *item)
Definition: rpc.c:63
M0_INTERNAL void m0_rpc_oneway_item_post(const struct m0_rpc_conn *conn, struct m0_rpc_item *item)
Definition: rpc.c:169
static struct m0_net_buffer_pool app_pool
Definition: reqh_fom_ut.c:167
M0_INTERNAL uint32_t m0_rpc_max_recv_msgs(struct m0_net_domain *ndom, m0_bcount_t rpc_size)
Definition: rpc.c:312
uint64_t m0_time_t
Definition: time.h:37
uint64_t m0_bcount_t
Definition: types.h:77
M0_INTERNAL m0_time_t m0_rpc__down_timeout(void)
Definition: rpc.c:322
static struct m0_rpc_item * item
Definition: item.c:56
M0_INTERNAL m0_bcount_t m0_rpc_max_msg_size(struct m0_net_domain *ndom, m0_bcount_t rpc_size)
Definition: rpc.c:302
M0_INTERNAL int m0_rpc_net_buffer_pool_setup(struct m0_net_domain *ndom, struct m0_net_buffer_pool *app_pool, uint32_t bufs_nr, uint32_t tm_nr)
Definition: rpc.c:229
M0_INTERNAL uint32_t m0_rpc_bufs_nr(uint32_t len, uint32_t tms_nr)
Definition: rpc.c:271
void m0_rpc_reply_post(struct m0_rpc_item *request, struct m0_rpc_item *reply)
Definition: rpc.c:135
struct m0_rpc_conn conn
Definition: fsync.c:96
M0_INTERNAL int m0_rpc_init(void)
Definition: rpc.c:42
M0_INTERNAL void m0_rpc_fini(void)
Definition: rpc.c:51
void m0_rpc_net_buffer_pool_cleanup(struct m0_net_buffer_pool *app_pool)
Definition: rpc.c:264
static struct m0_dtm_oper_descr reply
Definition: transmit.c:94
M0_INTERNAL m0_bcount_t m0_rpc_max_seg_size(struct m0_net_domain *ndom)
Definition: rpc.c:284