Motr  M0
console_fop.c
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 
23 #include "fop/fop.h" /* m0_fop_xcode_length */
24 #include "fop/fom_generic.h" /* m0_generic_conf */
25 #include "rpc/rpc_opcodes.h" /* M0_CONS_FOP_DEVICE_OPCODE */
26 
27 #include "console/console_fom.h" /* FOMs defs */
28 #include "console/console_fop.h" /* FOPs defs */
29 #include "console/console_fop_xc.h" /* FOP memory layout */
30 
37 
41 
42 M0_INTERNAL void m0_console_fop_fini(void)
43 {
47 }
48 
50 
51 M0_INTERNAL int m0_console_fop_init(void)
52 {
54  .name = "Device Failed",
56  .xt = m0_cons_fop_device_xc,
57  .rpc_flags = M0_RPC_ITEM_TYPE_REQUEST,
58  .sm = &m0_generic_conf,
60  .svc_type = &m0_rpc_service_type);
62  .name = "Console Reply",
64  .xt = m0_cons_fop_reply_xc,
65  .rpc_flags = M0_RPC_ITEM_TYPE_REPLY);
67  .name = "Console Test",
69  .xt = m0_cons_fop_test_xc,
70  .sm = &m0_generic_conf,
71  .rpc_flags = M0_RPC_ITEM_TYPE_REQUEST,
72  .fom_ops = &m0_console_fom_type_test_ops,
73  .svc_type = &m0_rpc_service_type);
74  return 0;
75 }
76 
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  */
#define M0_FOP_TYPE_INIT(ft,...)
Definition: fop.h:307
const struct m0_fom_type_ops m0_cons_fom_device_type_ops
struct m0_fop_type m0_cons_fop_reply_fopt
Definition: console_fop.c:39
struct m0_fop_type m0_cons_fop_test_fopt
Definition: console_fop.c:40
struct m0_fop_type m0_cons_fop_device_fopt
Definition: console_fop.c:38
void m0_fop_type_fini(struct m0_fop_type *fopt)
Definition: fop.c:232
static struct m0_xcode_type ** xt[]
Definition: protocol.c:64
const struct m0_sm_conf m0_generic_conf
Definition: fom_generic.c:838
const struct m0_fom_type_ops m0_console_fom_type_device_ops
Definition: console_fom.c:147
int opcode
Definition: crate.c:301
const struct m0_fom_type_ops m0_console_fom_type_test_ops
Definition: console_fom.c:168
const char * name
Definition: trace.c:110
struct m0_reqh_service_type m0_rpc_service_type
Definition: service.c:120
M0_INTERNAL int m0_console_fop_init(void)
Definition: console_fop.c:51
M0_INTERNAL void m0_console_fop_fini(void)
Definition: console_fop.c:42