diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-23 04:31:11 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-23 04:31:11 +0000 |
commit | fb08d0057f91d420b6f48c112264fc87dc91b532 (patch) | |
tree | 46bb86f514fbf6bad82da48e69a18fb09d878834 /libgo/go/net/sockoptip_linux.go | |
parent | f507227a181bb31fa87d23a082485f99f3ef9183 (diff) | |
download | gcc-fb08d0057f91d420b6f48c112264fc87dc91b532.tar.gz |
libgo: Update to current sources.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192704 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/go/net/sockoptip_linux.go')
-rw-r--r-- | libgo/go/net/sockoptip_linux.go | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/libgo/go/net/sockoptip_linux.go b/libgo/go/net/sockoptip_linux.go index 169718f14aa..225fb0c4c6c 100644 --- a/libgo/go/net/sockoptip_linux.go +++ b/libgo/go/net/sockoptip_linux.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// IP-level socket options for Linux - package net import ( @@ -11,21 +9,6 @@ import ( "syscall" ) -func ipv4MulticastInterface(fd *netFD) (*Interface, error) { - if err := fd.incref(false); err != nil { - return nil, err - } - defer fd.decref() - mreq, err := syscall.GetsockoptIPMreqn(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_IF) - if err != nil { - return nil, os.NewSyscallError("getsockopt", err) - } - if int(mreq.Ifindex) == 0 { - return nil, nil - } - return InterfaceByIndex(int(mreq.Ifindex)) -} - func setIPv4MulticastInterface(fd *netFD, ifi *Interface) error { var v int32 if ifi != nil { @@ -43,42 +26,6 @@ func setIPv4MulticastInterface(fd *netFD, ifi *Interface) error { return nil } -func ipv4MulticastTTL(fd *netFD) (int, error) { - if err := fd.incref(false); err != nil { - return 0, err - } - defer fd.decref() - v, err := syscall.GetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_TTL) - if err != nil { - return -1, os.NewSyscallError("getsockopt", err) - } - return v, nil -} - -func setIPv4MulticastTTL(fd *netFD, v int) error { - if err := fd.incref(false); err != nil { - return err - } - defer fd.decref() - err := syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_TTL, v) - if err != nil { - return os.NewSyscallError("setsockopt", err) - } - return nil -} - -func ipv4MulticastLoopback(fd *netFD) (bool, error) { - if err := fd.incref(false); err != nil { - return false, err - } - defer fd.decref() - v, err := syscall.GetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_LOOP) - if err != nil { - return false, os.NewSyscallError("getsockopt", err) - } - return v == 1, nil -} - func setIPv4MulticastLoopback(fd *netFD, v bool) error { if err := fd.incref(false); err != nil { return err @@ -90,51 +37,3 @@ func setIPv4MulticastLoopback(fd *netFD, v bool) error { } return nil } - -func ipv4ReceiveInterface(fd *netFD) (bool, error) { - if err := fd.incref(false); err != nil { - return false, err - } - defer fd.decref() - v, err := syscall.GetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_PKTINFO) - if err != nil { - return false, os.NewSyscallError("getsockopt", err) - } - return v == 1, nil -} - -func setIPv4ReceiveInterface(fd *netFD, v bool) error { - if err := fd.incref(false); err != nil { - return err - } - defer fd.decref() - err := syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_PKTINFO, boolint(v)) - if err != nil { - return os.NewSyscallError("setsockopt", err) - } - return nil -} - -func ipv6TrafficClass(fd *netFD) (int, error) { - if err := fd.incref(false); err != nil { - return 0, err - } - defer fd.decref() - v, err := syscall.GetsockoptInt(fd.sysfd, syscall.IPPROTO_IPV6, syscall.IPV6_TCLASS) - if err != nil { - return 0, os.NewSyscallError("getsockopt", err) - } - return v, nil -} - -func setIPv6TrafficClass(fd *netFD, v int) error { - if err := fd.incref(false); err != nil { - return err - } - defer fd.decref() - err := syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_IPV6, syscall.IPV6_TCLASS, v) - if err != nil { - return os.NewSyscallError("setsockopt", err) - } - return nil -} |