edge.c edge.h \
ethernet.h \
event.c event.h \
- fake-gai-errnos.h \
fake-getaddrinfo.c fake-getaddrinfo.h \
fake-getnameinfo.c fake-getnameinfo.h \
graph.c graph.h \
+#ifndef TINC_AVL_TREE_H
+#define TINC_AVL_TREE_H
+
/*
avl_tree.h -- header file for avl_tree.c
Copyright (C) 1998 Michael H. Buselli
Guus Sliepen <guus@tinc-vpn.org>.
*/
-
-#ifndef __AVL_TREE_H__
-#define __AVL_TREE_H__
-
#ifndef AVL_DEPTH
#ifndef AVL_COUNT
#define AVL_DEPTH
extern unsigned int avl_depth(const avl_tree_t *);
#endif
-#endif /* __AVL_TREE_H__ */
+#endif
+#ifndef TINC_CONF_H
+#define TINC_CONF_H
+
/*
conf.h -- header for conf.c
Copyright (C) 1998-2005 Ivo Timmermans
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_CONF_H__
-#define __TINC_CONF_H__
-
#include "avl_tree.h"
#include "list.h"
extern FILE *ask_and_open(const char *, const char *);
extern bool is_safe_path(const char *);
-#endif /* __TINC_CONF_H__ */
+#endif
+#ifndef TINC_CONNECTION_H
+#define TINC_CONNECTION_H
+
/*
connection.h -- header for connection.c
Copyright (C) 2000-2016 Guus Sliepen <guus@tinc-vpn.org>,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_CONNECTION_H__
-#define __TINC_CONNECTION_H__
-
#include <openssl/rsa.h>
#include <openssl/evp.h>
extern void connection_del(connection_t *);
extern void dump_connections(void);
-#endif /* __TINC_CONNECTION_H__ */
+#endif
+#ifndef TINC_DEVICE_H
+#define TINC_DEVICE_H
+
/*
device.h -- generic header for device.c
Copyright (C) 2001-2005 Ivo Timmermans
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_DEVICE_H__
-#define __TINC_DEVICE_H__
-
#include "net.h"
extern int device_fd;
extern const devops_t vde_devops;
extern devops_t devops;
-#endif /* __TINC_DEVICE_H__ */
+#endif
+#ifndef TINC_DROPIN_H
+#define TINC_DROPIN_H
+
/*
dropin.h -- header file for dropin.c
Copyright (C) 2000-2005 Ivo Timmermans,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __DROPIN_H__
-#define __DROPIN_H__
-
#include "fake-getaddrinfo.h"
#include "fake-getnameinfo.h"
extern int usleep(long long);
#endif
-#endif /* __DROPIN_H__ */
+#endif
+#ifndef TINC_EDGE_H
+#define TINC_EDGE_H
+
/*
edge.h -- header for edge.c
Copyright (C) 2001-2006 Guus Sliepen <guus@tinc-vpn.org>,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_EDGE_H__
-#define __TINC_EDGE_H__
-
#include "avl_tree.h"
#include "connection.h"
#include "net.h"
extern edge_t *lookup_edge(struct node_t *, struct node_t *);
extern void dump_edges(void);
-#endif /* __TINC_EDGE_H__ */
+#endif
+#ifndef TINC_ETHERNET_H
+#define TINC_ETHERNET_H
+
/*
ethernet.h -- missing Ethernet related definitions
Copyright (C) 2005 Ivo Timmermans
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_ETHERNET_H__
-#define __TINC_ETHERNET_H__
-
#ifndef ETH_ALEN
#define ETH_ALEN 6
#endif
#define arp_op ea_hdr.ar_op
#endif
-#endif /* __TINC_ETHERNET_H__ */
+#endif
+#ifndef TINC_EVENT_H
+#define TINC_EVENT_H
+
/*
event.h -- header for event.c
Copyright (C) 2002-2009 Guus Sliepen <guus@tinc-vpn.org>,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_EVENT_H__
-#define __TINC_EVENT_H__
-
#include "avl_tree.h"
extern avl_tree_t *event_tree;
extern event_t *get_expired_event(void);
extern event_t *peek_next_event(void);
-#endif /* __TINC_EVENT_H__ */
+#endif
+++ /dev/null
-/*
- * fake library for ssh
- *
- * This file is included in getaddrinfo.c and getnameinfo.c.
- * See getaddrinfo.c and getnameinfo.c.
- */
-
-/* for old netdb.h */
-#ifndef EAI_NODATA
-#define EAI_NODATA 1
-#endif
-
-#ifndef EAI_MEMORY
-#define EAI_MEMORY 2
-#endif
-
-#ifndef EAI_FAMILY
-#define EAI_FAMILY 3
-#endif
-#ifndef _FAKE_GETADDRINFO_H
-#define _FAKE_GETADDRINFO_H
+#ifndef TINC_FAKE_GETADDRINFO_H
+#define TINC_FAKE_GETADDRINFO_H
-#include "fake-gai-errnos.h"
+#ifndef EAI_NODATA
+#define EAI_NODATA 1
+#endif
+
+#ifndef EAI_MEMORY
+#define EAI_MEMORY 2
+#endif
+
+#ifndef EAI_FAMILY
+#define EAI_FAMILY 3
+#endif
#ifndef AI_PASSIVE
# define AI_PASSIVE 1
void freeaddrinfo(struct addrinfo *ai);
#endif /* !HAVE_FREEADDRINFO */
-#endif /* _FAKE_GETADDRINFO_H */
+#endif
-#ifndef _FAKE_GETNAMEINFO_H
-#define _FAKE_GETNAMEINFO_H
+#ifndef TINC_FAKE_GETNAMEINFO_H
+#define TINC_FAKE_GETNAMEINFO_H
#if !HAVE_DECL_GETNAMEINFO
int getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
# define NI_MAXHOST 1025
#endif /* !NI_MAXHOST */
-#endif /* _FAKE_GETNAMEINFO_H */
+#endif
#include "../config.h"
#endif
-#if !defined (__STDC__) || !__STDC__
+#if !defined (STDC) || !STDC
/* This is a separate conditional since some stdc systems
reject `defined (const)'. */
#ifndef const
it is simpler to just do this in the source for each such file. */
#define GETOPT_INTERFACE_VERSION 2
-#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2
+#if !defined (_LIBC) && defined (GLIBC) && GLIBC >= 2
#include <gnu-versions.h>
#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
#define ELIDE_CODE
/* This needs to come after some library #include
- to get __GNU_LIBRARY__ defined. */
-#ifdef __GNU_LIBRARY__
+ to get GNU_LIBRARY defined. */
+#ifdef GNU_LIBRARY
/* Don't include stdlib.h for non-GNU C libraries because some of them
contain conflicting prototypes for getopt. */
#include <stdlib.h>
#endif
#endif
-#if defined (WIN32) && !defined (__CYGWIN32__)
+#if defined (WIN32) && !defined (CYGWIN32)
/* It's not Unix, really. See? Capital letters. */
#include <windows.h>
#define getpid() GetCurrentProcessId()
causes problems with re-calling getopt as programs generally don't
know that. */
-int __getopt_initialized = 0;
+int getopt_initialized = 0;
/* The next char to be scanned in the option-element
in which the last option character we returned was found.
/* Value of POSIXLY_CORRECT environment variable. */
static char *posixly_correct;
\f
-#ifdef __GNU_LIBRARY__
+#ifdef GNU_LIBRARY
/* We want to avoid inclusion of string.h with non-GNU libraries
because there are many ways it can cause trouble.
On some systems, it contains special magic macros that don't work
/* If using GCC, we can safely declare strlen this way.
If not using GCC, it is ok not to declare it. */
-#ifdef __GNUC__
+#ifdef GNUC
/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
That was relevant to code that was here before. */
-#if !defined (__STDC__) || !__STDC__
+#if !defined (STDC) || !STDC
/* gcc with -traditional declares the built-in strlen to return int,
and has done so at least since version 2.4.5. -- rms. */
extern int strlen (const char *);
-#endif /* not __STDC__ */
-#endif /* __GNUC__ */
+#endif /* not STDC */
+#endif /* GNUC */
-#endif /* not __GNU_LIBRARY__ */
+#endif /* not GNU_LIBRARY */
\f
/* Handle permutation of arguments. */
indicating ARGV elements that should not be considered arguments. */
/* Defined in getopt_init.c */
-extern char *__getopt_nonoption_flags;
+extern char *getopt_nonoption_flags;
static int nonoption_flags_max_len;
static int nonoption_flags_len;
static int original_argc;
static char *const *original_argv;
-extern pid_t __libc_pid;
+extern pid_t libc_pid;
/* Make sure the environment variable bash 2.0 puts in the environment
is valid for the getopt call we must make sure that the ARGV passed
original_argc = argc;
original_argv = argv;
}
-text_set_element (__libc_subinit, store_args_and_env);
+text_set_element (libc_subinit, store_args_and_env);
# define SWAP_FLAGS(ch1, ch2) \
if (nonoption_flags_len > 0) \
{ \
- char __tmp = __getopt_nonoption_flags[ch1]; \
- __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \
- __getopt_nonoption_flags[ch2] = __tmp; \
+ char tmp = getopt_nonoption_flags[ch1]; \
+ getopt_nonoption_flags[ch1] = getopt_nonoption_flags[ch2]; \
+ getopt_nonoption_flags[ch2] = tmp; \
}
#else /* !_LIBC */
# define SWAP_FLAGS(ch1, ch2)
`first_nonopt' and `last_nonopt' are relocated so that they describe
the new indices of the non-options in ARGV after they are moved. */
-#if defined (__STDC__) && __STDC__
+#if defined (STDC) && STDC
static void exchange (char **);
#endif
but it consists of two parts that need to be swapped next. */
#ifdef _LIBC
- /* First make sure the handling of the `__getopt_nonoption_flags'
+ /* First make sure the handling of the `getopt_nonoption_flags'
string can work normally. Our top argument must be in the range
of the string. */
if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len)
nonoption_flags_len = nonoption_flags_max_len = 0;
else
{
- memcpy (new_str, __getopt_nonoption_flags, nonoption_flags_max_len);
+ memcpy (new_str, getopt_nonoption_flags, nonoption_flags_max_len);
memset (&new_str[nonoption_flags_max_len], '\0',
top + 1 - nonoption_flags_max_len);
nonoption_flags_max_len = top + 1;
- __getopt_nonoption_flags = new_str;
+ getopt_nonoption_flags = new_str;
}
}
#endif
/* Initialize the internal data when the first call is made. */
-#if defined (__STDC__) && __STDC__
+#if defined (STDC) && STDC
static const char *_getopt_initialize (int, char *const *, const char *);
#endif
static const char *
{
if (nonoption_flags_max_len == 0)
{
- if (__getopt_nonoption_flags == NULL
- || __getopt_nonoption_flags[0] == '\0')
+ if (getopt_nonoption_flags == NULL
+ || getopt_nonoption_flags[0] == '\0')
nonoption_flags_max_len = -1;
else
{
- const char *orig_str = __getopt_nonoption_flags;
+ const char *orig_str = getopt_nonoption_flags;
int len = nonoption_flags_max_len = strlen (orig_str);
if (nonoption_flags_max_len < argc)
nonoption_flags_max_len = argc;
- __getopt_nonoption_flags =
+ getopt_nonoption_flags =
(char *) malloc (nonoption_flags_max_len);
- if (__getopt_nonoption_flags == NULL)
+ if (getopt_nonoption_flags == NULL)
nonoption_flags_max_len = -1;
else
{
- memcpy (__getopt_nonoption_flags, orig_str, len);
- memset (&__getopt_nonoption_flags[len], '\0',
+ memcpy (getopt_nonoption_flags, orig_str, len);
+ memset (&getopt_nonoption_flags[len], '\0',
nonoption_flags_max_len - len);
}
}
{
optarg = NULL;
- if (optind == 0 || !__getopt_initialized)
+ if (optind == 0 || !getopt_initialized)
{
if (optind == 0)
optind = 1; /* Don't scan ARGV[0], the program name. */
optstring = _getopt_initialize (argc, argv, optstring);
- __getopt_initialized = 1;
+ getopt_initialized = 1;
}
/* Test whether ARGV[optind] points to a non-option argument.
#ifdef _LIBC
#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
|| (optind < nonoption_flags_len \
- && __getopt_nonoption_flags[optind] == '1'))
+ && getopt_nonoption_flags[optind] == '1'))
#else
#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0')
#endif
+#ifndef TINC_GETOPT_H
+#define TINC_GETOPT_H
+
/* Declarations for getopt.
Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef _GETOPT_H
-#define _GETOPT_H 1
-
-#ifdef __cplusplus
+#ifdef cplusplus
extern "C" {
#endif
struct option
{
-#if defined (__STDC__) && __STDC__
+#if defined (STDC) && STDC
const char *name;
#else
char *name;
#define required_argument 1
#define optional_argument 2
-#if defined (__STDC__) && __STDC__
-#ifdef __GNU_LIBRARY__
+#if defined (STDC) && STDC
+#ifdef GNU_LIBRARY
/* Many other libraries have conflicting prototypes for getopt, with
differences in the consts, in stdlib.h. To avoid compilation
errors, only prototype getopt for the GNU C library. */
extern int getopt (int argc, char *const *argv, const char *shortopts);
-#else /* not __GNU_LIBRARY__ */
+#else /* not GNU_LIBRARY */
extern int getopt ();
-#endif /* __GNU_LIBRARY__ */
+#endif /* GNU_LIBRARY */
extern int getopt_long (int argc, char *const *argv, const char *shortopts,
const struct option *longopts, int *longind);
extern int getopt_long_only (int argc, char *const *argv,
const char *shortopts,
const struct option *longopts, int *longind,
int long_only);
-#else /* not __STDC__ */
+#else /* not STDC */
extern int getopt ();
extern int getopt_long ();
extern int getopt_long_only ();
extern int _getopt_internal ();
-#endif /* __STDC__ */
+#endif /* STDC */
-#ifdef __cplusplus
+#ifdef cplusplus
}
#endif
-#endif /* _GETOPT_H */
+#endif
#include "getopt.h"
-#if !defined (__STDC__) || !__STDC__
+#if !defined (STDC) || !STDC
/* This is a separate conditional since some stdc systems
reject `defined (const)'. */
#ifndef const
it is simpler to just do this in the source for each such file. */
#define GETOPT_INTERFACE_VERSION 2
-#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2
+#if !defined (_LIBC) && defined (GLIBC) && GLIBC >= 2
#include <gnu-versions.h>
#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
#define ELIDE_CODE
/* This needs to come after some library #include
- to get __GNU_LIBRARY__ defined. */
-#ifdef __GNU_LIBRARY__
+ to get GNU_LIBRARY defined. */
+#ifdef GNU_LIBRARY
#include <stdlib.h>
#endif
+#ifndef TINC_GRAPH_H
+#define TINC_GRAPH_H
+
/*
graph.h -- header for graph.c
Copyright (C) 2001-2012 Guus Sliepen <guus@tinc-vpn.org>,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_GRAPH_H__
-#define __TINC_GRAPH_H__
-
extern void graph(void);
extern void dump_graph(void);
-#endif /* __TINC_GRAPH_H__ */
+#endif
+#ifndef TINC_HAVE_H
+#define TINC_HAVE_H
+
/*
have.h -- include headers which are known to exist
Copyright (C) 1998-2005 Ivo Timmermans
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_HAVE_H__
-#define __TINC_HAVE_H__
-
#ifdef HAVE_MINGW
#ifdef WITH_WINDOWS2000
#define WINVER Windows2000
#include <linux/if_tun.h>
#endif
-#endif /* __TINC_SYSTEM_H__ */
+#endif
+#ifndef TINC_IPV4_H
+#define TINC_IPV4_H
+
/*
ipv4.h -- missing IPv4 related definitions
Copyright (C) 2005 Ivo Timmermans
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_IPV4_H__
-#define __TINC_IPV4_H__
-
#ifndef AF_INET
#define AF_INET 2
#endif
#ifndef HAVE_STRUCT_IP
struct ip {
-#if __BYTE_ORDER == __LITTLE_ENDIAN
+#if BYTE_ORDER == LITTLE_ENDIAN
unsigned int ip_hl:4;
unsigned int ip_v:4;
#else
} __attribute__ ((__packed__));
#endif
-#endif /* __TINC_IPV4_H__ */
+#endif
+#ifndef TINC_IPV6_H
+#define TINC_IPV6_H
+
/*
ipv6.h -- missing IPv6 related definitions
Copyright (C) 2005 Ivo Timmermans
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_IPV6_H__
-#define __TINC_IPV6_H__
-
#ifndef AF_INET6
#define AF_INET6 10
#endif
#ifndef IN6_IS_ADDR_V4MAPPED
#define IN6_IS_ADDR_V4MAPPED(a) \
- ((((__const uint32_t *) (a))[0] == 0) \
- && (((__const uint32_t *) (a))[1] == 0) \
- && (((__const uint32_t *) (a))[2] == htonl (0xffff)))
+ ((((const uint32_t *) (a))[0] == 0) \
+ && (((const uint32_t *) (a))[1] == 0) \
+ && (((const uint32_t *) (a))[2] == htonl (0xffff)))
#endif
#ifndef HAVE_STRUCT_IP6_HDR
} __attribute__ ((__packed__));
#endif
-#endif /* __TINC_IPV6_H__ */
+#endif
+#ifndef TINC_LIST_H
+#define TINC_LIST_H
+
/*
list.h -- header file for list.c
Copyright (C) 2000-2005 Ivo Timmermans
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_LIST_H__
-#define __TINC_LIST_H__
-
typedef struct list_node_t {
struct list_node_t *prev;
struct list_node_t *next;
extern void list_foreach(list_t *, list_action_t);
extern void list_foreach_node(list_t *, list_action_node_t);
-#endif /* __TINC_LIST_H__ */
+#endif
-#ifndef __TINC_LOGGER_H__
-#define __TINC_LOGGER_H__
+#ifndef TINC_LOGGER_H
+#define TINC_LOGGER_H
+
+/*
+ logger.h -- header file for logger.c
+ Copyright (C) 2003-2016 Guus Sliepen <guus@tinc-vpn.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
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
typedef enum debug_t {
DEBUG_NOTHING = 0, /* Quiet mode, only show starting/stopping of the daemon */
#define ifdebug(l) if(debug_level >= DEBUG_##l)
-#endif /* __TINC_LOGGER_H__ */
+#endif
+#ifndef TINC_META_H
+#define TINC_META_H
+
/*
meta.h -- header for meta.c
Copyright (C) 2000-2006 Guus Sliepen <guus@tinc-vpn.org>,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_META_H__
-#define __TINC_META_H__
-
#include "connection.h"
extern bool send_meta(struct connection_t *, const char *, int);
extern bool flush_meta(struct connection_t *);
extern bool receive_meta(struct connection_t *);
-#endif /* __TINC_META_H__ */
+#endif
+#ifndef TINC_NET_H
+#define TINC_NET_H
+
/*
net.h -- header for net.c
Copyright (C) 1998-2005 Ivo Timmermans
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_NET_H__
-#define __TINC_NET_H__
-
#include <openssl/evp.h>
#include "ipv6.h"
extern CRITICAL_SECTION mutex;
#endif
-#endif /* __TINC_NET_H__ */
+#endif
+#ifndef TINC_NETUTL_H
+#define TINC_NETUTL_H
+
/*
netutl.h -- header file for netutl.c
Copyright (C) 1998-2005 Ivo Timmermans
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_NETUTL_H__
-#define __TINC_NETUTL_H__
-
#include "net.h"
extern bool hostnames;
extern void mask(void *, int, int);
extern bool maskcheck(const void *, int, int);
-#endif /* __TINC_NETUTL_H__ */
+#endif
+#ifndef TINC_NODE_H
+#define TINC_NODE_H
+
/*
node.h -- header for node.c
Copyright (C) 2001-2016 Guus Sliepen <guus@tinc-vpn.org>,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_NODE_H__
-#define __TINC_NODE_H__
-
#include "avl_tree.h"
#include "connection.h"
#include "event.h"
extern void update_node_udp(node_t *, const sockaddr_t *);
extern void dump_nodes(void);
-#endif /* __TINC_NODE_H__ */
+#endif
+#ifndef TINC_PIDFILE_H
+#define TINC_PIDFILE_H
+
/*
pidfile.h - interact with pidfiles
Copyright (c) 1995 Martin Schulze <Martin.Schulze@Linux.DE>
*/
extern int remove_pid (const char *pidfile);
#endif
+
+#endif
+#ifndef TINC_PROCESS_H
+#define TINC_PROCESS_H
+
/*
process.h -- header file for process.c
Copyright (C) 1999-2005 Ivo Timmermans,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_PROCESS_H__
-#define __TINC_PROCESS_H__
-
extern bool do_detach;
extern bool sighup;
extern bool sigalrm;
extern bool init_service(void);
#endif
-#endif /* __TINC_PROCESS_H__ */
+#endif
+#ifndef TINC_PROTOCOL_H
+#define TINC_PROTOCOL_H
+
/*
protocol.h -- header for protocol.c
Copyright (C) 1999-2005 Ivo Timmermans,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_PROTOCOL_H__
-#define __TINC_PROTOCOL_H__
-
/* Protocol version. Different versions are incompatible,
incompatible version have different protocols.
*/
extern bool ans_key_h(struct connection_t *);
extern bool tcppacket_h(struct connection_t *);
-#endif /* __TINC_PROTOCOL_H__ */
+#endif
+#ifndef TINC_PROXY_H
+#define TINC_PROXY_H
+
/*
proxy.h -- header for proxy.c
Copyright (C) 2015 Guus Sliepen <guus@tinc-vpn.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_PROXY_H__
-#define __TINC_PROXY_H__
-
#include "connection.h"
typedef enum proxytype_t {
+#ifndef TINC_ROUTE_H
+#define TINC_ROUTE_H
+
/*
route.h -- header file for route.c
Copyright (C) 2000-2005 Ivo Timmermans
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_ROUTE_H__
-#define __TINC_ROUTE_H__
-
#include "net.h"
#include "node.h"
extern void age_subnets(void);
extern void route(struct node_t *, struct vpn_packet_t *);
-#endif /* __TINC_ROUTE_H__ */
+#endif
+#ifndef TINC_SUBNET_H
+#define TINC_SUBNET_H
+
/*
subnet.h -- header for subnet.c
Copyright (C) 2000-2009 Guus Sliepen <guus@tinc-vpn.org>,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_SUBNET_H__
-#define __TINC_SUBNET_H__
-
#include "net.h"
typedef enum subnet_type_t {
extern void dump_subnets(void);
extern void subnet_cache_flush(void);
-#endif /* __TINC_SUBNET_H__ */
+#endif
+#ifndef TINC_SYSTEM_H
+#define TINC_SYSTEM_H
+
/*
system.h -- system headers
Copyright (C) 1998-2005 Ivo Timmermans
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_SYSTEM_H__
-#define __TINC_SYSTEM_H__
-
#include "config.h"
#include "have.h"
typedef int socklen_t;
#endif
-#endif /* __TINC_SYSTEM_H__ */
+#endif
"initgroups", strerror(errno));
return false;
}
-#ifndef __ANDROID__
+#ifndef ANDROID
// Not supported in android NDK
endgrent();
endpwent();
}
default:
- logger(LOG_ERR, "Invalid value for state variable in " __FILE__);
+ logger(LOG_ERR, "Invalid value for state variable in " FILE);
abort();
}
}
+#ifndef TINC_UTILS_H
+#define TINC_UTILS_H
+
/*
utils.h -- header file for utils.c
Copyright (C) 1999-2005 Ivo Timmermans
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_UTILS_H__
-#define __TINC_UTILS_H__
-
extern bool hex2bin(char *src, char *dst, int length);
extern void bin2hex(char *src, char *dst, int length);
int memcmp_constant_time (const void *a, const void *b, size_t size);
-#endif /* __TINC_UTILS_H__ */
+#endif
+#ifndef TINC_XALLOC_H
+#define TINC_XALLOC_H
+
/*
xalloc.h -- malloc and related fuctions with out of memory checking
Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc., Foundation,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
-
-#ifndef __TINC_XALLOC_H__
-#define __TINC_XALLOC_H__
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
static inline void *xmalloc(size_t n) __attribute__ ((__malloc__));
static inline void *xmalloc(size_t n) {