From d24a74c5b4fb62b720a79b632021746b69de7c45 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Thu, 30 Apr 2009 11:37:54 +0000 Subject: merging changes from portability branch back to trunk important change for developers: %Y replaces %D to print identities! --- src/libfreeswan/pfkey_v2_build.c | 67 +++++++--------------------------------- 1 file changed, 11 insertions(+), 56 deletions(-) (limited to 'src/libfreeswan/pfkey_v2_build.c') diff --git a/src/libfreeswan/pfkey_v2_build.c b/src/libfreeswan/pfkey_v2_build.c index 312edbcf5..12ef26fd2 100644 --- a/src/libfreeswan/pfkey_v2_build.c +++ b/src/libfreeswan/pfkey_v2_build.c @@ -21,41 +21,10 @@ char pfkey_v2_build_c_version[] = "$Id$"; -/* - * Some ugly stuff to allow consistent debugging code for use in the - * kernel and in user space -*/ - -#ifdef __KERNEL__ - -# include /* for printk */ - -# include "freeswan/ipsec_kversion.h" /* for malloc switch */ -# ifdef MALLOC_SLAB -# include /* kmalloc() */ -# else /* MALLOC_SLAB */ -# include /* kmalloc() */ -# endif /* MALLOC_SLAB */ -# include /* error codes */ -# include /* size_t */ -# include /* mark_bh */ - -# include /* struct device, and other headers */ -# include /* eth_type_trans */ -# include /* struct iphdr */ -# if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) -# include /* struct ipv6hdr */ -# endif /* if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ - -# define MALLOC(size) kmalloc(size, GFP_ATOMIC) -# define FREE(obj) kfree(obj) -# include -#else /* __KERNEL__ */ - # include -# include -# include -# include +# include +# include +# include # include /* memset */ # include @@ -63,8 +32,6 @@ unsigned int pfkey_lib_debug = 0; void (*pfkey_debug_func)(const char *message, ...) PRINTF_LIKE(1); -/* #define PLUTO */ - #define DEBUGGING(args...) if(pfkey_lib_debug) { \ if(pfkey_debug_func != NULL) { \ (*pfkey_debug_func)("pfkey_lib_debug:" args); \ @@ -73,22 +40,10 @@ void (*pfkey_debug_func)(const char *message, ...) PRINTF_LIKE(1); } } # define MALLOC(size) malloc(size) # define FREE(obj) free(obj) -#endif /* __KERNEL__ */ #include #include -#ifdef __KERNEL__ - -#include "freeswan/radij.h" /* rd_nodes */ -#include "freeswan/ipsec_encap.h" /* sockaddr_encap */ - -# define DEBUGGING(args...) \ - KLIPS_PRINT(debug_pfkey, "klips_debug:" args) -#endif /* __KERNEL__ */ - -#include "ipsec_sa.h" /* IPSEC_SAREF_NULL, IPSEC_SA_REF_TABLE_IDX_WIDTH */ - #define SENDERR(_x) do { error = -(_x); goto errlab; } while (0) void @@ -483,14 +438,14 @@ pfkey_address_build(struct sadb_ext** pfkey_ext, "found address family AF_INET6.\n"); saddr_len = sizeof(struct sockaddr_in6); sprintf(ipaddr_txt, "%x:%x:%x:%x:%x:%x:%x:%x-%x" - , ntohs(((struct sockaddr_in6*)address)->sin6_addr.s6_addr16[0]) - , ntohs(((struct sockaddr_in6*)address)->sin6_addr.s6_addr16[1]) - , ntohs(((struct sockaddr_in6*)address)->sin6_addr.s6_addr16[2]) - , ntohs(((struct sockaddr_in6*)address)->sin6_addr.s6_addr16[3]) - , ntohs(((struct sockaddr_in6*)address)->sin6_addr.s6_addr16[4]) - , ntohs(((struct sockaddr_in6*)address)->sin6_addr.s6_addr16[5]) - , ntohs(((struct sockaddr_in6*)address)->sin6_addr.s6_addr16[6]) - , ntohs(((struct sockaddr_in6*)address)->sin6_addr.s6_addr16[7]) + , ntohs(((struct sockaddr_in6*)address)->sin6_addr.s6_addr[0]) + , ntohs(((struct sockaddr_in6*)address)->sin6_addr.s6_addr[1]) + , ntohs(((struct sockaddr_in6*)address)->sin6_addr.s6_addr[2]) + , ntohs(((struct sockaddr_in6*)address)->sin6_addr.s6_addr[3]) + , ntohs(((struct sockaddr_in6*)address)->sin6_addr.s6_addr[4]) + , ntohs(((struct sockaddr_in6*)address)->sin6_addr.s6_addr[5]) + , ntohs(((struct sockaddr_in6*)address)->sin6_addr.s6_addr[6]) + , ntohs(((struct sockaddr_in6*)address)->sin6_addr.s6_addr[7]) , ntohs(((struct sockaddr_in6*)address)->sin6_port)); break; default: -- cgit v1.2.3