Esempio n. 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
}
Esempio n. 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
}
Esempio n. 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))))
}
Esempio n. 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
}
Esempio n. 5
0
func setIPv4MulticastLoopback(fd int, v bool) error {
	return os.NewSyscallError("setsockopt", syscall.SetsockoptByte(fd, ianaProtocolIP, syscall.IP_MULTICAST_LOOP, byte(boolint(v))))
}
Esempio n. 6
0
func setIPv4MulticastTTL(fd int, v int) error {
	return os.NewSyscallError("setsockopt", syscall.SetsockoptByte(fd, ianaProtocolIP, syscall.IP_MULTICAST_TTL, byte(v)))
}
Esempio n. 7
0
func setIPv4MulticastLoopback(fd int, v bool) error {
	return syscall.SetsockoptByte(fd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_LOOP, byte(boolint(v)))
}