aboutsummaryrefslogtreecommitdiffstats
path: root/src/device.go
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2017-07-08 09:23:10 +0200
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2017-07-08 09:23:10 +0200
commit5c1ccbddf0c6fdfd98cb3204c1cd4726862855f2 (patch)
tree69269d6a8ec41134dfdb98c6590fc77e9fdaa64c /src/device.go
parentFixed cookie reply processing bug (diff)
downloadwireguard-go-5c1ccbddf0c6fdfd98cb3204c1cd4726862855f2.tar.xz
wireguard-go-5c1ccbddf0c6fdfd98cb3204c1cd4726862855f2.zip
Added source verification
Diffstat (limited to 'src/device.go')
-rw-r--r--src/device.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/device.go b/src/device.go
index 882d587..0564068 100644
--- a/src/device.go
+++ b/src/device.go
@@ -31,10 +31,16 @@ type Device struct {
signal struct {
stop chan struct{}
}
- peers map[NoisePublicKey]*Peer
- mac MACStateDevice
+ congestionState int32 // used as an atomic bool
+ peers map[NoisePublicKey]*Peer
+ mac MACStateDevice
}
+const (
+ CongestionStateUnderLoad = iota
+ CongestionStateOkay
+)
+
func (device *Device) SetPrivateKey(sk NoisePrivateKey) {
device.mutex.Lock()
defer device.mutex.Unlock()
@@ -93,6 +99,7 @@ func NewDevice(tun TUNDevice, logLevel int) *Device {
go device.RoutineDecryption()
go device.RoutineHandshake()
}
+ go device.RoutineBusyMonitor()
go device.RoutineReadFromTUN(tun)
go device.RoutineReceiveIncomming()
go device.RoutineWriteToTUN(tun)