-typedef struct enc_key_t {
- int length;
- char *key;
- time_t expiry;
-} enc_key_t;
-
-extern int tap_fd;
-
-extern int total_tap_in;
-extern int total_tap_out;
-extern int total_socket_in;
-extern int total_socket_out;
-
-extern char *unknown;
-
-extern char *request_name[256];
-extern char *status_text[10];
-
-#include "connection.h" /* Yes, very strange placement indeed, but otherwise the typedefs get all tangled up */
-
-extern int str2opt(const char *);
-extern char *opt2str(int);
-extern int send_packet(ip_t, vpn_packet_t *);
-extern int receive_packet(connection_t *, vpn_packet_t *);
+typedef struct outgoing_t {
+ char *name;
+ int timeout;
+ struct config_t *cfg;
+ struct addrinfo *ai;
+ struct addrinfo *aip;
+} outgoing_t;
+
+typedef struct listen_socket_t {
+ int tcp;
+ int udp;
+ sockaddr_t sa;
+} listen_socket_t;
+
+extern int maxtimeout;
+extern int seconds_till_retry;
+extern int addressfamily;
+
+extern char *request_name[];
+extern char *status_text[];
+
+#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 int keylifetime;
+extern int do_prune;
+extern int do_purge;
+extern char *myport;
+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 *);