1 // Copyright 2012 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 // TOS returns the type-of-service field value for outgoing packets.
10 func (c *genericOpt) TOS() (int, error) {
12 return 0, syscall.EINVAL
14 so, ok := sockOpts[ssoTOS]
16 return 0, errOpNoSupport
18 return so.GetInt(c.Conn)
21 // SetTOS sets the type-of-service field value for future outgoing
23 func (c *genericOpt) SetTOS(tos int) error {
27 so, ok := sockOpts[ssoTOS]
31 return so.SetInt(c.Conn, tos)
34 // TTL returns the time-to-live field value for outgoing packets.
35 func (c *genericOpt) TTL() (int, error) {
37 return 0, syscall.EINVAL
39 so, ok := sockOpts[ssoTTL]
41 return 0, errOpNoSupport
43 return so.GetInt(c.Conn)
46 // SetTTL sets the time-to-live field value for future outgoing
48 func (c *genericOpt) SetTTL(ttl int) error {
52 so, ok := sockOpts[ssoTTL]
56 return so.SetInt(c.Conn, ttl)