Motr  M0
sd_common.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2017-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 #pragma once
23 
24 #ifndef __MOTR_FDMI_UT_FDMI_SD_COMMON_H__
25 #define __MOTR_FDMI_UT_FDMI_SD_COMMON_H__
26 
27 #include "rpc/formation2_internal.h" /* m0_rpc_frm_ops */
28 
29 #include "fdmi/filterc.h"
30 
31 #define _QUOTE(s) #s
32 #define QUOTE(s) _QUOTE(s)
33 
34 /* See "fdmi/ut/Makefile.sub" for M0_FDMI_UT_DIR */
35 #define M0_FDMI_UT_PATH(name) QUOTE(M0_FDMI_UT_DIR) "/" name
36 
37 void fdmi_serv_start_ut(const struct m0_filterc_ops *filterc_ops);
38 void fdmi_serv_stop_ut(void);
39 
41  struct m0_motr motr;
42  /* Actually not used, but added to req->rh_rpc_machines
43  * to pass some checks */
46 };
47 
48 extern struct fdmi_sd_ut_ctx g_sd_ut;
49 
50 extern const struct m0_filterc_ops filterc_stub_ops;
51 
52 struct test_rpc_env {
62 };
63 
64 void prepare_rpc_env(struct test_rpc_env *env,
65  struct m0_reqh *reqh,
66  const struct m0_rpc_frm_ops *frm_ops,
67  bool sender,
68  struct m0_rpc_conn *rpc_conn,
69  struct m0_rpc_session *rpc_session);
70 
71 void unprepare_rpc_env(struct test_rpc_env *env);
72 
74  struct m0_rpc_packet *p);
75 
76 #endif /* __MOTR_FDMI_UT_FDMI_SD_COMMON_H__ */
77 
78 /*
79  * Local variables:
80  * c-indentation-style: "K&R"
81  * c-basic-offset: 8
82  * tab-width: 8
83  * fill-column: 80
84  * scroll-step: 1
85  * End:
86  */
87 /*
88  * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
89  */
struct m0_motr motr
Definition: sd_common.h:41
static struct m0_addb2_philter p
Definition: consumer.c:40
const struct m0_filterc_ops filterc_stub_ops
Definition: filterc_stub.c:43
const struct m0_rpc_frm_ops frm_ops
Definition: pd_ut.c:438
void fdmi_serv_start_ut(const struct m0_filterc_ops *filterc_ops)
Definition: sd_common.c:66
struct m0_net_end_point * tre_ep
Definition: sd_common.h:59
struct m0_rpc_machine tre_rpc_machine
Definition: sd_common.h:56
void fdmi_serv_stop_ut(void)
Definition: sd_common.c:121
static struct m0_addb2_mach * mach
Definition: storage.c:42
struct m0_net_buffer_pool tre_buffer_pool
Definition: sd_common.h:58
struct fdmi_sd_ut_ctx g_sd_ut
Definition: sd_common.c:41
void prepare_rpc_env(struct test_rpc_env *env, struct m0_reqh *reqh, const struct m0_rpc_frm_ops *frm_ops, bool sender, struct m0_rpc_conn *rpc_conn, struct m0_rpc_session *rpc_session)
Definition: sd_common.c:171
void unprepare_rpc_env(struct test_rpc_env *env)
Definition: sd_common.c:241
struct m0_rpc_chan * tre_rpc_chan
Definition: sd_common.h:57
struct m0_rpc_session * tre_session
Definition: sd_common.h:54
Definition: reqh.h:94
void fdmi_ut_packet_send_failed(struct m0_rpc_machine *mach, struct m0_rpc_packet *p)
Definition: sd_common.c:154
struct m0_rpc_machine rpc_machine
Definition: sd_common.h:44
char * ep_addr_remote
Definition: sd_common.h:61
Definition: setup.h:354
struct m0_reqh reqh
Definition: rm_foms.c:48
char * ep_addr_local
Definition: sd_common.h:60
struct m0_reqh_service * fdmi_service
Definition: sd_common.h:45
struct m0_net_domain tre_net_dom
Definition: sd_common.h:53
struct m0_rpc_conn * tre_conn
Definition: sd_common.h:55