Small fixes so tinc compiles out of the box on SunOS 5.8
authorGuus Sliepen <guus@tinc-vpn.org>
Sun, 15 Sep 2002 14:55:54 +0000 (14:55 +0000)
committerGuus Sliepen <guus@tinc-vpn.org>
Sun, 15 Sep 2002 14:55:54 +0000 (14:55 +0000)
configure.in
lib/fake-getnameinfo.c
src/net.c
src/net_packet.c
src/net_setup.c
src/net_socket.c
src/process.c
src/protocol_edge.c
src/subnet.c
src/tincd.c

index 249cd14e98020f8c7ed5f6cf2a618525a7aa354f..77db35a4ae6b8df05e2281dee396cc7118607a3e 100644 (file)
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 
-dnl $Id: configure.in,v 1.13.2.58 2002/09/09 19:39:53 guus Exp $
+dnl $Id: configure.in,v 1.13.2.59 2002/09/15 14:55:53 guus Exp $
 
 AC_PREREQ(2.53)
 AC_INIT(src/tincd.c)
@@ -86,8 +86,13 @@ dnl Checks for libraries.
 dnl Checks for header files.
 AC_HEADER_STDC
 AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h malloc.h stdint.h strings.h syslog.h unistd.h \
-net/ethernet.h net/if.h netinet/in_systm.h netinet/ip.h netinet/tcp.h \
-sys/file.h sys/ioctl.h sys/param.h sys/time.h])
+       sys/file.h sys/ioctl.h sys/param.h sys/time.h netinet/in_systm.h])
+AC_CHECK_HEADERS([net/ethernet.h net/if.h netinet/ip.h netinet/tcp.h], [], [],
+       [#include <sys/types.h>
+        #include <sys/socket.h>
+        #ifdef HAVE_NETINET_IN_SYSTM_H
+     #include <netinet/in_systm.h>
+        #endif])
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
@@ -128,8 +133,7 @@ AC_FUNC_MEMCMP
 AC_FUNC_ALLOCA
 AC_TYPE_SIGNAL
 AC_CHECK_FUNCS([asprintf daemon fcloseall flock ftime get_current_dir_name \
-putenv select strdup strerror strsignal strtol unsetenv \
-freeaddrinfo gai_strerror getaddrinfo getnameinfo mlockall])
+putenv select strdup strerror strsignal strtol unsetenv mlockall])
 jm_FUNC_MALLOC
 jm_FUNC_REALLOC
 
@@ -142,6 +146,8 @@ AC_CHECK_FUNC(gethostbyname, [], [
   AC_CHECK_LIB(nsl, gethostbyname)
 ])
 
+AC_CHECK_FUNCS([freeaddrinfo gai_strerror getaddrinfo getnameinfo])
+
 AC_CACHE_SAVE
 
 dnl These are defined in files in m4/
index 894c6952dd84dad976807ae76125c56da0a5af83..05416487ead0f12e687108cf10b0ae2ca5061134 100644 (file)
 
 #include "config.h"
 
+#include <stdio.h>
 #include <sys/types.h>
-#include <netinet/in.h>
 #include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
 #include <netdb.h>
 #include <string.h>
 
index c56fe98d670d552b2aa33a08c954b3cea5385587..f81c4ba8903fdea455830e39e3baaecaeafba2b9 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: net.c,v 1.35.4.181 2002/09/09 22:32:39 guus Exp $
+    $Id: net.c,v 1.35.4.182 2002/09/15 14:55:53 guus Exp $
 */
 
 #include "config.h"
 #include <errno.h>
 #include <fcntl.h>
 #include <netdb.h>
-#include <netinet/in.h>
-#ifdef HAVE_NETINET_IN_SYSTM_H
-#include <netinet/in_systm.h>
-#endif
-#ifdef HAVE_NETINET_IP_H
-#include <netinet/ip.h>
-#endif
-#ifdef HAVE_NETINET_TCP_H
-#include <netinet/tcp.h>
-#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <arpa/inet.h>
 #include <sys/socket.h>
 #include <net/if.h>
+#ifdef HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
+#include <netinet/in.h>
+#ifdef HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif
+#ifdef HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif
 
 #include <openssl/rand.h>
 
index eaa2cf183406b7010d7bc4ef977f7796eac2a132..7c51ad6388989b79ba4c30ac67173e401eab158c 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: net_packet.c,v 1.1.2.23 2002/09/09 22:32:44 guus Exp $
+    $Id: net_packet.c,v 1.1.2.24 2002/09/15 14:55:53 guus Exp $
 */
 
 #include "config.h"
 #include <fcntl.h>
 #include <netdb.h>
 #include <netinet/in.h>
