mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2024-11-23 18:15:24 +00:00
f08dec822a
* Allow setting link priorities * Fix a bug * Allow setting priority on listeners and multicast interfaces * Update `yggdrasilctl` * Update to Arceliar/ironwood#5
30 lines
524 B
Go
30 lines
524 B
Go
package multicast
|
|
|
|
import "regexp"
|
|
|
|
func (m *Multicast) _applyOption(opt SetupOption) {
|
|
switch v := opt.(type) {
|
|
case MulticastInterface:
|
|
m.config._interfaces[v] = struct{}{}
|
|
case GroupAddress:
|
|
m.config._groupAddr = v
|
|
}
|
|
}
|
|
|
|
type SetupOption interface {
|
|
isSetupOption()
|
|
}
|
|
|
|
type MulticastInterface struct {
|
|
Regex *regexp.Regexp
|
|
Beacon bool
|
|
Listen bool
|
|
Port uint16
|
|
Priority uint8
|
|
}
|
|
|
|
type GroupAddress string
|
|
|
|
func (a MulticastInterface) isSetupOption() {}
|
|
func (a GroupAddress) isSetupOption() {}
|