test

package
v3.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	N_NAS_ENC_ALG uint8 = 0x01
	N_NAS_INT_ALG uint8 = 0x02
	N_RRC_ENC_ALG uint8 = 0x03
	N_RRC_INT_ALG uint8 = 0x04
	N_UP_ENC_alg  uint8 = 0x05
	N_UP_INT_alg  uint8 = 0x06
)

TS 33501 Annex A.8 Algorithm distinguisher For Knas_int Knas_enc

View Source
const (
	ALG_INTEGRITY_128_NIA0 uint8 = 0x00 // NULL
	ALG_INTEGRITY_128_NIA1 uint8 = 0x01 // 128-Snow3G
	ALG_INTEGRITY_128_NIA2 uint8 = 0x02 // 128-AES
	ALG_INTEGRITY_128_NIA3 uint8 = 0x03 // 128-ZUC
)

TS 33501 Annex D Algorithm identifier values For Knas_int

View Source
const (
	ALG_CIPHERING_128_NEA0 uint8 = 0x00 // NULL
	ALG_CIPHERING_128_NEA1 uint8 = 0x01 // 128-Snow3G
	ALG_CIPHERING_128_NEA2 uint8 = 0x02 // 128-AES
	ALG_CIPHERING_128_NEA3 uint8 = 0x03 // 128-ZUC
)

TS 33501 Annex D Algorithm identifier values For Knas_enc

View Source
const (
	SECURITY_DIRECTION_UPLINK   uint8 = 0x00
	SECURITY_DIRECTION_DOWNLINK uint8 = 0x01
)

1bit

View Source
const (
	SECURITY_ONLY_ONE_BEARER uint8 = 0x00
	SECURITY_BEARER_3GPP     uint8 = 0x01
	SECURITY_BEARER_NON_3GPP uint8 = 0x02
)

5bits

View Source
const (
	ACCESS_TYPE_3GPP     uint8 = 0x01
	ACCESS_TYPE_NON_3GPP uint8 = 0x02
)

TS 33501 Annex A.0 Access type distinguisher For Kgnb Kn3iwf

Variables

This section is empty.

Functions

func DelAccessAndMobilitySubscriptionDataFromMongoDB

func DelAccessAndMobilitySubscriptionDataFromMongoDB(ueId string, servingPlmnId string)

func DelAmPolicyDataFromMongoDB

func DelAmPolicyDataFromMongoDB(ueId string)

func DelAuthSubscriptionToMongoDB

func DelAuthSubscriptionToMongoDB(ueId string)

func DelSessionManagementSubscriptionDataFromMongoDB

func DelSessionManagementSubscriptionDataFromMongoDB(ueId string, servingPlmnId string)

func DelSmPolicyDataFromMongoDB

func DelSmPolicyDataFromMongoDB(ueId string)

func DelSmfSelectionSubscriptionDataFromMongoDB

func DelSmfSelectionSubscriptionDataFromMongoDB(ueId string, servingPlmnId string)

func EncodeNasPduWithSecurity

func EncodeNasPduWithSecurity(ue *RanUeContext, pdu []byte) ([]byte, error)

func GetAccessAndMobilitySubscriptionDataFromMongoDB

func GetAccessAndMobilitySubscriptionDataFromMongoDB(ueId string, servingPlmnId string) (amData *models.AccessAndMobilitySubscriptionData)

func GetAmPolicyDataFromMongoDB

func GetAmPolicyDataFromMongoDB(ueId string) (amPolicyData *models.AmPolicyData)

func GetAuthSubscriptionFromMongoDB

func GetAuthSubscriptionFromMongoDB(ueId string) (authSubs *models.AuthenticationSubscription)

func GetHandoverNotify

func GetHandoverNotify(amfUeNgapID int64, ranUeNgapID int64) ([]byte, error)

func GetHandoverRequestAcknowledge

func GetHandoverRequestAcknowledge(amfUeNgapID int64, ranUeNgapID int64) ([]byte, error)

func GetHandoverRequired

func GetHandoverRequired(amfUeNgapID int64, ranUeNgapID int64, targetGNBID []byte, targetCellID []byte) ([]byte, error)

func GetInitialContextSetupResponse

func GetInitialContextSetupResponse(amfUeNgapID int64, ranUeNgapID int64) ([]byte, error)

func GetInitialContextSetupResponseForServiceRequest

func GetInitialContextSetupResponseForServiceRequest(amfUeNgapID int64, ranUeNgapID int64, ipv4 string) ([]byte, error)

func GetInitialUEMessage

func GetInitialUEMessage(ranUeNgapID int64, nasPdu []byte, fiveGSTmsi string) ([]byte, error)

func GetNGSetupRequest

func GetNGSetupRequest(gnbId []byte, bitlength uint64, name string) ([]byte, error)

func GetNasPdu

