Motr  M0
msg.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2016-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 
23 #pragma once
24 
25 #ifndef __MOTR_HA_MSG_H__
26 #define __MOTR_HA_MSG_H__
27 
34 #include "lib/types.h" /* UINT64_MAX */
35 #include "lib/time.h" /* m0_time_t */
36 #include "lib/cookie.h" /* m0_cookie */
37 
38 #include "fid/fid.h" /* m0_fid */
39 #include "stob/ioq_error.h" /* m0_stob_ioq_error */
40 #include "ha/note.h" /* m0_ha_msg_nvec */
41 #include "ha/failvec.h" /* m0_ha_msg_failure_vec_req */
42 #include "motr/keepalive.h" /* m0_ha_msg_keepalive_req */
43 #include "conf/ha.h" /* m0_conf_ha_process */
44 #include "rpc/ha.h" /* m0_rpc_ha_msg */
45 #include "be/ha.h" /* m0_be_io_err */
46 #include "sns/cm/ha.h" /* m0_ha_sns_err */
47 
48 /*
49  * XXX The generator of *_xc.h files cannot handle dependencies, so we have
50  * to specify them manually.
51  */
52 #include "stob/ioq_error_xc.h" /* workaround */
53 #include "lib/types_xc.h" /* m0_uint128_xc */
54 #include "lib/cookie_xc.h" /* m0_cookie_xc */
55 #include "ha/note_xc.h" /* m0_ha_msg_nvec_xc */
56 #include "ha/failvec_xc.h" /* m0_ha_msg_failure_vec_req */
57 #include "motr/keepalive_xc.h" /* m0_ha_msg_keepalive_req_xc */
58 #include "conf/ha_xc.h" /* m0_conf_ha_process_xc */
59 #include "rpc/ha_xc.h" /* m0_rpc_ha_msg_xc */
60 #include "be/ha_xc.h" /* m0_be_io_err_xc */
61 #include "sns/cm/ha_xc.h" /* m0_ha_sns_err_xc */
62 
63 enum {
65 };
66 
67 enum {
70 };
71 
85 };
86 
88  uint64_t hed_type;
89  union {
90  struct m0_stob_ioq_error hed_stob_ioq
92  struct m0_ha_msg_nvec hed_nvec
94  struct m0_ha_msg_failure_vec_req hed_fvec_req
96  struct m0_ha_msg_failure_vec_rep hed_fvec_rep
98  struct m0_ha_msg_keepalive_req hed_keepalive_req
100  struct m0_ha_msg_keepalive_rep hed_keepalive_rep
102  struct m0_conf_ha_process hed_event_process
104  struct m0_conf_ha_service hed_event_service
106  struct m0_ha_msg_rpc hed_event_rpc
108  struct m0_be_io_err hed_be_io_err
110  struct m0_ha_sns_err hed_ha_sns_err
112  } u;
113 } M0_XCA_UNION M0_XCA_DOMAIN(rpc);
114 
115 struct m0_ha_msg {
116 /* public fields */
117  struct m0_fid hm_fid;
121  uint64_t hm_epoch;
123 /* private fields */
125  uint64_t hm_tag;
126 } M0_XCA_RECORD M0_XCA_DOMAIN(rpc);
127 
129 M0_INTERNAL uint64_t m0_ha_msg_tag(const struct m0_ha_msg *msg);
131 M0_INTERNAL enum m0_ha_msg_type m0_ha_msg_type_get(const struct m0_ha_msg *msg);
132 
134 M0_INTERNAL bool m0_ha_msg_eq(const struct m0_ha_msg *msg1,
135  const struct m0_ha_msg *msg2);
136 
138 M0_INTERNAL void m0_ha_msg_debug_print(const struct m0_ha_msg *msg,
139  const char *prefix);
140 
142 #endif /* __MOTR_HA_MSG_H__ */
143 
144 /*
145  * Local variables:
146  * c-indentation-style: "K&R"
147  * c-basic-offset: 8
148  * tab-width: 8
149  * fill-column: 80
150  * scroll-step: 1
151  * End:
152  */
153 /*
154  * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
155  */
uint64_t hed_type
Definition: msg.h:88
struct m0_fid hm_fid
Definition: msg.h:117
M0_INTERNAL enum m0_ha_msg_type m0_ha_msg_type_get(const struct m0_ha_msg *msg)
Definition: msg.c:41
uint64_t m0_time_t
Definition: time.h:37
static struct m0_uint128 prefix
Definition: extmap.c:45
struct m0_ha_msg_data hm_data
Definition: msg.h:122
#define M0_XCA_TAG(value)
Definition: xcode_attr.h:57
struct m0_fid hm_source_process
Definition: msg.h:118
uint64_t hm_epoch
Definition: msg.h:121
m0_ha_msg_type
Definition: msg.h:72
uint64_t hm_tag
Definition: msg.h:125
M0_INTERNAL bool m0_ha_msg_eq(const struct m0_ha_msg *msg1, const struct m0_ha_msg *msg2)
Definition: msg.c:46
Definition: msg.h:115
#define UINT64_MAX
Definition: types.h:44
#define M0_XCA_DOMAIN(value)
Definition: xcode_attr.h:72
M0_INTERNAL uint64_t m0_ha_msg_tag(const struct m0_ha_msg *msg)
Definition: msg.c:36
union m0_ha_msg_data::@212 u
Definition: fid.h:38
m0_time_t hm_time
Definition: msg.h:120
M0_INTERNAL void m0_ha_msg_debug_print(const struct m0_ha_msg *msg, const char *prefix)
Definition: msg.c:63
struct m0_fid hm_source_service
Definition: msg.h:119