-extern time_t now;
-
-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 int handle_new_meta_connection(int);
-extern int setup_listen_socket(sockaddr_t *);
-extern int setup_vpn_in_socket(sockaddr_t *);
-extern void send_packet(struct node_t *, vpn_packet_t *);
-extern void receive_packet(struct node_t *, vpn_packet_t *);
-extern void receive_tcppacket(struct connection_t *, char *, int);
-extern void broadcast_packet(struct node_t *, vpn_packet_t *);
-extern int setup_network_connections(void);
-extern void setup_outgoing_connection(struct outgoing_t *);
+extern bool device_standby;
+extern bool autoconnect;
+extern bool disablebuggypeers;
+extern int contradicting_add_edge;
+extern int contradicting_del_edge;
+extern time_t last_config_check;
+
+extern char *proxyhost;
+extern char *proxyport;
+extern char *proxyuser;
+extern char *proxypass;
+typedef enum proxytype_t {
+ PROXY_NONE = 0,
+ PROXY_SOCKS4,
+ PROXY_SOCKS4A,
+ PROXY_SOCKS5,
+ PROXY_HTTP,
+ PROXY_EXEC,
+} proxytype_t;
+extern proxytype_t proxytype;
+
+extern char *scriptinterpreter;
+extern char *scriptextension;
+
+/* 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 *outgoing);
+extern void handle_incoming_vpn_data(void *data, int flags);
+extern void finish_connecting(struct connection_t *c);
+extern bool do_outgoing_connection(struct outgoing_t *outgoing);
+extern void handle_new_meta_connection(void *data, int flags);
+extern void handle_new_unix_connection(void *data, int flags);
+extern int setup_listen_socket(const sockaddr_t *sa);
+extern int setup_vpn_in_socket(const sockaddr_t *sa);
+extern bool send_sptps_data(struct node_t *to, struct node_t *from, int type, const void *data, size_t len);
+extern bool receive_sptps_record(void *handle, uint8_t type, const void *data, uint16_t len);
+extern void send_packet(struct node_t *n, vpn_packet_t *packet);
+extern void receive_tcppacket(struct connection_t *c, const char *buffer, size_t length);
+extern bool receive_tcppacket_sptps(struct connection_t *c, const char *buffer, size_t length);
+extern void broadcast_packet(const struct node_t *n, vpn_packet_t *packet);
+extern char *get_name(void);
+extern void device_enable(void);
+extern void device_disable(void);
+extern bool setup_myself_reloadable(void);
+extern bool setup_network(void);
+extern void setup_outgoing_connection(struct outgoing_t *outgoing, bool verbose);