~ubuntu-branches/ubuntu/saucy/juju-core/saucy-proposed

« back to all changes in this revision

Viewing changes to src/code.google.com/p/go.net/ipv6/sockopt_rfc2292_darwin.go

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-07-11 17:18:27 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20130711171827-vjqkg40r0dlf7ys2
Tags: 1.11.2-0ubuntu1
* New upstream release.
* Make juju-core the default juju (LP: #1190634):
  - d/control: Add virtual package juju -> juju-core.
  - d/juju-core.postinst.in: Bump priority of alternatives over that of
    python juju packages.
* Enable for all architectures (LP: #1172505):
  - d/control: Version BD on golang-go to >= 2:1.1.1 to ensure CGO
    support for non-x86 archs, make juju-core Arch: any.
  - d/README.source: Dropped - no longer required.
* d/watch: Updated for new upstream tarball naming.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2013 The Go Authors.  All rights reserved.
 
2
// Use of this source code is governed by a BSD-style
 
3
// license that can be found in the LICENSE file.
 
4
 
 
5
package ipv6
 
6
 
 
7
import (
 
8
        "os"
 
9
        "syscall"
 
10
)
 
11
 
 
12
func ipv6ReceiveTrafficClass(fd int) (bool, error) {
 
13
        return false, errNotSupported
 
14
}
 
15
 
 
16
func setIPv6ReceiveTrafficClass(fd int, v bool) error {
 
17
        return errNotSupported
 
18
}
 
19
 
 
20
func ipv6ReceiveHopLimit(fd int) (bool, error) {
 
21
        v, err := syscall.GetsockoptInt(fd, ianaProtocolIPv6, syscall.IPV6_2292HOPLIMIT)
 
22
        if err != nil {
 
23
                return false, os.NewSyscallError("getsockopt", err)
 
24
        }
 
25
        return v == 1, nil
 
26
}
 
27
 
 
28
func setIPv6ReceiveHopLimit(fd int, v bool) error {
 
29
        return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd, ianaProtocolIPv6, syscall.IPV6_2292HOPLIMIT, boolint(v)))
 
30
}
 
31
 
 
32
func ipv6ReceivePacketInfo(fd int) (bool, error) {
 
33
        v, err := syscall.GetsockoptInt(fd, ianaProtocolIPv6, syscall.IPV6_2292PKTINFO)
 
34
        if err != nil {
 
35
                return false, os.NewSyscallError("getsockopt", err)
 
36
        }
 
37
        return v == 1, nil
 
38
}
 
39
 
 
40
func setIPv6ReceivePacketInfo(fd int, v bool) error {
 
41
        return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd, ianaProtocolIPv6, syscall.IPV6_2292PKTINFO, boolint(v)))
 
42
}
 
43
 
 
44
func ipv6PathMTU(fd int) (int, error) {
 
45
        return 0, errNotSupported
 
46
}
 
47
 
 
48
func ipv6ReceivePathMTU(fd int) (bool, error) {
 
49
        return false, errNotSupported
 
50
}
 
51
 
 
52
func setIPv6ReceivePathMTU(fd int, v bool) error {
 
53
        return errNotSupported
 
54
}
 
55
 
 
56
func ipv6ICMPFilter(fd int) (*ICMPFilter, error) {
 
57
        v, err := syscall.GetsockoptICMPv6Filter(fd, ianaProtocolIPv6ICMP, syscall.ICMP6_FILTER)
 
58
        if err != nil {
 
59
                return nil, os.NewSyscallError("getsockopt", err)
 
60
        }
 
61
        return &ICMPFilter{rawICMPFilter: rawICMPFilter{*v}}, nil
 
62
}
 
63
 
 
64
func setIPv6ICMPFilter(fd int, f *ICMPFilter) error {
 
65
        return os.NewSyscallError("setsockopt", syscall.SetsockoptICMPv6Filter(fd, ianaProtocolIPv6ICMP, syscall.ICMP6_FILTER, &f.rawICMPFilter.ICMPv6Filter))
 
66
}