All that cgo crap compiles!

This commit is contained in:
Adam Ierymenko 2019-09-22 00:06:07 -07:00
commit ccc9be2d4d
No known key found for this signature in database
GPG key ID: C8877CF2D7A5D7F3
3 changed files with 107 additions and 39 deletions

View file

@ -18,3 +18,15 @@ type MulticastGroup struct {
MAC MAC
ADI uint32
}
// 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))
}
// key returns an array usable as a key for a map[]
func (mg *MulticastGroup) key() (k [2]uint64) {
k[0] = uint64(mg.MAC)
k[1] = uint64(mg.ADI)
return
}