From 920b90f2b03c60b6940e83cdce8c4b4bfbbc4268 Mon Sep 17 00:00:00 2001 From: "/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org" Date: Wed, 9 Jan 2008 22:52:31 +0000 Subject: wake up the daemon iff there are real events to handle instead of polling (Based on comments from Max Kellerman) --- include/Makefile.am | 2 +- include/alarm.h | 2 +- include/conntrackd.h | 2 +- include/sync.h | 2 +- include/timer.h | 17 ----------------- 5 files changed, 4 insertions(+), 21 deletions(-) delete mode 100644 include/timer.h (limited to 'include') diff --git a/include/Makefile.am b/include/Makefile.am index 7eaca35..4322f26 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -2,5 +2,5 @@ noinst_HEADERS = alarm.h jhash.h slist.h cache.h linux_list.h \ sync.h conntrackd.h local.h us-conntrack.h \ debug.h log.h hash.h mcast.h buffer.h conntrack.h \ - state_helper.h network.h ignore.h timer.h queue.h + state_helper.h network.h ignore.h queue.h diff --git a/include/alarm.h b/include/alarm.h index 93e6482..82a1612 100644 --- a/include/alarm.h +++ b/include/alarm.h @@ -5,7 +5,7 @@ struct alarm_list { struct list_head head; - unsigned long expires; + struct timeval tv; void *data; void (*function)(struct alarm_list *a, void *data); }; diff --git a/include/conntrackd.h b/include/conntrackd.h index 3bfcf18..e8b90cc 100644 --- a/include/conntrackd.h +++ b/include/conntrackd.h @@ -159,7 +159,7 @@ extern struct ct_general_state st; struct ct_mode { int (*init)(void); int (*add_fds_to_set)(fd_set *readfds); - void (*run)(fd_set *readfds, int step); + void (*run)(fd_set *readfds); int (*local)(int fd, int type, void *data); void (*kill)(void); void (*dump)(struct nf_conntrack *ct); diff --git a/include/sync.h b/include/sync.h index a27fb93..e6ce327 100644 --- a/include/sync.h +++ b/include/sync.h @@ -15,7 +15,7 @@ struct sync_mode { int (*local)(int fd, int type, void *data); int (*recv)(const struct nethdr *net); void (*send)(struct nethdr *net, struct us_conntrack *u); - void (*run)(int step); + void (*run)(void); }; extern struct sync_mode alarm; diff --git a/include/timer.h b/include/timer.h deleted file mode 100644 index 37b0fc9..0000000 --- a/include/timer.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef _TIMER_H_ -#define _TIMER_H_ - -#include - -struct timer { - long credits; - struct timeval start; - struct timeval stop; - struct timeval diff; -}; - -#define GET_CREDITS(x) x.credits -#define GET_STARTTIME(x) x.start -#define GET_STOPTIME(x) x.stop - -#endif -- cgit v1.2.3