-#ifdef HAVE_NETINET_IN_SYSTM_H
-#include <netinet/in_systm.h>
-#endif
-#ifdef HAVE_NETINET_IP_H
-#include <netinet/ip.h>
-#endif
-#ifdef HAVE_NETINET_TCP_H
-#include <netinet/tcp.h>
-#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <arpa/inet.h>
 #include <sys/socket.h>
 #include <net/if.h>
+#ifdef HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
+#ifdef HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif
+#ifdef HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif
 
 #include <openssl/rand.h>
 #include <openssl/evp.h>
index 5243b1e9a757d91c0d6b35cda5c0fc4914d93195..ec47f60dd694b50465aad502430803270428f193 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: net_setup.c,v 1.1.2.26 2002/09/09 22:32:44 guus Exp $
+    $Id: net_setup.c,v 1.1.2.27 2002/09/15 14:55:53 guus Exp $
 */
 
 #include "config.h"
 #include <fcntl.h>
 #include <netdb.h>
 #include <netinet/in.h>
-#ifdef HAVE_NETINET_IN_SYSTM_H
-#include <netinet/in_systm.h>
-#endif
-#ifdef HAVE_NETINET_IP_H
-#include <netinet/ip.h>
-#endif
-#ifdef HAVE_NETINET_TCP_H
-#include <netinet/tcp.h>
-#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <arpa/inet.h>
 #include <sys/socket.h>
 #include <net/if.h>
+#ifdef HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
+#ifdef HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif
+#ifdef HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif
 
 #include <openssl/pem.h>
 #include <openssl/rsa.h>
index eedef7b2f6e5cf7d1a3d0ab408773c73d3e01365..05485f8dc3a190b41d398266a8411205e3059f85 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: net_socket.c,v 1.1.2.21 2002/09/09 22:32:44 guus Exp $
+    $Id: net_socket.c,v 1.1.2.22 2002/09/15 14:55:53 guus Exp $
 */
 
 #include "config.h"
 #include <fcntl.h>
 #include <netdb.h>
 #include <netinet/in.h>
-#ifdef HAVE_NETINET_IN_SYSTM_H
-#include <netinet/in_systm.h>
-#endif
-#ifdef HAVE_NETINET_IP_H
-#include <netinet/ip.h>
-#endif
-#ifdef HAVE_NETINET_TCP_H
-#include <netinet/tcp.h>
-#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <arpa/inet.h>
 #include <sys/socket.h>
 #include <net/if.h>
+#ifdef HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
+#ifdef HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif
+#ifdef HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif
 
 #include <utils.h>
 #include <xalloc.h>
index a70d8d28e00d8f77195103e296d5db9ba8a537ee..edcd5a00ddad2c878b19531a518ccf497f171d6a 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: process.c,v 1.1.2.48 2002/09/10 09:40:25 guus Exp $
+    $Id: process.c,v 1.1.2.49 2002/09/15 14:55:53 guus Exp $
 */
 
 #include "config.h"
