context

package
v0.0.0-...-b8cd232 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxValueOfRanUeNgapID int64 = 4294967295
	MaxNumOfPDUSessions   int   = 256
)
View Source
const (
	ErrNil                          = EvtError("Nil")
	ErrRadioConnWithUeLost          = EvtError("RadioConnectionWithUeLost")
	ErrTransportResourceUnavailable = EvtError("TransportResourceUnavailable")
	ErrAMFSelection                 = EvtError("No avalible AMF for this UE")
)

NGAP IKE event error string

View Source
const (
	AmfUeNgapIdUnspecified int64 = 0xffffffffff
)
View Source
const (
	ArgsUEUDPConn string = "UE UDP Socket Info"
)

Temporary State Data Args

View Source
const (
	CxtTempPDUSessionSetupData int64 = iota
)

Ngap context

Variables

This section is empty.

Functions

func GetInterfaceName

func GetInterfaceName(IPAddress string) (interfaceName string, err error)

func InitN3IWFContext

func InitN3IWFContext() bool

Types

type AMFOverloadContent

type AMFOverloadContent struct {
	Action     *ngapType.OverloadAction
	TrafficInd *int64
	NSSAIList  []SliceOverloadItem
}

type AMFTNLAssociationItem

type AMFTNLAssociationItem struct {
	Ipv4                   string
	Ipv6                   string
	TNLAssociationUsage    *ngapType.TNLAssociationUsage
	TNLAddressWeightFactor *int64
}

type ChildSecurityAssociation

type ChildSecurityAssociation struct {
	// SPI
	InboundSPI  uint32 // N3IWF Specify
	OutboundSPI uint32 // Non-3GPP UE Specify

	// Associated XFRM interface
	XfrmIface netlink.Link

	XfrmStateList  []netlink.XfrmState
	XfrmPolicyList []netlink.XfrmPolicy

	// IP address
	PeerPublicIPAddr  net.IP
	LocalPublicIPAddr net.IP

	// Traffic selector
	SelectedIPProtocol    uint8
	TrafficSelectorLocal  net.IPNet
	TrafficSelectorRemote net.IPNet

	// Security
	EncryptionAlgorithm               uint16
	InitiatorToResponderEncryptionKey []byte
	ResponderToInitiatorEncryptionKey []byte
	IntegrityAlgorithm                uint16
	InitiatorToResponderIntegrityKey  []byte
	ResponderToInitiatorIntegrityKey  []byte
	ESN                               bool

	// Encapsulate
	EnableEncapsulate bool
	N3IWFPort         int
	NATPort           int

	// PDU Session IDs associated with this child SA
	PDUSessionIds []int64

	// IKE UE context
	IkeUE *N3IWFIkeUe
}

type CreatePDUSessionEvt

type CreatePDUSessionEvt struct {
	LocalSPI                uint64
	PduSessionListLen       int
	TempPDUSessionSetupData *PDUSessionSetupTemporaryData
}

func NewCreatePDUSessionEvt

func NewCreatePDUSessionEvt(localSPI uint64, pduSessionListLen int,
	tempPDUSessionSetupData *PDUSessionSetupTemporaryData,
) *CreatePDUSessionEvt

func (*CreatePDUSessionEvt) Type

func (createPDUSessionEvt *CreatePDUSessionEvt) Type() IkeEventType

type EvtError

type EvtError string

func (EvtError) Error

func (e EvtError) Error() string

type GTPConnectionInfo

type GTPConnectionInfo struct {
	UPFIPAddr           string
	UPFUDPAddr          net.Addr
	IncomingTEID        uint32
	OutgoingTEID        uint32
	UserPlaneConnection *gtpv1.UPlaneConn
}

type GetNGAPContextEvt

type GetNGAPContextEvt struct {
	RanUeNgapId       int64
	NgapCxtReqNumlist []int64
}

func NewGetNGAPContextEvt

func NewGetNGAPContextEvt(ranUeNgapId int64, ngapCxtReqNumlist []int64) *GetNGAPContextEvt

func (*GetNGAPContextEvt) Type

func (getNGAPContextEvt *GetNGAPContextEvt) Type() NgapEventType

type GetNGAPContextRepEvt

type GetNGAPContextRepEvt struct {
	LocalSPI          uint64
	NgapCxtReqNumlist []int64
	NgapCxt           []interface{}
}

func NewGetNGAPContextRepEvt

