MCPcopy Index your code
hub / github.com/tailscale/tailscale / getPeerStatusLite

Method getPeerStatusLite

wgengine/userspace.go:1107–1117  ·  view source on GitHub ↗
(pk key.NodePublic)

Source from the content-addressed store, hash-verified

1105}
1106
1107func (e *userspaceEngine) getPeerStatusLite(pk key.NodePublic) (status ipnstate.PeerStatusLite, ok bool) {
1108 peer, ok := e.PeerByKey(pk)
1109 if !ok {
1110 return status, false
1111 }
1112 status.NodeKey = pk
1113 status.RxBytes = int64(peer.RxBytes())
1114 status.TxBytes = int64(peer.TxBytes())
1115 status.LastHandshake = peer.LastHandshake()
1116 return status, true
1117}
1118
1119func (e *userspaceEngine) getStatus() (*Status, error) {
1120 // Grab derpConns before acquiring wgLock to not violate lock ordering;

Callers 2

onOpenTimeoutMethod · 0.95
getStatusMethod · 0.95

Calls 4

PeerByKeyMethod · 0.95
RxBytesMethod · 0.80
TxBytesMethod · 0.80
LastHandshakeMethod · 0.80

Tested by

no test coverage detected