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

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Robie Basak
  • Date: 2015-07-15 13:09:07 UTC
  • mfrom: (35.1.15 wily-proposed)
  • Revision ID: package-import@ubuntu.com-20150715130907-wqak1zpebzzdvy3q
Tags: 1.22.6-0ubuntu1~14.04.1
* No change backport to 14.04 (LP: #1469744). This results in the
  following packaging delta from the previous 1.20.11-0ubuntu0.14.04.1
  in trusty-updates:
  - distro-info added and libgo5 removed from Build-Depends.
  - Standards-Version bumped.
  - cloud-image-utils | cloud-utils added to juju-local Depends.
  - d/copyright updated.
  - dep8 tests updated.

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
 
// +build darwin freebsd linux netbsd openbsd windows
6
 
 
7
 
package ipv6
8
 
 
9
 
import "syscall"
10
 
 
11
 
// TrafficClass returns the traffic class field value for outgoing
12
 
// packets.
13
 
func (c *genericOpt) TrafficClass() (int, error) {
14
 
        if !c.ok() {
15
 
                return 0, syscall.EINVAL
16
 
        }
17
 
        fd, err := c.sysfd()
18
 
        if err != nil {
19
 
                return 0, err
20
 
        }
21
 
        return ipv6TrafficClass(fd)
22
 
}
23
 
 
24
 
// SetTrafficClass sets the traffic class field value for future
25
 
// outgoing packets.
26
 
func (c *genericOpt) SetTrafficClass(tclass int) error {
27
 
        if !c.ok() {
28
 
                return syscall.EINVAL
29
 
        }
30
 
        fd, err := c.sysfd()
31
 
        if err != nil {
32
 
                return err
33
 
        }
34
 
        return setIPv6TrafficClass(fd, tclass)
35
 
}
36
 
 
37
 
// HopLimit returns the hop limit field value for outgoing packets.
38
 
func (c *genericOpt) HopLimit() (int, error) {
39
 
        if !c.ok() {
40
 
                return 0, syscall.EINVAL
41
 
        }
42
 
        fd, err := c.sysfd()
43
 
        if err != nil {
44
 
                return 0, err
45
 
        }
46
 
        return ipv6HopLimit(fd)
47
 
}
48
 
 
49
 
// SetHopLimit sets the hop limit field value for future outgoing
50
 
// packets.
51
 
func (c *genericOpt) SetHopLimit(hoplim int) error {
52
 
        if !c.ok() {
53
 
                return syscall.EINVAL
54
 
        }
55
 
        fd, err := c.sysfd()
56
 
        if err != nil {
57
 
                return err
58
 
        }
59
 
        return setIPv6HopLimit(fd, hoplim)
60
 
}