summaryrefslogtreecommitdiffstats
path: root/include/sync.h
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2009-01-15 23:19:58 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2009-01-15 23:19:58 +0100
commite2af183ea7e5ea35a1582f40a01a7c49e83b31be (patch)
tree5d5c5fabca580aa2851fb39c3e343b5bc324342e /include/sync.h
parent2cacd3a802510bde43e23cf4c7d39f51a2eaf460 (diff)
sync: unify tx_list and tx_queue into one single tx_queue
This patch unifies the tx_list and the tx_queue to have only one transmission queue. Since the tx_list hold state objects and tx_queue control messages, I have introduced a queue node type that can be used to differenciate the kind of information that the node stores: object or control message. This patch also reworks the existing queue class to include a file descriptor that can be used to know if there are new data added to the queue (see QUEUE_F_EVFD flag). In this change, I have also modified the current evfd to make the file descriptor to make read operations non-blocking. Moreover, it keeps a counter that is used to know how many messages are inserted in the queue. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/sync.h')
-rw-r--r--include/sync.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/sync.h b/include/sync.h
index 60c9fae..9a9540c 100644
--- a/include/sync.h
+++ b/include/sync.h
@@ -1,8 +1,11 @@
#ifndef _SYNC_HOOKS_H_
#define _SYNC_HOOKS_H_
+#include <sys/select.h>
+
struct nethdr;
struct cache_object;
+struct fds;
struct sync_mode {
int internal_cache_flags;
@@ -15,7 +18,8 @@ struct sync_mode {
int (*local)(int fd, int type, void *data);
int (*recv)(const struct nethdr *net);
void (*send)(struct nethdr *net, struct cache_object *obj);
- void (*run)(void);
+ void (*run)(fd_set *readfds);
+ int (*register_fds)(struct fds *fds);
};
extern struct sync_mode sync_alarm;