Motr  M0
common.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2013-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_CONF_UT_COMMON_H__
25 #define __MOTR_CONF_UT_COMMON_H__
26 
27 #include "conf/confc.h" /* m0_confc_ctx */
28 #include "lib/chan.h" /* m0_clink */
29 
30 #define SERVER_ENDPOINT_ADDR "0@lo:12345:34:1"
31 #define SERVER_ENDPOINT M0_NET_XPRT_PREFIX_DEFAULT":"SERVER_ENDPOINT_ADDR
32 #define CLIENT_ENDPOINT_ADDR "0@lo:12345:34:*"
33 
34 extern struct m0_conf_cache m0_conf_ut_cache;
35 extern struct m0_sm_group m0_conf_ut_grp;
36 
39  struct m0_clink w_clink;
40 };
41 
42 M0_INTERNAL void m0_conf_ut_waiter_init(struct m0_conf_ut_waiter *w,
43  struct m0_confc *confc);
44 M0_INTERNAL void m0_conf_ut_waiter_fini(struct m0_conf_ut_waiter *w);
45 M0_INTERNAL int m0_conf_ut_waiter_wait(struct m0_conf_ut_waiter *w,
46  struct m0_conf_obj **result);
47 
48 M0_INTERNAL int m0_conf_ut_ast_thread_init(void);
49 M0_INTERNAL int m0_conf_ut_ast_thread_fini(void);
50 
51 M0_INTERNAL int m0_conf_ut_cache_init(void);
52 M0_INTERNAL int m0_conf_ut_cache_fini(void);
53 
54 #ifndef __KERNEL__
55 M0_INTERNAL void m0_conf_ut_cache_from_file(struct m0_conf_cache *cache,
56  const char *path);
57 #endif
58 
59 #endif /* __MOTR_CONF_UT_COMMON_H__ */
Definition: beck.c:235
M0_INTERNAL void m0_conf_ut_waiter_init(struct m0_conf_ut_waiter *w, struct m0_confc *confc)
Definition: common.c:41
M0_INTERNAL void m0_conf_ut_waiter_fini(struct m0_conf_ut_waiter *w)
Definition: common.c:49
M0_INTERNAL int m0_conf_ut_ast_thread_fini(void)
Definition: common.c:96
M0_INTERNAL int m0_conf_ut_waiter_wait(struct m0_conf_ut_waiter *w, struct m0_conf_obj **result)
Definition: common.c:56
struct m0_conf_cache m0_conf_ut_cache
Definition: common.c:31
M0_INTERNAL int m0_conf_ut_cache_init(void)
Definition: common.c:107
M0_INTERNAL void m0_conf_ut_cache_from_file(struct m0_conf_cache *cache, const char *path)
Definition: common.c:123
struct m0_confc_ctx w_ctx
Definition: common.h:38
struct m0_clink w_clink
Definition: common.h:39
M0_INTERNAL int m0_conf_ut_ast_thread_init(void)
Definition: common.c:86
static struct m0_confc * confc
Definition: file.c:94
struct m0_sm_group m0_conf_ut_grp
Definition: common.c:32
M0_INTERNAL int m0_conf_ut_cache_fini(void)
Definition: common.c:114