forked from heistp/irtt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsconfig.go
45 lines (42 loc) · 1.09 KB
/
sconfig.go
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
package irtt
import "time"
// ServerConfig defines the Server configuration.
type ServerConfig struct {
Addrs []string
HMACKey []byte
MaxDuration time.Duration
MinInterval time.Duration
MaxLength int
Timeout time.Duration
PacketBurst int
Filler Filler
AllowFills []string
AllowStamp AllowStamp
AllowDSCP bool
TTL int
IPVersion IPVersion
Handler Handler
SetSrcIP bool
TimeSource TimeSource
ThreadLock bool
}
// NewServerConfig returns a new ServerConfig with the default settings.
func NewServerConfig() *ServerConfig {
return &ServerConfig{
Addrs: DefaultBindAddrs,
MaxDuration: DefaultMaxDuration,
MinInterval: DefaultMinInterval,
MaxLength: DefaultMaxLength,
Timeout: DefaultServerTimeout,
PacketBurst: DefaultPacketBurst,
Filler: DefaultServerFiller,
AllowFills: DefaultAllowFills,
AllowStamp: DefaultAllowStamp,
AllowDSCP: DefaultAllowDSCP,
TTL: DefaultTTL,
IPVersion: DefaultIPVersion,
SetSrcIP: DefaultSetSrcIP,
TimeSource: DefaultTimeSource,
ThreadLock: DefaultThreadLock,
}
}