s3:lib: move all ctdb related dummy functions to ctdb_dummy.c
[Samba.git] / source3 / lib / ctdb_dummy.c
blob9f32d1353c67c0705bbb7b8790a521111c38f863
1 /*
2 Unix SMB/CIFS implementation.
3 Copyright (C) 2014 Björn Baumbach
4 Copyright (C) 2014 Stefan Metzmacher
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/>.
20 #include "includes.h"
21 #include "messages.h"
22 #include "ctdb_conn.h"
23 #include "ctdbd_conn.h"
24 #include "lib/dbwrap/dbwrap.h"
25 #include "lib/dbwrap/dbwrap_ctdb.h"
26 #include "torture/proto.h"
28 #ifndef CLUSTER_SUPPORT
30 NTSTATUS ctdbd_probe(void)
32 return NT_STATUS_NOT_IMPLEMENTED;
35 NTSTATUS ctdbd_messaging_send_blob(struct ctdbd_connection *conn,
36 uint32_t dst_vnn, uint64_t dst_srvid,
37 const uint8_t *buf, size_t buflen)
39 return NT_STATUS_NOT_IMPLEMENTED;
42 NTSTATUS register_with_ctdbd(struct ctdbd_connection *conn, uint64_t srvid)
44 return NT_STATUS_NOT_IMPLEMENTED;
47 NTSTATUS ctdbd_register_reconfigure(struct ctdbd_connection *conn)
49 return NT_STATUS_NOT_IMPLEMENTED;
52 NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn,
53 const struct sockaddr_storage *_server,
54 const struct sockaddr_storage *_client,
55 bool (*release_ip_handler)(const char *ip_addr,
56 void *private_data),
57 void *private_data)
59 return NT_STATUS_NOT_IMPLEMENTED;
62 bool ctdb_serverids_exist_supported(struct ctdbd_connection *conn)
64 return false;
67 bool ctdb_serverids_exist(struct ctdbd_connection *conn,
68 const struct server_id *pids, unsigned num_pids,
69 bool *results)
71 return false;
74 bool ctdb_processes_exist(struct ctdbd_connection *conn,
75 const struct server_id *pids, int num_pids,
76 bool *results)
78 return false;
81 struct dummy_state {
82 uint8_t dummy;
85 static struct tevent_req *dummy_send(TALLOC_CTX *mem_ctx,
86 struct tevent_context *ev)
88 struct tevent_req *req;
89 struct dummy_state *state;
90 req = tevent_req_create(mem_ctx, &state, struct dummy_state);
91 if (req == NULL) {
92 return NULL;
94 tevent_req_done(req);
95 return tevent_req_post(req, ev);
98 struct tevent_req *ctdb_conn_init_send(TALLOC_CTX *mem_ctx,
99 struct tevent_context *ev,
100 const char *sock)
102 return dummy_send(mem_ctx, ev);
105 int ctdb_conn_init_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
106 struct ctdb_conn **pconn)
108 return ENOSYS;
111 struct tevent_req *ctdb_conn_msg_write_send(TALLOC_CTX *mem_ctx,
112 struct tevent_context *ev,
113 struct ctdb_conn *conn,
114 uint32_t vnn, uint64_t srvid,
115 uint8_t *msg, size_t msg_len)
117 return dummy_send(mem_ctx, ev);
120 int ctdb_conn_msg_write_recv(struct tevent_req *req)
122 return ENOSYS;
125 struct tevent_req *ctdb_msg_channel_init_send(
126 TALLOC_CTX *mem_ctx, struct tevent_context *ev,
127 const char *sock, uint64_t srvid)
129 return dummy_send(mem_ctx, ev);
132 int ctdb_msg_channel_init_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
133 struct ctdb_msg_channel **pchannel)
135 return ENOSYS;
138 struct tevent_req *ctdb_msg_read_send(TALLOC_CTX *mem_ctx,
139 struct tevent_context *ev,
140 struct ctdb_msg_channel *channel)
142 return dummy_send(mem_ctx, ev);
145 int ctdb_msg_read_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
146 uint8_t **pmsg, size_t *pmsg_len)
148 return ENOSYS;
151 struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
152 const char *name,
153 int hash_size, int tdb_flags,
154 int open_flags, mode_t mode,
155 enum dbwrap_lock_order lock_order,
156 uint64_t dbwrap_flags)
158 errno = ENOSYS;
159 return NULL;
162 NTSTATUS messaging_ctdbd_init(struct messaging_context *msg_ctx,
163 TALLOC_CTX *mem_ctx,
164 struct messaging_backend **presult)
166 return NT_STATUS_NOT_IMPLEMENTED;
169 struct ctdbd_connection *messaging_ctdbd_connection(void)
171 return NULL;
174 bool run_ctdb_conn(int dummy)
176 return true;
179 #endif