selftest: Run samba.tests.dns in :local environment so it can access credentials
[obnox/samba/samba-obnox.git] / source3 / lib / ctdb_dummy.c
1 /*
2    Unix SMB/CIFS implementation.
3    Copyright (C) 2014 Björn Baumbach
4    Copyright (C) 2014 Stefan Metzmacher
5
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.
10
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.
15
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/>.
18 */
19
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"
27
28 NTSTATUS ctdbd_probe(void)
29 {
30         return NT_STATUS_NOT_IMPLEMENTED;
31 }
32
33 NTSTATUS ctdbd_messaging_send(struct ctdbd_connection *conn,
34                               uint32_t dst_vnn, uint64_t dst_srvid,
35                               struct messaging_rec *msg)
36 {
37         return NT_STATUS_NOT_IMPLEMENTED;
38 }
39
40 NTSTATUS ctdbd_messaging_send_blob(struct ctdbd_connection *conn,
41                                    uint32_t dst_vnn, uint64_t dst_srvid,
42                                    const uint8_t *buf, size_t buflen)
43 {
44         return NT_STATUS_NOT_IMPLEMENTED;
45 }
46
47 NTSTATUS register_with_ctdbd(struct ctdbd_connection *conn, uint64_t srvid)
48 {
49         return NT_STATUS_NOT_IMPLEMENTED;
50 }
51
52 NTSTATUS ctdbd_register_reconfigure(struct ctdbd_connection *conn)
53 {
54         return NT_STATUS_NOT_IMPLEMENTED;
55 }
56
57 NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn,
58                             const struct sockaddr_storage *_server,
59                             const struct sockaddr_storage *_client,
60                             bool (*release_ip_handler)(const char *ip_addr,
61                                                        void *private_data),
62                             void *private_data)
63 {
64         return NT_STATUS_NOT_IMPLEMENTED;
65 }
66
67 const char *lp_ctdbd_socket(void)
68 {
69         return "";
70 }
71
72 bool ctdb_serverids_exist_supported(struct ctdbd_connection *conn)
73 {
74         return false;
75 }
76
77 bool ctdb_serverids_exist(struct ctdbd_connection *conn,
78                           const struct server_id *pids, unsigned num_pids,
79                           bool *results)
80 {
81         return false;
82 }
83
84 bool ctdb_processes_exist(struct ctdbd_connection *conn,
85                           const struct server_id *pids, int num_pids,
86                           bool *results)
87 {
88         return false;
89 }
90
91 struct dummy_state {
92         uint8_t dummy;
93 };
94
95 static struct tevent_req *dummy_send(TALLOC_CTX *mem_ctx,
96                                      struct tevent_context *ev)
97 {
98         struct tevent_req *req;
99         struct dummy_state *state;
100         req = tevent_req_create(mem_ctx, &state, struct dummy_state);
101         if (req == NULL) {
102                 return NULL;
103         }
104         tevent_req_done(req);
105         return tevent_req_post(req, ev);
106 }
107
108 struct tevent_req *ctdb_conn_init_send(TALLOC_CTX *mem_ctx,
109                                        struct tevent_context *ev,
110                                        const char *sock)
111 {
112         return dummy_send(mem_ctx, ev);
113 }
114
115 int ctdb_conn_init_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
116                         struct ctdb_conn **pconn)
117 {
118         return ENOSYS;
119 }
120
121 struct tevent_req *ctdb_conn_msg_write_send(TALLOC_CTX *mem_ctx,
122                                             struct tevent_context *ev,
123                                             struct ctdb_conn *conn,
124                                             uint32_t vnn, uint64_t srvid,
125                                             uint8_t *msg, size_t msg_len)
126 {
127         return dummy_send(mem_ctx, ev);
128 }
129
130 int ctdb_conn_msg_write_recv(struct tevent_req *req)
131 {
132         return ENOSYS;
133 }
134
135 struct tevent_req *ctdb_msg_channel_init_send(
136         TALLOC_CTX *mem_ctx, struct tevent_context *ev,
137         const char *sock, uint64_t srvid)
138 {
139         return dummy_send(mem_ctx, ev);
140 }
141
142 int ctdb_msg_channel_init_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
143                                struct ctdb_msg_channel **pchannel)
144 {
145         return ENOSYS;
146 }
147
148 struct tevent_req *ctdb_msg_read_send(TALLOC_CTX *mem_ctx,
149                                       struct tevent_context *ev,
150                                       struct ctdb_msg_channel *channel)
151 {
152         return dummy_send(mem_ctx, ev);
153 }
154
155 int ctdb_msg_read_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
156                        uint8_t **pmsg, size_t *pmsg_len)
157 {
158         return ENOSYS;
159 }
160
161 struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
162                                 const char *name,
163                                 int hash_size, int tdb_flags,
164                                 int open_flags, mode_t mode,
165                                 enum dbwrap_lock_order lock_order,
166                                 uint64_t dbwrap_flags)
167 {
168         errno = ENOSYS;
169         return NULL;
170 }
171
172 NTSTATUS messaging_ctdbd_init(struct messaging_context *msg_ctx,
173                               TALLOC_CTX *mem_ctx,
174                               struct messaging_backend **presult)
175 {
176         return NT_STATUS_NOT_IMPLEMENTED;
177 }
178
179 struct ctdbd_connection *messaging_ctdbd_connection(void)
180 {
181         return NULL;
182 }
183
184 bool run_ctdb_conn(int dummy)
185 {
186         return true;
187 }