Example #1
0
func ipv4MulticastLoopback(fd int) (bool, error) {
	v, err := syscall.GetsockoptByte(fd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_LOOP)
	if err != nil {
		return false, os.NewSyscallError("getsockopt", err)
	}
	return v == 1, nil
}
Example #2
0
func ipv4MulticastTTL(fd int) (int, error) {
	v, err := syscall.GetsockoptByte(fd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_TTL)
	if err != nil {
		return 0, os.NewSyscallError("getsockopt", err)
	}
	return int(v), nil
}
Example #3
0
func ipv4MulticastLoopback(fd int) (bool, error) {
	v, err := syscall.GetsockoptByte(fd, ianaProtocolIP, sysSockoptMulticastLoopback)
	if err != nil {
		return false, os.NewSyscallError("getsockopt", err)
	}
	return v == 1, nil
}
Example #4
0
func ipv4MulticastTTL(fd int) (int, error) {
	v, err := syscall.GetsockoptByte(fd, ianaProtocolIP, sysSockoptMulticastTTL)
	if err != nil {
		return 0, os.NewSyscallError("getsockopt", err)
	}
	return int(v), nil
}
Example #5
0
func ipv4MulticastTTL(fd *netFD) (int, error) {
	fd.incref()
	defer fd.decref()
	v, err := syscall.GetsockoptByte(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_TTL)
	if err != nil {
		return -1, os.NewSyscallError("getsockopt", err)
	}
	return int(v), nil
}
Example #6
0
func ipv4MulticastLoopback(fd *netFD) (bool, error) {
	fd.incref()
	defer fd.decref()
	v, err := syscall.GetsockoptByte(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_LOOP)
	if err != nil {
		return false, os.NewSyscallError("getsockopt", err)
	}
	return v == 1, nil
}