@@ -370,9 +370,7 @@ RETSIGTYPE sigint_handler(int a)
                debug_lvl = saved_debug_lvl;
                saved_debug_lvl = 0;
        } else {
-               syslog(LOG_NOTICE,
-                          _
-                          ("Temporarily setting debug level to 5.  Kill me with SIGINT again to go back to level %d."),
+               syslog(LOG_NOTICE, _("Temporarily setting debug level to 5.  Kill me with SIGINT again to go back to level %d."),
                           debug_lvl);
                saved_debug_lvl = debug_lvl;
                debug_lvl = 5;
@@ -469,9 +467,7 @@ void setup_signals(void)
        for(i = 0; sighandlers[i].signal; i++) {
                act.sa_handler = sighandlers[i].handler;
                if(sigaction(sighandlers[i].signal, &act, NULL) < 0)
-                       fprintf(stderr,
-                                       _
-                                       ("Installing signal handler for signal %d (%s) failed: %s\n"),
+                       fprintf(stderr, _("Installing signal handler for signal %d (%s) failed: %s\n"),
                                        sighandlers[i].signal, strsignal(sighandlers[i].signal),
                                        strerror(errno));
        }
index 6129f71b4b99dd360415079f83f170b680d1ed4c..0ac9e7c80feafac3f5e62be6d2b6347ade589715 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: protocol_edge.c,v 1.1.4.13 2002/09/09 22:33:02 guus Exp $
+    $Id: protocol_edge.c,v 1.1.4.14 2002/09/15 14:55:53 guus Exp $
 */
 
 #include "config.h"
@@ -220,9 +220,7 @@ int del_edge_h(connection_t *c)
 
        if(!from) {
                if(debug_lvl >= DEBUG_PROTOCOL)
-                       syslog(LOG_ERR,
-                                  _
-                                  ("Got %s from %s (%s) which does not appear in the edge tree"),
+                       syslog(LOG_ERR, _("Got %s from %s (%s) which does not appear in the edge tree"),
                                   "DEL_EDGE", c->name, c->hostname);
                return 0;
        }
@@ -231,9 +229,7 @@ int del_edge_h(connection_t *c)
 
        if(!to) {
                if(debug_lvl >= DEBUG_PROTOCOL)
-                       syslog(LOG_ERR,
-                                  _
-                                  ("Got %s from %s (%s) which does not appear in the edge tree"),
+                       syslog(LOG_ERR, _("Got %s from %s (%s) which does not appear in the edge tree"),
                                   "DEL_EDGE", c->name, c->hostname);
                return 0;
        }
@@ -244,9 +240,7 @@ int del_edge_h(connection_t *c)
 
        if(!e) {
                if(debug_lvl >= DEBUG_PROTOCOL)
-                       syslog(LOG_WARNING,
-                                  _
-                                  ("Got %s from %s (%s) which does not appear in the edge tree"),
+                       syslog(LOG_WARNING, _("Got %s from %s (%s) which does not appear in the edge tree"),
                                   "DEL_EDGE", c->name, c->hostname);
                return 0;
        }
index fa00cd8873a7005ccb46c2d1039bf6ec5c5cc06b..4e528e1af387f9e83cd6944a2ed00d5bb127c0a7 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: subnet.c,v 1.1.2.42 2002/09/09 22:33:21 guus Exp $
+    $Id: subnet.c,v 1.1.2.43 2002/09/15 14:55:54 guus Exp $
 */
 
 #include "config.h"
@@ -111,9 +111,7 @@ int subnet_compare(subnet_t *a, subnet_t *b)
        case SUBNET_IPV6:
                return subnet_compare_ipv6(a, b);
        default:
-               syslog(LOG_ERR,
-                          _
-                          ("subnet_compare() was called with unknown subnet type %d, exitting!"),
+               syslog(LOG_ERR, _("subnet_compare() was called with unknown subnet type %d, exitting!"),
                           a->type);
                cp_trace();
                exit(0);
index 8ebbe42aa89a4a920b3258a10537f63795809c31..2aa16dd40cb1bd3d90cb444277ca86cb312e642e 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: tincd.c,v 1.10.4.64 2002/09/15 12:26:04 guus Exp $
+    $Id: tincd.c,v 1.10.4.65 2002/09/15 14:55:54 guus Exp $
 */
 
 #include "config.h"
@@ -110,8 +110,7 @@ static void usage(int status)
                                program_name);
        else {
                printf(_("Usage: %s [option]...\n\n"), program_name);
-               printf(_
-                          ("  -c, --config=DIR           Read configuration options from DIR.\n"
+               printf(_("  -c, --config=DIR           Read configuration options from DIR.\n"
                                "  -D, --no-detach            Don't fork and detach.\n"
                                "  -d, --debug[=LEVEL]        Increase debug level or set it to LEVEL.\n"
                                "  -k, --kill[=SIGNAL]        Attempt to kill a running tincd and exit.\n"
@@ -178,9 +177,7 @@ void parse_options(int argc, char **argv, char **envp)
                                                kill_tincd = atoi(optarg);
 
                                                if(!kill_tincd) {
-                                                       fprintf(stderr,
-                                                                       _
-                                                                       ("Invalid argument `%s'; SIGNAL must be a number or one of HUP, TERM, KILL, USR1, USR2, WINCH, INT or ALRM.\n"),
+                                                       fprintf(stderr, _("Invalid argument `%s'; SIGNAL must be a number or one of HUP, TERM, KILL, USR1, USR2, WINCH, INT or ALRM.\n"),
                                                                        optarg);
                                                        usage(1);
                                                }
@@ -199,9 +196,7 @@ void parse_options(int argc, char **argv, char **envp)
                                        generate_keys = atoi(optarg);
 
                                        if(generate_keys < 512) {
-                                               fprintf(stderr,
-                                                               _
-                                                               ("Invalid argument `%s'; BITS must be a number equal to or greater than 512.\n"),
+                                               fprintf(stderr, _("Invalid argument `%s'; BITS must be a number equal to or greater than 512.\n"),
                                                                optarg);
                                                usage(1);
                                        }