func NewGetNGAPContextRepEvt(localSPI uint64, ngapCxtReqNumlist []int64,
	ngapCxt []interface{},
) *GetNGAPContextRepEvt

func (*GetNGAPContextRepEvt) Type

func (getNGAPContextRepEvt *GetNGAPContextRepEvt) Type() IkeEventType

type IKEContextUpdateEvt

type IKEContextUpdateEvt struct {
	LocalSPI uint64
	Kn3iwf   []byte
}

func NewIKEContextUpdateEvt

func NewIKEContextUpdateEvt(localSPI uint64, kn3iwf []byte,
) *IKEContextUpdateEvt

func (*IKEContextUpdateEvt) Type

func (ikeContextUpdateEvt *IKEContextUpdateEvt) Type() IkeEventType

type IKEDeleteRequestEvt

type IKEDeleteRequestEvt struct {
	LocalSPI uint64
}

func NewIKEDeleteRequestEvt

func NewIKEDeleteRequestEvt(localSPI uint64,
) *IKEDeleteRequestEvt

func (*IKEDeleteRequestEvt) Type

func (ikeDeleteRequestEvt *IKEDeleteRequestEvt) Type() IkeEventType

type IKESecurityAssociation

type IKESecurityAssociation struct {
	// SPI
	RemoteSPI uint64
	LocalSPI  uint64

	// Message ID
	InitiatorMessageID uint32
	ResponderMessageID uint32

	// Transforms for IKE SA
	EncryptionAlgorithm    *ike_message.Transform
	PseudorandomFunction   *ike_message.Transform
	IntegrityAlgorithm     *ike_message.Transform
	DiffieHellmanGroup     *ike_message.Transform
	ExpandedSequenceNumber *ike_message.Transform

	// Used for key generating
	ConcatenatedNonce      []byte
	DiffieHellmanSharedKey []byte

	// Keys
	SK_d  []byte // used for child SA key deriving
	SK_ai []byte // used by initiator for integrity checking
	SK_ar []byte // used by responder for integrity checking
	SK_ei []byte // used by initiator for encrypting
	SK_er []byte // used by responder for encrypting
	SK_pi []byte // used by initiator for IKE authentication
	SK_pr []byte // used by responder for IKE authentication

	// State for IKE_AUTH
	State uint8

	// Temporary data stored for the use in later exchange
	InitiatorID              *ike_message.IdentificationInitiator
	InitiatorCertificate     *ike_message.Certificate
	IKEAuthResponseSA        *ike_message.SecurityAssociation
	TrafficSelectorInitiator *ike_message.TrafficSelectorInitiator
	TrafficSelectorResponder *ike_message.TrafficSelectorResponder
	LastEAPIdentifier        uint8

	// UDP Connection
	IKEConnection *UDPSocketInfo

	// Authentication data
	ResponderSignedOctets []byte
	InitiatorSignedOctets []byte

	// NAT detection
	// If UEIsBehindNAT == true, N3IWF should enable NAT traversal and
	// TODO: should support dynamic updating network address (MOBIKE)
	UEIsBehindNAT bool
	// If N3IWFIsBehindNAT == true, N3IWF should send UDP keepalive periodically
	N3IWFIsBehindNAT bool

	// IKE UE context
	IkeUE *N3IWFIkeUe

	// Temporary store the receive ike message
	TemporaryIkeMsg *IkeMsgTemporaryData

	DPDReqRetransTimer *Timer // The time from sending the DPD request to receiving the response
	CurrentRetryTimes  int32  // Accumulate the number of times the DPD response wasn't received
	IKESAClosedCh      chan struct{}
	IsUseDPD           bool
}

type IkeEventType

type IkeEventType int64
const (
	UnmarshalEAP5GDataResponse IkeEventType = iota
	SendEAP5GFailureMsg
	SendEAPNASMsg
	SendEAPSuccessMsg
	CreatePDUSession
	IKEDeleteRequest
	SendChildSADeleteRequest
	IKEContextUpdate
	GetNGAPContextResponse
)

IKE Event type

type IkeEvt

type IkeEvt interface {
	Type() IkeEventType
}

type IkeMsgTemporaryData

type IkeMsgTemporaryData struct {
	SecurityAssociation      *ike_message.SecurityAssociation
	TrafficSelectorInitiator *ike_message.TrafficSelectorInitiator
	TrafficSelectorResponder *ike_message.TrafficSelectorResponder
}

