2019-04-10 13:18:05 +02:00
|
|
|
package respondd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/FreifunkBremen/yanic/data"
|
|
|
|
)
|
|
|
|
|
2019-04-10 21:57:31 +02:00
|
|
|
func (d *Daemon) updateNeighbours(iface string, resp *data.ResponseData) {
|
2019-04-10 13:18:05 +02:00
|
|
|
_, nodeID := d.getAnswer(iface)
|
2019-04-10 21:57:31 +02:00
|
|
|
resp.Neighbours.NodeID = nodeID
|
|
|
|
resp.Neighbours.Batadv = make(map[string]data.BatadvNeighbours)
|
|
|
|
for _, bface := range d.Batman {
|
|
|
|
b := NewBatman(bface)
|
|
|
|
for bfaceAddr, n := range b.Neighbours() {
|
|
|
|
resp.Neighbours.Batadv[bfaceAddr] = n
|
|
|
|
}
|
|
|
|
}
|
2019-04-10 13:18:05 +02:00
|
|
|
}
|