app

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const GTPU_PORT = 2152
View Source
const (
	TUN_MTU = 1400
)

Variables

This section is empty.

Functions

func Status

func Status(c *gin.Context)

get status of the controller

Types

type DLPkt

type DLPkt struct {
	Ue      jsonapi.ControlURI
	Payload []byte
}

type Fteid

type Fteid struct {
	IpAddr netip.Addr
	Teid   uint32
}

type HttpServerEntity

type HttpServerEntity struct {
	// contains filtered or unexported fields
}

func NewHttpServerEntity

func NewHttpServerEntity(bindAddr netip.AddrPort, radio *Radio, ps *PduSessions) *HttpServerEntity

func (*HttpServerEntity) Start

func (e *HttpServerEntity) Start() error

func (*HttpServerEntity) Stop

func (e *HttpServerEntity) Stop()

type PduSessions

type PduSessions struct {
	PduSessionsMap sync.Map // key : UE 5G ip address; value: UE Control URI
	UserAgent      string
	Client         http.Client
	Control        jsonapi.ControlURI
	Cp             jsonapi.ControlURI
	GnbGtp         netip.Addr
	// contains filtered or unexported fields
}

func NewPduSessions

func NewPduSessions(control jsonapi.ControlURI, cp jsonapi.ControlURI, manager *PduSessionsManager, userAgent string, gnbGtp netip.Addr) *PduSessions

func (*PduSessions) EstablishmentRequest

func (p *PduSessions) EstablishmentRequest(c *gin.Context)

request from UE

func (*PduSessions) N2EstablishmentRequest

func (p *PduSessions) N2EstablishmentRequest(c *gin.Context)

request from CP

type PduSessionsManager

type PduSessionsManager struct {
	sync.Mutex

	Downlink map[uint32]jsonapi.ControlURI // teid: UE control uri
	Uplink   map[netip.Addr]*Fteid         // ue 5G ip address: uplink fteid
	GtpAddr  netip.Addr
	// contains filtered or unexported fields
}

func NewPduSessionsManager

func NewPduSessionsManager(gtpAddr netip.Addr) *PduSessionsManager

func (*PduSessionsManager) GetUECtrl

func (p *PduSessionsManager) GetUECtrl(teid uint32) (jsonapi.ControlURI, error)

func (*PduSessionsManager) NewPduSession

func (p *PduSessionsManager) NewPduSession(ctx context.Context, ueIpAddr netip.Addr, ueControlURI jsonapi.ControlURI, upf netip.Addr, uplinkTeid uint32) (uint32, error)
func (p *PduSessionsManager) WriteUplink(ctx context.Context, pkt []byte) error

type Radio

type Radio struct {
	Client    http.Client
	Control   jsonapi.ControlURI
	Data      netip.AddrPort
	UserAgent string
	// contains filtered or unexported fields
}

func NewRadio

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

func (*Radio) Peer

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

allow to peer to ue

func (*Radio) Write

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

type RadioDaemon

type RadioDaemon struct {
	DlQueue chan DLPkt

	PduSessionsManager *PduSessionsManager
	// contains filtered or unexported fields
}

func NewRadioDaemon

func NewRadioDaemon(radio *Radio, psMan *PduSessionsManager, gnbRanAddr netip.AddrPort) *RadioDaemon

func (*RadioDaemon) Start

func (r *RadioDaemon) Start(ctx context.Context) error
func (r *RadioDaemon) WriteDownlink(payload []byte, ue jsonapi.ControlURI) error

type Setup

type Setup struct {
	// contains filtered or unexported fields
}

func NewSetup

func NewSetup(config *config.GNBConfig) *Setup

func (*Setup) Exit

func (s *Setup) Exit() error

func (*Setup) Init

func (s *Setup) Init(ctx context.Context) error

func (*Setup) Run

func (s *Setup) Run(ctx context.Context) error

func (*Setup) StartGtpUProtocolEntity

func (s *Setup) StartGtpUProtocolEntity(ctx context.Context, ipAddress netip.Addr) error

Jump to

Keyboard shortcuts

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