2017-05-30 20:36:49 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2017-06-01 19:31:30 +00:00
|
|
|
"net"
|
2017-05-30 20:36:49 +00:00
|
|
|
"sync"
|
2017-06-04 19:48:15 +00:00
|
|
|
"time"
|
2017-05-30 20:36:49 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type KeyPair struct {
|
|
|
|
recieveKey NoiseSymmetricKey
|
|
|
|
recieveNonce NoiseNonce
|
|
|
|
sendKey NoiseSymmetricKey
|
|
|
|
sendNonce NoiseNonce
|
|
|
|
}
|
|
|
|
|
|
|
|
type Peer struct {
|
2017-06-04 19:48:15 +00:00
|
|
|
mutex sync.RWMutex
|
|
|
|
publicKey NoisePublicKey
|
|
|
|
presharedKey NoiseSymmetricKey
|
|
|
|
endpoint net.IP
|
|
|
|
persistentKeepaliveInterval time.Duration
|
2017-05-30 20:36:49 +00:00
|
|
|
}
|