s3-winbindd: Move connection to AD server from idmap_ad
[Samba/gbeck.git] / source3 / lib / ctdb_conn.h
blob0d648c78b8c5b756c29678d07780a6c0fb3ad2b1
1 /*
2 Unix SMB/CIFS implementation.
3 Samba3 ctdb connection handling
4 Copyright (C) Volker Lendecke 2012
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 #ifndef _CTDB_CONN_H
21 #define _CTDB_CONN_H
23 #ifdef CLUSTER_SUPPORT
25 #include <tdb.h>
27 #ifdef HAVE_CTDB_PROTOCOL_H
28 #include <ctdb_protocol.h>
29 #else
30 #include <ctdb_private.h>
31 #endif
33 #else /* CLUSTER_SUPPORT */
35 struct ctdb_reply_control;
37 #endif /* CLUSTER_SUPPORT */
39 #include "tevent.h"
40 #include "librpc/gen_ndr/messaging.h"
42 struct ctdb_conn;
44 struct tevent_req *ctdb_conn_control_send(TALLOC_CTX *mem_ctx,
45 struct tevent_context *ev,
46 struct ctdb_conn *conn,
47 uint32_t vnn, uint32_t opcode,
48 uint64_t srvid, uint32_t flags,
49 uint8_t *data, size_t datalen);
50 int ctdb_conn_control_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
51 struct ctdb_reply_control **preply);
53 struct tevent_req *ctdb_conn_init_send(TALLOC_CTX *mem_ctx,
54 struct tevent_context *ev,
55 const char *sock);
56 int ctdb_conn_init_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
57 struct ctdb_conn **pconn);
59 struct tevent_req *ctdb_conn_msg_write_send(TALLOC_CTX *mem_ctx,
60 struct tevent_context *ev,
61 struct ctdb_conn *conn,
62 uint32_t vnn, uint64_t srvid,
63 uint8_t *msg, size_t msg_len);
64 int ctdb_conn_msg_write_recv(struct tevent_req *req);
66 struct ctdb_msg_channel;
68 struct tevent_req *ctdb_msg_channel_init_send(
69 TALLOC_CTX *mem_ctx, struct tevent_context *ev,
70 const char *sock, uint64_t srvid);
71 int ctdb_msg_channel_init_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
72 struct ctdb_msg_channel **pchannel);
74 struct tevent_req *ctdb_msg_read_send(TALLOC_CTX *mem_ctx,
75 struct tevent_context *ev,
76 struct ctdb_msg_channel *channel);
77 int ctdb_msg_read_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
78 uint8_t **pmsg, size_t *pmsg_len);
80 #endif /* _CTDB_CONN_H */