// Copyright 2013 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 ipv6

// TrafficClass returns the traffic class field value for outgoing
// packets.
func ( *genericOpt) () (int, error) {
	if !.ok() {
		return 0, errInvalidConn
	}
	,  := sockOpts[ssoTrafficClass]
	if ! {
		return 0, errNotImplemented
	}
	return .GetInt(.Conn)
}

// SetTrafficClass sets the traffic class field value for future
// outgoing packets.
func ( *genericOpt) ( int) error {
	if !.ok() {
		return errInvalidConn
	}
	,  := sockOpts[ssoTrafficClass]
	if ! {
		return errNotImplemented
	}
	return .SetInt(.Conn, )
}

// HopLimit returns the hop limit field value for outgoing packets.
func ( *genericOpt) () (int, error) {
	if !.ok() {
		return 0, errInvalidConn
	}
	,  := sockOpts[ssoHopLimit]
	if ! {
		return 0, errNotImplemented
	}
	return .GetInt(.Conn)
}

// SetHopLimit sets the hop limit field value for future outgoing
// packets.
func ( *genericOpt) ( int) error {
	if !.ok() {
		return errInvalidConn
	}
	,  := sockOpts[ssoHopLimit]
	if ! {
		return errNotImplemented
	}
	return .SetInt(.Conn, )
}