Skip to content

Q: how to access IPv6 ext headers? #900

@hujun-open

Description

@hujun-open

Hi,
since gopacket doesn't provide any IP fragmentation support, I want to write one, however after reading the layers.IPv6 doc, I can't figure out how gopacket handle the IPv6 ext headers, there is only a HopByHop field in the struct, how does user access other v6 ext header like routing header after using gopacket.NewPacket() ?

type IPv6 struct {
	// http://www.networksorcery.com/enp/protocol/ipv6.htm
	BaseLayer
	Version      uint8
	TrafficClass uint8
	FlowLabel    uint32
	Length       uint16
	NextHeader   IPProtocol
	HopLimit     uint8
	SrcIP        net.IP
	DstIP        net.IP
	HopByHop     *IPv6HopByHop
	// contains filtered or unexported fields
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions