X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnet.h;h=8e256ce76aff54b66f8c25dd40c41245121060e4;hb=e62fd508158749a0d55eae06c2e361df5d6da6e0;hp=b1792883382439c2961bb9e1be864f35efc0cd6b;hpb=b322126576c52ffbc9a91d818125fc461fa17d1b;p=tinc diff --git a/src/net.h b/src/net.h index b1792883..8e256ce7 100644 --- a/src/net.h +++ b/src/net.h @@ -36,6 +36,8 @@ #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) @@ -122,6 +124,11 @@ typedef struct outgoing_t { timeout_t ev; } outgoing_t; +typedef struct ports_t { + char *tcp; + char *udp; +} ports_t; + extern list_t outgoing_list; extern int maxoutbufsize; @@ -149,7 +156,7 @@ extern bool udp_sndbuf_warnings; extern int max_connection_burst; extern int fwmark; extern bool do_prune; -extern char *myport; +extern ports_t myport; extern bool device_standby; extern bool autoconnect; extern bool disablebuggypeers; @@ -213,7 +220,7 @@ extern void load_all_nodes(void); extern void try_tx(struct node_t *n, bool mtu); extern void tarpit(int fd); -#ifndef HAVE_MINGW +#ifndef HAVE_WINDOWS #define closesocket(s) close(s) #endif