Motr  M0
main.c
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 
29 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_HA
30 #include "lib/trace.h"
31 
32 #include "lib/assert.h" /* M0_ASSERT */
33 #include "lib/misc.h" /* NULL */
34 #include "fid/fid.h" /* M0_FID_TINIT */
35 #include "ha/halon/interface.h" /* m0_halon_interface */
36 
37 int main(int argc, char *argv[])
38 {
39  struct m0_halon_interface *hi;
40  int rc;
41 
42  rc = m0_halon_interface_init(&hi, "", "", NULL, NULL);
43  M0_ASSERT(rc == 0);
44  rc = m0_halon_interface_start(hi, "0@lo:12345:42:100",
45  &M0_FID_TINIT('r', 1, 1),
46  &M0_FID_TINIT('s', 1, 1),
47  &M0_FID_TINIT('s', 1, 2),
48  NULL, NULL, NULL, NULL, NULL,
49  NULL, NULL, NULL, NULL);
50  M0_ASSERT(rc == 0);
53  return 0;
54 }
55 
56 #undef M0_TRACE_SUBSYSTEM
57 
59 /*
60  * Local variables:
61  * c-indentation-style: "K&R"
62  * c-basic-offset: 8
63  * tab-width: 8
64  * fill-column: 80
65  * scroll-step: 1
66  * End:
67  */
68 /*
69  * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
70  */
void m0_halon_interface_stop(struct m0_halon_interface *hi)
Definition: interface.c:1040
#define NULL
Definition: misc.h:38
int m0_halon_interface_start(struct m0_halon_interface *hi, const char *local_rpc_endpoint, const struct m0_fid *process_fid, const struct m0_fid *ha_service_fid, const struct m0_fid *rm_service_fid, void(*entrypoint_request_cb)(struct m0_halon_interface *hi, const struct m0_uint128 *req_id, const char *remote_rpc_endpoint, const struct m0_fid *process_fid, const char *git_rev_id, uint64_t pid, bool first_request), void(*msg_received_cb)(struct m0_halon_interface *hi, struct m0_ha_link *hl, const struct m0_ha_msg *msg, uint64_t tag), void(*msg_is_delivered_cb)(struct m0_halon_interface *hi, struct m0_ha_link *hl, uint64_t tag), void(*msg_is_not_delivered_cb)(struct m0_halon_interface *hi, struct m0_ha_link *hl, uint64_t tag), void(*link_connected_cb)(struct m0_halon_interface *hi, const struct m0_uint128 *req_id, struct m0_ha_link *link), void(*link_reused_cb)(struct m0_halon_interface *hi, const struct m0_uint128 *req_id, struct m0_ha_link *link), void(*link_absent_cb)(struct m0_halon_interface *hi, const struct m0_uint128 *req_id), void(*link_is_disconnecting_cb)(struct m0_halon_interface *hi, struct m0_ha_link *link), void(*link_disconnected_cb)(struct m0_halon_interface *hi, struct m0_ha_link *link))
Definition: interface.c:948
int m0_halon_interface_init(struct m0_halon_interface **hi_out, const char *build_git_rev_id, const char *build_configure_opts, const char *debug_options, const char *node_uuid)
Definition: interface.c:583
#define M0_FID_TINIT(type, container, key)
Definition: fid.h:90
#define M0_ASSERT(cond)
int main(int argc, char *argv[])
Definition: main.c:245
int32_t rc
Definition: trigger_fop.h:47
static void hi(void)
Definition: nucleus.c:93
void m0_halon_interface_fini(struct m0_halon_interface *hi)
Definition: interface.c:627