type IkeReceivePacket

type IkeReceivePacket struct {
	Listener   net.UDPConn
	LocalAddr  net.UDPAddr
	RemoteAddr net.UDPAddr
	Msg        []byte
}

type IkeServer

type IkeServer struct {
	Listener    map[int]*net.UDPConn
	RcvIkePktCh chan IkeReceivePacket
	RcvEventCh  chan IkeEvt
	StopServer  chan struct{}
}

type N3IWFAMF

type N3IWFAMF struct {
	SCTPAddr              string
	SCTPConn              *sctp.SCTPConn
	AMFName               *ngapType.AMFName
	ServedGUAMIList       *ngapType.ServedGUAMIList
	RelativeAMFCapacity   *ngapType.RelativeAMFCapacity
	PLMNSupportList       *ngapType.PLMNSupportList
	AMFTNLAssociationList map[string]*AMFTNLAssociationItem // v4+v6 as key
	// Overload related
	AMFOverloadContent *AMFOverloadContent
	// Relative Context
	N3iwfRanUeList map[int64]*N3IWFRanUe // ranUeNgapId as key
}

func (*N3IWFAMF) AddAMFTNLAssociationItem

func (amf *N3IWFAMF) AddAMFTNLAssociationItem(info ngapType.CPTransportLayerInformation) *AMFTNLAssociationItem

func (*N3IWFAMF) DeleteAMFTNLAssociationItem

func (amf *N3IWFAMF) DeleteAMFTNLAssociationItem(info ngapType.CPTransportLayerInformation)

func (*N3IWFAMF) FindAMFTNLAssociationItem

func (amf *N3IWFAMF) FindAMFTNLAssociationItem(info ngapType.CPTransportLayerInformation) *AMFTNLAssociationItem

func (*N3IWFAMF) FindAvalibleAMFByCompareGUAMI

func (amf *N3IWFAMF) FindAvalibleAMFByCompareGUAMI(ueSpecifiedGUAMI *ngapType.GUAMI) bool

FindAvalibleAMFByCompareGUAMI compares the incoming GUAMI with AMF served GUAMI and return if this AMF is avalible for UE

func (*N3IWFAMF) FindAvalibleAMFByCompareSelectedPLMNId

func (amf *N3IWFAMF) FindAvalibleAMFByCompareSelectedPLMNId(ueSpecifiedSelectedPLMNId *ngapType.PLMNIdentity) bool

func (*N3IWFAMF) FindUeByAmfUeNgapID

func (amf *N3IWFAMF) FindUeByAmfUeNgapID(id int64) *N3IWFRanUe

func (*N3IWFAMF) RemoveAllRelatedUe

func (amf *N3IWFAMF) RemoveAllRelatedUe() error

func (*N3IWFAMF) StopOverload

func (amf *N3IWFAMF) StopOverload()

type N3IWFContext

type N3IWFContext struct {
	NFInfo           factory.N3IWFNFInfo
	AMFSCTPAddresses []*sctp.SCTPAddr

	// ID generator
	RANUENGAPIDGenerator *idgenerator.IDGenerator
	TEIDGenerator        *idgenerator.IDGenerator

	// Pools
	AMFPool                sync.Map // map[string]*N3IWFAMF, SCTPAddr as key
	AMFReInitAvailableList sync.Map // map[string]bool, SCTPAddr as key
	IKESA                  sync.Map // map[uint64]*IKESecurityAssociation, SPI as key
	ChildSA                sync.Map // map[uint32]*ChildSecurityAssociation, inboundSPI as key
	GTPConnectionWithUPF   sync.Map // map[string]*gtpv1.UPlaneConn, UPF address as key
	AllocatedUEIPAddress   sync.Map // map[string]*N3IWFIkeUe, IPAddr as key
	AllocatedUETEID        sync.Map // map[uint32]*N3IWFRanUe, TEID as key
	IKEUePool              sync.Map // map[uint64]*N3IWFIkeUe, SPI as key
	RANUePool              sync.Map // map[int64]*N3IWFRanUe, RanUeNgapID as key
	IKESPIToNGAPId         sync.Map // map[uint64]RanUeNgapID, SPI as key
	NGAPIdToIKESPI         sync.Map // map[uint64]SPI, RanUeNgapID as key

	// N3IWF FQDN
	FQDN string

	// Security data
	CertificateAuthority []byte
	N3IWFCertificate     []byte
	N3IWFPrivateKey      *rsa.PrivateKey

	// UEIPAddressRange
	Subnet *net.IPNet

	// XFRM interface
	XfrmIfaceId         uint32
	XfrmIfaces          sync.Map // map[uint32]*netlink.Link, XfrmIfaceId as key
	XfrmIfaceName       string
	XfrmParentIfaceName string

	// Every UE's first UP IPsec will use default XFRM interface, additoinal UP IPsec will offset its XFRM id
	XfrmIfaceIdOffsetForUP uint32

	// N3IWF local address
	IKEBindAddress      string
	IPSecGatewayAddress string
	GTPBindAddress      string
	TCPPort             uint16

	// N3IWF NWu interface IPv4 packet connection
	NWuIPv4PacketConn *ipv4.PacketConn

	Ctx context.Context
	Wg  sync.WaitGroup

	NGAPServer *NGAPServer
	IKEServer  *IkeServer
}

