| 164 | } |
| 165 | |
| 166 | func buildSeqnos(n *Nylon) []*protocol.SeqnoEntry { |
| 167 | entries := make([]*protocol.SeqnoEntry, 0, len(n.RouterState.SelfSeqno)) |
| 168 | for prefix, seqno := range n.RouterState.SelfSeqno { |
| 169 | entries = append(entries, &protocol.SeqnoEntry{ |
| 170 | Prefix: prefix.String(), |
| 171 | Seqno: uint32(seqno), |
| 172 | }) |
| 173 | } |
| 174 | slices.SortFunc(entries, func(a, b *protocol.SeqnoEntry) int { |
| 175 | return cmp.Compare(a.Prefix, b.Prefix) |
| 176 | }) |
| 177 | return entries |
| 178 | } |
| 179 | |
| 180 | func buildNeighbours(n *Nylon, wgStats map[state.NyPublicKey]device.PeerStatus) []*protocol.NeighbourInfo { |
| 181 | ids := slices.Clone(n.GetPeers(n.LocalCfg.Id)) |