func (b IPv6) SetDestinationAddress(addr tcpip.Address) {
	copy(b[v6DstAddr:v6DstAddr+IPv6AddressSize], addr)
}
SetDestinationAddress sets the "destination address" field of the ipv6
header.
package header
import (
	"encoding/binary"
	"strings"
	tcpip "github.com/brewlin/net-protocol/protocol"
)
const (
	versTCFL   = 0
	payloadLen = 4
	nextHdr    = 6
	hopLimit   = 7
	v6SrcAddr  = 8
	v6DstAddr  = 24
)
type IPv6Fields struct {
	TrafficClass uint8
	FlowLabel uint32
	PayloadLength uint16
	NextHeader uint8
	HopLimit uint8
	SrcAddr tcpip.Address
	DstAddr tcpip.Address
}
type IPv6 []byte
const (
	IPv6MinimumSize = 40
	IPv6AddressSize = 16
	IPv6ProtocolNumber tcpip.NetworkProtocolNumber = 0x86dd
	IPv6Version = 6
	IPv6MinimumMTU = 1280
)
func (b IPv6) PayloadLength() uint16 {
	return binary.BigEndian.Uint16(b[payloadLen:])
}
func (b IPv6) HopLimit() uint8 {
	return b[hopLimit]
}
func (b IPv6) NextHeader() uint8 {
	return b[nextHdr]
}
func (b IPv6) TransportProtocol() tcpip.TransportProtocolNumber {
	return tcpip.TransportProtocolNumber(b.NextHeader())
}
func (b IPv6) Payload() []byte {
	return b[IPv6MinimumSize:][:b.PayloadLength()]
}
func (b IPv6) SourceAddress() tcpip.Address {
	return tcpip.Address(b[v6SrcAddr : v6SrcAddr+IPv6AddressSize])
}
func (b IPv6) DestinationAddress() tcpip.Address {
	return tcpip.Address(b[v6DstAddr : v6DstAddr+IPv6AddressSize])
}
func (IPv6) Checksum() uint16 {
	return 0
}
func (b IPv6) TOS() (uint8, uint32) {
	v := binary.BigEndian.Uint32(b[versTCFL:])
	return uint8(v >> 20), v & 0xfffff
}
func (b IPv6) SetTOS(t uint8, l uint32) {
	vtf := (6 << 28) | (uint32(t) << 20) | (l & 0xfffff)
	binary.BigEndian.PutUint32(b[versTCFL:], vtf)
}
func (b IPv6) SetPayloadLength(payloadLength uint16) {
	binary.BigEndian.PutUint16(b[payloadLen:], payloadLength)
}
func (b IPv6) SetSourceAddress(addr tcpip.Address) {
	copy(b[v6SrcAddr:v6SrcAddr+IPv6AddressSize], addr)
}