// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package ipv4

// TOS returns the type-of-service field value for outgoing packets.
func ( *genericOpt) () (int, error) {
	if !.ok() {
		return 0, errInvalidConn
	}
	,  := sockOpts[ssoTOS]
	if ! {
		return 0, errNotImplemented
	}
	return .GetInt(.Conn)
}

// SetTOS sets the type-of-service field value for future outgoing
// packets.
func ( *genericOpt) ( int) error {
	if !.ok() {
		return errInvalidConn
	}
	,  := sockOpts[ssoTOS]
	if ! {
		return errNotImplemented
	}
	return .SetInt(.Conn, )
}

// TTL returns the time-to-live field value for outgoing packets.
func ( *genericOpt) () (int, error) {
	if !.ok() {
		return 0, errInvalidConn
	}
	,  := sockOpts[ssoTTL]
	if ! {
		return 0, errNotImplemented
	}
	return .GetInt(.Conn)
}

// SetTTL sets the time-to-live field value for future outgoing
// packets.
func ( *genericOpt) ( int) error {
	if !.ok() {
		return errInvalidConn
	}
	,  := sockOpts[ssoTTL]
	if ! {
		return errNotImplemented
	}
	return .SetInt(.Conn, )
}