ctdbd_conn: Fix CID 1301580 Explicit null dereferenced
[Samba.git] / source3 / lib / ctdb_dummy.c
blobbea707dee3747c7c546290e5673e625044741f68
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 NTSTATUS ctdbd_probe(void)
30 return NT_STATUS_NOT_IMPLEMENTED;
33 NTSTATUS ctdbd_messaging_send_iov(struct ctdbd_connection *conn,
34 uint32_t dst_vnn, uint64_t dst_srvid,
35 const struct iovec *iov, int iovlen)
37 return NT_STATUS_NOT_IMPLEMENTED;
40 NTSTATUS register_with_ctdbd(struct ctdbd_connection *conn, uint64_t srvid,
41 void (*cb)(struct ctdb_req_message *msg,
42 void *private_data),
43 void *private_data)
45 return NT_STATUS_NOT_IMPLEMENTED;
48 NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn,
49 const struct sockaddr_storage *_server,
50 const struct sockaddr_storage *_client,
51 bool (*release_ip_handler)(const char *ip_addr,
52 void *private_data),
53 void *private_data)
55 return NT_STATUS_NOT_IMPLEMENTED;
58 const char *lp_ctdbd_socket(void)
60 return "";
63 bool ctdb_serverids_exist_supported(struct ctdbd_connection *conn)
65 return false;
68 bool ctdb_serverids_exist(struct ctdbd_connection *conn,
69 const struct server_id *pids, unsigned num_pids,
70 bool *results)
72 return false;
75 bool ctdb_processes_exist(struct ctdbd_connection *conn,
76 const struct server_id *pids, int num_pids,
77 bool *results)
79 return false;
82 struct dummy_state {
83 uint8_t dummy;
86 static struct tevent_req *dummy_send(TALLOC_CTX *mem_ctx,
87 struct tevent_context *ev)
89 struct tevent_req *req;
90 struct dummy_state *state;
91 req = tevent_req_create(mem_ctx, &state, struct dummy_state);
92 if (req == NULL) {
93 return NULL;
95 tevent_req_done(req);
96 return tevent_req_post(req, ev);
99 struct tevent_req *ctdb_conn_init_send(TALLOC_CTX *mem_ctx,
100 struct tevent_context *ev,
101 const char *sock)
103 return dummy_send(mem_ctx, ev);
106 int ctdb_conn_init_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
107 struct ctdb_conn **pconn)
109 return ENOSYS;
112 struct tevent_req *ctdb_conn_msg_write_send(TALLOC_CTX *mem_ctx,
113 struct tevent_context *ev,
114 struct ctdb_conn *conn,
115 uint32_t vnn, uint64_t srvid,
116 uint8_t *msg, size_t msg_len)
118 return dummy_send(mem_ctx, ev);
121 int ctdb_conn_msg_write_recv(struct tevent_req *req)
123 return ENOSYS;
126 struct tevent_req *ctdb_msg_channel_init_send(
127 TALLOC_CTX *mem_ctx, struct tevent_context *ev,
128 const char *sock, uint64_t srvid)
130 return dummy_send(mem_ctx, ev);
133 int ctdb_msg_channel_init_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
134 struct ctdb_msg_channel **pchannel)
136 return ENOSYS;
139 struct tevent_req *ctdb_msg_read_send(TALLOC_CTX *mem_ctx,
140 struct tevent_context *ev,
141 struct ctdb_msg_channel *channel)
143 return dummy_send(mem_ctx, ev);
146 int ctdb_msg_read_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
147 uint8_t **pmsg, size_t *pmsg_len)
149 return ENOSYS;
152 struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
153 const char *name,
154 int hash_size, int tdb_flags,
155 int open_flags, mode_t mode,
156 enum dbwrap_lock_order lock_order,
157 uint64_t dbwrap_flags)
159 errno = ENOSYS;
160 return NULL;
163 NTSTATUS messaging_ctdbd_init(struct messaging_context *msg_ctx,
164 TALLOC_CTX *mem_ctx,
165 struct messaging_backend **presult)
167 return NT_STATUS_NOT_IMPLEMENTED;
170 struct ctdbd_connection *messaging_ctdbd_connection(void)
172 return NULL;
175 bool run_ctdb_conn(int dummy)
177 return true;