s4-dsdb-tests: Make unique object names to test with in deletetest
[Samba.git] / source3 / include / ctdbd_conn.h
blob49445d91b2e62604c9e330f334ff764f4adea138
1 /*
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/>.
20 #ifndef _CTDBD_CONN_H
21 #define _CTDBD_CONN_H
23 #include "tdb_compat.h"
25 struct ctdbd_connection;
26 struct messaging_context;
27 struct messaging_rec;
29 NTSTATUS ctdbd_messaging_connection(TALLOC_CTX *mem_ctx,
30 struct ctdbd_connection **pconn);
32 uint32_t ctdbd_vnn(const struct ctdbd_connection *conn);
33 const char *lp_ctdbd_socket(void);
35 NTSTATUS ctdbd_register_msg_ctx(struct ctdbd_connection *conn,
36 struct messaging_context *msg_ctx);
37 struct messaging_context *ctdb_conn_msg_ctx(struct ctdbd_connection *conn);
39 int ctdbd_conn_get_fd(struct ctdbd_connection *conn);
41 NTSTATUS ctdbd_messaging_send(struct ctdbd_connection *conn,
42 uint32_t dst_vnn, uint64_t dst_srvid,
43 struct messaging_rec *msg);
44 NTSTATUS ctdbd_messaging_send_blob(struct ctdbd_connection *conn,
45 uint32_t dst_vnn, uint64_t dst_srvid,
46 const uint8_t *buf, size_t buflen);
48 bool ctdbd_process_exists(struct ctdbd_connection *conn, uint32_t vnn,
49 pid_t pid);
50 bool ctdb_processes_exist(struct ctdbd_connection *conn,
51 const struct server_id *pids, int num_pids,
52 bool *results);
53 bool ctdb_serverids_exist_supported(struct ctdbd_connection *conn);
54 bool ctdb_serverids_exist(struct ctdbd_connection *conn,
55 const struct server_id *pids, unsigned num_pids,
56 bool *results);
58 char *ctdbd_dbpath(struct ctdbd_connection *conn,
59 TALLOC_CTX *mem_ctx, uint32_t db_id);
61 NTSTATUS ctdbd_db_attach(struct ctdbd_connection *conn, const char *name,
62 uint32_t *db_id, int tdb_flags);
64 NTSTATUS ctdbd_migrate(struct ctdbd_connection *conn, uint32_t db_id,
65 TDB_DATA key);
67 NTSTATUS ctdbd_parse(struct ctdbd_connection *conn, uint32_t db_id,
68 TDB_DATA key, bool local_copy,
69 void (*parser)(TDB_DATA key, TDB_DATA data,
70 void *private_data),
71 void *private_data);
73 NTSTATUS ctdbd_traverse(uint32_t db_id,
74 void (*fn)(TDB_DATA key, TDB_DATA data,
75 void *private_data),
76 void *private_data);
78 NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn,
79 const struct sockaddr_storage *server,
80 const struct sockaddr_storage *client,
81 bool (*release_ip_handler)(const char *ip_addr,
82 void *private_data),
83 void *private_data);
85 NTSTATUS ctdbd_register_reconfigure(struct ctdbd_connection *conn);
87 NTSTATUS ctdbd_control_local(struct ctdbd_connection *conn, uint32_t opcode,
88 uint64_t srvid, uint32_t flags, TDB_DATA data,
89 TALLOC_CTX *mem_ctx, TDB_DATA *outdata,
90 int *cstatus);
91 NTSTATUS ctdb_watch_us(struct ctdbd_connection *conn);
92 NTSTATUS ctdb_unwatch(struct ctdbd_connection *conn);
93 NTSTATUS register_with_ctdbd(struct ctdbd_connection *conn, uint64_t srvid);
94 NTSTATUS ctdbd_probe(void);
96 #endif /* _CTDBD_CONN_H */