notifyd: Add notifydd
[kai/samba-autobuild/.git] / source3 / lib / ctdb_conn.h
1 /*
2    Unix SMB/CIFS implementation.
3    Samba3 ctdb connection handling
4    Copyright (C) Volker Lendecke 2012
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 #ifndef _CTDB_CONN_H
21 #define _CTDB_CONN_H
22
23 #include "tevent.h"
24 #include "librpc/gen_ndr/messaging.h"
25
26 struct ctdb_conn;
27 struct ctdb_reply_control;
28
29 struct tevent_req *ctdb_conn_control_send(TALLOC_CTX *mem_ctx,
30                                           struct tevent_context *ev,
31                                           struct ctdb_conn *conn,
32                                           uint32_t vnn, uint32_t opcode,
33                                           uint64_t srvid, uint32_t flags,
34                                           uint8_t *data, size_t datalen);
35 int ctdb_conn_control_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
36                            struct ctdb_reply_control **preply);
37
38 struct tevent_req *ctdb_conn_init_send(TALLOC_CTX *mem_ctx,
39                                        struct tevent_context *ev,
40                                        const char *sock);
41 int ctdb_conn_init_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
42                         struct ctdb_conn **pconn);
43
44 struct tevent_req *ctdb_conn_msg_write_send(TALLOC_CTX *mem_ctx,
45                                             struct tevent_context *ev,
46                                             struct ctdb_conn *conn,
47                                             uint32_t vnn, uint64_t srvid,
48                                             uint8_t *msg, size_t msg_len);
49 int ctdb_conn_msg_write_recv(struct tevent_req *req);
50
51 struct ctdb_msg_channel;
52
53 struct tevent_req *ctdb_msg_channel_init_send(
54         TALLOC_CTX *mem_ctx, struct tevent_context *ev,
55         const char *sock, uint64_t srvid);
56 int ctdb_msg_channel_init_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
57                                struct ctdb_msg_channel **pchannel);
58
59 struct tevent_req *ctdb_msg_read_send(TALLOC_CTX *mem_ctx,
60                                       struct tevent_context *ev,
61                                       struct ctdb_msg_channel *channel);
62 int ctdb_msg_read_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
63                        uint8_t **pmsg, size_t *pmsg_len);
64
65 #endif /* _CTDB_CONN_H */