nas

package
v0.0.0-...-701375f Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PDUSesModiReq    string = "PDU Session Modification Request"
	PDUSesModiCmp    string = "PDU Session Modification Complete"
	PDUSesModiCmdRej string = "PDU Session Modification Command Reject"
	PDUSesRelReq     string = "PDU Session Release Request"
	PDUSesRelCmp     string = "PDU Session Release Complete"
	PDUSesRelRej     string = "PDU Session Release Reject"
	PDUSesAuthCmp    string = "PDU Session Authentication Complete"
)
View Source
const (
	RmStateRegistered  = "REGISTERED"
	RmStateRegistering = "REGISTERING"
	RmStateDeregitered = "DEREGISTERED"
)
View Source
const (
	CmStateConnected = "CONNECTED"
	CmStateIdle      = "IDLE"
)
View Source
const (
	MsgRegisterSuccess       = "Registration success"
	MsgRegisterFail          = "Registration fail"
	MsgServiceRequestSuccess = "ServiceRequest success"
	MsgServiceRequestFail    = "ServiceRequest fail"
	MsgDeregisterSuccess     = "Deregistration success"
	MsgDeregisterFail        = "Deregistration fail"
)

Variables

This section is empty.

Functions

func DerivateKausf

func DerivateKausf(ck []byte, ik []byte, servingNetworkName string, sqnXorAK []byte) []byte

TS 33.501 Annex A.2

func DerivateKseaf

func DerivateKseaf(kausf []byte, servingNetworkName string) []byte

func NewTask

func NewTask() *task

Types

type NAS

type NAS struct {
	// registration related
	FollowOnRequest bool
	Supi            string // init
	Guti            *nasType.GUTI5G
	ServingPlmnId   string // init
	// security
	ULCount      security.Count
	DLCount      security.Count
	CipheringAlg uint8
	IntegrityAlg uint8
	KnasEnc      [16]uint8
	KnasInt      [16]uint8
	Kamf         []uint8
	Kn3iwf       []uint8
	NgKsi        uint8
	// PduSession
	PduSession map[int64]*SessionContext
	// related Context
	RmState *fsm.State
	CmState *fsm.State
}

func NewUeContext

func NewUeContext() *NAS

func (*NAS) AddPduSession

func (n *NAS) AddPduSession(pduSessionId uint8, dnn string, snssai models.Snssai) *SessionContext

func (*NAS) DelAllPduSession

func (n *NAS) DelAllPduSession() error

func (*NAS) DelPduSession

func (n *NAS) DelPduSession(pduSessionID int64) error

func (*NAS) DerivateAlgKey

func (n *NAS) DerivateAlgKey()

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

func (*NAS) DerivateAnKey

func (n *NAS) DerivateAnKey(accessType uint8)

Access Network key Derivation function defined in TS 33.501 Annex A.9

func (*NAS) DerivateKamf

func (n *NAS) DerivateKamf(kseaf []byte, abba []byte)

func (*NAS) DeriveRESstar

func (n *NAS) DeriveRESstar(ck []byte, ik []byte, servingNetworkName string, rand []byte, res []byte) []byte

TS 33.501 Annex A.4

func (*NAS) GetServingNetworkName

func (n *NAS) GetServingNetworkName() string

type NASTCPService

type NASTCPService struct {
	n3ue_exclusive.N3UECommon
	// contains filtered or unexported fields
}

func (*NASTCPService) Init

func (s *NASTCPService) Init(c n3ue_exclusive.N3UECommon, conn *net.TCPConn, packetIn, packetOut chan []byte)

func (*NASTCPService) Run

func (s *NASTCPService) Run()

type QosFlow

type QosFlow struct {
	Identifier int64
	Parameters ngapType.QosFlowLevelQosParameters
}

type Session

type Session struct {
	n3ue_exclusive.N3UECommon
	// contains filtered or unexported fields
}

func (*Session) BuildAuthenticationFailure

func (s *Session) BuildAuthenticationFailure(cause5GMM uint8, authenticationFailureParam []uint8) (nasPdu []byte)

func (*Session) BuildAuthenticationResponse

func (s *Session) BuildAuthenticationResponse(authenticationResponseParam []uint8, eapMsg string) (nasPdu []byte)

func (*Session) GetConfigurationUpdateComplete

func (s *Session) GetConfigurationUpdateComplete() (nasPdu []byte)

func (*Session) GetDeregistrationAccept

func (s *Session) GetDeregistrationAccept() (nasPdu []byte)

func (*Session) GetDeregistrationRequest

func (s *Session) GetDeregistrationRequest(switchOff uint8) ([]byte, error)

func (*Session) GetIdentityResponse

func (s *Session) GetIdentityResponse(mobileIdentity nasType.MobileIdentity) (nasPdu []byte)

func (*Session) GetNotificationResponse

func (s *Session) GetNotificationResponse(pDUSessionStatus []uint8) (nasPdu []byte)

func (*Session) GetPduSessionAuthenticationComplete

func (s *Session) GetPduSessionAuthenticationComplete(pduSessionId uint8) (nasPdu []byte)

func (*Session) GetPduSessionEstablishmentRequest

