Motr  M0
service.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 
23 #pragma once
24 
25 #ifndef __MOTR_NET_TEST_SERVICE_H__
26 #define __MOTR_NET_TEST_SERVICE_H__
27 
28 #include "lib/time.h" /* m0_time_t */
29 #include "lib/thread.h" /* m0_thread */
30 
31 #include "net/test/commands.h" /* m0_net_test_cmd_ctx */
32 
47 struct m0_net_test_service;
48 
54  int (*ntsch_handler)(void *ctx,
55  const struct m0_net_test_cmd *cmd,
56  struct m0_net_test_cmd *reply);
57 };
58 
71 };
72 
76  void *(*ntso_init)(struct m0_net_test_service *svc);
78  void (*ntso_fini)(void *ctx);
80  int (*ntso_step)(void *ctx);
85 };
86 
90  void *nts_svc_ctx;
96  int nts_errno;
97 };
98 
124  struct m0_net_test_service_ops *ops);
125 
135 
138 
145 
152  struct m0_net_test_cmd *cmd,
153  struct m0_net_test_cmd *reply);
154 
161  enum m0_net_test_service_state state);
162 
169 
174 #endif /* __MOTR_NET_TEST_SERVICE_H__ */
175 
176 /*
177  * Local variables:
178  * c-indentation-style: "K&R"
179  * c-basic-offset: 8
180  * tab-width: 8
181  * fill-column: 79
182  * scroll-step: 1
183  * End:
184  */
enum m0_net_test_cmd_type ntsch_type
Definition: service.h:52
int(* ntso_step)(void *ctx)
Definition: service.h:80
enum m0_net_test_service_state m0_net_test_service_state_get(struct m0_net_test_service *svc)
Definition: service.c:159
void m0_net_test_service_state_change(struct m0_net_test_service *svc, enum m0_net_test_service_state state)
Definition: service.c:147
struct m0_net_test_service_ops * nts_ops
Definition: service.h:92
m0_net_test_cmd_type
Definition: commands.h:78
int m0_net_test_service_init(struct m0_net_test_service *svc, struct m0_net_test_service_ops *ops)
Definition: service.c:68
struct m0_net_test_service_cmd_handler * ntso_cmd_handler
Definition: service.h:82
enum m0_net_test_service_state nts_state
Definition: service.h:94
static struct fdmi_ctx ctx
Definition: main.c:80
size_t ntso_cmd_handler_nr
Definition: service.h:84
int m0_net_test_service_step(struct m0_net_test_service *svc)
Definition: service.c:107
int m0_net_test_service_cmd_handle(struct m0_net_test_service *svc, struct m0_net_test_cmd *cmd, struct m0_net_test_cmd *reply)
Definition: service.c:121
void m0_net_test_service_fini(struct m0_net_test_service *svc)
Definition: service.c:88
m0_net_test_service_state
Definition: service.h:60
int(* ntsch_handler)(void *ctx, const struct m0_net_test_cmd *cmd, struct m0_net_test_cmd *reply)
Definition: service.h:54
static struct m0_net_test_service svc
Definition: service.c:34
void * nts_svc_ctx
Definition: service.h:90
void(* ntso_fini)(void *ctx)
Definition: service.h:78
bool m0_net_test_service_invariant(struct m0_net_test_service *svc)
Definition: service.c:98
struct m0_fom_ops ops
Definition: io_foms.c:623
static struct m0_dtm_oper_descr reply
Definition: transmit.c:94