summaryrefslogtreecommitdiffstats
path: root/include/channel.h
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2009-08-23 12:11:20 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2009-08-23 12:11:20 +0200
commitcf3be894fcb95adb360425c8482954522e9110d2 (patch)
tree9a6f2a95cd36218bcf6e852ecc300074ba7fef16 /include/channel.h
parent9d99a7699d7021a1c219d6553e037ac7ba4a5a37 (diff)
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 <pablo@netfilter.org>
Diffstat (limited to 'include/channel.h')
-rw-r--r--include/channel.h18
1 files changed, 17 insertions, 1 deletions
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);