+#ifndef TINC_AUTOCONNECT_H
+#define TINC_AUTOCONNECT_H
+
/*
autoconnect.h -- header for autoconnect.c
Copyright (C) 2017 Guus Sliepen <guus@tinc-vpn.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_AUTOCONNECT_H__
-#define __TINC_AUTOCONNECT_H__
-
extern void do_autoconnect(void);
#endif
-#ifndef __TINC_BUFFER_H__
-#define __TINC_BUFFER_H__
+#ifndef TINC_BUFFER_H
+#define TINC_BUFFER_H
typedef struct buffer_t {
char *data;
+#ifndef TINC_CIPHER_H
+#define TINC_CIPHER_H
+
/*
cipher.h -- header file cipher.c
Copyright (C) 2007-2016 Guus Sliepen <guus@tinc-vpn.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_CIPHER_H__
-#define __TINC_CIPHER_H__
-
#define CIPHER_MAX_BLOCK_SIZE 32
#define CIPHER_MAX_IV_SIZE 16
#define CIPHER_MAX_KEY_SIZE 32
+#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 "list.h"
#include "splay_tree.h"
#include "subnet.h"
extern bool read_host_config(splay_tree_t *, const char *);
extern bool append_config_file(const char *, const char *, const char *);
-#endif /* __TINC_CONF_H__ */
+#endif
+#ifndef TINC_CONNECTION_H
+#define TINC_CONNECTION_H
+
/*
connection.h -- header for connection.c
Copyright (C) 2000-2013 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 "buffer.h"
#include "cipher.h"
#include "digest.h"
extern void connection_del(connection_t *);
extern bool dump_connections(struct connection_t *);
-#endif /* __TINC_CONNECTION_H__ */
+#endif
+#ifndef TINC_CONTROL_H
+#define TINC_CONTROL_H
+
/*
control.h -- header for control.c.
Copyright (C) 2007 Guus Sliepen <guus@tinc-vpn.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_CONTROL_H__
-#define __TINC_CONTROL_H__
-
extern bool init_control();
extern void exit_control();
extern char controlcookie[];
+#ifndef TINC_CONTROL_COMMON_H
+#define TINC_CONTROL_COMMON_H
+
/*
control_protocol.h -- control socket protocol.
Copyright (C) 2007 Scott Lamb <slamb@slamb.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_CONTROL_PROTOCOL_H__
-#define __TINC_CONTROL_PROTOCOL_H__
-
#include "protocol.h"
enum request_type {
+#ifndef TINC_CRYPTO_H
+#define TINC_CRYPTO_H
+
/*
crypto.h -- header for crypto.c
Copyright (C) 2007-2013 Guus Sliepen <guus@tinc-vpn.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_CRYPTO_H__
-#define __TINC_CRYPTO_H__
-
extern void crypto_init();
extern void crypto_exit();
extern void randomize(void *, size_t);
+#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_DIGEST_H
+#define TINC_DIGEST_H
+
/*
digest.h -- header file digest.c
Copyright (C) 2007-2016 Guus Sliepen <guus@tinc-vpn.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_DIGEST_H__
-#define __TINC_DIGEST_H__
-
#define DIGEST_MAX_SIZE 64
#ifndef DISABLE_LEGACY
+#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__
-
#ifndef HAVE_DAEMON
extern int daemon(int, int);
#endif
#define EAI_SYSTEM 0
#endif
-#endif /* __DROPIN_H__ */
+#endif
+#ifndef TINC_ECDH_H
+#define TINC_ECDH_H
+
/*
ecdh.h -- header file for ecdh.c
Copyright (C) 2011-2013 Guus Sliepen <guus@tinc-vpn.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_ECDH_H__
-#define __TINC_ECDH_H__
-
#define ECDH_SIZE 32
#define ECDH_SHARED_SIZE 32
-#ifndef __TINC_ECDH_INTERNAL__
+#ifndef TINC_ECDH_INTERNAL
typedef struct ecdh ecdh_t;
#endif
+#ifndef TINC_ECDSA_H
+#define TINC_ECDSA_H
+
/*
ecdsa.h -- ECDSA key handling
Copyright (C) 2011-2013 Guus Sliepen <guus@tinc-vpn.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_ECDSA_H__
-#define __TINC_ECDSA_H__
-
-#ifndef __TINC_ECDSA_INTERNAL__
+#ifndef TINC_ECDSA_INTERNAL
typedef struct ecdsa ecdsa_t;
#endif
+#ifndef TINC_ECDSAGEN_H
+#define TINC_ECDSAGEN_H
+
/*
ecdsagen.h -- ECDSA key generation and export
Copyright (C) 2011-2013 Guus Sliepen <guus@tinc-vpn.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_ECDSAGEN_H__
-#define __TINC_ECDSAGEN_H__
-
#include "ecdsa.h"
extern ecdsa_t *ecdsa_generate(void) __attribute__ ((__malloc__));
#include "ed25519.h"
-#define __TINC_ECDH_INTERNAL__
+#define TINC_ECDH_INTERNAL
typedef struct ecdh_t {
uint8_t private[64];
} ecdh_t;
#include "ed25519.h"
-#define __TINC_ECDSA_INTERNAL__
+#define TINC_ECDSA_INTERNAL
typedef struct {
uint8_t private[64];
uint8_t public[32];
#include "ed25519.h"
-#define __TINC_ECDSA_INTERNAL__
+#define TINC_ECDSA_INTERNAL
typedef struct {
uint8_t private[64];
uint8_t public[32];
+#ifndef TINC_FIXEDINT_H
+#define TINC_FIXEDINT_H
+
/*
Portable header to provide the 32 and 64 bits type.
Not a compatible replacement for <stdint.h>, do not blindly use it as such.
*/
-#ifndef __TINC_FIXEDINT_H__
-#define __TINC_FIXEDINT_H__
-
#if ((defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined(__WATCOMC__) && (defined(_STDINT_H_INCLUDED) || __WATCOMC__ >= 1250)) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_) || defined(__UINT_FAST64_TYPE__)) )) && !defined(FIXEDINT_H_INCLUDED)
#include <stdint.h>
#define FIXEDINT_H_INCLUDED
+#ifndef TINC_EDGE_H
+#define TINC_EDGE_H
+
/*
edge.h -- header for edge.c
Copyright (C) 2001-2012 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 "splay_tree.h"
#include "connection.h"
#include "net.h"
extern edge_t *lookup_edge(struct node_t *, struct node_t *);
extern bool dump_edges(struct connection_t *);
-#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 -- I/O, timeout and signal event handling
Copyright (C) 2012-2013 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 "splay_tree.h"
#define IO_READ 1
+#ifndef TINC_FSCK_H
+#define TINC_FSCK_H
+
/*
fsck.h -- header for fsck.c.
Copyright (C) 2012 Guus Sliepen <guus@tinc-vpn.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_FSCK_H__
-#define __TINC_FSCK_H__
-
extern int fsck(const char *argv0);
#endif
-
+#ifndef TINC_GCRYPT_CIPHER_H
+#define TINC_GCRYPT_CIPHER_H
+
/*
cipher.h -- header file cipher.c
Copyright (C) 2007-2009 Guus Sliepen <guus@tinc-vpn.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_CIPHER_H__
-#define __TINC_CIPHER_H__
-
#include <gcrypt.h>
#define CIPHER_MAX_BLOCK_SIZE 32
+#ifndef TINC_GCRYPT_CRYPTO_H
+#define TINC_GCRYPT_CRYPTO_H
+
/*
crypto.h -- header for crypto.c
Copyright (C) 2007-2009 Guus Sliepen <guus@tinc-vpn.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_CRYPTO_H__
-#define __TINC_CRYPTO_H__
-
extern void crypto_init();
extern void crypto_exit();
extern void randomize(void *, size_t);
+#ifndef TINC_GCRYPT_DIGEST_H
+#define TINC_GCRYPT_DIGEST_H
+
/*
digest.h -- header file digest.c
Copyright (C) 2007-2009 Guus Sliepen <guus@tinc-vpn.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_DIGEST_H__
-#define __TINC_DIGEST_H__
-
#include <gcrypt.h>
#define DIGEST_MAX_SIZE 64
+#ifndef TINC_GCRYPT_RSA_H
+#define TINC_GCRYPT_RSA_H
+
/*
rsa.h -- RSA key handling
Copyright (C) 2007 Guus Sliepen <guus@tinc-vpn.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_RSA_H__
-#define __TINC_RSA_H__
-
#include <gcrypt.h>
typedef struct rsa {
+#ifndef TINC_GCRYPT_RSAGEN_H
+#define TINC_GCRYPT_RSAGEN_H
+
/*
rsagen.h -- RSA key generation and export
Copyright (C) 2008 Guus Sliepen <guus@tinc-vpn.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_RSAGEN_H__
-#define __TINC_RSAGEN_H__
-
#include "rsa.h"
extern bool rsa_generate(rsa_t *rsa, size_t bits, unsigned long exponent);
+#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.
}
#endif
-#endif /* _GETOPT_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_HASH_H
+#define TINC_HASH_H
+
/*
hash.h -- header file for hash.c
Copyright (C) 2012 Guus Sliepen <guus@tinc-vpn.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_HASH_H__
-#define __TINC_HASH_H__
-
typedef struct hash_t {
size_t n;
size_t size;
extern void hash_clear(hash_t *);
extern void hash_resize(hash_t *, size_t n);
-#endif /* __TINC_HASH_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
#define WINVER WindowsXP
#define WIN32_LEAN_AND_MEAN
#define SLASH "/"
#endif
-#endif /* __TINC_SYSTEM_H__ */
+#endif
+#ifndef TINC_IFCONFIG_H
+#define TINC_IFCONFIG_H
+
/*
ifconfig.h -- header for ifconfig.c.
Copyright (C) 2016 Guus Sliepen <guus@tinc-vpn.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_IFCONFIG_H__
-#define __TINC_IFCONFIG_H__
-
extern void ifconfig_dhcp(FILE *out);
extern void ifconfig_dhcp6(FILE *out);
extern void ifconfig_slaac(FILE *out);
+#ifndef TINC_INFO_H
+#define TINC_INFO_H
+
/*
info.h -- header for info.c.
Copyright (C) 2012 Guus Sliepen <guus@tinc-vpn.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_INFO_H__
-#define __TINC_INFO_H__
-
extern int info(int fd, const char *item);
extern char *strip_weight(char *);
#endif
-
+#ifndef TINC_INVITATION_H
+#define TINC_INVITATION_H
+
/*
invitation.h -- header for invitation.c.
Copyright (C) 2013 Guus Sliepen <guus@tinc-vpn.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_INVITATION_H__
-#define __TINC_INVITATION_H__
-
bool recvdata(int fd, char *data, size_t len);
int cmd_invite(int argc, char *argv[]);
int cmd_join(int argc, char *argv[]);
+#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
} __attribute__ ((__gcc_struct__, __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
} __attribute__ ((__gcc_struct__, __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;
*/
#define list_each(type, item, list) (type *item = (type *)1; item; item = NULL) for(list_node_t *node = (list)->head, *next; item = node ? node->data : NULL, next = node ? node->next : NULL, node; node = next)
-#endif /* __TINC_LIST_H__ */
+#endif
+#ifndef TINC_LOGGER_H
+#define TINC_LOGGER_H
+
/*
logger.h -- header file for logger.c
Copyright (C) 1998-2005 Ivo Timmermans
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_LOGGER_H__
-#define __TINC_LOGGER_H__
-
typedef enum debug_t {
DEBUG_NOTHING = 0, /* Quiet mode, only show starting/stopping of the daemon */
DEBUG_ALWAYS = 0,
extern void logger(int, int, const char *, ...) __attribute__ ((__format__(printf, 3, 4)));
extern void closelogger(void);
-#endif /* __TINC_LOGGER_H__ */
+#endif
+#ifndef TINC_META_H
+#define TINC_META_H
+
/*
meta.h -- header for meta.c
Copyright (C) 2000-2014 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 void broadcast_meta(struct connection_t *, const char *, int);
extern bool receive_meta(struct connection_t *);
-#endif /* __TINC_META_H__ */
+#endif
+#ifndef TINC_MINGW_COMMON_H
+#define TINC_MINGW_COMMON_H
+
/*
* TAP-Win32 -- A kernel driver to provide virtual tap device functionality
* on Windows. Originally derived from the CIPE-Win32
//=========================================================
#define TAP_COMPONENT_ID "tap0801"
+
+#endif
+#ifndef TINC_NAMES_H
+#define TINC_NAMES_H
+
/*
names.h -- header for names.c
Copyright (C) 1998-2005 Ivo Timmermans
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_NAMES_H__
-#define __TINC_NAMES_H__
-
extern char *confdir;
extern char *confbase;
extern bool confbase_given;
extern void make_names(bool daemon);
extern void free_names(void);
-#endif /* __TINC_NAMES_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 "ipv6.h"
#include "cipher.h"
#include "digest.h"
#define closesocket(s) close(s)
#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 sockaddrcpy(sockaddr_t *, const sockaddr_t *);
extern void sockaddr_setport(sockaddr_t *, const char *);
-#endif /* __TINC_NETUTL_H__ */
+#endif
+#ifndef TINC_NODE_H
+#define TINC_NODE_H
+
/*
node.h -- header for node.c
Copyright (C) 2001-2013 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 "splay_tree.h"
#include "cipher.h"
#include "connection.h"
extern bool dump_traffic(struct connection_t *);
extern void update_node_udp(node_t *, const sockaddr_t *);
-#endif /* __TINC_NODE_H__ */
+#endif
+#ifndef TINC_OPENSSL_DIGEST_H
+#define TINC_OPENSSL_DIGEST_H
+
/*
digest.h -- header file digest.c
Copyright (C) 2013 Guus Sliepen <guus@tinc-vpn.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_OPENSSL_DIGEST_H__
-#define __TINC_OPENSSL_DIGEST_H__
-
#include <openssl/evp.h>
struct digest {
#include <openssl/pem.h>
#include <openssl/err.h>
-#define __TINC_RSA_INTERNAL__
+#define TINC_RSA_INTERNAL
typedef RSA rsa_t;
#include "../logger.h"
#include <openssl/pem.h>
#include <openssl/err.h>
-#define __TINC_RSA_INTERNAL__
+#define TINC_RSA_INTERNAL
typedef RSA rsa_t;
#include "../logger.h"
+#ifndef TINC_PRF_H
+#define TINC_PRF_H
+
/*
prf.h -- header file for prf.c
Copyright (C) 2011-2013 Guus Sliepen <guus@tinc-vpn.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_PRF_H__
-#define __TINC_PRF_H__
-
extern bool prf(const char *secret, size_t secretlen, char *seed, size_t seedlen, char *out, size_t outlen) __attribute__ ((__warn_unused_result__));
#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 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__
-
#include "ecdsa.h"
/* Protocol version. Different major versions are incompatible. */
extern bool udp_info_h(struct connection_t *, const char *);
extern bool mtu_info_h(struct connection_t *, const char *);
-#endif /* __TINC_PROTOCOL_H__ */
+#endif
+#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 route(struct node_t *, struct vpn_packet_t *);
-#endif /* __TINC_ROUTE_H__ */
+#endif
+#ifndef TINC_RSA_H
+#define TINC_RSA_H
+
/*
rsa.h -- RSA key handling
Copyright (C) 2007-2013 Guus Sliepen <guus@tinc-vpn.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_RSA_H__
-#define __TINC_RSA_H__
-
-#ifndef __TINC_RSA_INTERNAL__
+#ifndef TINC_RSA_INTERNAL
typedef struct rsa rsa_t;
#endif
+#ifndef TINC_RSAGEN_H
+#define TINC_RSAGEN_H
+
/*
rsagen.h -- RSA key generation and export
Copyright (C) 2008-2013 Guus Sliepen <guus@tinc-vpn.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_RSAGEN_H__
-#define __TINC_RSAGEN_H__
-
#include "rsa.h"
extern rsa_t *rsa_generate(size_t bits, unsigned long exponent) __attribute__ ((__malloc__));
+#ifndef TINC_SCRIPT_H
+#define TINC_SCRIPT_H
+
/*
script.h -- header file for script.c
Copyright (C) 1999-2005 Ivo Timmermans,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_SCRIPT_H__
-#define __TINC_SCRIPT_H__
-
typedef struct environment {
int n;
int size;
extern bool execute_script(const char *name, environment_t *env);
-#endif /* __TINC_SCRIPT_H__ */
+#endif
+#ifndef TINC_SPLAY_TREE_H
+#define TINC_SPLAY_TREE_H
+
/*
splay_tree.h -- header file for splay_tree.c
Copyright (C) 2004-2013 Guus Sliepen <guus@tinc-vpn.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-
-#ifndef __SPLAY_TREE_H__
-#define __SPLAY_TREE_H__
-
typedef struct splay_node_t {
/* Linked list part */
+#ifndef TINC_SPTPS_H
+#define TINC_SPTPS_H
+
/*
sptps.h -- Simple Peer-to-Peer Security
Copyright (C) 2011-2014 Guus Sliepen <guus@tinc-vpn.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __SPTPS_H__
-#define __SPTPS_H__
-
#include "system.h"
#include "chacha-poly1305/chacha-poly1305.h"
+#ifndef TINC_SUBNET_H
+#define TINC_SUBNET_H
+
/*
subnet.h -- header for subnet.c
Copyright (C) 2000-2012 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"
#include "node.h"
extern bool dump_subnets(struct connection_t *);
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"
#include "dropin.h"
-#endif /* __TINC_SYSTEM_H__ */
+#endif
+#ifndef TINC_TINCCTL_H
+#define TINC_TINCCTL_H
+
/*
tincctl.h -- header for tincctl.c.
Copyright (C) 2011-2016 Guus Sliepen <guus@tinc-vpn.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_TINCCTL_H__
-#define __TINC_TINCCTL_H__
-
extern bool tty;
extern bool force;
extern char line[4096];
extern ecdsa_t *get_pubkey(FILE *f);
#endif
-
+#ifndef TINC_TOP_H
+#define TINC_TOP_H
+
/*
top.h -- header for top.c.
Copyright (C) 2011 Guus Sliepen <guus@tinc-vpn.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_TOP_H__
-#define __TINC_TOP_H__
-
extern void top(int fd);
#endif
-
+#ifndef TINC_UPNP_H
+#define TINC_UPNP_H
+
/*
upnp.h -- UPnP-IGD client
Copyright (C) 2015 Guus Sliepen <guus@tinc-vpn.org>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __UPNP_H__
-#define __UPNP_H__
-
#include "system.h"
extern void upnp_init(bool, bool);
+#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 int hex2bin(const char *src, void *dst, int length);
extern int bin2hex(const void *src, char *dst, int length);
extern bool check_netname(const char *, bool strict);
char *replace_name(const char *name);
-#endif /* __TINC_UTILS_H__ */
+#endif
+#ifndef TINC_VERSION_H
+#define TINC_VERSION_H
+
/*
version.h -- header for version.c
Copyright (C) 2014 Etienne Dechamps <etienne@edechamps.fr>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __TINC_VERSION_H__
-#define __TINC_VERSION_H__
-
extern const char* const BUILD_DATE;
extern const char* const BUILD_TIME;
extern const char* const BUILD_VERSION;
-#endif /* __TINC_VERSION_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) {