Big header file cleanup: everything that has to do with standard system
libraries is moved to system.h.
This commit is contained in:
parent
47721be760
commit
e449d94cae
48 changed files with 359 additions and 726 deletions
26
configure.in
26
configure.in
|
@ -1,6 +1,6 @@
|
|||
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)
|
||||
|
@ -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 ]
|
||||
;;
|
||||
*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.")
|
||||
;;
|
||||
|
@ -85,14 +89,18 @@ 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 \
|
||||
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
|
||||
|
|
|
@ -29,14 +29,13 @@
|
|||
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 "xalloc.h"
|
||||
|
||||
#ifdef AVL_COUNT
|
||||
#define AVL_NODE_COUNT(n) ((n) ? (n)->count : 0)
|
||||
|
|
17
lib/dropin.c
17
lib/dropin.c
|
@ -17,23 +17,10 @@
|
|||
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
|
||||
/*
|
||||
|
|
|
@ -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: 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__
|
||||
|
@ -36,8 +36,6 @@ extern int asprintf(char **, const char *, ...);
|
|||
#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
|
||||
|
|
|
@ -9,17 +9,7 @@
|
|||
* 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"
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
|
||||
#include "fake-gai-errnos.h"
|
||||
|
||||
#ifndef AI_PASSIVE
|
||||
|
|
|
@ -9,17 +9,7 @@
|
|||
* 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"
|
||||
|
|
|
@ -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
|
||||
|
||||
#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);
|
||||
|
|
|
@ -17,19 +17,12 @@
|
|||
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__
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <netinet/in.h>
|
||||
#ifdef HAVE_INTTYPES_H
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef AF_INET6
|
||||
#define AF_INET6 10
|
||||
#endif
|
||||
|
|
10
lib/list.c
10
lib/list.c
|
@ -17,17 +17,13 @@
|
|||
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 "xalloc.h"
|
||||
|
||||
/* (De)constructors */
|
||||
|
||||
|
|
|
@ -25,16 +25,7 @@
|
|||
* 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
|
||||
*
|
||||
|
|
13
lib/utils.c
13
lib/utils.c
|
@ -18,15 +18,10 @@
|
|||
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};
|
||||
|
@ -64,7 +59,7 @@ void bin2hex(char *src, char *dst, int length)
|
|||
#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],
|
||||
|
|
|
@ -21,14 +21,6 @@
|
|||
#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[];
|
||||
|
|
30
src/conf.c
30
src/conf.c
|
@ -19,32 +19,18 @@
|
|||
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 "conf.h"
|
||||
#include "netutl.h" /* for str2address */
|
||||
#include "logger.h"
|
||||
|
||||
#include "system.h"
|
||||
|
||||
#include "avl_tree.h"
|
||||
#include "conf.h"
|
||||
#include "logger.h"
|
||||
#include "netutl.h" /* for str2address */
|
||||
#include "utils.h" /* for cp */
|
||||
#include "xalloc.h"
|
||||
|
||||
avl_tree_t *config_tree;
|
||||
|
||||
int pingtimeout = 0; /* seconds before timeout */
|
||||
|
|
10
src/conf.h
10
src/conf.h
|
@ -17,18 +17,13 @@
|
|||
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__
|
||||
|
||||
#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 {
|
||||
|
@ -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 **);
|
||||
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 *);
|
||||
|
|
|
@ -17,27 +17,20 @@
|
|||
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 "conf.h"
|
||||
#include <utils.h>
|
||||
#include "subnet.h"
|
||||
#include "logger.h"
|
||||
|
||||
#include "utils.h"
|
||||
#include "xalloc.h"
|
||||
#include "system.h"
|
||||
|
||||
avl_tree_t *connection_tree; /* Meta connections */
|
||||
connection_t *broadcast;
|
||||
|
|
|
@ -17,34 +17,21 @@
|
|||
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__
|
||||
|
||||
#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 "node.h"
|
||||
#include "edge.h"
|
||||
#include "list.h"
|
||||
#include "net.h"
|
||||
#include "node.h"
|
||||
|
||||
#define OPTION_INDIRECT 0x0001
|
||||
#define OPTION_TCPONLY 0x0002
|
||||
|
|
28
src/edge.c
28
src/edge.c
|
@ -17,29 +17,19 @@
|
|||
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 "net.h" /* Don't ask. */
|
||||
#include "netutl.h"
|
||||
#include "conf.h"
|
||||
#include <utils.h>
|
||||
#include "subnet.h"
|
||||
#include "edge.h"
|
||||
#include "node.h"
|
||||
#include "logger.h"
|
||||
|
||||
#include "xalloc.h"
|
||||
#include "system.h"
|
||||
|
||||
#include "avl_tree.h"
|
||||
#include "edge.h"
|
||||
#include "logger.h"
|
||||
#include "netutl.h"
|
||||
#include "node.h"
|
||||
#include "utils.h"
|
||||
#include "xalloc.h"
|
||||
|
||||
avl_tree_t *edge_weight_tree; /* Tree with all edges, sorted on weight */
|
||||
|
||||
static int edge_compare(edge_t *a, edge_t *b)
|
||||
|
|
|
@ -17,17 +17,16 @@
|
|||
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__
|
||||
|
||||
#include <avl_tree.h>
|
||||
|
||||
#include "avl_tree.h"
|
||||
#include "connection.h"
|
||||
#include "net.h"
|
||||
#include "node.h"
|
||||
#include "connection.h"
|
||||
|
||||
typedef struct edge_t {
|
||||
struct node_t *from;
|
||||
|
|
18
src/event.c
18
src/event.c
|
@ -17,22 +17,16 @@
|
|||
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 "event.h"
|
||||
|
||||
#include "system.h"
|
||||
|
||||
#include "avl_tree.h"
|
||||
#include "event.h"
|
||||
#include "utils.h"
|
||||
#include "xalloc.h"
|
||||
|
||||
avl_tree_t *event_tree;
|
||||
extern time_t now;
|
||||
|
||||
|
|
|
@ -17,14 +17,13 @@
|
|||
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__
|
||||
|
||||
#include <time.h>
|
||||
#include <avl_tree.h>
|
||||
#include "avl_tree.h"
|
||||
|
||||
extern avl_tree_t *event_tree;
|
||||
|
||||
|
|
26
src/graph.c
26
src/graph.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: 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:
|
||||
|
@ -44,27 +44,17 @@
|
|||
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 "avl_tree.h"
|
||||
#include "connection.h"
|
||||
#include "device.h"
|
||||
#include "edge.h"
|
||||
#include "logger.h"
|
||||
#include "netutl.h"
|
||||
#include "node.h"
|
||||
#include "edge.h"
|
||||
#include "connection.h"
|
||||
#include "process.h"
|
||||
#include "device.h"
|
||||
#include "logger.h"
|
||||
|
||||
#include "system.h"
|
||||
#include "utils.h"
|
||||
|
||||
/* Implementation of Kruskal's algorithm.
|
||||
Running time: O(EN)
|
||||
|
|
|
@ -17,20 +17,10 @@
|
|||
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
|
||||
|
@ -43,13 +33,11 @@
|
|||
#define DEFAULT_DEVICE "/dev/tap0"
|
||||
#endif
|
||||
|
||||
#include <utils.h>
|
||||
#include "conf.h"
|
||||
#include "logger.h"
|
||||
#include "net.h"
|
||||
#include "route.h"
|
||||
#include "logger.h"
|
||||
|
||||
#include "system.h"
|
||||
#include "utils.h"
|
||||
|
||||
enum {
|
||||
DEVICE_TYPE_ETHERTAP,
|
||||
|
|
|
@ -17,19 +17,14 @@
|
|||
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 "system.h"
|
||||
|
||||
int debug_level = DEBUG_NOTHING;
|
||||
static int logmode = LOGMODE_STDERR;
|
||||
static pid_t logpid;
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
#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,
|
||||
|
|
21
src/meta.c
21
src/meta.c
|
@ -17,27 +17,20 @@
|
|||
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 "net.h"
|
||||
#include "avl_tree.h"
|
||||
#include "connection.h"
|
||||
#include "system.h"
|
||||
#include "protocol.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)
|
||||
{
|
||||
|
|
52
src/net.c
52
src/net.c
|
@ -17,62 +17,28 @@
|
|||
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 <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 "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 "subnet.h"
|
||||
#include "graph.h"
|
||||
#include "process.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;
|
||||
|
|
28
src/net.h
28
src/net.h
|
@ -17,26 +17,14 @@
|
|||
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__
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <sys/time.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
|
||||
|
@ -97,6 +85,8 @@ typedef struct packet_queue_t {
|
|||
queue_element_t *tail;
|
||||
} packet_queue_t;
|
||||
|
||||
#include "conf.h"
|
||||
|
||||
typedef struct outgoing_t {
|
||||
char *name;
|
||||
int timeout;
|
||||
|
@ -115,8 +105,6 @@ extern int maxtimeout;
|
|||
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;
|
||||
|
@ -127,10 +115,14 @@ extern char *myport;
|
|||
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 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 *);
|
||||
|
@ -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 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 *);
|
||||
|
||||
|
|
|
@ -17,37 +17,10 @@
|
|||
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>
|
||||
|
@ -57,27 +30,21 @@
|
|||
#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 "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 "device.h"
|
||||
#include "event.h"
|
||||
#include "graph.h"
|
||||
#include "list.h"
|
||||
#include "logger.h"
|
||||
|
||||
#include "system.h"
|
||||
#include "net.h"
|
||||
#include "netutl.h"
|
||||
#include "protocol.h"
|
||||
#include "process.h"
|
||||
#include "route.h"
|
||||
#include "utils.h"
|
||||
#include "xalloc.h"
|
||||
|
||||
int keylifetime = 0;
|
||||
int keyexpires = 0;
|
||||
|
|
|
@ -17,63 +17,30 @@
|
|||
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 <utils.h>
|
||||
#include <xalloc.h>
|
||||
#include <avl_tree.h>
|
||||
#include <list.h>
|
||||
|
||||
#include "avl_tree.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 "subnet.h"
|
||||
#include "graph.h"
|
||||
#include "process.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;
|
||||
|
||||
|
|
|
@ -17,63 +17,22 @@
|
|||
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 "conf.h"
|
||||
#include "connection.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 "device.h"
|
||||
#include "event.h"
|
||||
#include "logger.h"
|
||||
|
||||
#include "system.h"
|
||||
|
||||
#ifndef HAVE_RAND_PSEUDO_BYTES
|
||||
#define RAND_pseudo_bytes RAND_bytes
|
||||
#endif
|
||||
#include "avl_tree.h"
|
||||
#include "conf.h"
|
||||
#include "connection.h"
|
||||
#include "event.h"
|
||||
#include "logger.h"
|
||||
#include "meta.h"
|
||||
#include "net.h"
|
||||
#include "netutl.h"
|
||||
#include "protocol.h"
|
||||
#include "utils.h"
|
||||
#include "xalloc.h"
|
||||
|
||||
int addressfamily = AF_UNSPEC;
|
||||
int maxtimeout = 900;
|
||||
|
|
26
src/netutl.c
26
src/netutl.c
|
@ -17,34 +17,16 @@
|
|||
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 "system.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 "net.h"
|
||||
#include "netutl.h"
|
||||
#include "logger.h"
|
||||
|
||||
#include "system.h"
|
||||
#include "utils.h"
|
||||
#include "xalloc.h"
|
||||
|
||||
int hostnames = 0;
|
||||
|
||||
|
|
|
@ -17,16 +17,12 @@
|
|||
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__
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
|
||||
#include "net.h"
|
||||
|
||||
extern int hostnames;
|
||||
|
|
23
src/node.c
23
src/node.c
|
@ -17,24 +17,19 @@
|
|||
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 <avl_tree.h>
|
||||
#include "node.h"
|
||||
#include "netutl.h"
|
||||
#include "net.h"
|
||||
#include "logger.h"
|
||||
|
||||
#include <utils.h>
|
||||
#include <xalloc.h>
|
||||
|
||||
#include "system.h"
|
||||
|
||||
#include "avl_tree.h"
|
||||
#include "logger.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 */
|
||||
|
||||
|
|
12
src/node.h
12
src/node.h
|
@ -17,20 +17,16 @@
|
|||
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__
|
||||
|
||||
#ifdef HAVE_INTTYPES_H
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
|
||||
#include <avl_tree.h>
|
||||
|
||||
#include "subnet.h"
|
||||
#include "avl_tree.h"
|
||||
#include "connection.h"
|
||||
#include "list.h"
|
||||
#include "subnet.h"
|
||||
|
||||
typedef struct node_status_t {
|
||||
int active:1; /* 1 if active.. */
|
||||
|
|
|
@ -17,37 +17,22 @@
|
|||
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 "process.h"
|
||||
#include "subnet.h"
|
||||
#include "device.h"
|
||||
#include "connection.h"
|
||||
#include "device.h"
|
||||
#include "edge.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;
|
||||
|
|
|
@ -17,14 +17,12 @@
|
|||
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__
|
||||
|
||||
#include "config.h"
|
||||
|
||||
extern int do_detach;
|
||||
|
||||
extern void setup_signals(void);
|
||||
|
|
|
@ -17,29 +17,18 @@
|
|||
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 "protocol.h"
|
||||
#include "meta.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 */
|
||||
|
||||
|
|
|
@ -17,15 +17,15 @@
|
|||
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__
|
||||
|
||||
#include "edge.h"
|
||||
#include "net.h"
|
||||
#include "node.h"
|
||||
#include "edge.h"
|
||||
#include "subnet.h"
|
||||
|
||||
/* Protocol version. Different versions are incompatible,
|
||||
|
|
|
@ -17,37 +17,27 @@
|
|||
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 "avl_tree.h"
|
||||
#include "conf.h"
|
||||
#include "net.h"
|
||||
#include "netutl.h"
|
||||
#include "protocol.h"
|
||||
#include "meta.h"
|
||||
#include "connection.h"
|
||||
#include "node.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)
|
||||
{
|
||||
|
|
|
@ -17,33 +17,24 @@
|
|||
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 "net.h"
|
||||
#include "netutl.h"
|
||||
#include "protocol.h"
|
||||
#include "meta.h"
|
||||
#include "connection.h"
|
||||
#include "node.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)
|
||||
{
|
||||
|
|
|
@ -17,31 +17,20 @@
|
|||
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 "system.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 "conf.h"
|
||||
#include "avl_tree.h"
|
||||
#include "connection.h"
|
||||
#include "logger.h"
|
||||
#include "net.h"
|
||||
#include "netutl.h"
|
||||
#include "protocol.h"
|
||||
#include "meta.h"
|
||||
#include "connection.h"
|
||||
#include "node.h"
|
||||
#include "logger.h"
|
||||
|
||||
#include "system.h"
|
||||
#include "protocol.h"
|
||||
#include "utils.h"
|
||||
#include "xalloc.h"
|
||||
|
||||
int mykeyused = 0;
|
||||
|
||||
|
|
|
@ -17,28 +17,19 @@
|
|||
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 "connection.h"
|
||||
#include "logger.h"
|
||||
#include "meta.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 */
|
||||
|
||||
|
|
|
@ -17,31 +17,21 @@
|
|||
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 "connection.h"
|
||||
#include "logger.h"
|
||||
#include "net.h"
|
||||
#include "netutl.h"
|
||||
#include "protocol.h"
|
||||
#include "meta.h"
|
||||
#include "connection.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)
|
||||
{
|
||||
|
|
41
src/route.c
41
src/route.c
|
@ -17,50 +17,39 @@
|
|||
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_NETINET_IN_SYSTM_H
|
||||
#include <netinet/in_systm.h>
|
||||
#ifdef HAVE_NET_IF_ARP_H
|
||||
#include <net/if_arp.h>
|
||||
#endif
|
||||
#include <netinet/ip.h>
|
||||
#ifdef HAVE_NETINET_IP_ICMP_H
|
||||
#include <netinet/ip_icmp.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IP6_H
|
||||
#include <netinet/ip6.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_ICMP6_H
|
||||
#include <netinet/icmp6.h>
|
||||
#endif
|
||||
#ifdef HAVE_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
|
||||
|
||||
#include <avl_tree.h>
|
||||
|
||||
#include "net.h"
|
||||
#include "avl_tree.h"
|
||||
#include "connection.h"
|
||||
#include "subnet.h"
|
||||
#include "route.h"
|
||||
#include "protocol.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 */
|
||||
|
||||
|
|
25
src/subnet.c
25
src/subnet.c
|
@ -17,30 +17,19 @@
|
|||
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 "system.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 "conf.h"
|
||||
#include "avl_tree.h"
|
||||
#include "logger.h"
|
||||
#include "net.h"
|
||||
#include "netutl.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 */
|
||||
|
||||
|
|
29
src/tincd.c
29
src/tincd.c
|
@ -17,21 +17,10 @@
|
|||
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
|
||||
|
@ -40,10 +29,6 @@
|
|||
|
||||
#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>
|
||||
|
@ -51,18 +36,14 @@
|
|||
|
||||
#include <lzo1x.h>
|
||||
|
||||
#include <utils.h>
|
||||
#include <xalloc.h>
|
||||
|
||||
#include "conf.h"
|
||||
#include "logger.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;
|
||||
|
|
104
system.h
104
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
|
||||
|
@ -20,6 +21,102 @@
|
|||
#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
|
||||
|
@ -27,7 +124,8 @@
|
|||
#endif
|
||||
|
||||
/* Other functions */
|
||||
#include <dropin.h>
|
||||
|
||||
#include "dropin.h"
|
||||
|
||||
#ifndef HAVE_SOCKLEN_T
|
||||
typedef int socklen_t;
|
||||
|
|
Loading…
Reference in a new issue