X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnet.h;h=6d4dfc892e232dd32c8e27a379e84c85b034291c;hb=5822f817aa802c2c5a83e9d99a8ae78cb822799b;hp=dcc99a4a6055c44d6f33bf016f30958432f90e64;hpb=6b92ac505d2cd5c7e390d49bf1f0b399ef9f8327;p=tinc diff --git a/src/net.h b/src/net.h index dcc99a4a..6d4dfc89 100644 --- a/src/net.h +++ b/src/net.h @@ -1,7 +1,10 @@ +#ifndef TINC_NET_H +#define TINC_NET_H + /* net.h -- header for net.c Copyright (C) 1998-2005 Ivo Timmermans - 2000-2014 Guus Sliepen + 2000-2016 Guus Sliepen 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 @@ -18,9 +21,6 @@ 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" @@ -115,6 +115,7 @@ typedef struct listen_socket_t { io_t udp; sockaddr_t sa; bool bindto; + int priority; } listen_socket_t; #include "conf.h" @@ -125,8 +126,9 @@ typedef struct outgoing_t { int timeout; splay_tree_t *config_tree; struct config_t *cfg; - struct addrinfo *ai; + struct addrinfo *ai; // addresses from config files struct addrinfo *aip; + struct addrinfo *kai; // addresses known via other online nodes (use free_known_addresses()) timeout_t ev; } outgoing_t; @@ -138,6 +140,14 @@ extern int addressfamily; extern unsigned replaywin; extern bool localdiscovery; +extern bool udp_discovery; +extern int udp_discovery_keepalive_interval; +extern int udp_discovery_interval; +extern int udp_discovery_timeout; + +extern int mtu_info_interval; +extern int udp_info_interval; + extern listen_socket_t listen_socket[MAXSOCKETS]; extern int listen_sockets; extern io_t unix_socket; @@ -183,10 +193,11 @@ extern void handle_new_meta_connection(void *, int); extern void handle_new_unix_connection(void *, int); extern int setup_listen_socket(const sockaddr_t *); extern int setup_vpn_in_socket(const sockaddr_t *); -extern bool send_sptps_data(void *handle, uint8_t type, const void *data, size_t len); +extern bool send_sptps_data(node_t *to, 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 *, vpn_packet_t *); extern void receive_tcppacket(struct connection_t *, const char *, int); +extern bool receive_tcppacket_sptps(struct connection_t *, const char *, int); extern void broadcast_packet(const struct node_t *, vpn_packet_t *); extern char *get_name(void); extern void device_enable(void); @@ -201,18 +212,17 @@ extern void terminate_connection(struct connection_t *, bool); extern bool node_read_ecdsa_public_key(struct node_t *); extern bool read_ecdsa_public_key(struct connection_t *); extern bool read_rsa_public_key(struct connection_t *); -extern void send_mtu_probe(struct node_t *); extern void handle_device_data(void *, int); extern void handle_meta_connection_data(struct connection_t *); extern void regenerate_key(void); extern void purge(void); extern void retry(void); extern int reload_configuration(void); -extern void load_all_subnets(void); extern void load_all_nodes(void); +extern void try_tx(struct node_t *n, bool); #ifndef HAVE_MINGW #define closesocket(s) close(s) #endif -#endif /* __TINC_NET_H__ */ +#endif