Use datagram SPTPS for packet exchange between nodes.

When two nodes which support SPTPS want to send packets to each other, they now
always use SPTPS. The node initiating the SPTPS session send the first SPTPS
packet via an extended REQ_KEY messages. All other handshake messages are sent
using ANS_KEY messages. This ensures that intermediate nodes using an older
version of tinc can still help with NAT traversal. After the authentication
phase is over, SPTPS packets are sent via UDP, or are encapsulated in extended
REQ_KEY messages instead of PACKET messages.
This commit is contained in:
Guus Sliepen 2012-07-30 18:36:59 +02:00
parent 248d300f1b
commit 153abaa4d9
12 changed files with 213 additions and 134 deletions

View file

@ -31,7 +31,7 @@
#include "utils.h"
#include "xalloc.h"
bool send_meta_sptps(void *handle, const char *buffer, size_t length) {
bool send_meta_sptps(void *handle, uint8_t type, const char *buffer, size_t length) {
connection_t *c = handle;
if(!c) {