| 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 | #ifndef _CTDBD_CONN_H
|
|---|
| 21 | #define _CTDBD_CONN_H
|
|---|
| 22 |
|
|---|
| 23 | struct ctdbd_connection;
|
|---|
| 24 |
|
|---|
| 25 | NTSTATUS ctdbd_init_connection(TALLOC_CTX *mem_ctx,
|
|---|
| 26 | struct ctdbd_connection **pconn);
|
|---|
| 27 | NTSTATUS ctdbd_messaging_connection(TALLOC_CTX *mem_ctx,
|
|---|
| 28 | struct ctdbd_connection **pconn);
|
|---|
| 29 |
|
|---|
| 30 | uint32 ctdbd_vnn(const struct ctdbd_connection *conn);
|
|---|
| 31 |
|
|---|
| 32 | NTSTATUS ctdbd_register_msg_ctx(struct ctdbd_connection *conn,
|
|---|
| 33 | struct messaging_context *msg_ctx);
|
|---|
| 34 | struct messaging_context *ctdb_conn_msg_ctx(struct ctdbd_connection *conn);
|
|---|
| 35 |
|
|---|
| 36 | int ctdbd_conn_get_fd(struct ctdbd_connection *conn);
|
|---|
| 37 |
|
|---|
| 38 | NTSTATUS ctdbd_messaging_send(struct ctdbd_connection *conn,
|
|---|
| 39 | uint32 dst_vnn, uint64 dst_srvid,
|
|---|
| 40 | struct messaging_rec *msg);
|
|---|
| 41 |
|
|---|
| 42 | bool ctdbd_process_exists(struct ctdbd_connection *conn, uint32 vnn,
|
|---|
| 43 | pid_t pid);
|
|---|
| 44 |
|
|---|
| 45 | char *ctdbd_dbpath(struct ctdbd_connection *conn,
|
|---|
| 46 | TALLOC_CTX *mem_ctx, uint32_t db_id);
|
|---|
| 47 |
|
|---|
| 48 | NTSTATUS ctdbd_db_attach(struct ctdbd_connection *conn, const char *name,
|
|---|
| 49 | uint32_t *db_id, int tdb_flags);
|
|---|
| 50 |
|
|---|
| 51 | NTSTATUS ctdbd_migrate(struct ctdbd_connection *conn, uint32 db_id,
|
|---|
| 52 | TDB_DATA key);
|
|---|
| 53 |
|
|---|
| 54 | NTSTATUS ctdbd_fetch(struct ctdbd_connection *conn, uint32 db_id,
|
|---|
| 55 | TDB_DATA key, TALLOC_CTX *mem_ctx, TDB_DATA *data);
|
|---|
| 56 |
|
|---|
| 57 | NTSTATUS ctdbd_traverse(uint32 db_id,
|
|---|
| 58 | void (*fn)(TDB_DATA key, TDB_DATA data,
|
|---|
| 59 | void *private_data),
|
|---|
| 60 | void *private_data);
|
|---|
| 61 |
|
|---|
| 62 | NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn,
|
|---|
| 63 | const struct sockaddr_storage *server,
|
|---|
| 64 | const struct sockaddr_storage *client,
|
|---|
| 65 | void (*release_ip_handler)(const char *ip_addr,
|
|---|
| 66 | void *private_data),
|
|---|
| 67 | void *private_data);
|
|---|
| 68 |
|
|---|
| 69 | NTSTATUS ctdbd_register_reconfigure(struct ctdbd_connection *conn);
|
|---|
| 70 |
|
|---|
| 71 | NTSTATUS ctdbd_persistent_store(struct ctdbd_connection *conn, uint32_t db_id, TDB_DATA key, TDB_DATA data);
|
|---|
| 72 | NTSTATUS ctdbd_start_persistent_update(struct ctdbd_connection *conn, uint32_t db_id, TDB_DATA key, TDB_DATA data);
|
|---|
| 73 | NTSTATUS ctdbd_cancel_persistent_update(struct ctdbd_connection *conn, uint32_t db_id, TDB_DATA key, TDB_DATA data);
|
|---|
| 74 |
|
|---|
| 75 | NTSTATUS ctdbd_control_local(struct ctdbd_connection *conn, uint32 opcode,
|
|---|
| 76 | uint64_t srvid, uint32_t flags, TDB_DATA data,
|
|---|
| 77 | TALLOC_CTX *mem_ctx, TDB_DATA *outdata,
|
|---|
| 78 | int *cstatus);
|
|---|
| 79 | NTSTATUS ctdb_watch_us(struct ctdbd_connection *conn);
|
|---|
| 80 | NTSTATUS ctdb_unwatch(struct ctdbd_connection *conn);
|
|---|
| 81 |
|
|---|
| 82 | #endif /* _CTDBD_CONN_H */
|
|---|