add names for well-known multicast addresses and cap sacn universes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Ian Gulliver
2026-01-23 07:02:47 -08:00
parent c12e8c0933
commit c2318279bf

View File

@@ -144,11 +144,25 @@ func (g *MulticastGroup) Name() string {
return g.IP.String() return g.IP.String()
} }
if ip[0] == 239 && ip[1] == 255 { // Well-known multicast addresses
universe := int(ip[2])*256 + int(ip[3]) switch g.IP.String() {
return fmt.Sprintf("sacn:%d", universe) case "224.0.0.251":
return "mdns"
case "224.0.1.129":
return "ptp"
case "224.2.127.254":
return "sap"
} }
// sACN (239.255.x.x, universes 1-63999)
if ip[0] == 239 && ip[1] == 255 {
universe := int(ip[2])*256 + int(ip[3])
if universe >= 1 && universe <= 63999 {
return fmt.Sprintf("sacn:%d", universe)
}
}
// Dante audio multicast (239.69-71.x.x)
if ip[0] == 239 && ip[1] >= 69 && ip[1] <= 71 { if ip[0] == 239 && ip[1] >= 69 && ip[1] <= 71 {
flowID := (int(ip[1]-69) << 16) | (int(ip[2]) << 8) | int(ip[3]) flowID := (int(ip[1]-69) << 16) | (int(ip[2]) << 8) | int(ip[3])
return fmt.Sprintf("dante-mcast:%d", flowID) return fmt.Sprintf("dante-mcast:%d", flowID)