diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/alarm.c | 7 | ||||
-rw-r--r-- | src/buffer.c | 4 | ||||
-rw-r--r-- | src/cache.c | 6 | ||||
-rw-r--r-- | src/cache_iterators.c | 5 | ||||
-rw-r--r-- | src/cache_lifetime.c | 2 | ||||
-rw-r--r-- | src/cache_timer.c | 7 | ||||
-rw-r--r-- | src/cache_wt.c | 6 | ||||
-rw-r--r-- | src/conntrack.c | 12 | ||||
-rw-r--r-- | src/hash.c | 8 | ||||
-rw-r--r-- | src/ignore_pool.c | 5 | ||||
-rw-r--r-- | src/local.c | 7 | ||||
-rw-r--r-- | src/log.c | 8 | ||||
-rw-r--r-- | src/main.c | 8 | ||||
-rw-r--r-- | src/mcast.c | 10 | ||||
-rw-r--r-- | src/netlink.c | 8 | ||||
-rw-r--r-- | src/network.c | 5 | ||||
-rw-r--r-- | src/parse.c | 4 | ||||
-rw-r--r-- | src/queue.c | 4 | ||||
-rw-r--r-- | src/read_config_lex.l | 1 | ||||
-rw-r--r-- | src/read_config_yy.y | 1 | ||||
-rw-r--r-- | src/run.c | 7 | ||||
-rw-r--r-- | src/stats-mode.c | 11 | ||||
-rw-r--r-- | src/sync-alarm.c | 3 | ||||
-rw-r--r-- | src/sync-ftfw.c | 7 | ||||
-rw-r--r-- | src/sync-mode.c | 14 | ||||
-rw-r--r-- | src/traffic_stats.c | 7 |
26 files changed, 72 insertions, 95 deletions
diff --git a/src/alarm.c b/src/alarm.c index d00e281..576839a 100644 --- a/src/alarm.c +++ b/src/alarm.c @@ -16,14 +16,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <stdlib.h> -#include <sys/time.h> -#include "linux_list.h" -#include "conntrackd.h" #include "alarm.h" -#include "jhash.h" -#include <time.h> -#include <errno.h> static LIST_HEAD(alarm_list); diff --git a/src/buffer.c b/src/buffer.c index 389dd38..739174a 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -15,10 +15,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#include "buffer.h" + #include <stdlib.h> #include <string.h> #include <errno.h> -#include "buffer.h" struct buffer *buffer_create(size_t size) { diff --git a/src/cache.c b/src/cache.c index dcb0123..2f0e57a 100644 --- a/src/cache.c +++ b/src/cache.c @@ -16,14 +16,16 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include "cache.h" #include "jhash.h" #include "hash.h" +#include "us-conntrack.h" #include "conntrackd.h" + #include <libnetfilter_conntrack/libnetfilter_conntrack.h> #include <errno.h> -#include "us-conntrack.h" -#include "cache.h" #include <stdlib.h> +#include <string.h> static uint32_t hash(const void *data, struct hashtable *table) { diff --git a/src/cache_iterators.c b/src/cache_iterators.c index 4fdb920..bf70dd1 100644 --- a/src/cache_iterators.c +++ b/src/cache_iterators.c @@ -17,14 +17,15 @@ */ #include "cache.h" -#include "jhash.h" #include "hash.h" #include "log.h" #include "conntrackd.h" #include "netlink.h" +#include "us-conntrack.h" + #include <libnetfilter_conntrack/libnetfilter_conntrack.h> #include <errno.h> -#include "us-conntrack.h" +#include <string.h> struct __dump_container { int fd; diff --git a/src/cache_lifetime.c b/src/cache_lifetime.c index 26496d2..ad3416a 100644 --- a/src/cache_lifetime.c +++ b/src/cache_lifetime.c @@ -17,10 +17,8 @@ */ #include <stdio.h> -#include "conntrackd.h" #include "us-conntrack.h" #include "cache.h" -#include "alarm.h" #include <sys/time.h> #include <time.h> diff --git a/src/cache_timer.c b/src/cache_timer.c index 53ed703..0fbba14 100644 --- a/src/cache_timer.c +++ b/src/cache_timer.c @@ -16,12 +16,13 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <stdio.h> -#include <sys/time.h> +#include "cache.h" #include "conntrackd.h" #include "us-conntrack.h" -#include "cache.h" #include "alarm.h" +#include "debug.h" + +#include <stdio.h> static void timeout(struct alarm_list *a, void *data) { diff --git a/src/cache_wt.c b/src/cache_wt.c index 9d0af0b..8ff8fae 100644 --- a/src/cache_wt.c +++ b/src/cache_wt.c @@ -16,11 +16,11 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include "cache.h" #include "netlink.h" -#include <stdio.h> -#include "conntrackd.h" #include "us-conntrack.h" -#include "cache.h" + +#include <string.h> static void add_update(struct us_conntrack *u) { diff --git a/src/conntrack.c b/src/conntrack.c index 7918b3f..5f0cb1a 100644 --- a/src/conntrack.c +++ b/src/conntrack.c @@ -33,9 +33,10 @@ * Ported to the new libnetfilter_conntrack API * */ + +#include "conntrack.h" + #include <stdio.h> -#include <sys/wait.h> -#include <stdlib.h> #include <getopt.h> #include <stdlib.h> #include <stdarg.h> @@ -43,22 +44,15 @@ #include <unistd.h> #include <netinet/in.h> #include <sys/types.h> -#include <sys/stat.h> #include <sys/socket.h> #include <sys/time.h> #include <time.h> #ifdef HAVE_ARPA_INET_H #include <arpa/inet.h> #endif -#include <fcntl.h> -#include <dlfcn.h> #include <signal.h> #include <string.h> -#include "linux_list.h" -#include "conntrack.h" #include <libnetfilter_conntrack/libnetfilter_conntrack.h> -#include <libnetfilter_conntrack/libnetfilter_conntrack_ipv4.h> -#include <libnetfilter_conntrack/libnetfilter_conntrack_ipv6.h> static const char cmdflags[NUMBER_OF_CMD] = {'L','I','U','D','G','F','E','V','h','L','I','D','G','F','E'}; @@ -18,14 +18,12 @@ * Description: generic hash table implementation */ -#include <stdio.h> +#include "hash.h" +#include "slist.h" + #include <errno.h> #include <stdlib.h> -#include <sys/types.h> #include <string.h> -#include "slist.h" -#include "hash.h" - struct hashtable_node *hashtable_alloc_node(int datasize, void *data) { diff --git a/src/ignore_pool.c b/src/ignore_pool.c index 5889398..c77a55b 100644 --- a/src/ignore_pool.c +++ b/src/ignore_pool.c @@ -16,14 +16,15 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include "ignore.h" #include "jhash.h" #include "hash.h" #include "conntrackd.h" -#include "ignore.h" #include "log.h" -#include <libnetfilter_conntrack/libnetfilter_conntrack.h> +#include <libnetfilter_conntrack/libnetfilter_conntrack.h> #include <stdlib.h> +#include <string.h> /* XXX: These should be configurable */ #define IGNORE_POOL_SIZE 128 diff --git a/src/local.c b/src/local.c index d861e12..f0aba1c 100644 --- a/src/local.c +++ b/src/local.c @@ -18,12 +18,13 @@ * Description: UNIX sockets library */ +#include "local.h" + #include <stdio.h> #include <unistd.h> +#include <string.h> #include <arpa/inet.h> -#include <errno.h> - -#include "local.h" +#include <sys/un.h> int local_server_create(struct local_conf *conf) { @@ -19,16 +19,14 @@ */ #include "log.h" -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> +#include "buffer.h" +#include "conntrackd.h" + #include <time.h> #include <stdarg.h> #include <string.h> #include <errno.h> #include <unistd.h> -#include "buffer.h" -#include "conntrackd.h" int init_log(void) { @@ -16,17 +16,17 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <stdlib.h> #include "conntrackd.h" #include "log.h" + #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <sys/utsname.h> #include <linux/capability.h> -#include <errno.h> -#include "hash.h" -#include "jhash.h" +#include <string.h> +#include <stdlib.h> +#include <unistd.h> #undef _POSIX_SOURCE #include <sys/capability.h> diff --git a/src/mcast.c b/src/mcast.c index 9684b61..77aa35c 100644 --- a/src/mcast.c +++ b/src/mcast.c @@ -17,19 +17,17 @@ * * Description: multicast socket library */ + +#include "mcast.h" +#include "debug.h" + #include <stdio.h> #include <stdlib.h> -#include <unistd.h> #include <arpa/inet.h> -#include <fcntl.h> -#include <errno.h> -#include <sys/time.h> #include <unistd.h> #include <string.h> #include <sys/ioctl.h> #include <net/if.h> -#include "mcast.h" -#include "debug.h" struct mcast_sock *mcast_server_create(struct mcast_conf *conf) { diff --git a/src/netlink.c b/src/netlink.c index 388407a..0457e8a 100644 --- a/src/netlink.c +++ b/src/netlink.c @@ -21,13 +21,7 @@ #include "traffic_stats.h" #include "ignore.h" #include "log.h" -#include <libnfnetlink/libnfnetlink.h> -#include <libnetfilter_conntrack/libnetfilter_conntrack.h> -#include <errno.h> -#include "us-conntrack.h" -#include <signal.h> -#include <stdlib.h> -#include "network.h" +#include "debug.h" int ignore_conntrack(struct nf_conntrack *ct) { diff --git a/src/network.c b/src/network.c index 939e94b..7c7a08a 100644 --- a/src/network.c +++ b/src/network.c @@ -18,11 +18,12 @@ #include "conntrackd.h" #include "network.h" -#include "us-conntrack.h" -#include "sync.h" #include "log.h" +#include "debug.h" #include <stdlib.h> +#include <time.h> +#include <string.h> static unsigned int seq_set, cur_seq; diff --git a/src/parse.c b/src/parse.c index a248b47..5bc71ef 100644 --- a/src/parse.c +++ b/src/parse.c @@ -16,10 +16,10 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <string.h> -#include <libnetfilter_conntrack/libnetfilter_conntrack.h> #include "network.h" +#include <libnetfilter_conntrack/libnetfilter_conntrack.h> + static void parse_u8(struct nf_conntrack *ct, int attr, void *data) { uint8_t *value = (uint8_t *) data; diff --git a/src/queue.c b/src/queue.c index a721760..7b20e83 100644 --- a/src/queue.c +++ b/src/queue.c @@ -18,6 +18,10 @@ #include "queue.h" +#include <errno.h> +#include <stdlib.h> +#include <string.h> + struct queue *queue_create(size_t max_size) { struct queue *b; diff --git a/src/read_config_lex.l b/src/read_config_lex.l index 6211fee..65df1e7 100644 --- a/src/read_config_lex.l +++ b/src/read_config_lex.l @@ -20,7 +20,6 @@ */ #include "read_config_yy.h" -#include "conntrackd.h" %} %option yylineno diff --git a/src/read_config_yy.y b/src/read_config_yy.y index 82131d7..531b1fe 100644 --- a/src/read_config_yy.y +++ b/src/read_config_yy.y @@ -26,6 +26,7 @@ #include "conntrackd.h" #include "ignore.h" #include <syslog.h> +#include <libnetfilter_conntrack/libnetfilter_conntrack_tcp.h> extern struct state_replication_helper tcp_state_helper; @@ -23,16 +23,13 @@ #include "ignore.h" #include "log.h" #include "alarm.h" -#include <libnetfilter_conntrack/libnetfilter_conntrack.h> + #include <errno.h> -#include "us-conntrack.h" #include <signal.h> #include <stdlib.h> #include <unistd.h> -#include <sys/types.h> #include <sys/wait.h> -#include <sys/time.h> -#include <time.h> +#include <string.h> void killer(int foo) { diff --git a/src/stats-mode.c b/src/stats-mode.c index 0c42d95..0ecb2b0 100644 --- a/src/stats-mode.c +++ b/src/stats-mode.c @@ -18,16 +18,15 @@ #include "netlink.h" #include "traffic_stats.h" -#include <stdlib.h> +#include "buffer.h" +#include "debug.h" #include "cache.h" #include "log.h" #include "conntrackd.h" -#include <libnfnetlink/libnfnetlink.h> -#include <libnetfilter_conntrack/libnetfilter_conntrack.h> + #include <errno.h> -#include "us-conntrack.h" -#include <signal.h> -#include <sys/select.h> +#include <string.h> +#include <stdlib.h> static int init_stats(void) { diff --git a/src/sync-alarm.c b/src/sync-alarm.c index 05ddf81..6ee306e 100644 --- a/src/sync-alarm.c +++ b/src/sync-alarm.c @@ -21,8 +21,11 @@ #include "network.h" #include "us-conntrack.h" #include "alarm.h" +#include "cache.h" +#include "debug.h" #include <stdlib.h> +#include <string.h> static void refresher(struct alarm_list *a, void *data) { diff --git a/src/sync-ftfw.c b/src/sync-ftfw.c index f0b3262..f6d2ed3 100644 --- a/src/sync-ftfw.c +++ b/src/sync-ftfw.c @@ -16,18 +16,17 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <errno.h> #include "conntrackd.h" #include "sync.h" -#include "linux_list.h" #include "us-conntrack.h" #include "queue.h" #include "debug.h" #include "network.h" #include "alarm.h" #include "log.h" -#include <libnfnetlink/libnfnetlink.h> -#include <libnetfilter_conntrack/libnetfilter_conntrack.h> +#include "cache.h" + +#include <string.h> #if 0 #define dp printf diff --git a/src/sync-mode.c b/src/sync-mode.c index 1632019..0a0fcc2 100644 --- a/src/sync-mode.c +++ b/src/sync-mode.c @@ -16,22 +16,22 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include "sync.h" #include "netlink.h" #include "traffic_stats.h" #include "log.h" -#include <stdlib.h> +#include "state_helper.h" #include "cache.h" #include "conntrackd.h" -#include <libnfnetlink/libnfnetlink.h> -#include <libnetfilter_conntrack/libnetfilter_conntrack.h> -#include <errno.h> #include "us-conntrack.h" -#include <signal.h> -#include <sys/select.h> -#include "sync.h" #include "network.h" #include "debug.h" + +#include <errno.h> #include <unistd.h> +#include <time.h> +#include <string.h> +#include <stdlib.h> static void do_mcast_handler_step(struct nethdr *net) { diff --git a/src/traffic_stats.c b/src/traffic_stats.c index 93511ce..9e40d53 100644 --- a/src/traffic_stats.c +++ b/src/traffic_stats.c @@ -17,14 +17,7 @@ */ #include "traffic_stats.h" -#include "cache.h" -#include "hash.h" #include "conntrackd.h" -#include <libnfnetlink/libnfnetlink.h> -#include <libnetfilter_conntrack/libnetfilter_conntrack.h> -#include <errno.h> -#include "us-conntrack.h" -#include <signal.h> void update_traffic_stats(struct nf_conntrack *ct) { |