libraries is moved to system.h.
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_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.")
;;
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
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)
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
/*
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__
#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
* 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"
-/* $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
* 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"
-/* $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);
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
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 */
* 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
*
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
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],
#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[];
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 "netutl.h" /* for str2address */
#include "logger.h"
-
-#include "system.h"
+#include "netutl.h" /* for str2address */
+#include "utils.h" /* for cp */
+#include "xalloc.h"
avl_tree_t *config_tree;
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 {
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 *);
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;
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
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 "node.h"
#include "logger.h"
-
+#include "netutl.h"
+#include "node.h"
+#include "utils.h"
#include "xalloc.h"
-#include "system.h"
avl_tree_t *edge_weight_tree; /* Tree with all edges, sorted on weight */
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;
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 "system.h"
+#include "utils.h"
+#include "xalloc.h"
avl_tree_t *event_tree;
extern time_t now;
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;
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:
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 "process.h"
#include "device.h"
+#include "edge.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)
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
#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,
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;
#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,
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)
{
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;
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
queue_element_t *tail;
} packet_queue_t;
+#include "conf.h"
+
typedef struct outgoing_t {
char *name;
int timeout;
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 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 *);
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 *);
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 <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 "device.h"
+#include "event.h"
+#include "graph.h"
+#include "list.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 "utils.h"
+#include "xalloc.h"
int keylifetime = 0;
int keyexpires = 0;
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;
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 "event.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"
-
-#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;
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 "system.h"
+#include "utils.h"
+#include "xalloc.h"
int hostnames = 0;
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;
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 <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 */
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.. */
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;
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);
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 */
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,
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)
{
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)
{
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 "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;
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 */
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)
{
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 */
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 "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 */
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
#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 <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;
/*
- 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
#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
#endif
/* Other functions */
-#include <dropin.h>
+
+#include "dropin.h"
#ifndef HAVE_SOCKLEN_T
typedef int socklen_t;