2 Unix SMB/CIFS implementation.
3 Samba3 ctdb connection handling
4 Copyright (C) Volker Lendecke 2007
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/>.
23 #include "tdb_compat.h"
25 struct ctdbd_connection
;
26 struct messaging_context
;
29 NTSTATUS
ctdbd_messaging_connection(TALLOC_CTX
*mem_ctx
,
30 struct ctdbd_connection
**pconn
);
32 uint32
ctdbd_vnn(const struct ctdbd_connection
*conn
);
34 NTSTATUS
ctdbd_register_msg_ctx(struct ctdbd_connection
*conn
,
35 struct messaging_context
*msg_ctx
);
36 struct messaging_context
*ctdb_conn_msg_ctx(struct ctdbd_connection
*conn
);
38 int ctdbd_conn_get_fd(struct ctdbd_connection
*conn
);
40 NTSTATUS
ctdbd_messaging_send(struct ctdbd_connection
*conn
,
41 uint32 dst_vnn
, uint64 dst_srvid
,
42 struct messaging_rec
*msg
);
43 NTSTATUS
ctdbd_messaging_send_blob(struct ctdbd_connection
*conn
,
44 uint32 dst_vnn
, uint64 dst_srvid
,
45 const uint8_t *buf
, size_t buflen
);
47 bool ctdbd_process_exists(struct ctdbd_connection
*conn
, uint32 vnn
,
49 bool ctdb_processes_exist(struct ctdbd_connection
*conn
,
50 const struct server_id
*pids
, int num_pids
,
52 bool ctdb_serverids_exist(struct ctdbd_connection
*conn
,
53 const struct server_id
*pids
, unsigned num_pids
,
56 char *ctdbd_dbpath(struct ctdbd_connection
*conn
,
57 TALLOC_CTX
*mem_ctx
, uint32_t db_id
);
59 NTSTATUS
ctdbd_db_attach(struct ctdbd_connection
*conn
, const char *name
,
60 uint32_t *db_id
, int tdb_flags
);
62 NTSTATUS
ctdbd_migrate(struct ctdbd_connection
*conn
, uint32 db_id
,
65 NTSTATUS
ctdbd_fetch(struct ctdbd_connection
*conn
, uint32 db_id
,
66 TDB_DATA key
, TALLOC_CTX
*mem_ctx
, TDB_DATA
*data
,
69 NTSTATUS
ctdbd_traverse(uint32 db_id
,
70 void (*fn
)(TDB_DATA key
, TDB_DATA data
,
74 NTSTATUS
ctdbd_register_ips(struct ctdbd_connection
*conn
,
75 const struct sockaddr_storage
*server
,
76 const struct sockaddr_storage
*client
,
77 void (*release_ip_handler
)(const char *ip_addr
,
81 NTSTATUS
ctdbd_register_reconfigure(struct ctdbd_connection
*conn
);
83 NTSTATUS
ctdbd_control_local(struct ctdbd_connection
*conn
, uint32 opcode
,
84 uint64_t srvid
, uint32_t flags
, TDB_DATA data
,
85 TALLOC_CTX
*mem_ctx
, TDB_DATA
*outdata
,
87 NTSTATUS
ctdb_watch_us(struct ctdbd_connection
*conn
);
88 NTSTATUS
ctdb_unwatch(struct ctdbd_connection
*conn
);
89 NTSTATUS
register_with_ctdbd(struct ctdbd_connection
*conn
, uint64_t srvid
);
91 #endif /* _CTDBD_CONN_H */