func N3IWFSelf

func N3IWFSelf() *N3IWFContext

Create new N3IWF context

func (*N3IWFContext) AMFPoolLoad

func (context *N3IWFContext) AMFPoolLoad(sctpAddr string) (*N3IWFAMF, bool)

func (*N3IWFContext) AMFReInitAvailableListLoad

func (context *N3IWFContext) AMFReInitAvailableListLoad(sctpAddr string) (bool, bool)

func (*N3IWFContext) AMFReInitAvailableListStore

func (context *N3IWFContext) AMFReInitAvailableListStore(sctpAddr string, flag bool)

func (*N3IWFContext) AMFSelection

func (context *N3IWFContext) AMFSelection(ueSpecifiedGUAMI *ngapType.GUAMI,
	ueSpecifiedPLMNId *ngapType.PLMNIdentity,
) *N3IWFAMF

func (*N3IWFContext) AllocatedUEIPAddressLoad

func (context *N3IWFContext) AllocatedUEIPAddressLoad(ipAddr string) (*N3IWFIkeUe, bool)

func (*N3IWFContext) AllocatedUETEIDLoad

func (context *N3IWFContext) AllocatedUETEIDLoad(teid uint32) (*N3IWFRanUe, bool)

func (*N3IWFContext) DeleteAMFReInitAvailableFlag

func (context *N3IWFContext) DeleteAMFReInitAvailableFlag(sctpAddr string)

func (*N3IWFContext) DeleteGTPConnection

func (context *N3IWFContext) DeleteGTPConnection(upfAddr string)

func (*N3IWFContext) DeleteIKESecurityAssociation

func (context *N3IWFContext) DeleteIKESecurityAssociation(spi uint64)

func (*N3IWFContext) DeleteIKEUe

func (context *N3IWFContext) DeleteIKEUe(spi uint64)

func (*N3IWFContext) DeleteIkeSPIFromNgapId

func (context *N3IWFContext) DeleteIkeSPIFromNgapId(ranUeNgapId int64)

func (*N3IWFContext) DeleteInternalUEIPAddr

func (context *N3IWFContext) DeleteInternalUEIPAddr(ipAddr string)

func (*N3IWFContext) DeleteN3iwfAmf

func (context *N3IWFContext) DeleteN3iwfAmf(sctpAddr string)

func (*N3IWFContext) DeleteNgapIdFromIkeSPI

func (context *N3IWFContext) DeleteNgapIdFromIkeSPI(spi uint64)

func (*N3IWFContext) DeleteRanUe

func (context *N3IWFContext) DeleteRanUe(ranUeNgapId int64)

func (*N3IWFContext) DeleteTEID

func (context *N3IWFContext) DeleteTEID(teid uint32)

func (*N3IWFContext) GTPConnectionWithUPFLoad

func (context *N3IWFContext) GTPConnectionWithUPFLoad(upfAddr string) (*gtpv1.UPlaneConn, bool)

func (*N3IWFContext) GTPConnectionWithUPFStore

func (context *N3IWFContext) GTPConnectionWithUPFStore(upfAddr string, conn *gtpv1.UPlaneConn)

func (*N3IWFContext) IKESALoad

func (context *N3IWFContext) IKESALoad(spi uint64) (*IKESecurityAssociation, bool)

func (*N3IWFContext) IkeSpiLoad

func (context *N3IWFContext) IkeSpiLoad(ranUeNgapId int64) (uint64, bool)

