Big header file cleanup: everything that has to do with standard system
authorGuus Sliepen <guus@tinc-vpn.org>
Thu, 17 Jul 2003 15:06:27 +0000 (15:06 +0000)
committerGuus Sliepen <guus@tinc-vpn.org>
Thu, 17 Jul 2003 15:06:27 +0000 (15:06 +0000)
libraries is moved to system.h.

48 files changed:
configure.in
lib/avl_tree.c
lib/dropin.c
lib/dropin.h
lib/fake-getaddrinfo.c
lib/fake-getaddrinfo.h
lib/fake-getnameinfo.c
lib/fake-getnameinfo.h
lib/ipv6.h
lib/list.c
lib/pidfile.c
lib/utils.c
lib/utils.h
src/conf.c
src/conf.h
src/connection.c
src/connection.h
src/edge.c
src/edge.h
src/event.c
src/event.h
src/graph.c
src/linux/device.c
src/logger.c
src/logger.h
src/meta.c
src/net.c
src/net.h
src/net_packet.c
src/net_setup.c
src/net_socket.c
src/netutl.c
src/netutl.h
src/node.c
src/node.h
src/process.c
src/process.h
src/protocol.c
src/protocol.h
src/protocol_auth.c
src/protocol_edge.c
src/protocol_key.c
src/protocol_misc.c
src/protocol_subnet.c
src/route.c
src/subnet.c
src/tincd.c
system.h

index a51bd29..52b9196 100644 (file)
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 
 dnl Process this file with autoconf to produce a configure script.
 
-dnl $Id: configure.in,v 1.13.2.66 2003/07/11 16:12:58 guus Exp $
+dnl $Id: configure.in,v 1.13.2.67 2003/07/17 15:06:25 guus Exp $
 
 AC_PREREQ(2.53)
 AC_INIT(src/tincd.c)
 
 AC_PREREQ(2.53)
 AC_INIT(src/tincd.c)
@@ -67,6 +67,10 @@ case $host_os in
     AC_DEFINE(HAVE_CYGWIN, 1, [Cygwin])
     [ rm -f src/device.c; ln -sf cygwin/device.c src/device.c ]
   ;;
     AC_DEFINE(HAVE_CYGWIN, 1, [Cygwin])
     [ rm -f src/device.c; ln -sf cygwin/device.c src/device.c ]
   ;;
+  *mingw*)
+    AC_DEFINE(HAVE_CYGWIN, 1, [MinGW])
+    [ rm -f src/device.c; ln -sf mingw/device.c src/device.c ]
+  ;;
   *)
     AC_MSG_ERROR("Unknown operating system.")
   ;;
   *)
     AC_MSG_ERROR("Unknown operating system.")
   ;;
@@ -85,14 +89,18 @@ dnl Checks for libraries.
 
 dnl Checks for header files.
 AC_HEADER_STDC
 
 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 \
