radio

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilTunIface             = errors.New("nil TUN interface")
	ErrNilUdpConn              = errors.New("nil UDP Connection")
	ErrUnknownGnb              = errors.New("unknown gNB")
	ErrUnexpectedGnb           = errors.New("PDU session do not use the expected gNB")
	ErrPduSessionNotFound      = errors.New("no PDU Session found for this IP Address")
	ErrPduSessionAlreadyExists = errors.New("PDU session already exists")

	ErrUnsupportedPDUType = errors.New("unsupported PDU Type")
	ErrMalformedPDU       = errors.New("malformed PDU")
)

Functions

This section is empty.

Types

type Radio

type Radio struct {
	common.WithContext

	Client http.Client

	Tun       *tun.TunManager
	Control   jsonapi.ControlURI
	Data      netip.AddrPort
	UserAgent string
	// contains filtered or unexported fields
}

func NewRadio

func NewRadio(control jsonapi.ControlURI, tunMan *tun.TunManager, data netip.AddrPort, userAgent string) *Radio

func (*Radio) AddRoute

func (r *Radio) AddRoute(ueIp netip.Addr, gnb jsonapi.ControlURI) error

AddRoute creates a route to the gNB for this PDU session, including configuration of iproute2 interface

func (*Radio) DelRoute

func (r *Radio) DelRoute(ueIp netip.Addr) error

DelRoute remove the route to the gNB for this PDU session, including (de-)configuration of iproute2 interface

func (*Radio) GetRoutes added in v0.0.3

func (r *Radio) GetRoutes() map[netip.Addr]jsonapi.ControlURI

func (*Radio) HandlePeer

func (r *Radio) HandlePeer(peer n1n2.RadioPeerMsg)

func (*Radio) InitPeer

func (r *Radio) InitPeer(gnb jsonapi.ControlURI) error

func (*Radio) Peer

func (r *Radio) Peer(c *gin.Context)

Allow to peer to a gNB

func (*Radio) Register

func (r *Radio) Register(e *gin.Engine)

func (*Radio) Status

func (r *Radio) Status(c *gin.Context)

func (*Radio) UpdateRoute

func (r *Radio) UpdateRoute(ueIp netip.Addr, oldGnb jsonapi.ControlURI, newGnb jsonapi.ControlURI) error

UpdateRoute updates the route to the gNB for this PDU Session

func (*Radio) Write

func (r *Radio) Write(pkt []byte, srv *net.UDPConn, ue netip.Addr) error

type RadioDaemon

type RadioDaemon struct {
	Control   jsonapi.ControlURI
	Gnbs      []jsonapi.ControlURI
	Radio     *Radio
	UeRanAddr netip.AddrPort
	// contains filtered or unexported fields
}

func NewRadioDaemon

func NewRadioDaemon(control jsonapi.ControlURI, gnbs []jsonapi.ControlURI, radio *Radio, ueRanAddr netip.AddrPort) *RadioDaemon

func (*RadioDaemon) Start

func (r *RadioDaemon) Start(ctx context.Context) error

func (*RadioDaemon) WaitShutdown

func (r *RadioDaemon) WaitShutdown(ctx context.Context) error

Jump to

Keyboard shortcuts

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