func (*N3IWFContext) IkeSpiNgapIdMapping

func (context *N3IWFContext) IkeSpiNgapIdMapping(spi uint64, ranUeNgapId int64)

func (*N3IWFContext) IkeUeLoadFromNgapId

func (context *N3IWFContext) IkeUeLoadFromNgapId(ranUeNgapId int64) (*N3IWFIkeUe, error)

func (*N3IWFContext) IkeUePoolLoad

func (context *N3IWFContext) IkeUePoolLoad(spi uint64) (*N3IWFIkeUe, bool)

func (*N3IWFContext) NewIKESecurityAssociation

func (context *N3IWFContext) NewIKESecurityAssociation() *IKESecurityAssociation

func (*N3IWFContext) NewInternalUEIPAddr

func (context *N3IWFContext) NewInternalUEIPAddr(ikeUe *N3IWFIkeUe) net.IP

func (*N3IWFContext) NewN3iwfAmf

func (context *N3IWFContext) NewN3iwfAmf(sctpAddr string, conn *sctp.SCTPConn) *N3IWFAMF

func (*N3IWFContext) NewN3iwfIkeUe

func (context *N3IWFContext) NewN3iwfIkeUe(spi uint64) *N3IWFIkeUe

func (*N3IWFContext) NewN3iwfRanUe

func (context *N3IWFContext) NewN3iwfRanUe() *N3IWFRanUe

func (*N3IWFContext) NewTEID

func (context *N3IWFContext) NewTEID(ranUe *N3IWFRanUe) uint32

func (*N3IWFContext) NgapIdLoad

func (context *N3IWFContext) NgapIdLoad(spi uint64) (int64, bool)

func (*N3IWFContext) RanUeLoadFromIkeSPI

func (context *N3IWFContext) RanUeLoadFromIkeSPI(spi uint64) (*N3IWFRanUe, error)

func (*N3IWFContext) RanUePoolLoad

func (context *N3IWFContext) RanUePoolLoad(ranUeNgapId int64) (*N3IWFRanUe, bool)

type N3IWFIkeUe

type N3IWFIkeUe struct {
	/* UE identity */
	IPSecInnerIP     net.IP
	IPSecInnerIPAddr *net.IPAddr // Used to send UP packets to UE

	/* IKE Security Association */
	N3IWFIKESecurityAssociation   *IKESecurityAssociation
	N3IWFChildSecurityAssociation map[uint32]*ChildSecurityAssociation // inbound SPI as key

	/* Temporary Mapping of two SPIs */
	// Exchange Message ID(including a SPI) and ChildSA(including a SPI)
	// Mapping of Message ID of exchange in IKE and Child SA when creating new child SA
	TemporaryExchangeMsgIDChildSAMapping map[uint32]*ChildSecurityAssociation // Message ID as a key

	/* Security */
	Kn3iwf []uint8 // 32 bytes (256 bits), value is from NGAP IE "Security Key"

	/* NAS IKE Connection */
	IKEConnection *UDPSocketInfo

	// Length of PDU Session List
	PduSessionListLen int
}

func (*N3IWFIkeUe) CompleteChildSA

func (ikeUe *N3IWFIkeUe) CompleteChildSA(msgID uint32, outboundSPI uint32,
	chosenSecurityAssociation *ike_message.SecurityAssociation,
) (*ChildSecurityAssociation, error)

func (*N3IWFIkeUe) CreateHalfChildSA

func (ikeUe *N3IWFIkeUe) CreateHalfChildSA(msgID, inboundSPI uint32, pduSessionID int64)

When N3IWF send CREATE_CHILD_SA request to N3UE, the inbound SPI of childSA will be only stored first until receive response and call CompleteChildSAWithProposal to fill the all data of childSA

func (*N3IWFIkeUe) DeleteChildSA

func (ikeUe *N3IWFIkeUe) DeleteChildSA(childSA *ChildSecurityAssociation) error

func (*N3IWFIkeUe) Remove

func (ikeUe *N3IWFIkeUe) Remove() error

type N3IWFRanUe