func GetNasPdu(msg *ngapType.DownlinkNASTransport) (m *nas.Message)

func GetPDUSessionResourceReleaseResponse

func GetPDUSessionResourceReleaseResponse(amfUeNgapID int64, ranUeNgapID int64) ([]byte, error)

func GetPDUSessionResourceSetupResponse

func GetPDUSessionResourceSetupResponse(amfUeNgapID int64, ranUeNgapID int64, ipv4 string) ([]byte, error)

func GetPDUSessionResourceSetupResponseForPaging

func GetPDUSessionResourceSetupResponseForPaging(amfUeNgapID int64, ranUeNgapID int64, ipv4 string) ([]byte, error)

func GetPathSwitchRequest

func GetPathSwitchRequest(amfUeNgapID int64, ranUeNgapID int64) ([]byte, error)

func GetSessionManagementDataFromMongoDB

func GetSessionManagementDataFromMongoDB(ueId string, servingPlmnId string) (amData *models.SessionManagementSubscriptionData)

func GetSmPolicyDataFromMongoDB

func GetSmPolicyDataFromMongoDB(ueId string) (smPolicyData *models.SmPolicyData)

func GetSmfSelectionSubscriptionDataFromMongoDB

func GetSmfSelectionSubscriptionDataFromMongoDB(ueId string, servingPlmnId string) (smfSelData *models.SmfSelectionSubscriptionData)

func GetUEContextReleaseComplete

func GetUEContextReleaseComplete(amfUeNgapID int64, ranUeNgapID int64, pduSessionIDList []int64) ([]byte, error)

func GetUEContextReleaseRequest

func GetUEContextReleaseRequest(amfUeNgapID int64, ranUeNgapID int64, pduSessionIDList []int64) ([]byte, error)

func GetUplinkNASTransport

func GetUplinkNASTransport(amfUeNgapID, ranUeNgapID int64, nasPdu []byte) ([]byte, error)

func InsertAccessAndMobilitySubscriptionDataToMongoDB

func InsertAccessAndMobilitySubscriptionDataToMongoDB(ueId string, amData models.AccessAndMobilitySubscriptionData, servingPlmnId string)

func InsertAmPolicyDataToMongoDB

func InsertAmPolicyDataToMongoDB(ueId string, amPolicyData models.AmPolicyData)

func InsertAuthSubscriptionToMongoDB

func InsertAuthSubscriptionToMongoDB(ueId string, authSubs models.AuthenticationSubscription)

func InsertSessionManagementSubscriptionDataToMongoDB

func InsertSessionManagementSubscriptionDataToMongoDB(ueId string, servingPlmnId string, smData models.SessionManagementSubscriptionData)

func InsertSmPolicyDataToMongoDB

func InsertSmPolicyDataToMongoDB(ueId string, smPolicyData models.SmPolicyData)

func InsertSmfSelectionSubscriptionDataToMongoDB

func InsertSmfSelectionSubscriptionDataToMongoDB(ueId string, smfSelData models.SmfSelectionSubscriptionData, servingPlmnId string)

func NASDecode

func NASDecode(ue *RanUeContext, securityHeaderType uint8, payload []byte) (msg *nas.Message, err error)

func NASEncode

func NASEncode(ue *RanUeContext, msg *nas.Message) (payload []byte, err error)

func NasEncrypt

func NasEncrypt(AlgoID uint8, KnasEnc []byte, Count []byte, Bearer uint8, Direction uint8, plainText []byte) error

func NasMacCalculate

func NasMacCalculate(AlgoID uint8, KnasInt []byte, Count []byte, Bearer uint8, Direction uint8, msg []byte) ([]byte, error)

Types

type RanUeContext

type RanUeContext struct {
	Supi               string
	RanUeNgapId        int64
	AmfUeNgapId        int64
	ULCount            uint32
	DLOverflow         uint16
	DLCountSQN         uint8
	CipheringAlg       uint8
	IntegrityAlg       uint8
	KnasEnc            []uint8
	KnasInt            []uint8
	Kamf               []uint8
	AuthenticationSubs models.AuthenticationSubscription
}

func NewRanUeContext

func NewRanUeContext(supi string, ranUeNgapId int64, cipheringAlg, integrityAlg uint8) *RanUeContext

func (*RanUeContext) DerivateAlgKey

func (ue *RanUeContext) DerivateAlgKey()

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

func (*RanUeContext) DerivateKamf

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

func (*RanUeContext) DeriveRESstarAndSetKey

func (ue *RanUeContext) DeriveRESstarAndSetKey(authSubs models.AuthenticationSubscription, RAND []byte, snNmae string) []byte

func (*RanUeContext) GetSecurityDLCount

func (ue *RanUeContext) GetSecurityDLCount() []byte

func (*RanUeContext) GetSecurityULCount

func (ue *RanUeContext) GetSecurityULCount() []byte

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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