diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-11-16 04:13:16 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-11-16 04:25:05 +0100 |
commit | 95e81892c9b4d069bf7d064ed8a644e92e751abb (patch) | |
tree | e66c1008b78619ee78103ea407d2a5f4fceaa5fe /src/messages.h | |
parent | 6e71b31d5116a9260be12e855672196bcec618cb (diff) |
packets: consolidate constants
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/messages.h')
-rw-r--r-- | src/messages.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/messages.h b/src/messages.h index 0a799eb..7a4b14e 100644 --- a/src/messages.h +++ b/src/messages.h @@ -46,7 +46,10 @@ enum limits { INITIATIONS_PER_SECOND = HZ / 50, MAX_PEERS_PER_DEVICE = U16_MAX, KEEPALIVE_TIMEOUT = 10 * HZ, - MAX_TIMER_HANDSHAKES = (90 * HZ) / REKEY_TIMEOUT + MAX_TIMER_HANDSHAKES = (90 * HZ) / REKEY_TIMEOUT, + MAX_QUEUED_INCOMING_HANDSHAKES = 4096, + MAX_BURST_INCOMING_HANDSHAKES = 16, + MAX_QUEUED_OUTGOING_PACKETS = 1024 }; enum message_type { @@ -108,6 +111,13 @@ enum message_alignments { MESSAGE_MINIMUM_LENGTH = message_data_len(0) }; +#define SKB_HEADER_LEN (max(sizeof(struct iphdr), sizeof(struct ipv6hdr)) + sizeof(struct udphdr) + NET_SKB_PAD) +#define DATA_PACKET_HEAD_ROOM ALIGN(sizeof(struct message_data) + SKB_HEADER_LEN, 4) + +enum { + HANDSHAKE_DSCP = 0b10001000 /* AF41, plus 00 ECN */ +}; + static inline enum message_type message_determine_type(void *src, size_t src_len) { struct message_header *header = src; |