Link cost-aware routing

This commit is contained in:
Neil Alexander 2024-02-01 22:23:16 +00:00
parent 5ea16e63a1
commit bfdcf0762f
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
8 changed files with 53 additions and 6 deletions

View file

@ -174,7 +174,7 @@ func run() int {
if err := json.Unmarshal(recv.Response, &resp); err != nil {
panic(err)
}
table.SetHeader([]string{"URI", "State", "Dir", "IP Address", "Uptime", "RTT", "RX", "TX", "Pr", "Last Error"})
table.SetHeader([]string{"URI", "State", "Dir", "IP Address", "Uptime", "RTT", "RX", "TX", "Pr", "Cost", "Last Error"})
for _, peer := range resp.Peers {
state, lasterr, dir, rtt := "Up", "-", "Out", "-"
if !peer.Up {
@ -200,6 +200,7 @@ func run() int {
peer.RXBytes.String(),
peer.TXBytes.String(),
fmt.Sprintf("%d", peer.Priority),
fmt.Sprintf("%d", peer.Cost),
lasterr,
})
}