891e7c33dc5824bb1da661818f8bf29fa05a7a4c
[samba.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 "lib/messages_ctdbd.h"
23 #include "lib/messages_ctdb.h"
24 #include "lib/messages_ctdb_ref.h"
25 #include "ctdbd_conn.h"
26 #include "lib/dbwrap/dbwrap.h"
27 #include "lib/dbwrap/dbwrap_ctdb.h"
28 #include "torture/proto.h"
29
30 int ctdbd_probe(const char *sockname, int timeout)
31 {
32         return ENOSYS;
33 }
34
35 int ctdbd_messaging_send_iov(struct ctdbd_connection *conn,
36                              uint32_t dst_vnn, uint64_t dst_srvid,
37                              const struct iovec *iov, int iovlen)
38 {
39         return ENOSYS;
40 }
41
42 int register_with_ctdbd(struct ctdbd_connection *conn, uint64_t srvid,
43                         int (*cb)(struct tevent_context *ev,
44                                   uint32_t src_vnn, uint32_t dst_vnn,
45                                   uint64_t dst_srvid,
46                                   const uint8_t *msg, size_t msglen,
47                                   void *private_data),
48                         void *private_data)
49 {
50         return ENOSYS;
51 }
52
53 int ctdbd_register_ips(struct ctdbd_connection *conn,
54                        const struct sockaddr_storage *_server,
55                        const struct sockaddr_storage *_client,
56                        int (*cb)(struct tevent_context *ev,
57                                  uint32_t src_vnn, uint32_t dst_vnn,
58                                  uint64_t dst_srvid,
59                                  const uint8_t *msg, size_t msglen,
60                                  void *private_data),
61                        void *private_data)
62 {
63         return ENOSYS;
64 }
65
66 bool ctdbd_process_exists(struct ctdbd_connection *conn, uint32_t vnn, pid_t pid)
67 {
68         return false;
69 }
70
71 struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
72                                 struct messaging_context *msg_ctx,
73                                 const char *name,
74                                 int hash_size, int tdb_flags,
75                                 int open_flags, mode_t mode,
76                                 enum dbwrap_lock_order lock_order,
77                                 uint64_t dbwrap_flags)
78 {
79         errno = ENOSYS;
80         return NULL;
81 }
82
83 int messaging_ctdbd_init(struct messaging_context *msg_ctx,
84                          TALLOC_CTX *mem_ctx,
85                          void (*recv_cb)(struct tevent_context *ev,
86                                          const uint8_t *msg, size_t msg_len,
87                                          int *fds, size_t num_fds,
88                                          void *private_data),
89                          void *private_data,
90                               struct messaging_backend **presult)
91 {
92         return ENOSYS;
93 }
94
95 int messaging_ctdb_send(uint32_t dst_vnn, uint64_t dst_srvid,
96                         const struct iovec *iov, int iovlen)
97 {
98         return ENOSYS;
99 }
100
101 void *messaging_ctdb_ref(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
102                          const char *sockname, int timeout, uint64_t unique_id,
103                          void (*recv_cb)(struct tevent_context *ev,
104                                          const uint8_t *msg, size_t msg_len,
105                                          int *fds, size_t num_fds,
106                                          void *private_data),
107                          void *private_data,
108                          int *err)
109 {
110         return NULL;
111 }
112
113 struct messaging_ctdb_fde *messaging_ctdb_register_tevent_context(
114         TALLOC_CTX *mem_ctx, struct tevent_context *ev)
115 {
116         return NULL;
117 }
118
119 int messaging_ctdbd_reinit(struct messaging_context *msg_ctx,
120                            TALLOC_CTX *mem_ctx,
121                            void (*recv_cb)(struct tevent_context *ev,
122                                            const uint8_t *msg, size_t msg_len,
123                                            int *fds, size_t num_fds,
124                                            void *private_data),
125                            void *private_data,
126                            struct messaging_backend *backend)
127 {
128         return ENOSYS;
129 }
130
131 struct messaging_ctdbd_fde *messaging_ctdbd_register_tevent_context(
132         TALLOC_CTX *mem_ctx, struct tevent_context *ev,
133         struct messaging_backend *backend)
134 {
135         return NULL;
136 }
137
138 struct ctdbd_connection *messaging_ctdbd_connection(void)
139 {
140         return NULL;
141 }
142
143 int ctdb_async_ctx_reinit(TALLOC_CTX *mem_ctx, struct tevent_context *ev)
144 {
145         return ENOSYS;
146 }