gopacket_gtp

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

README

gopacket-gtp

gopacket (v1.1.19) is not serializing GTP Extension Headers in the right way. Extension Headers are appended to the buffer in multiple times instead of allocating the right size directly. This results in a malformed packet since the extension ends up after the payload.

This fork indends to fix this.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GTPExtensionHeader

type GTPExtensionHeader struct {
	Type    uint8
	Content []byte
}

GTPExtensionHeader is used to carry extra data and enable future extensions of the GTP without the need to use another version number.

type GTPv1U

type GTPv1U struct {
	layers.BaseLayer
	Version             uint8
	ProtocolType        uint8
	Reserved            uint8
	ExtensionHeaderFlag bool
	SequenceNumberFlag  bool
	NPDUFlag            bool
	MessageType         uint8
	MessageLength       uint16
	TEID                uint32
	SequenceNumber      uint16
	NPDU                uint8
	GTPExtensionHeaders []GTPExtensionHeader
}

GTPv1U protocol is used to exchange user data over GTP tunnels across the Sx interfaces. Defined in https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1595

func (*GTPv1U) CanDecode

func (g *GTPv1U) CanDecode() gopacket.LayerClass

CanDecode returns a set of layers that GTP objects can decode.

func (*GTPv1U) DecodeFromBytes

func (g *GTPv1U) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes analyses a byte slice and attempts to decode it as a GTPv1U packet

func (*GTPv1U) LayerType

func (g *GTPv1U) LayerType() gopacket.LayerType

LayerType returns LayerTypeGTPV1U

func (*GTPv1U) NextLayerType

func (g *GTPv1U) NextLayerType() gopacket.LayerType

NextLayerType specifies the next layer that GoPacket should attempt to

func (*GTPv1U) SerializeTo

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

Jump to

Keyboard shortcuts

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