type N3IWFRanUe struct {
	/* UE identity */
	RanUeNgapId  int64
	AmfUeNgapId  int64
	IPAddrv4     string
	IPAddrv6     string
	PortNumber   int32
	MaskedIMEISV *ngapType.MaskedIMEISV // TS 38.413 9.3.1.54
	Guti         string

	/* Relative Context */
	AMF *N3IWFAMF

	/* Security */
	SecurityCapabilities *ngapType.UESecurityCapabilities // TS 38.413 9.3.1.86

	/* PDU Session */
	PduSessionList map[int64]*PDUSession // pduSessionId as key

	/* PDU Session Setup Temporary Data */
	TemporaryPDUSessionSetupData *PDUSessionSetupTemporaryData

	/* Temporary cached NAS message */
	// Used when NAS registration accept arrived before
	// UE setup NAS TCP connection with N3IWF, and
	// Forward pduSessionEstablishmentAccept to UE after
	// UE send CREATE_CHILD_SA response
	TemporaryCachedNASMessage []byte

	/* NAS TCP Connection Established */
	IsNASTCPConnEstablished         bool
	IsNASTCPConnEstablishedComplete bool

	/* NAS TCP Connection */
	TCPConnection net.Conn

	/* Others */
	Guami                            *ngapType.GUAMI
	IndexToRfsp                      int64
	Ambr                             *ngapType.UEAggregateMaximumBitRate
	AllowedNssai                     *ngapType.AllowedNSSAI
	RadioCapability                  *ngapType.UERadioCapability                // TODO: This is for RRC, can be deleted
	CoreNetworkAssistanceInformation *ngapType.CoreNetworkAssistanceInformation // TS 38.413 9.3.1.15
	IMSVoiceSupported                int32
	RRCEstablishmentCause            int16
	PduSessionReleaseList            ngapType.PDUSessionResourceReleasedListRelRes
}

func (*N3IWFRanUe) AttachAMF

func (ranUe *N3IWFRanUe) AttachAMF(sctpAddr string) bool

func (*N3IWFRanUe) CreatePDUSession

func (ranUe *N3IWFRanUe) CreatePDUSession(pduSessionID int64, snssai ngapType.SNSSAI) (*PDUSession, error)

func (*N3IWFRanUe) DetachAMF

func (ranUe *N3IWFRanUe) DetachAMF()

func (*N3IWFRanUe) FindPDUSession

func (ranUe *N3IWFRanUe) FindPDUSession(pduSessionID int64) *PDUSession

func (*N3IWFRanUe) Remove

func (ranUe *N3IWFRanUe) Remove() error

type NASTCPConnEstablishedCompleteEvt

type NASTCPConnEstablishedCompleteEvt struct {
	RanUeNgapId int64
}

func NewNASTCPConnEstablishedCompleteEvt

func NewNASTCPConnEstablishedCompleteEvt(ranUeNgapId int64) *NASTCPConnEstablishedCompleteEvt

func (*NASTCPConnEstablishedCompleteEvt) Type

func (nasTCPConnEstablishedCompleteEvt *NASTCPConnEstablishedCompleteEvt) Type() NgapEventType

type NGAPServer

type NGAPServer struct {
	Conn         []*sctp.SCTPConn
	RcvNgapPktCh chan ReceiveNGAPPacket
	RcvEventCh   chan NgapEvt
}

type NgapEventType

type NgapEventType int64
const (
	UnmarshalEAP5GData NgapEventType = iota
	SendInitialUEMessage
	SendPDUSessionResourceSetupResponse
	SendNASMsg
	StartTCPSignalNASMsg
	NASTCPConnEstablishedComplete
	SendUEContextReleaseRequest
	SendUEContextReleaseComplete
	SendPDUSessionResourceReleaseResponse
	GetNGAPContext
)

NGAP event type

type NgapEvt

type NgapEvt interface {
	Type() NgapEventType
}

type PDUSession

type PDUSession struct {
	Id                               int64 // PDU Session ID
	Type                             *ngapType.PDUSessionType
	Ambr                             *ngapType.PDUSessionAggregateMaximumBitRate
	Snssai                           ngapType.SNSSAI
	NetworkInstance                  *ngapType.NetworkInstance
	SecurityCipher                   bool
	SecurityIntegrity                bool
	MaximumIntegrityDataRateUplink   *ngapType.MaximumIntegrityProtectedDataRate
	MaximumIntegrityDataRateDownlink *ngapType.MaximumIntegrityProtectedDataRate
	GTPConnection                    *GTPConnectionInfo
	QFIList                          []uint8
	QosFlows                         map[int64]*QosFlow // QosFlowIdentifier as key
}

