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.
9 // TrafficClass returns the traffic class field value for outgoing
11 func (c *genericOpt) TrafficClass() (int, error) {
13 return 0, syscall.EINVAL
15 so, ok := sockOpts[ssoTrafficClass]
17 return 0, errOpNoSupport
19 return so.GetInt(c.Conn)
22 // SetTrafficClass sets the traffic class field value for future
24 func (c *genericOpt) SetTrafficClass(tclass int) error {
28 so, ok := sockOpts[ssoTrafficClass]
32 return so.SetInt(c.Conn, tclass)
35 // HopLimit returns the hop limit field value for outgoing packets.
36 func (c *genericOpt) HopLimit() (int, error) {
38 return 0, syscall.EINVAL
40 so, ok := sockOpts[ssoHopLimit]
42 return 0, errOpNoSupport
44 return so.GetInt(c.Conn)
47 // SetHopLimit sets the hop limit field value for future outgoing
49 func (c *genericOpt) SetHopLimit(hoplim int) error {
53 so, ok := sockOpts[ssoHopLimit]
57 return so.SetInt(c.Conn, hoplim)