Cleanup - maybe working...
This commit is contained in:
@@ -26,6 +26,7 @@ type Peer struct {
|
||||
Endpoint4 netip.AddrPort // Reported IPv4 endpoint.
|
||||
Endpoint6 netip.AddrPort // Reported IPv6 endpoint.
|
||||
RTT time.Duration // Round-trip time.
|
||||
State PeerState // Current routing state; updated on each devXxx call.
|
||||
Role control.Role // Client initiates pings; server responds.
|
||||
SignPubKey [32]byte // nacl/sign public key for verifying multicast beacons.
|
||||
}
|
||||
@@ -35,16 +36,6 @@ func (p *Peer) PubKey() wgtypes.Key {
|
||||
return p.wgPeer.PublicKey
|
||||
}
|
||||
|
||||
func (p *Peer) State() PeerState {
|
||||
if len(p.wgPeer.AllowedIPs) > 0 {
|
||||
return StateDirect
|
||||
}
|
||||
if p.wgPeer.Endpoint == nil {
|
||||
return StateRelayed
|
||||
}
|
||||
return StateProbing
|
||||
}
|
||||
|
||||
func (p *Peer) WGEndpoint() netip.AddrPort {
|
||||
ep := p.wgPeer.Endpoint
|
||||
if ep == nil {
|
||||
|
||||
Reference in New Issue
Block a user