-       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 netinet/ip6.h], [], [],
-       [#include <sys/types.h>
-        #include <sys/socket.h>
-        #ifdef HAVE_NETINET_IN_SYSTM_H
-     #include <netinet/in_systm.h>
-        #endif])
+AC_CHECK_HEADERS([syslog.h sys/file.h sys/ioctl.h sys/param.h \
+  sys/time.h sys/socket.h sys/wait.h netdb.h arpa/inet.h netinet/in_systm.h])
+AC_CHECK_HEADERS([net/ethernet.h net/if.h net/if_arp.h netinet/if_ether.h netinet/ip.h \
+  netinet/tcp.h netinet/ip_icmp.h netinet/ip6.h netinet/icmp6.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
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
index fc3c27e..65df7b7 100644 (file)
     library for inclusion into tinc (http://tinc.nl.linux.org/) by
     Guus Sliepen <guus@sliepen.eu.org>.
 
     library for inclusion into tinc (http://tinc.nl.linux.org/) by
     Guus Sliepen <guus@sliepen.eu.org>.
 
-    $Id: avl_tree.c,v 1.1.2.15 2003/07/12 17:48:38 guus Exp $
+    $Id: avl_tree.c,v 1.1.2.16 2003/07/17 15:06:25 guus Exp $
 */
 
 */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <xalloc.h>
+#include "system.h"
 
 #include "avl_tree.h"
 
 #include "avl_tree.h"
+#include "xalloc.h"
 
 #ifdef AVL_COUNT
 #define AVL_NODE_COUNT(n)  ((n) ? (n)->count : 0)
 
 #ifdef AVL_COUNT
 #define AVL_NODE_COUNT(n)  ((n) ? (n)->count : 0)
index 24d25ca..0efa5f2 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: dropin.c,v 1.1.2.14 2003/07/12 17:48:38 guus Exp $
+    $Id: dropin.c,v 1.1.2.15 2003/07/17 15:06:25 guus Exp $
 */
 
 */
 
-#include "config.h"
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-
-#include <xalloc.h>
-
-#include <system.h>
-#include <errno.h>
+#include "system.h"
 
 #ifndef HAVE_DAEMON
 /*
 
 #ifndef HAVE_DAEMON
 /*
index e4aa702..c0bf14d 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.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: dropin.h,v 1.1.2.11 2003/07/12 17:48:38 guus Exp $
+    $Id: dropin.h,v 1.1.2.12 2003/07/17 15:06:25 guus Exp $
 */
 
 #ifndef __DROPIN_H__
 */
 
 #ifndef __DROPIN_H__
@@ -36,8 +36,6 @@ extern int asprintf(char **, const char *, ...);
 #endif
 
 #ifndef HAVE_GETNAMEINFO
 #endif
 
 #ifndef HAVE_GETNAMEINFO
-#include <sys/types.h>
-#include <sys/socket.h>
 extern int getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
                                           size_t hostlen, char *serv, size_t servlen, int flags);
 #endif
 extern int getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
                                           size_t hostlen, char *serv, size_t servlen, int flags);
 #endif
index 5e95a2a..e170680 100644 (file)
@@ -9,17 +9,7 @@
  * that ai_family is AF_INET. Don't use it for another purpose.
  */
 
  * that ai_family is AF_INET. Don't use it for another purpose.
  */
 
-#include "config.h"
-
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <string.h>
-
-#include <system.h>
+#include "system.h"
 
 #include "fake-getaddrinfo.h"
 
 
 #include "fake-getaddrinfo.h"
 
index 3f24375..db7b147 100644 (file)
@@ -1,14 +1,8 @@
-/* $Id: fake-getaddrinfo.h,v 1.1.2.2 2003/07/06 23:16:27 guus Exp $ */
+/* $Id: fake-getaddrinfo.h,v 1.1.2.3 2003/07/17 15:06:25 guus Exp $ */
 
 #ifndef _FAKE_GETADDRINFO_H
 #define _FAKE_GETADDRINFO_H
 
 
 #ifndef _FAKE_GETADDRINFO_H
 #define _FAKE_GETADDRINFO_H
 
-#include "config.h"
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-
 #include "fake-gai-errnos.h"
 
 #ifndef AI_PASSIVE
 #include "fake-gai-errnos.h"
 
 #ifndef AI_PASSIVE
index 50d0722..8774da2 100644 (file)
@@ -9,17 +9,7 @@
  * that ai_family is AF_INET. Don't use it for another purpose.
  */
 
  * that ai_family is AF_INET. Don't use it for another purpose.
  */
 
-#include "config.h"
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <string.h>
-
-#include <system.h>
+#include "system.h"
 
 #include "fake-getnameinfo.h"
 #include "fake-getaddrinfo.h"
 
 #include "fake-getnameinfo.h"
 #include "fake-getaddrinfo.h"
index 20889a6..1d7b0db 100644 (file)
@@ -1,13 +1,8 @@
-/* $Id: fake-getnameinfo.h,v 1.1.2.2 2003/07/12 17:41:45 guus Exp $ */
+/* $Id: fake-getnameinfo.h,v 1.1.2.3 2003/07/17 15:06:25 guus Exp $ */
 
 #ifndef _FAKE_GETNAMEINFO_H
 #define _FAKE_GETNAMEINFO_H
 
 
 #ifndef _FAKE_GETNAMEINFO_H
 #define _FAKE_GETNAMEINFO_H
 
-#include "config.h"
-
-#include <sys/socket.h>
-#include <netdb.h>
-
 #ifndef HAVE_GETNAMEINFO
 int getnameinfo(const struct sockaddr *sa, size_t salen, char *host, 
                 size_t hostlen, char *serv, size_t servlen, int flags);
 #ifndef HAVE_GETNAMEINFO
 int getnameinfo(const struct sockaddr *sa, size_t salen, char *host, 
                 size_t hostlen, char *serv, size_t servlen, int flags);
index c04ada2..92a0ae0 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: ipv6.h,v 1.1.2.3 2003/07/11 16:12:59 guus Exp $
+    $Id: ipv6.h,v 1.1.2.4 2003/07/17 15:06:25 guus Exp $
 */
 
 #ifndef __TINC_IPV6_H__
 #define __TINC_IPV6_H__
 
 */
 
 #ifndef __TINC_IPV6_H__
 #define __TINC_IPV6_H__
 
-#include "config.h"
-
-#include <netinet/in.h>
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-
 #ifndef AF_INET6
 #define AF_INET6 10
 #endif
 #ifndef AF_INET6
 #define AF_INET6 10
 #endif
index 0b516c8..573bc9e 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: list.c,v 1.1.2.15 2003/07/12 17:48:38 guus Exp $
+    $Id: list.c,v 1.1.2.16 2003/07/17 15:06:25 guus Exp $
 */
 
 */
 
-#include "config.h"
-
-#include <stdlib.h>
-
-#include <xalloc.h>
-#include <system.h>
+#include "system.h"
 
 #include "list.h"
 
 #include "list.h"
+#include "xalloc.h"
 
 /* (De)constructors */
 
 
 /* (De)constructors */
 
index 250f67b..2dea70b 100644 (file)
  *     First version (v0.2) released
  */
 
  *     First version (v0.2) released
  */
 
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#include <sys/file.h>
-#include <string.h>
-#include <errno.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <signal.h>
-#include <fcntl.h>
+#include "system.h"
 
 /* read_pid
  *
 
 /* read_pid
  *
index 9552c5c..9ffad70 100644 (file)
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include "config.h"
+#include "system.h"
 
 
-#include <sys/types.h>
-#include <ctype.h>
-#include <string.h>
-
-#include <utils.h>
-#include <syslog.h>
-#include <xalloc.h>
+#include "../src/logger.h"
+#include "utils.h"
 
 #ifdef ENABLE_TRACING
 volatile int (cp_line[]) = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
 
 #ifdef ENABLE_TRACING
 volatile int (cp_line[]) = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
@@ -64,7 +59,7 @@ void bin2hex(char *src, char *dst, int length)
 #ifdef ENABLE_TRACING
 void cp_trace()
 {
 #ifdef ENABLE_TRACING
 void cp_trace()
 {
-       syslog(LOG_DEBUG, "Checkpoint trace: %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d...",
+       logger(LOG_DEBUG, "Checkpoint trace: %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d <- %s:%d...",
                   cp_file[(cp_index + 15) % 16], cp_line[(cp_index + 15) % 16],
                   cp_file[(cp_index + 14) % 16], cp_line[(cp_index + 14) % 16],
                   cp_file[(cp_index + 13) % 16], cp_line[(cp_index + 13) % 16],
                   cp_file[(cp_index + 15) % 16], cp_line[(cp_index + 15) % 16],
                   cp_file[(cp_index + 14) % 16], cp_line[(cp_index + 14) % 16],
                   cp_file[(cp_index + 13) % 16], cp_line[(cp_index + 13) % 16],
index 2a56ef5..caf6e6f 100644 (file)
 #ifndef __TINC_UTILS_H__
 #define __TINC_UTILS_H__
 
 #ifndef __TINC_UTILS_H__
 #define __TINC_UTILS_H__
 
-#include <ctype.h>
-
-#include "fake-getaddrinfo.h"
-#include "fake-getnameinfo.h"
-#include "ipv6.h"
-
-#define min(a,b) (((a)<(b))?(a):(b))
-
 #ifdef ENABLE_TRACING
 extern volatile int cp_line[];
 extern volatile char *cp_file[];
 #ifdef ENABLE_TRACING
 extern volatile int cp_line[];
 extern volatile char *cp_file[];
index b6d2b0a..f7019d1 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: conf.c,v 1.9.4.65 2003/07/12 17:41:45 guus Exp $
+    $Id: conf.c,v 1.9.4.66 2003/07/17 15:06:26 guus Exp $
 */
 
 */
 
-#include "config.h"
-
-#include <ctype.h>
-#include <errno.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <string.h>
-
-#include <xalloc.h>
-#include <utils.h>                             /* for cp */
-#include <avl_tree.h>
+#include "system.h"
 
 
+#include "avl_tree.h"
 #include "conf.h"
 #include "conf.h"
-#include "netutl.h"                            /* for str2address */
 #include "logger.h"
 #include "logger.h"
-
-#include "system.h"
+#include "netutl.h"                            /* for str2address */
+#include "utils.h"                             /* for cp */
+#include "xalloc.h"
 
 avl_tree_t *config_tree;
 
 
 avl_tree_t *config_tree;
 
index 76e3893..32bb909 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: conf.h,v 1.6.4.38 2003/07/12 17:41:45 guus Exp $
+    $Id: conf.h,v 1.6.4.39 2003/07/17 15:06:26 guus Exp $
 */
 
 #ifndef __TINC_CONF_H__
 #define __TINC_CONF_H__
 
 */
 
 #ifndef __TINC_CONF_H__
 #define __TINC_CONF_H__
 
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-
-#include <avl_tree.h>
-#include "net.h"
+#include "avl_tree.h"
 #include "subnet.h"
 
 typedef struct config_t {
 #include "subnet.h"
 
 typedef struct config_t {
@@ -57,7 +52,6 @@ extern int get_config_bool(config_t *, int *);
 extern int get_config_int(config_t *, int *);
 extern int get_config_string(config_t *, char **);
 extern int get_config_address(config_t *, struct addrinfo **);
 extern int get_config_int(config_t *, int *);
 extern int get_config_string(config_t *, char **);
 extern int get_config_address(config_t *, struct addrinfo **);
-struct subnet_t;                               /* Needed for next line. */
 extern int get_config_subnet(config_t *, struct subnet_t **);
 
 extern int read_config_file(avl_tree_t *, const char *);
 extern int get_config_subnet(config_t *, struct subnet_t **);
 
 extern int read_config_file(avl_tree_t *, const char *);
index dbfe6d6..9890f51 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: connection.c,v 1.1.2.39 2003/07/12 17:41:45 guus Exp $
+    $Id: connection.c,v 1.1.2.40 2003/07/17 15:06:26 guus Exp $
 */
 
 */
 
-#include "config.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <sys/time.h>
-
-#include <avl_tree.h>
-#include <list.h>
+#include "system.h"
 
 
+#include "avl_tree.h"
+#include "conf.h"
+#include "list.h"
+#include "logger.h"
 #include "net.h"                               /* Don't ask. */
 #include "netutl.h"
 #include "net.h"                               /* Don't ask. */
 #include "netutl.h"
-#include "conf.h"
-#include <utils.h>
 #include "subnet.h"
 #include "subnet.h"
-#include "logger.h"
-
+#include "utils.h"
 #include "xalloc.h"
 #include "xalloc.h"
-#include "system.h"
 
 avl_tree_t *connection_tree;   /* Meta connections */
 connection_t *broadcast;
 
 avl_tree_t *connection_tree;   /* Meta connections */
 connection_t *broadcast;
index 30102f2..1b3ca36 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: connection.h,v 1.1.2.33 2003/07/12 17:41:45 guus Exp $
+    $Id: connection.h,v 1.1.2.34 2003/07/17 15:06:26 guus Exp $
 */
 
 #ifndef __TINC_CONNECTION_H__
 #define __TINC_CONNECTION_H__
 
 */
 
 #ifndef __TINC_CONNECTION_H__
 #define __TINC_CONNECTION_H__
 
-#include <sys/time.h>
+#include <openssl/rsa.h>
+#include <openssl/evp.h>
 
 
-#include <avl_tree.h>
-#include <list.h>
-
-#ifdef HAVE_OPENSSL_EVP_H
-# include <openssl/evp.h>
-#else
-# include <evp.h>
-#endif
-
-#ifdef HAVE_OPENSSL_RSA_H
-# include <openssl/rsa.h>
-#else
-# include <rsa.h>
-#endif
-
-#include "net.h"
+#include "avl_tree.h"
 #include "conf.h"
 #include "conf.h"
-
-#include "node.h"
 #include "edge.h"
 #include "edge.h"
+#include "list.h"
+#include "net.h"
+#include "node.h"
 
 #define OPTION_INDIRECT                0x0001
 #define OPTION_TCPONLY         0x0002
 
 #define OPTION_INDIRECT                0x0001
 #define OPTION_TCPONLY         0x0002
index 3bceb00..48ead00 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: edge.c,v 1.1.2.21 2003/07/12 17:41:45 guus Exp $
+    $Id: edge.c,v 1.1.2.22 2003/07/17 15:06:26 guus Exp $
 */
 
 */
 
-#include "config.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <avl_tree.h>
-#include <list.h>
+#include "system.h"
 
 
-#include "net.h"                               /* Don't ask. */
-#include "netutl.h"
-#include "conf.h"
-#include <utils.h>
-#include "subnet.h"
+#include "avl_tree.h"
 #include "edge.h"
 #include "edge.h"
-#include "node.h"
 #include "logger.h"
 #include "logger.h"
-
+#include "netutl.h"
+#include "node.h"
+#include "utils.h"
 #include "xalloc.h"
 #include "xalloc.h"
-#include "system.h"
 
 avl_tree_t *edge_weight_tree;  /* Tree with all edges, sorted on weight */
 
 
 avl_tree_t *edge_weight_tree;  /* Tree with all edges, sorted on weight */
 
index 3fe8645..b841bc9 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: edge.h,v 1.1.2.13 2003/07/12 17:41:45 guus Exp $
+    $Id: edge.h,v 1.1.2.14 2003/07/17 15:06:26 guus Exp $
 */
 
 #ifndef __TINC_EDGE_H__
 #define __TINC_EDGE_H__
 
 */
 
 #ifndef __TINC_EDGE_H__
 #define __TINC_EDGE_H__
 
-#include <avl_tree.h>
-
+#include "avl_tree.h"
+#include "connection.h"
 #include "net.h"
 #include "node.h"
 #include "net.h"
 #include "node.h"
-#include "connection.h"
 
 typedef struct edge_t {
        struct node_t *from;
 
 typedef struct edge_t {
        struct node_t *from;
index 4596165..4eae34d 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: event.c,v 1.1.4.8 2003/07/12 17:41:45 guus Exp $
+    $Id: event.c,v 1.1.4.9 2003/07/17 15:06:26 guus Exp $
 */
 
 */
 
-#include "config.h"
-
-#include <stdlib.h>
-#include <xalloc.h>
-#include <string.h>
-#include <utils.h>
-#include <avl_tree.h>
-#include <time.h>
+#include "system.h"
 
 
+#include "avl_tree.h"
 #include "event.h"
 #include "event.h"
-
-#include "system.h"
+#include "utils.h"
+#include "xalloc.h"
 
 avl_tree_t *event_tree;
 extern time_t now;
 
 avl_tree_t *event_tree;
 extern time_t now;
index fb10c4a..71aae18 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: event.h,v 1.1.4.6 2003/07/12 17:41:45 guus Exp $
+    $Id: event.h,v 1.1.4.7 2003/07/17 15:06:26 guus Exp $
 */
 
 #ifndef __TINC_EVENT_H__
 #define __TINC_EVENT_H__
 
 */
 
 #ifndef __TINC_EVENT_H__
 #define __TINC_EVENT_H__
 
-#include <time.h>
-#include <avl_tree.h>
+#include "avl_tree.h"
 
 extern avl_tree_t *event_tree;
 
 
 extern avl_tree_t *event_tree;
 
index 3692f44..2c6ad22 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.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: graph.c,v 1.1.2.24 2003/07/12 17:41:45 guus Exp $
+    $Id: graph.c,v 1.1.2.25 2003/07/17 15:06:26 guus Exp $
 */
 
 /* We need to generate two trees from the graph:
 */
 
 /* We need to generate two trees from the graph:
    destination address and port of a node if possible.
 */
 
    destination address and port of a node if possible.
 */
 
-#include "config.h"
-
-#include <stdio.h>
-#include <string.h>
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#include <netinet/in.h>
-
-#include <avl_tree.h>
-#include <utils.h>
+#include "system.h"
 
 
-#include "netutl.h"
-#include "node.h"
-#include "edge.h"
+#include "avl_tree.h"
 #include "connection.h"
 #include "connection.h"
-#include "process.h"
 #include "device.h"
 #include "device.h"
+#include "edge.h"
 #include "logger.h"
 #include "logger.h"
-
-#include "system.h"
+#include "netutl.h"
+#include "node.h"
+#include "process.h"
+#include "utils.h"
 
 /* Implementation of Kruskal's algorithm.
    Running time: O(EN)
 
 /* Implementation of Kruskal's algorithm.
    Running time: O(EN)
index f9105e6..08d9364 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: device.c,v 1.1.2.17 2003/07/12 17:41:48 guus Exp $
+    $Id: device.c,v 1.1.2.18 2003/07/17 15:06:27 guus Exp $
 */
 
 */
 
-#include "config.h"
-
-#include <stdio.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <net/if.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/ioctl.h>
+#include "system.h"
 
 #ifdef HAVE_TUNTAP
 #ifdef LINUX_IF_TUN_H
 
 #ifdef HAVE_TUNTAP
 #ifdef LINUX_IF_TUN_H
 #define DEFAULT_DEVICE "/dev/tap0"
 #endif
 
 #define DEFAULT_DEVICE "/dev/tap0"
 #endif
 
-#include <utils.h>
 #include "conf.h"
 #include "conf.h"
+#include "logger.h"
 #include "net.h"
 #include "route.h"
 #include "net.h"
 #include "route.h"
-#include "logger.h"
-
-#include "system.h"
+#include "utils.h"
 
 enum {
        DEVICE_TYPE_ETHERTAP,
 
 enum {
        DEVICE_TYPE_ETHERTAP,
index 012f19d..b8ea092 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: logger.c,v 1.1.2.3 2003/07/12 17:41:45 guus Exp $
+    $Id: logger.c,v 1.1.2.4 2003/07/17 15:06:26 guus Exp $
 */
 
 */
 
-#include <stdio.h>
-#include <stdarg.h>
-#include <syslog.h>
-#include <unistd.h>
+#include "system.h"
 
 #include "conf.h"
 #include "logger.h"
 
 
 #include "conf.h"
 #include "logger.h"
 
-#include "system.h"
-
 int debug_level = DEBUG_NOTHING;
 static int logmode = LOGMODE_STDERR;
 static pid_t logpid;
 int debug_level = DEBUG_NOTHING;
 static int logmode = LOGMODE_STDERR;
 static pid_t logpid;
index edd0d93..615d0c3 100644 (file)
@@ -1,8 +1,5 @@
 #ifndef __TINC_LOGGER_H__
 
 #ifndef __TINC_LOGGER_H__
 
-#include <syslog.h>
-#include <stdarg.h>
-
 enum {
        DEBUG_NOTHING = 0,                      /* Quiet mode, only show starting/stopping of the daemon */
        DEBUG_ALWAYS = 0,
 enum {
        DEBUG_NOTHING = 0,                      /* Quiet mode, only show starting/stopping of the daemon */
        DEBUG_ALWAYS = 0,
index 939f76b..967477b 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: meta.c,v 1.1.2.35 2003/07/12 17:41:45 guus Exp $
+    $Id: meta.c,v 1.1.2.36 2003/07/17 15:06:26 guus Exp $
 */
 
 */
 
-#include "config.h"
-#include <utils.h>
-#include <avl_tree.h>
-
-#include <errno.h>
-#include <unistd.h>
-#include <string.h>
-/* This line must be below the rest for FreeBSD */
-#include <sys/types.h>
-#include <sys/socket.h>
+#include "system.h"
 
 #include <openssl/evp.h>
 
 
 #include <openssl/evp.h>
 
-#include "net.h"
+#include "avl_tree.h"
 #include "connection.h"
 #include "connection.h"
-#include "system.h"
-#include "protocol.h"
 #include "logger.h"
 #include "logger.h"
+#include "net.h"
+#include "protocol.h"
+#include "system.h"
+#include "utils.h"
 
 int send_meta(connection_t *c, char *buffer, int length)
 {
 
 int send_meta(connection_t *c, char *buffer, int length)
 {
index 8b2c9f0..d43aede 100644 (file)
--- a/src/net.c
+++ b/src/net.c
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     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.190 2003/07/12 17:41:45 guus Exp $
+    $Id: net.c,v 1.35.4.191 2003/07/17 15:06:26 guus Exp $
 */
 
 */
 
-#include "config.h"
-
-#include <errno.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <signal.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-/* SunOS really wants sys/socket.h BEFORE net/if.h,
-   and FreeBSD wants these lines below the rest. */
-#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 "system.h"
 
 #include <openssl/rand.h>
 
 
 #include <openssl/rand.h>
 
-#include <utils.h>
-#include <xalloc.h>
-#include <avl_tree.h>
-#include <list.h>
-
+#include "utils.h"
+#include "avl_tree.h"
 #include "conf.h"
 #include "connection.h"
 #include "conf.h"
 #include "connection.h"
+#include "device.h"
+#include "event.h"
+#include "graph.h"
+#include "logger.h"
 #include "meta.h"
 #include "net.h"
 #include "netutl.h"
 #include "process.h"
 #include "protocol.h"
 #include "meta.h"
 #include "net.h"
 #include "netutl.h"
 #include "process.h"
 #include "protocol.h"
-#include "subnet.h"
-#include "graph.h"
-#include "process.h"
 #include "route.h"
 #include "route.h"
-#include "device.h"
-#include "event.h"
-#include "logger.h"
-
-#include "system.h"
+#include "subnet.h"
 
 int do_purge = 0;
 int sighup = 0;
 
 int do_purge = 0;
 int sighup = 0;
index 8ad8994..43371ad 100644 (file)
--- a/src/net.h
+++ b/src/net.h
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: net.h,v 1.9.4.63 2003/07/12 17:41:46 guus Exp $
+    $Id: net.h,v 1.9.4.64 2003/07/17 15:06:26 guus Exp $
 */
 
 #ifndef __TINC_NET_H__
 #define __TINC_NET_H__
 
 */
 
 #ifndef __TINC_NET_H__
 #define __TINC_NET_H__
 
-#include "config.h"
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/time.h>
 #include <openssl/evp.h>
 
 #include <openssl/evp.h>
 
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-
-#include "utils.h"
-
 #ifdef ENABLE_JUMBOGRAMS
 #define MTU 9014                               /* 9000 bytes payload + 14 bytes ethernet header */
 #else
 #ifdef ENABLE_JUMBOGRAMS
 #define MTU 9014                               /* 9000 bytes payload + 14 bytes ethernet header */
 #else
@@ -97,6 +85,8 @@ typedef struct packet_queue_t {
        queue_element_t *tail;
 } packet_queue_t;
 
        queue_element_t *tail;
 } packet_queue_t;
 
+#include "conf.h"
+
 typedef struct outgoing_t {
        char *name;
        int timeout;
 typedef struct outgoing_t {
        char *name;
        int timeout;
@@ -115,8 +105,6 @@ extern int maxtimeout;
 extern int seconds_till_retry;
 extern int addressfamily;
 
 extern int seconds_till_retry;
 extern int addressfamily;
 
-#include "connection.h"                        /* Yes, very strange placement indeed, but otherwise the typedefs get all tangled up */
-
 extern listen_socket_t listen_socket[MAXSOCKETS];
 extern int listen_sockets;
 extern int keyexpires;
 extern listen_socket_t listen_socket[MAXSOCKETS];
 extern int listen_sockets;
 extern int keyexpires;
@@ -127,10 +115,14 @@ extern char *myport;
 extern time_t now;
 extern EVP_CIPHER_CTX packet_ctx;
 
 extern time_t now;
 extern EVP_CIPHER_CTX packet_ctx;
 
+/* Yes, very strange placement indeed, but otherwise the typedefs get all tangled up */
+#include "connection.h"
+#include "node.h"
+
 extern void retry_outgoing(outgoing_t *);
 extern void handle_incoming_vpn_data(int);
 extern void retry_outgoing(outgoing_t *);
 extern void handle_incoming_vpn_data(int);
-extern void finish_connecting(connection_t *);
-extern void do_outgoing_connection(connection_t *);
+extern void finish_connecting(struct connection_t *);
+extern void do_outgoing_connection(struct connection_t *);
 extern int handle_new_meta_connection(int);
 extern int setup_listen_socket(sockaddr_t *);
 extern int setup_vpn_in_socket(sockaddr_t *);
 extern int handle_new_meta_connection(int);
 extern int setup_listen_socket(sockaddr_t *);
 extern int setup_vpn_in_socket(sockaddr_t *);
@@ -142,7 +134,7 @@ extern void setup_outgoing_connection(struct outgoing_t *);
 extern void try_outgoing_connections(void);
 extern void close_network_connections(void);
 extern void main_loop(void);
 extern void try_outgoing_connections(void);
 extern void close_network_connections(void);
 extern void main_loop(void);
-extern void terminate_connection(connection_t *, int);
+extern void terminate_connection(struct connection_t *, int);
 extern void flush_queue(struct node_t *);
 extern int read_rsa_public_key(struct connection_t *);
 
 extern void flush_queue(struct node_t *);
 extern int read_rsa_public_key(struct connection_t *);
 
index c0bd247..e858daa 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     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.33 2003/07/12 17:41:46 guus Exp $
+    $Id: net_packet.c,v 1.1.2.34 2003/07/17 15:06:26 guus Exp $
 */
 
 */
 
-#include "config.h"
-
-#include <errno.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <netinet/in.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <signal.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-/* SunOS really wants sys/socket.h BEFORE net/if.h,
-   and FreeBSD wants these lines below the rest. */
-#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 "system.h"
 
 #include <openssl/rand.h>
 #include <openssl/evp.h>
 
 #include <openssl/rand.h>
 #include <openssl/evp.h>
 #include <zlib.h>
 #include <lzo1x.h>
 
 #include <zlib.h>
 #include <lzo1x.h>
 
-#include <utils.h>
-#include <xalloc.h>
-#include <avl_tree.h>
-#include <list.h>
-
+#include "avl_tree.h"
 #include "conf.h"
 #include "connection.h"
 #include "conf.h"
 #include "connection.h"
-#include "meta.h"
+#include "device.h"
+#include "event.h"
+#include "graph.h"
+#include "list.h"
+#include "logger.h"
 #include "net.h"
 #include "netutl.h"
 #include "net.h"
 #include "netutl.h"
-#include "process.h"
 #include "protocol.h"
 #include "protocol.h"
-#include "subnet.h"
-#include "graph.h"
 #include "process.h"
 #include "route.h"
 #include "process.h"
 #include "route.h"
-#include "device.h"
-#include "event.h"
-#include "logger.h"
-
-#include "system.h"
+#include "utils.h"
+#include "xalloc.h"
 
 int keylifetime = 0;
 int keyexpires = 0;
 
 int keylifetime = 0;
 int keyexpires = 0;
index 4c258ab..ca7aa61 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     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.34 2003/07/12 17:41:46 guus Exp $
+    $Id: net_setup.c,v 1.1.2.35 2003/07/17 15:06:26 guus Exp $
 */
 
 */
 
-#include "config.h"
-
-#include <errno.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <netinet/in.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <signal.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-/* SunOS really wants sys/socket.h BEFORE net/if.h,
-   and FreeBSD wants these lines below the rest. */
-#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 "system.h"
 
 #include <openssl/pem.h>
 #include <openssl/rsa.h>
 #include <openssl/rand.h>
 
 
 #include <openssl/pem.h>
 #include <openssl/rsa.h>
 #include <openssl/rand.h>
 
-#include <utils.h>
-#include <xalloc.h>
-#include <avl_tree.h>
-#include <list.h>
-
+#include "avl_tree.h"
 #include "conf.h"
 #include "connection.h"
 #include "conf.h"
 #include "connection.h"
-#include "meta.h"
+#include "device.h"
+#include "event.h"
+#include "graph.h"
+#include "logger.h"
 #include "net.h"
 #include "netutl.h"
 #include "process.h"
 #include "protocol.h"
 #include "net.h"
 #include "netutl.h"
 #include "process.h"
 #include "protocol.h"
-#include "subnet.h"
-#include "graph.h"
-#include "process.h"
 #include "route.h"
 #include "route.h"
-#include "device.h"
-#include "event.h"
-#include "logger.h"
-
-#include "system.h"
+#include "subnet.h"
+#include "utils.h"
+#include "xalloc.h"
 
 char *myport;
 
 
 char *myport;
 
index 1b5c18f..bb5208f 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     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.26 2003/07/12 17:41:46 guus Exp $
+    $Id: net_socket.c,v 1.1.2.27 2003/07/17 15:06:26 guus Exp $
 */
 
 */
 
-#include "config.h"
-
-#include <errno.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <netinet/in.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <signal.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-/* SunOS really wants sys/socket.h BEFORE net/if.h,
-   and FreeBSD wants these lines below the rest. */
-#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>
-#include <avl_tree.h>
-#include <list.h>
+#include "system.h"
 
 
+#include "avl_tree.h"
 #include "conf.h"
 #include "connection.h"
 #include "conf.h"
 #include "connection.h"
+#include "event.h"
+#include "logger.h"
 #include "meta.h"
 #include "net.h"
 #include "netutl.h"
 #include "meta.h"
 #include "net.h"
 #include "netutl.h"
-#include "process.h"
 #include "protocol.h"
 #include "protocol.h"
-#include "subnet.h"
-#include "graph.h"
-#include "process.h"
-#include "route.h"
-#include "device.h"
-#include "event.h"
-#include "logger.h"
-
-#include "system.h"
-
-#ifndef HAVE_RAND_PSEUDO_BYTES
-#define RAND_pseudo_bytes RAND_bytes
-#endif
+#include "utils.h"
+#include "xalloc.h"
 
 int addressfamily = AF_UNSPEC;
 int maxtimeout = 900;
 
 int addressfamily = AF_UNSPEC;
 int maxtimeout = 900;
index 1f5e4af..6784833 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: netutl.c,v 1.12.4.46 2003/07/12 17:41:46 guus Exp $
+    $Id: netutl.c,v 1.12.4.47 2003/07/17 15:06:26 guus Exp $
 */
 
 */
 
-#include "config.h"
-
-#include <fcntl.h>
-#include <netdb.h>
-#include <netinet/in.h>
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-#include <string.h>
-#include <signal.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
-
-#include <utils.h>
-#include <xalloc.h>
-
-#include "errno.h"
-#include "conf.h"
+#include "system.h"
+
 #include "net.h"
 #include "netutl.h"
 #include "logger.h"
 #include "net.h"
 #include "netutl.h"
 #include "logger.h"
-
-#include "system.h"
+#include "utils.h"
+#include "xalloc.h"
 
 int hostnames = 0;
 
 
 int hostnames = 0;
 
index b946b77..eb5aeeb 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: netutl.h,v 1.2.4.15 2003/07/12 17:41:46 guus Exp $
+    $Id: netutl.h,v 1.2.4.16 2003/07/17 15:06:26 guus Exp $
 */
 
 #ifndef __TINC_NETUTL_H__
 #define __TINC_NETUTL_H__
 
 */
 
 #ifndef __TINC_NETUTL_H__
 #define __TINC_NETUTL_H__
 
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-
 #include "net.h"
 
 extern int hostnames;
 #include "net.h"
 
 extern int hostnames;
index 6dba7f2..5fc94a9 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: node.c,v 1.1.2.22 2003/07/12 17:41:46 guus Exp $
+    $Id: node.c,v 1.1.2.23 2003/07/17 15:06:26 guus Exp $
 */
 
 */
 
-#include "config.h"
-
-#include <string.h>
+#include "system.h"
 
 
-#include <avl_tree.h>
-#include "node.h"
-#include "netutl.h"
-#include "net.h"
+#include "avl_tree.h"
 #include "logger.h"
 #include "logger.h"
-
-#include <utils.h>
-#include <xalloc.h>
-
-#include "system.h"
+#include "net.h"
+#include "netutl.h"
+#include "node.h"
+#include "utils.h"
+#include "xalloc.h"
 
 avl_tree_t *node_tree;                 /* Known nodes, sorted by name */
 avl_tree_t *node_udp_tree;             /* Known nodes, sorted by address and port */
 
 avl_tree_t *node_tree;                 /* Known nodes, sorted by name */
 avl_tree_t *node_udp_tree;             /* Known nodes, sorted by address and port */
index 085d6a4..a4e439a 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: node.h,v 1.1.2.24 2003/07/12 17:41:46 guus Exp $
+    $Id: node.h,v 1.1.2.25 2003/07/17 15:06:26 guus Exp $
 */
 
 #ifndef __TINC_NODE_H__
 #define __TINC_NODE_H__
 
 */
 
 #ifndef __TINC_NODE_H__
 #define __TINC_NODE_H__
 
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-
-#include <avl_tree.h>
-
-#include "subnet.h"
+#include "avl_tree.h"
 #include "connection.h"
 #include "connection.h"
+#include "list.h"
+#include "subnet.h"
 
 typedef struct node_status_t {
        int active:1;                           /* 1 if active.. */
 
 typedef struct node_status_t {
        int active:1;                           /* 1 if active.. */
index 326d3ff..b0e1e63 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     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.54 2003/07/12 17:41:46 guus Exp $
+    $Id: process.c,v 1.1.2.55 2003/07/17 15:06:26 guus Exp $
 */
 
 */
 
-#include "config.h"
-
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <termios.h>
-
-#include <pidfile.h>
-#include <utils.h>
-#include <xalloc.h>
+#include "system.h"
 
 #include "conf.h"
 
 #include "conf.h"
-#include "process.h"
-#include "subnet.h"
-#include "device.h"
 #include "connection.h"
 #include "device.h"
 #include "connection.h"
 #include "device.h"
+#include "edge.h"
 #include "logger.h"
 #include "logger.h"
-
-#include "system.h"
+#include "node.h"
+#include "pidfile.h"
+#include "process.h"
+#include "subnet.h"
+#include "utils.h"
+#include "xalloc.h"
 
 /* If zero, don't detach from the terminal. */
 int do_detach = 1;
 
 /* If zero, don't detach from the terminal. */
 int do_detach = 1;
index cae136c..cb5f7c7 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: process.h,v 1.1.2.15 2003/07/12 17:41:46 guus Exp $
+    $Id: process.h,v 1.1.2.16 2003/07/17 15:06:26 guus Exp $
 */
 
 #ifndef __TINC_PROCESS_H__
 #define __TINC_PROCESS_H__
 
 */
 
 #ifndef __TINC_PROCESS_H__
 #define __TINC_PROCESS_H__
 
-#include "config.h"
-
 extern int do_detach;
 
 extern void setup_signals(void);
 extern int do_detach;
 
 extern void setup_signals(void);
index c8b868c..47cc948 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: protocol.c,v 1.28.4.140 2003/07/12 17:41:46 guus Exp $
+    $Id: protocol.c,v 1.28.4.141 2003/07/17 15:06:26 guus Exp $
 */
 
 */
 
-#include "config.h"
-
-#include <sys/types.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <errno.h>
-
-#include <utils.h>
-#include <xalloc.h>
+#include "system.h"
 
 #include "conf.h"
 
 #include "conf.h"
-#include "protocol.h"
-#include "meta.h"
 #include "connection.h"
 #include "logger.h"
 #include "connection.h"
 #include "logger.h"
-
-#include "system.h"
+#include "meta.h"
+#include "protocol.h"
+#include "utils.h"
+#include "xalloc.h"
 
 /* Jumptable for the request handlers */
 
 
 /* Jumptable for the request handlers */
 
index 6e71f81..6f01a76 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: protocol.h,v 1.5.4.38 2003/07/06 23:16:28 guus Exp $
+    $Id: protocol.h,v 1.5.4.39 2003/07/17 15:06:26 guus Exp $
 */
 
 #ifndef __TINC_PROTOCOL_H__
 #define __TINC_PROTOCOL_H__
 
 */
 
 #ifndef __TINC_PROTOCOL_H__
 #define __TINC_PROTOCOL_H__
 
+#include "edge.h"
 #include "net.h"
 #include "node.h"
 #include "net.h"
 #include "node.h"
-#include "edge.h"
 #include "subnet.h"
 
 /* Protocol version. Different versions are incompatible,
 #include "subnet.h"
 
 /* Protocol version. Different versions are incompatible,
index 1b8794d..88fba26 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: protocol_auth.c,v 1.1.4.23 2003/07/12 17:41:47 guus Exp $
+    $Id: protocol_auth.c,v 1.1.4.24 2003/07/17 15:06:26 guus Exp $
 */
 
 */
 
-#include "config.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <errno.h>
-
-#include <utils.h>
-#include <xalloc.h>
-#include <avl_tree.h>
+#include "system.h"
 
 #include <openssl/sha.h>
 #include <openssl/rand.h>
 #include <openssl/evp.h>
 
 
 #include <openssl/sha.h>
 #include <openssl/rand.h>
 #include <openssl/evp.h>
 
+#include "avl_tree.h"
 #include "conf.h"
 #include "conf.h"
-#include "net.h"
-#include "netutl.h"
-#include "protocol.h"
-#include "meta.h"
 #include "connection.h"
 #include "connection.h"
-#include "node.h"
 #include "edge.h"
 #include "graph.h"
 #include "logger.h"
 #include "edge.h"
 #include "graph.h"
 #include "logger.h"
-
-#include "system.h"
+#include "net.h"
+#include "netutl.h"
+#include "node.h"
+#include "protocol.h"
+#include "utils.h"
+#include "xalloc.h"
 
 int send_id(connection_t *c)
 {
 
 int send_id(connection_t *c)
 {
index d81fc87..75b4995 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     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.17 2003/07/12 17:41:47 guus Exp $
+    $Id: protocol_edge.c,v 1.1.4.18 2003/07/17 15:06:26 guus Exp $
 */
 
 */
 
-#include "config.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <errno.h>
-
-#include <utils.h>
-#include <xalloc.h>
-#include <avl_tree.h>
+#include "system.h"
 
 
+#include "avl_tree.h"
 #include "conf.h"
 #include "conf.h"
-#include "net.h"
-#include "netutl.h"
-#include "protocol.h"
-#include "meta.h"
 #include "connection.h"
 #include "connection.h"
-#include "node.h"
 #include "edge.h"
 #include "graph.h"
 #include "logger.h"
 #include "edge.h"
 #include "graph.h"
 #include "logger.h"
-
-#include "system.h"
+#include "meta.h"
+#include "net.h"
+#include "netutl.h"
+#include "node.h"
+#include "protocol.h"
+#include "utils.h"
+#include "xalloc.h"
 
 int send_add_edge(connection_t *c, edge_t *e)
 {
 
 int send_add_edge(connection_t *c, edge_t *e)
 {
index 1a6804a..832b2af 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: protocol_key.c,v 1.1.4.18 2003/07/12 17:41:47 guus Exp $
+    $Id: protocol_key.c,v 1.1.4.19 2003/07/17 15:06:26 guus Exp $
 */
 
 */
 
-#include "config.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <errno.h>
-
-#include <utils.h>
-#include <xalloc.h>
-#include <avl_tree.h>
+#include "system.h"
 
 
-#include "conf.h"
+#include "avl_tree.h"
+#include "connection.h"
+#include "logger.h"
 #include "net.h"
 #include "netutl.h"
 #include "net.h"
 #include "netutl.h"
-#include "protocol.h"
-#include "meta.h"
-#include "connection.h"
 #include "node.h"
 #include "node.h"
-#include "logger.h"
-
-#include "system.h"
+#include "protocol.h"
+#include "utils.h"
+#include "xalloc.h"
 
 int mykeyused = 0;
 
 
 int mykeyused = 0;
 
index d5c9aeb..934a182 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: protocol_misc.c,v 1.1.4.10 2003/07/12 17:41:47 guus Exp $
+    $Id: protocol_misc.c,v 1.1.4.11 2003/07/17 15:06:26 guus Exp $
 */
 
 */
 
-#include "config.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <errno.h>
-
-#include <utils.h>
+#include "system.h"
 
 #include "conf.h"
 
 #include "conf.h"
+#include "connection.h"
+#include "logger.h"
+#include "meta.h"
 #include "net.h"
 #include "netutl.h"
 #include "protocol.h"
 #include "net.h"
 #include "netutl.h"
 #include "protocol.h"
-#include "meta.h"
-#include "connection.h"
-#include "logger.h"
-
-#include "system.h"
+#include "utils.h"
 
 /* Status and error notification routines */
 
 
 /* Status and error notification routines */
 
index c0a351f..f29bdbe 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: protocol_subnet.c,v 1.1.4.11 2003/07/12 17:41:47 guus Exp $
+    $Id: protocol_subnet.c,v 1.1.4.12 2003/07/17 15:06:27 guus Exp $
 */
 
 */
 
-#include "config.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <errno.h>
-
-#include <utils.h>
-#include <xalloc.h>
-#include <avl_tree.h>
+#include "system.h"
 
 #include "conf.h"
 
 #include "conf.h"
+#include "connection.h"
+#include "logger.h"
 #include "net.h"
 #include "netutl.h"
 #include "net.h"
 #include "netutl.h"
-#include "protocol.h"
-#include "meta.h"
-#include "connection.h"
 #include "node.h"
 #include "node.h"
-#include "logger.h"
-
-#include "system.h"
+#include "protocol.h"
+#include "subnet.h"
+#include "utils.h"
+#include "xalloc.h"
 
 int send_add_subnet(connection_t *c, subnet_t *subnet)
 {
 
 int send_add_subnet(connection_t *c, subnet_t *subnet)
 {
index f00728c..3d9b28b 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: route.c,v 1.1.2.58 2003/07/15 16:26:18 guus Exp $
+    $Id: route.c,v 1.1.2.59 2003/07/17 15:06:27 guus Exp $
 */
 
 */
 
-#include "config.h"
+#include "system.h"
 
 
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#include <sys/socket.h>
-#include <netinet/in.h>
-#ifdef HAVE_NET_IF_H
-#include <net/if.h>
-#endif
 #ifdef HAVE_NET_ETHERNET_H
 #include <net/ethernet.h>
 #endif
 #ifdef HAVE_NET_ETHERNET_H
 #include <net/ethernet.h>
 #endif
-#ifdef HAVE_NETINET_IN_SYSTM_H
-#include <netinet/in_systm.h>
+#ifdef HAVE_NET_IF_ARP_H
+#include <net/if_arp.h>
 #endif
 #endif
-#include <netinet/ip.h>
+#ifdef HAVE_NETINET_IP_ICMP_H
 #include <netinet/ip_icmp.h>
 #include <netinet/ip_icmp.h>
+#endif
 #ifdef HAVE_NETINET_IP6_H
 #include <netinet/ip6.h>
 #ifdef HAVE_NETINET_IP6_H
 #include <netinet/ip6.h>
+#endif
+#ifdef HAVE_NETINET_ICMP6_H
 #include <netinet/icmp6.h>
 #endif
 #include <netinet/icmp6.h>
 #endif
+#ifdef HAVE_NETINET_IF_ETHER_H
 #include <netinet/if_ether.h>
 #include <netinet/if_ether.h>
-#include <utils.h>
-#include <xalloc.h>
-#include <string.h>
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
 #endif
 
 #endif
 
-#include <avl_tree.h>
-
-#include "net.h"
+#include "avl_tree.h"
 #include "connection.h"
 #include "connection.h"
-#include "subnet.h"
-#include "route.h"
-#include "protocol.h"
 #include "device.h"
 #include "logger.h"
 #include "device.h"
 #include "logger.h"
-
-#include "system.h"
+#include "net.h"
+#include "protocol.h"
+#include "route.h"
+#include "subnet.h"
+#include "utils.h"
 
 /* Missing definitions */
 
 
 /* Missing definitions */
 
index 2aab91d..f5a8bd4 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     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.46 2003/07/12 17:41:47 guus Exp $
+    $Id: subnet.c,v 1.1.2.47 2003/07/17 15:06:27 guus Exp $
 */
 
 */
 
-#include "config.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <netinet/in.h>
-
-#include <utils.h>
-#include <xalloc.h>
-#include <avl_tree.h>
+#include "system.h"
 
 
-#include "conf.h"
+#include "avl_tree.h"
+#include "logger.h"
 #include "net.h"
 #include "net.h"
+#include "netutl.h"
 #include "node.h"
 #include "subnet.h"
 #include "node.h"
 #include "subnet.h"
-#include "netutl.h"
-#include "logger.h"
-
-#include "system.h"
+#include "utils.h"
+#include "xalloc.h"
 
 /* lists type of subnet */
 
 
 /* lists type of subnet */
 
index 185a96a..8ef8c51 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
     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.72 2003/07/12 17:41:47 guus Exp $
+    $Id: tincd.c,v 1.10.4.73 2003/07/17 15:06:27 guus Exp $
 */
 
 */
 
-#include "config.h"
-
-#include <errno.h>
-#include <fcntl.h>
-#include <getopt.h>
-#include <signal.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <signal.h>
-#include <string.h>
-#include <termios.h>
+#include "system.h"
 
 /* Darwin (MacOS/X) needs the following definition... */
 #ifndef _P1003_1B_VISIBLE
 
 /* Darwin (MacOS/X) needs the following definition... */
 #ifndef _P1003_1B_VISIBLE
 
 #include <sys/mman.h>
 
 
 #include <sys/mman.h>
 
-#ifdef HAVE_SYS_IOCTL_H
-# include <sys/ioctl.h>
-#endif
-
 #include <openssl/rand.h>
 #include <openssl/rsa.h>
 #include <openssl/pem.h>
 #include <openssl/rand.h>
 #include <openssl/rsa.h>
 #include <openssl/pem.h>
 
 #include <lzo1x.h>
 
 
 #include <lzo1x.h>
 
-#include <utils.h>
-#include <xalloc.h>
-
 #include "conf.h"
 #include "conf.h"
+#include "logger.h"
 #include "net.h"
 #include "netutl.h"
 #include "process.h"
 #include "protocol.h"
 #include "net.h"
 #include "netutl.h"
 #include "process.h"
 #include "protocol.h"
-#include "subnet.h"
-#include "logger.h"
-
-#include "system.h"
+#include "utils.h"
+#include "xalloc.h"
 
 /* The name this program was run with. */
 char *program_name = NULL;
 
 /* The name this program was run with. */
 char *program_name = NULL;
index 6391c39..c4dd0d1 100644 (file)
--- a/system.h
+++ b/system.h
@@ -1,6 +1,7 @@
 /*
 /*
-    system.h -- header for locale settings
-    Copyright (C) 1998,99,2000 Ivo Timmermans <ivo@o2w.nl.com>
+    system.h -- system headers
+    Copyright (C) 1998-2003 Ivo Timmermans <ivo@o2w.nl>
+                       2003 Guus Sliepen <guus@sliepen.eu.org>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
 #ifndef __TINC_SYSTEM_H__
 #define __TINC_SYSTEM_H__
 
 #ifndef __TINC_SYSTEM_H__
 #define __TINC_SYSTEM_H__
 
+#include "config.h"
+
+/* Include standard headers */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <stdarg.h>
+#include <string.h>
+#include <ctype.h>
+#include <signal.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <termios.h>
+
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+
+/* Include system specific headers */
+
+#ifdef HAVE_SYSLOG_H
+#include <syslog.h>
+#endif
+
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+#ifdef HAVE_SYS_FILE_H
+#include <sys/file.h>
+#endif
+
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/ioctl.h>
+#endif
+
+/* SunOS really wants sys/socket.h BEFORE net/if.h,
+   and FreeBSD wants these lines below the rest. */
+
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+
+#ifdef HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
+
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#ifdef HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif
+
+#ifdef HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif
+
+#ifdef HAVE_MINGW
+#include <windows.h>
+#include <winsock.h>
+#endif
+
+/* Include localisation support */
+
 #include "gettext.h"
 
 #ifndef HAVE_STRSIGNAL
 #include "gettext.h"
 
 #ifndef HAVE_STRSIGNAL
 #endif
 
 /* Other functions */
 #endif
 
 /* Other functions */
-#include <dropin.h>
+
+#include "dropin.h"
 
 #ifndef HAVE_SOCKLEN_T
 typedef int socklen_t;
 
 #ifndef HAVE_SOCKLEN_T
 typedef int socklen_t;