aboutsummaryrefslogtreecommitdiffstats
path: root/src/Network/WireGuard/Internal/Constant.hs
blob: c615a0fcd4b23bbfc266e4f8a8db2fa04ea570ee (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
module Network.WireGuard.Internal.Constant where

authLength :: Int
authLength = 16

aeadLength :: Int -> Int
aeadLength payload = payload + authLength

keyLength :: Int
keyLength = 32

timestampLength :: Int
timestampLength = 12

mac1Length :: Int
mac1Length = 16

mac2Length :: Int
mac2Length = 16

maxQueuedUdpPackets :: Int
maxQueuedUdpPackets = 4096

maxQueuedTunPackets :: Int
maxQueuedTunPackets = 4096

udpReadBufferLength :: Int
udpReadBufferLength = 4096

tunReadBufferLength :: Int
tunReadBufferLength = 4096

retryMaxWaitTime :: Int
retryMaxWaitTime = 5 * 1000000 -- 5 seconds

handshakeRetryTime :: Int
handshakeRetryTime = 5

handshakeStopTime :: Int
handshakeStopTime = 90

sessionRenewTime :: Int
sessionRenewTime = 120

sessionExpireTime :: Int
sessionExpireTime = 180

sessionKeepaliveTime :: Int
sessionKeepaliveTime = 10

maxActiveSessions :: Int
maxActiveSessions = 2

heartbeatWaitTime :: Int
heartbeatWaitTime = 250 * 1000 -- 0.25 second