gopacket_srv6

package module
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2023 License: BSD-3-Clause Imports: 5 Imported by: 1

README

gopacket-srv6

gopacket (v1.1.19) is missing decoder and encoder for IPv6Routing Extension with RoutingType = 4 (SRv6) This file module is a patch to enable using gopacket with SRv6.

For information, here are some related PRs:

  • 703 : implementation of SRv6 extension header decoding (LastEntry, Flags and Tag are missing)
  • 879 : implementation of SRv6 extension header decoding
  • 889 : implementation of SRv6 extension header decoding
  • 1040 : implementation of SRv6 extension header decoding + serialization

Nota: For the decoding part, this code is based on PR 1040, by Takanori Hirano and Gernot Vormayr.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LayerTypeIPv6Routing = gopacket.OverrideLayerType(47, gopacket.LayerTypeMetadata{Name: "IPv6Routing", Decoder: gopacket.DecodeFunc(decodeIPv6Routing)})

Register our decoding function to use it instead of gopacket's one

Functions

This section is empty.

Types

type GopacketIpv6ExtensionBase added in v0.0.6

type GopacketIpv6ExtensionBase struct {
	layers.BaseLayer
	NextHeader   layers.IPProtocol
	HeaderLength uint8
	ActualLength int
}

Copy of ipv6ExtensionBase from gopacket's layers/ip6.go

type IPv6Routing

type IPv6Routing struct {
	GopacketIpv6ExtensionBase
	RoutingType      uint8
	SegmentsLeft     uint8
	Reserved         []byte // only for RoutingType != 4
	LastEntry        uint8
	Flags            uint8
	Tag              uint16
	SourceRoutingIPs []net.IP // Segment List
}

Copy of IPv6Routing from gopacket's layers/ip6.go with the following modifications: - Added SRv6 Fields (`LastEntry`, `Flags`, `Tag`)

func (*IPv6Routing) DecodeFromBytes

func (i *IPv6Routing) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

Copy of DecodeFromBytes from PR 1040

func (*IPv6Routing) LayerType

func (i *IPv6Routing) LayerType() gopacket.LayerType

Copy of LayerType method from gopacket's layers/ip6.go

func (*IPv6Routing) SerializeTo

Copy of SerializeTo from PR 1040

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL