From 5d0ba69e06d2f37788697c3b7c39287334d2fa22 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 28 Nov 2006 14:15:46 +1100 Subject: - setup a convenience name field for nodes - added basic IO handling for the tcp backend - added a ctdb_node_dead upcall - added packet queueing - adding incoming packet handling (This used to be ctdb commit 415497c952630e746e8cdcf8e1e2a7b2ac3e51fb) --- ctdb/tcp/ctdb_tcp.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'ctdb/tcp/ctdb_tcp.h') diff --git a/ctdb/tcp/ctdb_tcp.h b/ctdb/tcp/ctdb_tcp.h index 571c20508b4..14e96ea8979 100644 --- a/ctdb/tcp/ctdb_tcp.h +++ b/ctdb/tcp/ctdb_tcp.h @@ -32,21 +32,28 @@ struct ctdb_incoming { int fd; }; +struct ctdb_tcp_packet { + struct ctdb_tcp_packet *next, *prev; + uint8_t *data; + uint32_t length; +}; + /* state associated with one tcp node */ struct ctdb_tcp_node { int fd; + struct fd_event *fde; + struct ctdb_tcp_packet *queue; }; /* prototypes internal to tcp transport */ -void ctdb_tcp_node_read(struct event_context *ev, struct fd_event *fde, - uint16_t flags, void *private); +void ctdb_tcp_node_write(struct event_context *ev, struct fd_event *fde, + uint16_t flags, void *private); void ctdb_tcp_incoming_read(struct event_context *ev, struct fd_event *fde, uint16_t flags, void *private); +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); - - -- cgit