type PDUSessionSetupTemporaryData

type PDUSessionSetupTemporaryData struct {
	// Slice of unactivated PDU session
	UnactivatedPDUSession []*PDUSession // PDUSession as content
	// NGAPProcedureCode is used to identify which type of
	// response shall be used
	NGAPProcedureCode ngapType.ProcedureCode
	// PDU session setup list response
	SetupListCxtRes  *ngapType.PDUSessionResourceSetupListCxtRes
	FailedListCxtRes *ngapType.PDUSessionResourceFailedToSetupListCxtRes
	SetupListSURes   *ngapType.PDUSessionResourceSetupListSURes
	FailedListSURes  *ngapType.PDUSessionResourceFailedToSetupListSURes
	// List of Error for failed setup PDUSessionID
	FailedErrStr []EvtError // Error string as content
	// Current Index of UnactivatedPDUSession
	Index int
}

type QosFlow

type QosFlow struct {
	Identifier int64
	Parameters ngapType.QosFlowLevelQosParameters
}

type ReceiveNGAPPacket

type ReceiveNGAPPacket struct {
	Conn *sctp.SCTPConn
	Buf  []byte
}

type SendChildSADeleteRequestEvt

type SendChildSADeleteRequestEvt struct {
	LocalSPI      uint64
	ReleaseIdList []int64
}

func NewSendChildSADeleteRequestEvt

func NewSendChildSADeleteRequestEvt(localSPI uint64, releaseIdList []int64,
) *SendChildSADeleteRequestEvt

func (*SendChildSADeleteRequestEvt) Type

func (sendChildSADeleteRequestEvt *SendChildSADeleteRequestEvt) Type() IkeEventType

type SendEAP5GFailureMsgEvt

type SendEAP5GFailureMsgEvt struct {
	LocalSPI uint64
	ErrMsg   EvtError
}

func NewSendEAP5GFailureMsgEvt

func NewSendEAP5GFailureMsgEvt(localSPI uint64, errMsg EvtError,
) *SendEAP5GFailureMsgEvt

func (*SendEAP5GFailureMsgEvt) Type

func (sendEAP5GFailureMsgEvt *SendEAP5GFailureMsgEvt) Type() IkeEventType

type SendEAPNASMsgEvt

type SendEAPNASMsgEvt struct {
	LocalSPI uint64
	NasPDU   []byte
}

func NewSendEAPNASMsgEvt

func NewSendEAPNASMsgEvt(localSPI uint64, nasPDU []byte,
) *SendEAPNASMsgEvt

func (*SendEAPNASMsgEvt) Type

func (sendEAPNASMsgEvt *SendEAPNASMsgEvt) Type() IkeEventType

type SendEAPSuccessMsgEvt

type SendEAPSuccessMsgEvt struct {
	LocalSPI          uint64
	Kn3iwf            []byte
	PduSessionListLen int
}

func NewSendEAPSuccessMsgEvt

func NewSendEAPSuccessMsgEvt(localSPI uint64, kn3iwf []byte, pduSessionListLen int,
) *SendEAPSuccessMsgEvt

func (*SendEAPSuccessMsgEvt) Type

func (SendEAPSuccessMsgEvt *SendEAPSuccessMsgEvt) Type() IkeEventType

type SendInitialUEMessageEvt

type SendInitialUEMessageEvt struct {
	RanUeNgapId int64
	IPv4Addr    string
	IPv4Port    int
	NasPDU      []byte
}

func NewSendInitialUEMessageEvt

func NewSendInitialUEMessageEvt(ranUeNgapId int64, ipv4Addr string, ipv4Port int,
	nasPDU []byte,
) *SendInitialUEMessageEvt

func (*SendInitialUEMessageEvt) Type

func (sendInitialUEMessageEvt *SendInitialUEMessageEvt) Type() NgapEventType

type SendNASMsgEvt

type SendNASMsgEvt struct {
	RanUeNgapId int64
}

func NewSendNASMsgEvt

func NewSendNASMsgEvt(ranUeNgapId int64) *SendNASMsgEvt

func (*SendNASMsgEvt) Type

func (sendNASMsgEvt *SendNASMsgEvt) Type() NgapEventType

type SendPDUSessionResourceReleaseResEvt

type SendPDUSessionResourceReleaseResEvt struct {
	RanUeNgapId int64
}

func NewSendPDUSessionResourceReleaseResEvt

func NewSendPDUSessionResourceReleaseResEvt(ranUeNgapId int64) *SendPDUSessionResourceReleaseResEvt

func (*SendPDUSessionResourceReleaseResEvt) Type

func (sendPDUSessionResourceReleaseResEvt *SendPDUSessionResourceReleaseResEvt) Type() NgapEventType

type SendPDUSessionResourceSetupResEvt

type SendPDUSessionResourceSetupResEvt struct {
	RanUeNgapId int64
}

func NewSendPDUSessionResourceSetupResEvt

func NewSendPDUSessionResourceSetupResEvt(ranUeNgapId int64) *SendPDUSessionResourceSetupResEvt

func (*SendPDUSessionResourceSetupResEvt) Type

func (sendPDUSessionResourceSetupResEvt *SendPDUSessionResourceSetupResEvt) Type() NgapEventType

type SendUEContextReleaseCompleteEvt

type SendUEContextReleaseCompleteEvt struct {
	RanUeNgapId int64
}

func NewSendUEContextReleaseCompleteEvt

func NewSendUEContextReleaseCompleteEvt(ranUeNgapId int64) *SendUEContextReleaseCompleteEvt

func (*SendUEContextReleaseCompleteEvt) Type

func (sendUEContextReleaseCompleteEvt *SendUEContextReleaseCompleteEvt) Type() NgapEventType

type SendUEContextReleaseRequestEvt

type SendUEContextReleaseRequestEvt struct {
	RanUeNgapId int64
	ErrMsg      EvtError
}

func NewSendUEContextReleaseRequestEvt

func NewSendUEContextReleaseRequestEvt(ranUeNgapId int64, errMsg EvtError,
) *SendUEContextReleaseRequestEvt

func (*SendUEContextReleaseRequestEvt) Type

func (sendUEContextReleaseRequestEvt *SendUEContextReleaseRequestEvt) Type() NgapEventType

type SliceOverloadItem

type SliceOverloadItem struct {
	SNssaiList []ngapType.SNSSAI
	Action     *ngapType.OverloadAction
	TrafficInd *int64
}

type StartTCPSignalNASMsgEvt

type StartTCPSignalNASMsgEvt struct {
	RanUeNgapId int64
}

func NewStartTCPSignalNASMsgEvt

func NewStartTCPSignalNASMsgEvt(ranUeNgapId int64) *StartTCPSignalNASMsgEvt

func (*StartTCPSignalNASMsgEvt) Type

func (startTCPSignalNASMsgEvt *StartTCPSignalNASMsgEvt) Type() NgapEventType

type Timer

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

func NewDPDPeriodicTimer

func NewDPDPeriodicTimer(d time.Duration, maxRetryTimes int32, ikeSA *IKESecurityAssociation,
	cancelFunc func(),
) *Timer

func (*Timer) Stop

func (t *Timer) Stop()

type UDPSocketInfo

type UDPSocketInfo struct {
	Conn      *net.UDPConn
	N3IWFAddr *net.UDPAddr
	UEAddr    *net.UDPAddr
}

type UnmarshalEAP5GDataEvt

type UnmarshalEAP5GDataEvt struct {
	LocalSPI      uint64
	EAPVendorData []byte
	IsInitialUE   bool
	RanUeNgapId   int64
}

func NewUnmarshalEAP5GDataEvt

func NewUnmarshalEAP5GDataEvt(localSPI uint64, eapVendorData []byte, isInitialUE bool,
	ranUeNgapId int64,
) *UnmarshalEAP5GDataEvt

func (*UnmarshalEAP5GDataEvt) Type

func (unmarshalEAP5GDataEvt *UnmarshalEAP5GDataEvt) Type() NgapEventType

type UnmarshalEAP5GDataResponseEvt

type UnmarshalEAP5GDataResponseEvt struct {
	LocalSPI    uint64
	RanUeNgapId int64
	NasPDU      []byte
}

func NewUnmarshalEAP5GDataResponseEvt

func NewUnmarshalEAP5GDataResponseEvt(localSPI uint64, ranUeNgapId int64, nasPDU []byte,
) *UnmarshalEAP5GDataResponseEvt

func (*UnmarshalEAP5GDataResponseEvt) Type

func (unmarshalEAP5GDataResponseEvt *UnmarshalEAP5GDataResponseEvt) Type() IkeEventType

Jump to

Keyboard shortcuts

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