Merge commit 'rusty/libctdb-new' into foo
[vlendec/samba-autobuild/.git] / ctdb / ib / ibw_ctdb.h
1 /*
2  * Unix SMB/CIFS implementation.
3  * Join infiniband wrapper and ctdb.
4  *
5  * Copyright (C) Sven Oehme <oehmes@de.ibm.com> 2006
6  *
7  * Major code contributions by Peter Somogyi <psomogyi@gamax.hu>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, see <http://www.gnu.org/licenses/>.
21  */
22
23 struct ctdb_ibw_msg {
24         uint8_t *data;
25         uint32_t length;
26         struct ctdb_ibw_msg *prev;
27         struct ctdb_ibw_msg *next;
28 };
29
30 struct ctdb_ibw_node {
31         struct ibw_conn *conn;
32
33         struct ctdb_ibw_msg *queue;
34         struct ctdb_ibw_msg *queue_last;
35         int     qcnt;
36 };
37
38 int ctdb_ibw_get_address(struct ctdb_context *ctdb,
39         const char *address, struct in_addr *addr);
40
41 int ctdb_ibw_connstate_handler(struct ibw_ctx *ctx, struct ibw_conn *conn);
42 int ctdb_ibw_receive_handler(struct ibw_conn *conn, void *buf, int n);
43
44 int ctdb_ibw_node_connect(struct ctdb_node *node);
45 void ctdb_ibw_node_connect_event(struct event_context *ev, struct timed_event *te, 
46         struct timeval t, void *private_data);
47
48 int ctdb_flush_cn_queue(struct ctdb_ibw_node *cn);
49
50 int ctdb_ibw_init(struct ctdb_context *ctdb);