func (i *ICMPv6RouterAdvertisement) LayerType() gopacket.LayerType {
	return LayerTypeICMPv6RouterAdvertisement
}
LayerType returns LayerTypeICMPv6RouterAdvertisement.
package layers
import (
	"encoding/binary"
	"encoding/hex"
	"errors"
	"fmt"
	"net"
	"time"
	"github.com/google/gopacket"
)
type ICMPv6Opt uint8
const (
	_ ICMPv6Opt = iota
	ICMPv6OptSourceAddress
	ICMPv6OptTargetAddress
	ICMPv6OptPrefixInfo
	ICMPv6OptRedirectedHeader
	ICMPv6OptMTU
)
type ICMPv6Echo struct {
	BaseLayer
	Identifier uint16
	SeqNumber  uint16
}
type ICMPv6RouterSolicitation struct {
	BaseLayer
	Options ICMPv6Options
}
type ICMPv6RouterAdvertisement struct {
	BaseLayer
	HopLimit       uint8
	Flags          uint8
	RouterLifetime uint16
	ReachableTime  uint32
	RetransTimer   uint32
	Options        ICMPv6Options
}
type ICMPv6NeighborSolicitation struct {
	BaseLayer
	TargetAddress net.IP
	Options       ICMPv6Options
}
type ICMPv6NeighborAdvertisement struct {
	BaseLayer
	Flags         uint8
	TargetAddress net.IP
	Options       ICMPv6Options
}
type ICMPv6Redirect struct {
	BaseLayer
	TargetAddress      net.IP
	DestinationAddress net.IP
	Options            ICMPv6Options
}
type ICMPv6Option struct {
	Type ICMPv6Opt
	Data []byte
}
type ICMPv6Options []ICMPv6Option
func (i ICMPv6Opt) String() string {
	switch i {
	case ICMPv6OptSourceAddress:
		return "SourceAddress"
	case ICMPv6OptTargetAddress:
		return "TargetAddress"
	case ICMPv6OptPrefixInfo:
		return "PrefixInfo"
	case ICMPv6OptRedirectedHeader:
		return "RedirectedHeader"
	case ICMPv6OptMTU:
		return "MTU"
	default:
		return fmt.Sprintf("Unknown(%d)", i)
	}
}
func (i *ICMPv6Echo) CanDecode() gopacket.LayerClass {
	return LayerTypeICMPv6Echo
}
func (i *ICMPv6Echo) LayerType() gopacket.LayerType {
	return LayerTypeICMPv6Echo
}
func (i *ICMPv6Echo) NextLayerType() gopacket.LayerType {
	return gopacket.LayerTypePayload
}
func (i *ICMPv6Echo) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error {
	if len(data) < 4 {
		df.SetTruncated()
		return errors.New("ICMP layer less then 4 bytes for ICMPv6 Echo")
	}
	i.Identifier = binary.BigEndian.Uint16(data[0:2])
	i.SeqNumber = binary.BigEndian.Uint16(data[2:4])
	return nil
}
func (i *ICMPv6Echo) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error {
	buf, err := b.PrependBytes(4)
	if err != nil {
		return err
	}
	binary.BigEndian.PutUint16(buf, i.Identifier)
	binary.BigEndian.PutUint16(buf[2:], i.SeqNumber)
	return nil
}
func (i *ICMPv6RouterSolicitation) LayerType() gopacket.LayerType {
	return LayerTypeICMPv6RouterSolicitation
}
func (i *ICMPv6RouterSolicitation) NextLayerType() gopacket.LayerType {
	return gopacket.LayerTypePayload
}
func (i *ICMPv6RouterSolicitation) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error {
	if len(data) < 4 {
		df.SetTruncated()
		return errors.New("ICMP layer less then 4 bytes for ICMPv6 router solicitation")
	}
	i.Options = i.Options[:0]
	return i.Options.DecodeFromBytes(data[4:], df)
}
func (i *ICMPv6RouterSolicitation) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error {
	if err := i.Options.SerializeTo(b, opts); err != nil {
		return err
	}
	buf, err := b.PrependBytes(4)
	if err != nil {
		return err
	}
	copy(buf, lotsOfZeros[:4])
	return nil
}
func (i *ICMPv6RouterSolicitation) CanDecode() gopacket.LayerClass {
	return LayerTypeICMPv6RouterSolicitation
}