From cf3be894fcb95adb360425c8482954522e9110d2 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sun, 23 Aug 2009 12:11:20 +0200 Subject: conntrackd: add support state-replication based on TCP This patch adds support for TCP as protocol to replicate state-changes between two daemons. Note that this only makes sense with the notrack mode. Signed-off-by: Pablo Neira Ayuso --- include/channel.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'include/channel.h') diff --git a/include/channel.h b/include/channel.h index 1d3c48c..98605d9 100644 --- a/include/channel.h +++ b/include/channel.h @@ -3,6 +3,7 @@ #include "mcast.h" #include "udp.h" +#include "tcp.h" struct channel; struct nethdr; @@ -11,6 +12,7 @@ enum { CHANNEL_NONE, CHANNEL_MCAST, CHANNEL_UDP, + CHANNEL_TCP, CHANNEL_MAX, }; @@ -24,13 +26,20 @@ struct udp_channel { struct udp_sock *server; }; +struct tcp_channel { + struct tcp_sock *client; + struct tcp_sock *server; +}; + #define CHANNEL_F_DEFAULT (1 << 0) #define CHANNEL_F_BUFFERED (1 << 1) -#define CHANNEL_F_MAX (1 << 2) +#define CHANNEL_F_STREAM (1 << 2) +#define CHANNEL_F_MAX (1 << 3) union channel_type_conf { struct mcast_conf mcast; struct udp_conf udp; + struct tcp_conf tcp; }; struct channel_conf { @@ -47,7 +56,10 @@ struct channel_ops { void (*close)(void *channel); int (*send)(void *channel, const void *data, int len); int (*recv)(void *channel, char *buf, int len); + int (*accept)(struct channel *c); int (*get_fd)(void *channel); + int (*isset)(struct channel *c, fd_set *readfds); + int (*accept_isset)(struct channel *c, fd_set *readfds); void (*stats)(struct channel *c, int fd); void (*stats_extended)(struct channel *c, int active, struct nlif_handle *h, int fd); @@ -72,8 +84,12 @@ void channel_close(struct channel *c); int channel_send(struct channel *c, const struct nethdr *net); int channel_send_flush(struct channel *c); int channel_recv(struct channel *c, char *buf, int size); +int channel_accept(struct channel *c); int channel_get_fd(struct channel *c); +int channel_accept_isset(struct channel *c, fd_set *readfds); +int channel_isset(struct channel *c, fd_set *readfds); + void channel_stats(struct channel *c, int fd); void channel_stats_extended(struct channel *c, int active, struct nlif_handle *h, int fd); -- cgit v1.2.3