Added source verification

This commit is contained in:
Mathias Hall-Andersen
2017-07-08 09:23:10 +02:00
parent ed31e75739
commit 5c1ccbddf0
5 changed files with 115 additions and 44 deletions

View File

@@ -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)