From ea7a0801544940ae1ad7a8a6aa5fac7e8e13f9d3 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Tue, 28 Jul 2015 21:44:32 +0200 Subject: [PATCH] remove more unused functions --- configure | 15 --------------- configure.ac | 1 - include/common.h | 4 ---- include/inet.h | 1 - include/setup.h.in | 6 ------ src/support.c | 35 ----------------------------------- 6 files changed, 62 deletions(-) diff --git a/configure b/configure index 6f1bd0b1e..94d49b495 100755 --- a/configure +++ b/configure @@ -6017,21 +6017,6 @@ $as_echo "#define NEED_INET_NTOA /**/" >>confdefs.h fi done -for ac_func in inet_netof -do : - ac_fn_c_check_func "$LINENO" "inet_netof" "ac_cv_func_inet_netof" -if test "x$ac_cv_func_inet_netof" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_INET_NETOF 1 -_ACEOF - -else - -$as_echo "#define NEED_INET_NETOF /**/" >>confdefs.h - -fi -done - LIBS="$save_libs" for ac_func in syslog do : diff --git a/configure.ac b/configure.ac index 1481842e5..9e8b5d14e 100644 --- a/configure.ac +++ b/configure.ac @@ -445,7 +445,6 @@ save_libs="$LIBS" LIBS="$LIBS $SOCKLIB $INETLIB" AC_CHECK_FUNCS(inet_addr,,AC_DEFINE([NEED_INET_ADDR], [], [Define if you need inet_addr])) AC_CHECK_FUNCS(inet_ntoa,,AC_DEFINE([NEED_INET_NTOA], [], [Define if you need inet_ntoa])) -AC_CHECK_FUNCS(inet_netof,,AC_DEFINE([NEED_INET_NETOF], [], [Define if you need inet_netof])) LIBS="$save_libs" AC_CHECK_FUNCS(syslog,AC_DEFINE([HAVE_SYSLOG], [], [Define if you have syslog])) AC_SUBST(STRTOUL) diff --git a/include/common.h b/include/common.h index 3ca0fba6c..d53e2d4a4 100644 --- a/include/common.h +++ b/include/common.h @@ -128,10 +128,6 @@ extern unsigned long inet_addr(char *); extern char *inet_ntoa(struct IN_ADDR); #endif -#ifdef NEED_INET_NETOF -extern int inet_netof(struct IN_ADDR); -#endif - #ifndef HAVE_INET_NTOP const char *inet_ntop(int, const void *, char *, size_t); #endif diff --git a/include/inet.h b/include/inet.h index e3aa99662..dd9e95fcc 100644 --- a/include/inet.h +++ b/include/inet.h @@ -38,7 +38,6 @@ extern const char *inet_ntop(int af, const void *src, char *dst, size_t cnt); extern __u_l inet_addr(char *); extern char *inet_ntoa(struct in_addr); extern int inet_aton(const char *, struct in_addr *); -extern int inet_netof(struct in_addr); # endif extern __u_l inet_makeaddr(int, int); extern __u_l inet_network(char *); diff --git a/include/setup.h.in b/include/setup.h.in index 655fc8d04..adc2db3bf 100644 --- a/include/setup.h.in +++ b/include/setup.h.in @@ -100,9 +100,6 @@ /* Define to 1 if you have the `inet_addr' function. */ #undef HAVE_INET_ADDR -/* Define to 1 if you have the `inet_netof' function. */ -#undef HAVE_INET_NETOF - /* Define to 1 if you have the `inet_ntoa' function. */ #undef HAVE_INET_NTOA @@ -259,9 +256,6 @@ /* Define if you need inet_addr */ #undef NEED_INET_ADDR -/* Define if you need inet_netof */ -#undef NEED_INET_NETOF - /* Define if you need inet_ntoa */ #undef NEED_INET_NTOA diff --git a/src/support.c b/src/support.c index 250f055ad..04c39b614 100644 --- a/src/support.c +++ b/src/support.c @@ -157,28 +157,6 @@ char *inetntoa(char *in) return buf; } -#ifndef INET6 -#ifdef NEED_INET_NETOF -/* -** inet_netof -- return the net portion of an internet number -** argv 11/90 -*/ - -int inet_netof(struct IN_ADDR in) -{ - int addr = in.s_net; - - if (addr & 0x80 == 0) - return ((int)in.s_net); - - if (addr & 0x40 == 0) - return ((int)in.s_net * 256 + in.s_host); - - return ((int)in.s_net * 256 + in.s_host * 256 + in.s_lh); -} - -#endif /* NEED_INET_NETOF */ -#endif /* * inetntop: return the : notation of a given IPv6 internet number. @@ -2258,19 +2236,6 @@ int inet_pton6(const char *src, unsigned char *dst) return (1); } -/** Finds out if an address is IPv6, returns 1 if so, otherwise 0 */ -int isipv6(struct IN_ADDR *addr) -{ -#ifndef INET6 - return 0; -#else -static char compareme[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff }; /* First part of IPv4-in-IPv6 (::ffff) */ - - /* If memcmp returns non-zero it means it did not match, hence it is ipv6, otherwise it is ipv4 */ - return memcmp(addr, compareme, 12) ? 1 : 0; -#endif -} - /** Transforms an IPv4 address (assumed in network byte order) to inet6 (as ::ffff:a.b.c.d). */ void inet4_to_inet6(const void *src_in, void *dst_in) {