summaryrefslogtreecommitdiffhomepage
path: root/src/constants.go
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2017-07-11 22:48:58 +0200
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2017-07-11 22:48:58 +0200
commit86707cbc88fbad58481b400eaf12fa75c78f9855 (patch)
treece3b662db2da9ad78f09ed96cb2a93c2f0e6bfa4 /src/constants.go
parentc273078376d5aa394e871e7436b8e770b0c3f4a0 (diff)
Fixed MTU method for linux TUN interface
Updated the TUN interface Added the "MTU" method for the linux implementation of the TUN interface
Diffstat (limited to 'src/constants.go')
-rw-r--r--src/constants.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/constants.go b/src/constants.go
index 4e8d521..0384741 100644
--- a/src/constants.go
+++ b/src/constants.go
@@ -4,15 +4,17 @@ import (
"time"
)
+/* Specification constants */
+
const (
RekeyAfterMessages = (1 << 64) - (1 << 16) - 1
+ RejectAfterMessages = (1 << 64) - (1 << 4) - 1
RekeyAfterTime = time.Second * 120
RekeyAttemptTime = time.Second * 90
- RekeyTimeout = time.Second * 5 // TODO: Exponential backoff
+ RekeyTimeout = time.Second * 5
RejectAfterTime = time.Second * 180
- RejectAfterMessages = (1 << 64) - (1 << 4) - 1
KeepaliveTimeout = time.Second * 10
- CookieRefreshTime = time.Minute * 2
+ CookieRefreshTime = time.Second * 120
MaxHandshakeAttemptTime = time.Second * 90
)
@@ -20,11 +22,13 @@ const (
RekeyAfterTimeReceiving = RekeyAfterTime - KeepaliveTimeout - RekeyTimeout
)
+/* Implementation specific constants */
+
const (
QueueOutboundSize = 1024
QueueInboundSize = 1024
QueueHandshakeSize = 1024
QueueHandshakeBusySize = QueueHandshakeSize / 8
MinMessageSize = MessageTransportSize // keep-alive
- MaxMessageSize = 4096
+ MaxMessageSize = 4096 // TODO: make depend on the MTU?
)