Priority support (#964)

* Allow setting link priorities

* Fix a bug

* Allow setting priority on listeners and multicast interfaces

* Update `yggdrasilctl`

* Update to Arceliar/ironwood#5
This commit is contained in:
Neil Alexander 2022-10-26 09:24:24 +01:00 committed by GitHub
parent 9a9452dcc8
commit f08dec822a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 79 additions and 56 deletions

View file

@ -335,10 +335,11 @@ func run(args yggArgs, ctx context.Context) {
options := []multicast.SetupOption{}
for _, intf := range cfg.MulticastInterfaces {
options = append(options, multicast.MulticastInterface{
Regex: regexp.MustCompile(intf.Regex),
Beacon: intf.Beacon,
Listen: intf.Listen,
Port: intf.Port,
Regex: regexp.MustCompile(intf.Regex),
Beacon: intf.Beacon,
Listen: intf.Listen,
Port: intf.Port,
Priority: intf.Priority,
})
}
if n.multicast, err = multicast.New(n.core, logger, options...); err != nil {

View file

@ -174,7 +174,7 @@ func run() int {
if err := json.Unmarshal(recv.Response, &resp); err != nil {
panic(err)
}
table.SetHeader([]string{"Port", "Public Key", "IP Address", "Uptime", "RX", "TX", "URI"})
table.SetHeader([]string{"Port", "Public Key", "IP Address", "Uptime", "RX", "TX", "Pr", "URI"})
for _, peer := range resp.Peers {
table.Append([]string{
fmt.Sprintf("%d", peer.Port),
@ -183,6 +183,7 @@ func run() int {
(time.Duration(peer.Uptime) * time.Second).String(),
peer.RXBytes.String(),
peer.TXBytes.String(),
fmt.Sprintf("%d", peer.Priority),
peer.Remote,
})
}