4 Copyright (C) Martin Schwenke 2011
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, see <http://www.gnu.org/licenses/>.
23 #ifdef CTDB_TEST_OVERRIDE_MAIN
25 /* Define our own main() and usage() functions */
26 #define main(argc, argv) main_foobar(argc, argv)
27 int main_foobar(int argc
, const char **argv
);
28 #define usage usage_foobar
30 #endif /* CTDB_TEST_USE_MAIN */
32 #define ctdb_cmdline_client(x, y) \
33 ctdb_cmdline_client_stub(x, y)
34 #define tevent_context_init(x) \
35 tevent_context_init_stub(x)
36 #define ctdb_ctrl_getnodemap(ctdb, timelimit, pnn, tmp_ctx, nodemap) \
37 ctdb_ctrl_getnodemap_stub(ctdb, timelimit, pnn, tmp_ctx, nodemap)
38 #define ctdb_ctrl_get_ifaces(ctdb, timelimit, pnn, tmp_ctx, ifaces) \
39 ctdb_ctrl_get_ifaces_stub(ctdb, timelimit, pnn, tmp_ctx, ifaces)
40 #define ctdb_ctrl_getpnn(ctdb, timelimit, pnn) \
41 ctdb_ctrl_getpnn_stub(ctdb, timelimit, pnn)
42 #define ctdb_ctrl_getrecmode(ctdb, tmp_ctx, timelimit, pnn, recmode) \
43 ctdb_ctrl_getrecmode_stub(ctdb, tmp_ctx, timelimit, pnn, recmode)
44 #define ctdb_ctrl_getrecmaster(ctdb, tmp_ctx, timelimit, pnn, recmaster) \
45 ctdb_ctrl_getrecmaster_stub(ctdb, tmp_ctx, timelimit, pnn, recmaster)
46 #define ctdb_ctrl_getvnnmap(ctdb, timelimit, pnn, tmp_ctx, vnnmap) \
47 ctdb_ctrl_getvnnmap_stub(ctdb, timelimit, pnn, tmp_ctx, vnnmap)
48 #define ctdb_ctrl_getdebseqnum(ctdb, timelimit, pnn, db_id, seqnum) \
49 ctdb_ctrl_getvnnmap_stub(ctdb, timelimit, pnn, db_id, seqnum)
50 #define ctdb_client_check_message_handlers(ctdb, ids, argc, result) \
51 ctdb_client_check_message_handlers_stub(ctdb, ids, argc, result)
52 #define ctdb_ctrl_getcapabilities(ctdb, timeout, destnode, capabilities) \
53 ctdb_ctrl_getcapabilities_stub(ctdb, timeout, destnode, capabilities)
54 #define ctdb_sys_have_ip(addr) \
55 ctdb_sys_have_ip_stub(addr)
57 #include "tools/ctdb.c"
59 #ifndef CTDB_TEST_USE_MAIN
62 #endif /* CTDB_TEST_USE_MAIN */
64 #undef ctdb_cmdline_client
65 #undef tevent_context_init
66 /* This is called in client/ctdb_client.c so needs a declaration... */
67 struct ctdb_context
*ctdb_cmdline_client(struct tevent_context
*ev
,
68 struct timeval req_timeout
);
69 struct tevent_context
*tevent_context_init(TALLOC_CTX
*mem_ctx
);
70 #include "common/cmdline.c"
72 #undef ctdb_ctrl_getnodemap
73 #undef ctdb_ctrl_get_ifaces
74 #undef ctdb_ctrl_getpnn
75 #undef ctdb_ctrl_getrecmode
76 #undef ctdb_ctrl_getrecmaster
77 #undef ctdb_ctrl_getvnnmap
78 #undef ctdb_ctrl_getdebseqnum
79 #undef ctdb_client_check_message_handlers
80 #undef ctdb_ctrl_getcapabilities
81 #undef ctdb_sys_have_ip
82 int ctdb_ctrl_getnodemap(struct ctdb_context
*ctdb
,
83 struct timeval timeout
, uint32_t destnode
,
84 TALLOC_CTX
*mem_ctx
, struct ctdb_node_map
**nodemap
);
85 int ctdb_ctrl_get_ifaces(struct ctdb_context
*ctdb
,
86 struct timeval timeout
, uint32_t destnode
,
88 struct ctdb_control_get_ifaces
**ifaces
);
89 int ctdb_ctrl_getpnn(struct ctdb_context
*ctdb
, struct timeval timeout
,
91 int ctdb_ctrl_getrecmode(struct ctdb_context
*ctdb
,
92 TALLOC_CTX
*mem_ctx
, struct timeval timeout
,
93 uint32_t destnode
, uint32_t *recmode
);
94 int ctdb_ctrl_getrecmaster(struct ctdb_context
*ctdb
,
95 TALLOC_CTX
*mem_ctx
, struct timeval timeout
,
96 uint32_t destnode
, uint32_t *recmaster
);
97 int ctdb_ctrl_getvnnmap(struct ctdb_context
*ctdb
,
98 struct timeval timeout
, uint32_t destnode
,
99 TALLOC_CTX
*mem_ctx
, struct ctdb_vnn_map
**vnnmap
);
100 int ctdb_ctrl_getdbseqnum(struct ctdb_context
*ctdb
, struct timeval timeout
,
101 uint32_t destnode
, uint32_t dbid
, uint64_t *seqnum
);
102 int ctdb_client_check_message_handlers(struct ctdb_context
*ctdb
,
103 uint64_t *ids
, uint32_t num
,
105 int ctdb_ctrl_getcapabilities(struct ctdb_context
*ctdb
,
106 struct timeval timeout
, uint32_t destnode
,
107 uint32_t *capabilities
);
108 bool ctdb_sys_have_ip(ctdb_sock_addr
*addr
);
111 #include "tools/ctdb_vacuum.c"
114 #include "lib/util/idtree.c"
115 #include "lib/util/util.c"
116 #include "lib/util/util_time.c"
117 #include "lib/util/util_file.c"
118 #include "lib/util/fault.c"
119 #include "lib/util/substitute.c"
120 #include "lib/util/signal.c"
122 /* CTDB_COMMON_OBJ */
123 #include "common/ctdb_io.c"
124 #include "common/ctdb_util.c"
125 #include "common/ctdb_ltdb.c"
126 #include "common/ctdb_message.c"
127 #include "lib/util/debug.c"
128 #include "common/rb_tree.c"
129 #include "common/system_common.c"
130 #include "common/ctdb_logging.c"
131 #include "common/ctdb_fork.c"
132 #include "common/system_util.c"
134 /* CTDB_CLIENT_OBJ */
135 #include "client/ctdb_client.c"
138 #include "ctdb_test_stubs.c"
140 #endif /* _CTDBD_TEST_C */