summaryrefslogtreecommitdiffstats
path: root/ctdb/tcp/ctdb_tcp.h
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2013-11-13 14:17:32 +0100
committerMichael Adam <obnox@samba.org>2013-11-13 14:18:52 +0100
commitf087a8e2b81fae82fa571ef09d2d1cb682cc8ff8 (patch)
treed4a6b14a1594958150b733180d995b5c32025017 /ctdb/tcp/ctdb_tcp.h
parente80a5aba3db8e81173fa443991e08ef4a300ea5c (diff)
parent25f3c8b5269863aadbe72e304da7012782ef5b25 (diff)
downloadsamba-f087a8e2b81fae82fa571ef09d2d1cb682cc8ff8.tar.gz
samba-f087a8e2b81fae82fa571ef09d2d1cb682cc8ff8.tar.xz
samba-f087a8e2b81fae82fa571ef09d2d1cb682cc8ff8.zip
Merge branch 'master' of ctdb into 'master' of samba
Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'ctdb/tcp/ctdb_tcp.h')
-rw-r--r--ctdb/tcp/ctdb_tcp.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/ctdb/tcp/ctdb_tcp.h b/ctdb/tcp/ctdb_tcp.h
new file mode 100644
index 0000000000..5b6b6516b7
--- /dev/null
+++ b/ctdb/tcp/ctdb_tcp.h
@@ -0,0 +1,60 @@
+/*
+ ctdb database library
+
+ Copyright (C) Andrew Tridgell 2006
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef _CTDB_TCP_H
+#define _CTDB_TCP_H
+
+/* ctdb_tcp main state */
+struct ctdb_tcp {
+ struct ctdb_context *ctdb;
+ int listen_fd;
+};
+
+/*
+ state associated with an incoming connection
+*/
+struct ctdb_incoming {
+ struct ctdb_context *ctdb;
+ int fd;
+ struct ctdb_queue *queue;
+};
+
+/*
+ state associated with one tcp node
+*/
+struct ctdb_tcp_node {
+ int fd;
+ struct ctdb_queue *out_queue;
+ struct fd_event *connect_fde;
+ struct timed_event *connect_te;
+};
+
+
+/* prototypes internal to tcp transport */
+int ctdb_tcp_queue_pkt(struct ctdb_node *node, uint8_t *data, uint32_t length);
+int ctdb_tcp_listen(struct ctdb_context *ctdb);
+void ctdb_tcp_node_connect(struct event_context *ev, struct timed_event *te,
+ struct timeval t, void *private_data);
+void ctdb_tcp_read_cb(uint8_t *data, size_t cnt, void *args);
+void ctdb_tcp_tnode_cb(uint8_t *data, size_t cnt, void *private_data);
+void ctdb_tcp_stop_connection(struct ctdb_node *node);
+
+#define CTDB_TCP_ALIGNMENT 8
+
+#endif /* _CTDB_TCP_H */