func setIPv4MulticastInterface(fd int, ifi *net.Interface) error { var mreqn syscall.IPMreqn if ifi != nil { mreqn.Ifindex = int32(ifi.Index) } return os.NewSyscallError("setsockopt", syscall.SetsockoptIPMreqn(fd, ianaProtocolIP, sysSockoptMulticastInterface, &mreqn)) }
func leaveIPv4Group(fd int, ifi *net.Interface, grp net.IP) error { mreqn := syscall.IPMreqn{Multiaddr: [4]byte{grp[0], grp[1], grp[2], grp[3]}} if ifi != nil { mreqn.Ifindex = int32(ifi.Index) } return os.NewSyscallError("setsockopt", syscall.SetsockoptIPMreqn(fd, ianaProtocolIP, sysSockoptLeaveGroup, &mreqn)) }
func setIPv4MulticastInterface(fd int, ifi *net.Interface) error { mreqn := syscall.IPMreqn{} if ifi != nil { mreqn.Ifindex = int32(ifi.Index) } return os.NewSyscallError("setsockopt", syscall.SetsockoptIPMreqn(fd, ianaProtocolIP, syscall.IP_MULTICAST_IF, &mreqn)) }