From 19980872755027ab9fe3ca514d2053ab7b2a4c70 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 20 Dec 2009 02:37:26 +0000 Subject: contrib/fwd: renamed struct fwd_{addr,network}_list to struct fwd_{network,addr} --- contrib/fwd/src/fwd.h | 35 +++++------------------------------ 1 file changed, 5 insertions(+), 30 deletions(-) (limited to 'contrib/fwd/src/fwd.h') diff --git a/contrib/fwd/src/fwd.h b/contrib/fwd/src/fwd.h index 0228daf7b..6de8b880c 100644 --- a/contrib/fwd/src/fwd.h +++ b/contrib/fwd/src/fwd.h @@ -25,13 +25,9 @@ #include #include #include +#include #include -#if 0 -#include "fwd_addr.h" -#include "fwd_rules.h" -#include "fwd_config.h" -#endif enum fwd_policy { FWD_P_UNSPEC = 0, @@ -83,12 +79,12 @@ struct fwd_icmptype { int code; }; -struct fwd_network_list { +struct fwd_network { char *name; char *ifname; int isalias; struct fwd_cidr *addr; - struct fwd_network_list *next; + struct fwd_network *next; }; struct fwd_defaults { @@ -103,7 +99,7 @@ struct fwd_defaults { struct fwd_zone { char *name; - struct fwd_network_list *networks; + struct fwd_network *networks; struct fwd_data *forwardings; struct fwd_data *redirects; struct fwd_data *rules; @@ -168,23 +164,11 @@ struct fwd_data { struct fwd_handle { int rtnl_socket; + int unix_socket; struct fwd_data *conf; - struct fwd_addr_list *addrs; }; -/* fwd_zmalloc(size_t) - * Allocates a zeroed buffer of the given size. */ -static void * fwd_zmalloc(size_t s) -{ - void *b = malloc(s); - - if( b != NULL ) - memset(b, 0, s); - - return b; -} - /* fwd_fatal(fmt, ...) * Prints message to stderr and termintes program. */ #define fwd_fatal(...) do { \ @@ -194,14 +178,5 @@ static void * fwd_zmalloc(size_t s) exit(1); \ } while(0) -/* fwd_alloc_ptr(type) - * Allocates a buffer with the size of the given datatype - * and returns a pointer to it. */ -#define fwd_alloc_ptr(t) (t *) fwd_zmalloc(sizeof(t)) - -/* fwd_free_ptr(void *) - * Frees the given pointer and sets it to NULL. - * Safe for NULL values. */ -#define fwd_free_ptr(x) do { if(x != NULL) free(x); x = NULL; } while(0) #endif -- cgit v1.2.3