r22231: merge from bzr ctdb tree
[Samba.git] / source / cluster / ctdb / tcp / ctdb_tcp.h
bloba34cd9736da4a16e73f1fa9b2a078d70fa8ceedb
1 /*
2 ctdb database library
4 Copyright (C) Andrew Tridgell 2006
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
11 This library 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 GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 /* ctdb_tcp main state */
23 struct ctdb_tcp {
24 int listen_fd;
28 state associated with an incoming connection
30 struct ctdb_incoming {
31 struct ctdb_context *ctdb;
32 int fd;
33 struct ctdb_queue *queue;
37 state associated with one tcp node
39 struct ctdb_tcp_node {
40 int fd;
41 struct ctdb_queue *queue;
45 /* prototypes internal to tcp transport */
46 int ctdb_tcp_queue_pkt(struct ctdb_node *node, uint8_t *data, uint32_t length);
47 int ctdb_tcp_listen(struct ctdb_context *ctdb);
48 void ctdb_tcp_node_connect(struct event_context *ev, struct timed_event *te,
49 struct timeval t, void *private_data);
50 void ctdb_tcp_read_cb(uint8_t *data, size_t cnt, void *args);
51 void ctdb_tcp_tnode_cb(uint8_t *data, size_t cnt, void *private_data);
53 #define CTDB_TCP_ALIGNMENT 8