diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/Makefile.am | 2 | ||||
-rw-r--r-- | include/conntrackd.h | 4 | ||||
-rw-r--r-- | include/fds.h | 16 |
3 files changed, 20 insertions, 2 deletions
diff --git a/include/Makefile.am b/include/Makefile.am index d7f27a9..92ebbcc 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -3,5 +3,5 @@ noinst_HEADERS = alarm.h jhash.h slist.h cache.h linux_list.h linux_rbtree.h \ sync.h conntrackd.h local.h us-conntrack.h \ debug.h log.h hash.h mcast.h conntrack.h \ state_helper.h network.h ignore.h queue.h \ - traffic_stats.h netlink.h + traffic_stats.h netlink.h fds.h diff --git a/include/conntrackd.h b/include/conntrackd.h index 47898e2..69c1303 100644 --- a/include/conntrackd.h +++ b/include/conntrackd.h @@ -105,6 +105,8 @@ struct ct_general_state { struct nfct_handle *event; /* event handler */ struct nfct_handle *dump; /* dump handler */ + struct fds *fds; + /* statistics */ uint64_t malformed; uint64_t bytes[NFCT_DIR_MAX]; @@ -151,7 +153,7 @@ extern struct ct_general_state st; struct ct_mode { int (*init)(void); - int (*add_fds_to_set)(fd_set *readfds); + int (*register_fds)(struct fds *fds); void (*run)(fd_set *readfds); int (*local)(int fd, int type, void *data); void (*kill)(void); diff --git a/include/fds.h b/include/fds.h new file mode 100644 index 0000000..cc213fe --- /dev/null +++ b/include/fds.h @@ -0,0 +1,16 @@ +#ifndef _FDS_H_ +#define _FDS_H_ + +struct fds { + int maxfd; + int fd_array_len; + int fd_array_cur; + int *fd_array; + fd_set readfds; +}; + +struct fds *create_fds(void); +void destroy_fds(struct fds *); +int register_fd(int fd, struct fds *fds); + +#endif |