n4tosrv6

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package n4tosrv6 allow to translate PFCP Rules into SRv6.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	SRH        SRH         `json:"srh"`
	SourceGtp4 *netip.Addr `json:"src-gtp4,omitempty"`
}

type BackboneIP

type BackboneIP struct {
	netip.Addr
}

func (*BackboneIP) UnmarshalText

func (b *BackboneIP) UnmarshalText(text []byte) error

type GtpHeader

type GtpHeader struct {
	OuterIpSrc []netip.Prefix `json:"outer-ip-src"` // i.e. list of gNB IPs, or 0/0
	FTeid      jsonapi.Fteid  `json:"fteid"`
	InnerIpSrc *netip.Addr    `json:"inner-ip-src,omitempty"` // i.e. UE ip; only useful for uplink when multiple PDU Sessions are aggregated on a single TEID
}

type Locator

type Locator struct {
	netip.Prefix
}

func (Locator) Overlaps

func (l Locator) Overlaps(o Locator) bool

func (*Locator) UnmarshalText

func (l *Locator) UnmarshalText(text []byte) error

type Match

type Match struct {
	Header  *GtpHeader `json:"gtp,omitempty"`
	Payload *Payload   `json:"payload,omitempty"` // if empty, the rule is considered "default"
}

type NextHop

type NextHop struct {
	netip.Addr
}

func NewNextHop

func NewNextHop(nh string) (*NextHop, error)

func (*NextHop) UnmarshalText

func (nh *NextHop) UnmarshalText(text []byte) error

type Payload

type Payload struct {
	Dst netip.Addr `json:"destination-ip"`
}

type Router

type Router struct {
	Control  jsonapi.ControlURI `json:"control"`  // url used for control
	Locator  Locator            `json:"locator"`  // locator (ipv6 prefix)
	Backbone BackboneIP         `json:"backbone"` // data plane backbone ipv6 address
}

type RouterMap

type RouterMap map[uuid.UUID]Router

type Rule

type Rule struct {
	Enabled bool
	Type    string // uplink or downlink
	Match   Match
	Action  Action
}

type RuleMap

type RuleMap map[uuid.UUID]Rule

type SRH

type SRH []*Segment

func NewSRH

func NewSRH(segments []string) (*SRH, error)

func (SRH) AsSlice

func (srh SRH) AsSlice() []net.IP

type Segment

type Segment struct {
	netip.Addr
}

func NewSegment

func NewSegment(s string) (*Segment, error)

func (*Segment) UnmarshalText

func (s *Segment) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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