r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
[ira/wip.git] / source3 / include / ctdbd_conn.h
1 /* 
2    Unix SMB/CIFS implementation.
3    Samba3 ctdb connection handling
4    Copyright (C) Volker Lendecke 2007
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 struct ctdbd_connection;
21
22 NTSTATUS ctdbd_init_connection(TALLOC_CTX *mem_ctx,
23                                struct ctdbd_connection **pconn);
24 NTSTATUS ctdbd_messaging_connection(TALLOC_CTX *mem_ctx,
25                                     struct ctdbd_connection **pconn);
26
27 uint32 ctdbd_vnn(const struct ctdbd_connection *conn);
28
29 NTSTATUS ctdbd_register_msg_ctx(struct ctdbd_connection *conn,
30                                 struct messaging_context *msg_ctx);
31
32 NTSTATUS ctdbd_messaging_send(struct ctdbd_connection *conn,
33                               uint32 dst_vnn, uint64 dst_srvid,
34                               struct messaging_rec *msg);
35
36 BOOL ctdbd_process_exists(struct ctdbd_connection *conn, uint32 vnn,
37                           pid_t pid);
38
39 char *ctdbd_dbpath(struct ctdbd_connection *conn,
40                    TALLOC_CTX *mem_ctx, uint32_t db_id);
41
42 NTSTATUS ctdbd_db_attach(struct ctdbd_connection *conn, const char *name,
43                          uint32_t *db_id, int tdb_flags);
44
45 NTSTATUS ctdbd_migrate(struct ctdbd_connection *conn, uint32 db_id,
46                        TDB_DATA key);
47
48 NTSTATUS ctdbd_fetch(struct ctdbd_connection *conn, uint32 db_id,
49                      TDB_DATA key, TALLOC_CTX *mem_ctx, TDB_DATA *data);
50
51 NTSTATUS ctdbd_traverse(uint32 db_id,
52                         void (*fn)(TDB_DATA key, TDB_DATA data,
53                                    void *private_data),
54                         void *private_data);
55
56 NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn,
57                             const struct sockaddr_in *server,
58                             const struct sockaddr_in *client,
59                             void (*release_ip_handler)(const char *ip_addr,
60                                                        void *private_data),
61                             void *private_data);
62
63 NTSTATUS ctdbd_register_reconfigure(struct ctdbd_connection *conn);
64