X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnet.h;h=261d9c3cfb40c17e0f57897c19d3c576e6329073;hb=b13e1a3c1f7252cda5ab95166d9f2d578983471f;hp=419f961f553ae707768fd561ae57a1777595e64c;hpb=ed2dddd420c8718006008b68e29ee93c5a1c3a79;p=tinc diff --git a/src/net.h b/src/net.h index 419f961f..261d9c3c 100644 --- a/src/net.h +++ b/src/net.h @@ -21,17 +21,23 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "system.h" + #include "ipv6.h" #include "cipher.h" #include "digest.h" #include "event.h" +#define EPOLL_MAX_EVENTS_PER_LOOP 32 + #ifdef ENABLE_JUMBOGRAMS #define MTU 9018 /* 9000 bytes payload + 14 bytes ethernet header + 4 bytes VLAN tag */ #else #define MTU 1518 /* 1500 bytes payload + 14 bytes ethernet header + 4 bytes VLAN tag */ #endif +#define MINMTU 512 /* Below this we don't consider UDP to be working */ + /* MAXSIZE is the maximum size of an encapsulated packet: MTU + seqno + srcid + dstid + padding + HMAC + compressor overhead */ #define MAXSIZE (MTU + 4 + sizeof(node_id_t) + sizeof(node_id_t) + CIPHER_MAX_BLOCK_SIZE + DIGEST_MAX_SIZE + MTU/64 + 20) @@ -118,7 +124,7 @@ typedef struct outgoing_t { timeout_t ev; } outgoing_t; -extern list_t *outgoing_list; +extern list_t outgoing_list; extern int maxoutbufsize; extern int seconds_till_retry; @@ -182,7 +188,7 @@ 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(node_t *to, node_t *from, int type, const void *data, size_t len); +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);