vfs:shadow_copy2: fix a debug message
[obnox/samba/samba-obnox.git] / ctdb / client / client_private.h
1 /*
2    CTDB client code
3
4    Copyright (C) Amitay Isaacs  2015
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_CLIENT_PRIVATE_H__
21 #define __CTDB_CLIENT_PRIVATE_H__
22
23 #include "protocol/protocol.h"
24
25 struct ctdb_db_context {
26         struct ctdb_db_context *prev, *next;
27         uint32_t db_id;
28         const char *db_name;
29         const char *db_path;
30         struct tdb_wrap *ltdb;
31         bool persistent;
32 };
33
34 struct ctdb_client_context {
35         struct reqid_context *idr;
36         struct srvid_context *srv;
37         struct comm_context *comm;
38         int fd;
39         uint32_t pnn;
40         struct ctdb_db_context *db;
41 };
42
43 struct ctdb_record_handle {
44         struct tevent_context *ev;
45         struct ctdb_client_context *client;
46         struct ctdb_db_context *db;
47         struct ctdb_ltdb_header header;
48         TDB_DATA key;
49         TDB_DATA data; /* This is returned from tdb_fetch() */
50         bool readonly;
51 };
52
53 struct ctdb_transaction_handle {
54         struct tevent_context *ev;
55         struct ctdb_client_context *client;
56         struct ctdb_db_context *db, *db_g_lock;
57         struct ctdb_rec_buffer *recbuf;
58         struct ctdb_server_id sid;
59         const char *lock_name;
60         bool readonly;
61         bool updated;
62 };
63
64 /* From client_call.c */
65
66 void ctdb_client_reply_call(struct ctdb_client_context *client,
67                             uint8_t *buf, size_t buflen, uint32_t reqid);
68
69 /* From client_message.c */
70
71 void ctdb_client_req_message(struct ctdb_client_context *client,
72                              uint8_t *buf, size_t buflen, uint32_t reqid);
73
74 /* From client_control.c */
75
76 void ctdb_client_reply_control(struct ctdb_client_context *client,
77                                uint8_t *buf, size_t buflen, uint32_t reqid);
78
79 #endif /* __CTDB_CLIENT_PRIVATE_H__ */