func (s *Session) GetPduSessionEstablishmentRequest(pduSessionId, sessionType uint8) ([]byte, error)

func (*Session) GetPduSessionModificationCommandReject

func (s *Session) GetPduSessionModificationCommandReject(pduSessionId uint8) (nasPdu []byte)

func (*Session) GetPduSessionModificationComplete

func (s *Session) GetPduSessionModificationComplete(pduSessionId uint8) ([]byte, error)

func (*Session) GetPduSessionModificationRequest

func (s *Session) GetPduSessionModificationRequest(pduSessionId uint8) (nasPdu []byte)

func (*Session) GetPduSessionReleaseCommand

func (s *Session) GetPduSessionReleaseCommand(pduSessionId uint8) (nasPdu []byte)

func (*Session) GetPduSessionReleaseComplete

func (s *Session) GetPduSessionReleaseComplete(pduSessionId uint8) ([]byte, error)

func (*Session) GetPduSessionReleaseReject

func (s *Session) GetPduSessionReleaseReject(pduSessionId uint8) (nasPdu []byte)

func (*Session) GetPduSessionReleaseRequest

func (s *Session) GetPduSessionReleaseRequest(pduSessionId uint8) ([]byte, error)

func (*Session) GetRegistrationComplete

func (s *Session) GetRegistrationComplete(sorTransparentContainer []uint8) ([]byte, error)

func (*Session) GetRegistrationRequest

func (s *Session) GetRegistrationRequest(registrationType uint8, mobileIdentity nasType.MobileIdentity5GS, capBuffer []uint8, requestedNSSAI *nasType.RequestedNSSAI, uplinkDataStatus *nasType.UplinkDataStatus) (nasPdu []byte)

func (*Session) GetRegistrationRequestWith5GMM

func (s *Session) GetRegistrationRequestWith5GMM(registrationType uint8,
	requestedNSSAI *nasType.RequestedNSSAI, uplinkDataStatus *nasType.UplinkDataStatus) ([]byte, error)

func (*Session) GetSecurityModeComplete

func (s *Session) GetSecurityModeComplete(nasMessageContainer []uint8) ([]byte, error)

TS 24.501 8.2.26

func (*Session) GetSecurityModeReject

func (s *Session) GetSecurityModeReject(cause5GMM uint8) (nasPdu []byte)

func (*Session) GetServiceRequest

func (s *Session) GetServiceRequest(serviceType uint8) ([]byte, error)

func (*Session) GetStatus5GMM

func (s *Session) GetStatus5GMM(cause uint8) (nasPdu []byte)

func (*Session) GetStatus5GSM

func (s *Session) GetStatus5GSM(pduSessionId uint8, cause uint8) (nasPdu []byte)

func (*Session) GetUlNasTransport_PduSessionCommonData

func (s *Session) GetUlNasTransport_PduSessionCommonData(pduSessionId uint8, types string) ([]byte, error)

func (*Session) GetUlNasTransport_PduSessionEstablishmentRequest

func (s *Session) GetUlNasTransport_PduSessionEstablishmentRequest(pduSessionId uint8, requestType uint8, dnnString string, sNssai *models.Snssai, gsmPdu []byte) ([]byte, error)

func (*Session) GetUlNasTransport_PduSessionModificationRequest

func (s *Session) GetUlNasTransport_PduSessionModificationRequest(pduSessionId uint8, requestType uint8, dnnString string, sNssai *models.Snssai) (nasPdu []byte)

func (*Session) GetUlNasTransport_PduSessionReleaseCommand

func (s *Session) GetUlNasTransport_PduSessionReleaseCommand(pduSessionId uint8, requestType uint8, dnnString string, sNssai *models.Snssai) (nasPdu []byte)

func (*Session) GetUlNasTransport_Status5GSM

func (s *Session) GetUlNasTransport_Status5GSM(pduSessionId uint8, cause uint8) (nasPdu []byte)

func (*Session) Init

func (s *Session) Init(c n3ue_exclusive.N3UECommon, sir, siw chan *sessInterface.SessInt)

func (*Session) NASDecode

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

func (*Session) NASEncode

func (s *Session) NASEncode(msg *nas.Message, securityContextAvailable bool, newSecurityContext bool) ([]byte, error)

func (*Session) PDUSessionEstablishmentRequest

func (s *Session) PDUSessionEstablishmentRequest(t *task) int

func (*Session) RegistrationRequest

func (s *Session) RegistrationRequest(t *task) int

func (*Session) SendAuthenticationFailure

func (s *Session) SendAuthenticationFailure(cause uint8, authFailParams []byte)

func (*Session) SendAuthenticationResponse

func (s *Session) SendAuthenticationResponse(resStar []byte)

func (*Session) SendSecurityModeCommand

func (s *Session) SendSecurityModeCommand(nasMsg []byte)

func (*Session) SessionStopHard

func (s *Session) SessionStopHard() error

type SessionContext

type SessionContext struct {
	Mtx sync.Mutex
	// GtpHdr       []byte
	// GtpHdrLen    uint16
	PduSessionId int64
	Dnn          string
	Snssai       models.Snssai
	Link         *netlink.Gretun
	Addr         *netlink.Addr
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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