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 249cd14..77db35a 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 894c695..0541648 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 c56fe98..f81c4ba 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 eaa2cf1..7c51ad6 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 5243b1e..ec47f60 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 eedef7b..05485f8 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 a70d8d2..edcd5a0 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 6129f71..0ac9e7c 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 fa00cd8..4e528e1 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 8ebbe42..2aa16dd 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);
                                        }