Beispiel #1
0
func setIPv4MulticastTTL(fd int, v int) error {
	err := syscall.SetsockoptByte(fd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_TTL, byte(v))
	if err != nil {
		return os.NewSyscallError("setsockopt", err)
	}
	return nil
}
Beispiel #2
0
func setIPv4MulticastLoopback(fd int, v bool) error {
	err := syscall.SetsockoptByte(fd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_LOOP, byte(boolint(v)))
	if err != nil {
		return os.NewSyscallError("setsockopt", err)
	}
	return nil
}
Beispiel #3
0
func setIPv4MulticastLoopback(fd *netFD, v bool) error {
	if err := fd.incref(); err != nil {
		return err
	}
	defer fd.decref()
	return os.NewSyscallError("setsockopt", syscall.SetsockoptByte(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_LOOP, byte(boolint(v))))
}
Beispiel #4
0
func setIPv4MulticastTTL(fd *netFD, v int) error {
	fd.incref()
	defer fd.decref()
	err := syscall.SetsockoptByte(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_TTL, byte(v))
	if err != nil {
		return os.NewSyscallError("setsockopt", err)
	}
	return nil
}
Beispiel #5
0
func setIPv4MulticastLoopback(fd int, v bool) error {
	return os.NewSyscallError("setsockopt", syscall.SetsockoptByte(fd, ianaProtocolIP, syscall.IP_MULTICAST_LOOP, byte(boolint(v))))
}
Beispiel #6
0
func setIPv4MulticastTTL(fd int, v int) error {
	return os.NewSyscallError("setsockopt", syscall.SetsockoptByte(fd, ianaProtocolIP, syscall.IP_MULTICAST_TTL, byte(v)))
}
Beispiel #7
0
func setIPv4MulticastLoopback(fd int, v bool) error {
	return syscall.SetsockoptByte(fd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_LOOP, byte(boolint(v)))
}