mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-20 05:13:58 -07:00
.
This commit is contained in:
parent
105023bd87
commit
9c37fc1a5f
3 changed files with 19 additions and 0 deletions
|
@ -13,12 +13,19 @@
|
|||
|
||||
package zerotier
|
||||
|
||||
import "fmt"
|
||||
|
||||
// MulticastGroup represents a normal Ethernet multicast or broadcast address plus 32 additional ZeroTier-specific bits
|
||||
type MulticastGroup struct {
|
||||
MAC MAC
|
||||
ADI uint32
|
||||
}
|
||||
|
||||
// String returns MAC#ADI
|
||||
func (mg *MulticastGroup) String() string {
|
||||
return fmt.Sprintf("%s#%.8x", mg.MAC.String(), mg.ADI)
|
||||
}
|
||||
|
||||
// Less returns true if this MulticastGroup is less than another.
|
||||
func (mg *MulticastGroup) Less(mg2 *MulticastGroup) bool {
|
||||
return (mg.MAC < mg2.MAC || (mg.MAC == mg2.MAC && mg.ADI < mg2.ADI))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue