ue

package
v1.10.2 Latest Latest
Warning

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

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

Documentation

Overview

*

  • SPDX-License-Identifier: Apache-2.0
  • © Copyright 2023 Hewlett Packard Enterprise Development LP

Index

Constants

View Source
const (
	MM5G_NULL                 = 0x00
	MM5G_DEREGISTERED         = 0x01
	MM5G_REGISTERED_INITIATED = 0x02
	MM5G_REGISTERED           = 0x03
	MM5G_SERVICE_REQ_INIT     = 0x04
	MM5G_DEREGISTERED_INIT    = 0x05
	MM5G_IDLE                 = 0x06
)

Variables

This section is empty.

Functions

func AlgorithmKeyDerivation

func AlgorithmKeyDerivation(cipheringAlg uint8, kamf []byte, knasEnc *[16]uint8, integrityAlg uint8, knasInt *[16]uint8) error

Algorithm key Derivation function defined in TS 33.501 Annex A.9

func BuildAuthenticationResponse

func BuildAuthenticationResponse(opts *AuthenticationResponseOpts) ([]byte, error)

func BuildConfigurationUpdateComplete

func BuildConfigurationUpdateComplete() ([]byte, error)

func BuildDeregistrationRequest

func BuildDeregistrationRequest(opts *DeregistrationRequestOpts) ([]byte, error)

func BuildIMEISV

func BuildIMEISV(imeisv string) (*nasType.IMEISV, error)

func BuildIdentityResponse

func BuildIdentityResponse(opts *IdentityResponseOpts) ([]byte, error)

func BuildPduSessionEstablishmentRequest

func BuildPduSessionEstablishmentRequest(opts *PduSessionEstablishmentRequestOpts) ([]byte, error)

func BuildRegistrationComplete

func BuildRegistrationComplete(opts *RegistrationCompleteOpts) ([]byte, error)

func BuildRegistrationRequest

func BuildRegistrationRequest(opts *RegistrationRequestOpts) ([]byte, error)

func BuildSecurityModeComplete

func BuildSecurityModeComplete(opts *SecurityModeCompleteOpts) ([]byte, error)

func BuildServiceRequest

func BuildServiceRequest(opts *ServiceRequestOpts) ([]byte, error)

func BuildUplinkNasTransport

func BuildUplinkNasTransport(opts *UplinkNasTransportOpts) ([]byte, error)

func SelectAlgorithms

func SelectAlgorithms(securityCapability *nasType.UESecurityCapability) (uint8, uint8, error)

Types

type Amf

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

type AuthenticationResponseOpts

type AuthenticationResponseOpts struct {
	AuthenticationResponseParam []uint8
	EapMsg                      string
}

type DeregistrationRequestOpts

type DeregistrationRequestOpts struct {
	Guti *nasType.GUTI5G
	Suci *nasType.MobileIdentity5GS
	Ksi  int32
}

type IdentityResponseOpts

type IdentityResponseOpts struct {
	Suci nasType.MobileIdentity5GS
}

type PDUSessionInfo

type PDUSessionInfo struct {
	PDUSessionID uint8
	UEIP         string
	MTU          uint16
	QFI          uint8
}

type PduSessionEstablishmentRequestOpts

type PduSessionEstablishmentRequestOpts struct {
	PDUSessionID   uint8
	PDUSessionType uint8
}

type RegistrationCompleteOpts

type RegistrationCompleteOpts struct {
	SORTransparentContainer []uint8
}

type RegistrationRequestOpts

type RegistrationRequestOpts struct {
	RegistrationType  uint8
	RequestedNSSAI    *nasType.RequestedNSSAI
	UplinkDataStatus  *nasType.UplinkDataStatus
	IncludeCapability bool
	UESecurity        *UESecurity
	PDUSessionStatus  *[16]bool
}

type SecurityModeCompleteOpts

type SecurityModeCompleteOpts struct {
	UESecurity       *UESecurity
	IMEISV           string
	PDUSessionStatus *[16]bool
}

type ServiceRequestOpts

type ServiceRequestOpts struct {
	ServiceType      uint8
	AMFSetID         uint16
	AMFPointer       uint8
	TMSI5G           [4]uint8
	PDUSessionStatus *[16]bool
	UESecurity       *UESecurity
}

type UE

type UE struct {
	UeSecurity     *UESecurity
	StateMM        int
	DNN            string
	PDUSessionID   uint8
	PDUSessionType uint8
	Snssai         models.Snssai

	IMEISV string
	Gnb    air.UplinkSender

	PDUSessions map[uint8]PDUSessionInfo
	// contains filtered or unexported fields
}

func NewUE

func NewUE(opts *UEOpts) (*UE, error)

func (*UE) DecodeNAS

func (ue *UE) DecodeNAS(message []byte) (*nas.Message, error)

func (*UE) DerivateAlgKey

func (ue *UE) DerivateAlgKey() error

func (*UE) DerivateKamf

func (ue *UE) DerivateKamf(key []byte, snName string, SQN, AK []byte) error

func (*UE) DeriveRESstarAndSetKey

func (ue *UE) DeriveRESstarAndSetKey(authSubs models.AuthenticationSubscription, RAND []byte, snName string, AUTN []byte) ([]byte, error)

func (*UE) EncodeNasPduWithSecurity

func (ue *UE) EncodeNasPduWithSecurity(pdu []byte, securityHeaderType uint8) ([]byte, error)

func (*UE) EncodeSuci

func (ue *UE) EncodeSuci() (nasType.MobileIdentity5GS, error)

func (*UE) Get5gGuti

func (ue *UE) Get5gGuti() *nasType.GUTI5G

func (*UE) GetAmfPointer

func (ue *UE) GetAmfPointer() uint8

func (*UE) GetAmfSetId

func (ue *UE) GetAmfSetId() uint16

func (*UE) GetMccAndMncInOctets

func (ue *UE) GetMccAndMncInOctets() ([]byte, error)

func (*UE) GetPDUSession

func (ue *UE) GetPDUSession(pduSessionID uint8) PDUSessionInfo

func (*UE) GetRoutingIndicatorInOctets

func (ue *UE) GetRoutingIndicatorInOctets() ([]byte, error)

TS 24.501 9.11.3.4.1 Routing Indicator shall consist of 1 to 4 digits. The coding of this field is the responsibility of home network operator but BCD coding shall be used. If a network operator decides to assign less than 4 digits to Routing Indicator, the remaining digits shall be coded as "1111" to fill the 4 digits coding of Routing Indicator (see NOTE 2). If no Routing Indicator is configured in the USIM, the UE shall code bits 1 to 4 of octet 8 of the Routing Indicator as "0000" and the remaining digits as “1111".

func (*UE) GetSuci

func (ue *UE) GetSuci() nasType.MobileIdentity5GS

func (*UE) GetTMSI5G

func (ue *UE) GetTMSI5G() [4]uint8

func (*UE) NASEncode

func (ue *UE) NASEncode(msg *nas.Message, securityHeaderType uint8) ([]byte, error)

func (*UE) RRCRelease

func (ue *UE) RRCRelease()

func (*UE) SendDeregistrationRequest

func (ue *UE) SendDeregistrationRequest(amfUENGAPID int64, ranUENGAPID int64) error

func (*UE) SendDownlinkNAS

func (ue *UE) SendDownlinkNAS(msg []byte, amfUENGAPID int64, ranUENGAPID int64) error

func (*UE) SendPDUSessionEstablishmentRequest

func (ue *UE) SendPDUSessionEstablishmentRequest(amfUENGAPID int64, ranUENGAPID int64, pduSessionID uint8, dnn string, snssai models.Snssai) error

func (*UE) SendRegistrationRequest

func (ue *UE) SendRegistrationRequest(ranUENGAPID int64, regType uint8) error

func (*UE) SendServiceRequest

func (ue *UE) SendServiceRequest(ranUENGAPID int64, pduSessionStatus [16]bool, serviceType uint8) error

func (*UE) Set5gGuti

func (ue *UE) Set5gGuti(guti *nasType.GUTI5G)

func (*UE) SetAmfMccAndMnc

func (ue *UE) SetAmfMccAndMnc(mcc string, mnc string)

func (*UE) SetAuthSubscription

func (ue *UE) SetAuthSubscription(k, opc, amf, sqn string)

func (*UE) SetPDUSession

func (ue *UE) SetPDUSession(pduSession PDUSessionInfo)

func (*UE) WaitForNASGMMMessage

func (ue *UE) WaitForNASGMMMessage(msgType uint8, timeout time.Duration) (*nas.Message, error)

func (*UE) WaitForNASGSMMessage

func (ue *UE) WaitForNASGSMMessage(msgType uint8, timeout time.Duration) (*nas.Message, error)

func (*UE) WaitForPDUSession

func (ue *UE) WaitForPDUSession(pduSessionID uint8, timeout time.Duration) (PDUSessionInfo, error)

func (*UE) WaitForRRCRelease

func (ue *UE) WaitForRRCRelease(timeout time.Duration) error

type UEOpts

type UEOpts struct {
	PDUSessionID         uint8
	PDUSessionType       uint8
	Msin                 string
	UeSecurityCapability *nasType.UESecurityCapability
	K                    string
	OpC                  string
	Amf                  string
	Sqn                  string
	Mcc                  string
	Mnc                  string
	HomeNetworkPublicKey sidf.HomeNetworkPublicKey
	RoutingIndicator     string
	DNN                  string
	Sst                  int32
	Sd                   string
	IMEISV               string
	Guti                 *nasType.GUTI5G
	GnodeB               air.UplinkSender
}

type UESecurity

type UESecurity struct {
	Supi string
	Msin string

	ULCount              security.Count
	DLCount              security.Count
	UeSecurityCapability *nasType.UESecurityCapability
	IntegrityAlg         uint8
	CipheringAlg         uint8
	NgKsi                models.NgKsi
	Snn                  string
	KnasEnc              [16]uint8
	KnasInt              [16]uint8
	Kamf                 []uint8
	AuthenticationSubs   models.AuthenticationSubscription
	Suci                 nasType.MobileIdentity5GS

	RoutingIndicator string
	Guti             *nasType.GUTI5G
	// contains filtered or unexported fields
}

type UplinkNasTransportOpts

type UplinkNasTransportOpts struct {
	PDUSessionID     uint8
	PayloadContainer []byte
	DNN              string
	SNSSAI           models.Snssai
}

Directories

Path Synopsis
*
*

Jump to

Keyboard shortcuts

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