summaryrefslogtreecommitdiff
path: root/src/channel.c
AgeCommit message (Collapse)Author
2012-05-28conntrackd: generalize file descriptor infrastructurePablo Neira Ayuso
This patch generalizes the select-based file descriptor infrastructure by allowing you to register file descriptors and its callbacks. Instead of hardcoding the descriptors that needs to be checked. Now, struct fds_item contains a callback and pointer to data that is passed to it: struct fds_item { struct list_head head; int fd; + void (*cb)(void *data); + void *data; }; Then, we check which ones are active in the select_main_step() function: list_for_each_entry(cur, &STATE(fds)->list, head) { if (FD_ISSET(cur->fd, &readfds)) cur->cb(cur->data); } And it invoked the corresponding callback. I had to slightly modify the channel infrastructure to fit it into the changes. This modularity is required for the upcoming cthelper support. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2009-09-23conntrackd: add retention queue for TCP errorsPablo Neira Ayuso
Under stress, the TCP stack may return EAGAIN if there is not space left in the sender buffer. We also enqueue any other error. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2009-09-21conntrackd: fix `conf' local variable in channel.c that shadows globalPablo Neira Ayuso
This patch avoids the shadowing of the global `conf' variable that is used to store the configuration information. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2009-09-11conntrackd: fix MTU for TCP channelsPablo Neira Ayuso
Use the TCP header size (20 bytes) instead of the UDP header size (8 bytes) to calculate the maximum packet size. Reported-by: Samuel Gauthier <samuel.gauthier@6wind.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2009-08-23conntrackd: add support state-replication based on TCPPablo Neira Ayuso
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>
2009-08-14conntrackd: fix crash for unubuffered channel on exit pathPablo Neira Ayuso
This patch fixes a crash in the exit path for channels that are not buffered (no CHANNEL_F_BUFFERED flag set). This fix does not affect any existing channel in the tree. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2009-03-13sync-mode: add unicast UDP support to propagate state-changesPablo Neira Ayuso
This patch adds support for unicast UDP to the channel infrastructure. With this patch, you can select UDP unicast to propagate state-changes instead of multicast. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2009-03-12sync-mode: add abstract layer to make daemon independent of multicastPablo Neira Ayuso
This patch reworks conntrackd to make it independent of the protocol used to propagate state-changes. This patch adds the channel layer abstraction, this layer allows you to add support for different protocols like unicast UDP or TIPC. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>