(n *Nylon, id state.NodeId)
| 287 | } |
| 288 | |
| 289 | func advertisementsForNode(n *Nylon, id state.NodeId) []*protocol.Advertisement { |
| 290 | ads := make([]*protocol.Advertisement, 0) |
| 291 | for prefix, adv := range n.RouterState.Advertised { |
| 292 | if adv.NodeId != id { |
| 293 | continue |
| 294 | } |
| 295 | ads = append(ads, &protocol.Advertisement{ |
| 296 | NodeId: string(adv.NodeId), |
| 297 | Prefix: prefix.String(), |
| 298 | Metric: adv.MetricFn(), |
| 299 | ExpiryUnix: adv.Expiry.Unix(), |
| 300 | PassiveHold: adv.IsPassiveHold, |
| 301 | }) |
| 302 | } |
| 303 | sortAdvertisements(ads) |
| 304 | return ads |
| 305 | } |
| 306 | |
| 307 | func wireGuardPeerStats(n *Nylon) map[state.NyPublicKey]device.PeerStatus { |
| 308 | stats := make(map[state.NyPublicKey]device.PeerStatus) |
no test coverage detected