pfcp

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OuterHeaderCreationFields

type OuterHeaderCreationFields struct {
	OuterHeaderCreationDescription uint16
	TEID                           uint32
	IPv4Address                    net.IP
	IPv6Address                    net.IP
	PortNumber                     uint16
	CTag                           uint32
	STag                           uint32
}

OuterHeaderCreationFields represents parsed Outer Header Creation IE fields. This local implementation explicitly handles 3-byte C-TAG/S-TAG fields as defined for the Outer Header Creation IE in 3GPP TS 29.244, Figure 8.2.56-1.

The go-pfcp library (github.com/wmnsk/go-pfcp) incorrectly uses Uint32 (4 bytes) to read 3-byte C-TAG/S-TAG fields, causing payload misalignment.

func ParseOuterHeaderCreation

func ParseOuterHeaderCreation(payload []byte) (*OuterHeaderCreationFields, error)

Bit flags in Octet 5 (payload[0]) determine which fields are present:

Bit 1 (0x01): GTP-U/UDP/IPv4  → TEID + IPv4
Bit 2 (0x02): GTP-U/UDP/IPv6  → TEID + IPv6
Bit 3 (0x04): UDP/IPv4        → IPv4 + Port
Bit 4 (0x08): UDP/IPv6        → IPv6 + Port
Bit 5 (0x10): IPv4            → IPv4
Bit 6 (0x20): IPv6            → IPv6
Bit 7 (0x40): C-TAG           → 3-octet C-TAG
Bit 8 (0x80): S-TAG           → 3-octet S-TAG

func (*OuterHeaderCreationFields) HasIPv4

func (f *OuterHeaderCreationFields) HasIPv4() bool

HasIPv4 checks if OuterHeaderCreation has IPv4 field

func (*OuterHeaderCreationFields) HasTEID

func (f *OuterHeaderCreationFields) HasTEID() bool

HasTEID checks if OuterHeaderCreation has TEID field

Jump to

Keyboard shortcuts

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