Documentation ¶
Overview ¶
Package nas is implementation for non-access stratum (NAS) procedure in the 5GS Sytem. document version: 3GPP TS 24.501 v16.3.0 (2019-12)
Index ¶
- Constants
- Variables
- func ShiftType1IE(iei bool, pdu *[]byte)
- func Str2BCD(str string) (bcd []byte)
- type AuthParam
- type AuthParamRes
- type FiveGMMCapability
- type FiveGSMobileIDIMEISV
- type FiveGSMobileIDSUCI
- type SNSSAI
- type TAI
- type UE
- func (ue *UE) ComputeAlgKey()
- func (ue *UE) ComputeKamf()
- func (ue *UE) ComputeKausf(ck, ik []byte)
- func (ue *UE) ComputeKseaf()
- func (ue *UE) ComputeMAC(dir uint8, pdu *[]byte) (mac []byte)
- func (ue *UE) ComputeRESstar(rand, res, ck, ik []byte)
- func (ue *UE) Decode(pdu *[]byte) (msgType int)
- func (ue *UE) Decode5GMM(pdu *[]byte) (msgType int)
- func (ue *UE) Decode5GSM(pdu *[]byte) (msgType int)
- func (ue *UE) MakeAuthenticationResponse() (pdu []byte)
- func (ue *UE) MakeDeregistrationRequest() (pdu []byte)
- func (ue *UE) MakeNasPdu() (pdu []byte)
- func (ue *UE) MakePDUSessionEstablishmentRequest() (pdu []byte)
- func (ue *UE) MakeRegistrationComplete() (pdu []byte)
- func (ue *UE) MakeRegistrationRequest() (pdu []byte)
- func (ue *UE) MakeSecurityModeComplete() (pdu []byte)
- func (ue *UE) MakeULNasTransport(payloadType uint8, msgType uint8, payload *[]byte) (pdu []byte)
- func (ue *UE) PowerON()
- func (ue *UE) Receive(pdu *[]byte)
- func (ue *UE) SetDebugLevel(level int)
- func (ue *UE) SetIndent(indent int)
- type UESecurityCapability
Constants ¶
const ( MMNULL = iota MMDeregistared MMRegisteredInitiated MMRegistered MMServiceRequestInitiated MMDeregistaredInitiated )
5.1.3 5GMM sublayer states actual value is not defined in the standard.
const ( SMInactive = iota SMActivePending SMInactivePending SMModificationPending SMActive )
6.1.3 5GSM sublayer states actual value is not defined in the standard.
const ( EPD5GSSessionManagement = 0x2e EPD5GSMobilityManagement = 0x7e )
TS 24.007 11.2.3.1.1A Extended protocol discriminator (EPD)
const ( SecurityHeaderTypePlain = iota SecurityHeaderTypeIntegrityProtected SecurityHeaderTypeIntegrityProtectedAndCiphered SecurityHeaderTypeIntegrityProtectedWithNewContext SecurityHeaderTypeIntegrityProtectedAndCipheredWithNewContext )
9.3 Security header type
const ( MessageTypeRegistrationRequest = 0x41 MessageTypeRegistrationAccept = 0x42 MessageTypeRegistrationComplete = 0x43 MessageTypeDeregistrationRequest = 0x45 MessageTypeDeregistrationAccept = 0x46 MessageTypeAuthenticationRequest = 0x56 MessageTypeAuthenticationResponse = 0x57 MessageTypeSecurityModeCommand = 0x5d MessageTypeSecurityModeComplete = 0x5e MessageTypeULNasTransport = 0x67 MessageTypeDLNasTransport = 0x68 MessageTypePDUSessionEstablishmentRequest = 0xc1 MessageTypePDUSessionEstablishmentAccept = 0xc2 )
9.7 Message type
const ( TypeIDNoIdentity = iota TypeIDSUCI TypeID5GGUTI TypeIDIMEI TypeID5GSTMSI TypeIDIMEISV )
9.11.3.4 5GS mobile identity I need C 'union' for golang...
const ( SUPIFormatIMSI = iota SUPIFormatNetworkSpecificID )
const ( ProtectionSchemeNull = iota ProtectionSchemeProfileA ProtectionSchemeProfileB )
const ( RegistrationTypeInitialRegistration = 0x01 RegistrationTypeFlagFollowOnRequestPending = 0x08 )
9.11.3.7 5GS registration type
const ( KeySetIdentityNoKeyIsAvailable = 0x07 KeySetIdentityFlagMappedSecurityContext = 0x08 )
9.11.3.32 NAS key set identifier
const ( EA0 = 0x80 EA1 = 0x40 EA2 = 0x20 IA0 = 0x80 IA1 = 0x40 IA2 = 0x20 )
const ( PDUSessionIPv4 = 0x01 PDUSessionIPv6 = 0x02 PDUSessionIPv4v6 = 0x03 )
9.11.4.11 PDU session type
const (
FiveGMMCapN3data = 0x20
)
const (
PayloadContainerN1SMInformation = 0x1
)
9.11.3.40 Payload container type
const (
RequestTypeInitialRequest = 0x01
)
9.11.3.47 Request type
Variables ¶
var MMstateStr = map[int]string{ MMNULL: "5GMM NULL", MMDeregistared: "5GMM DEREGISTERED", MMRegisteredInitiated: "5GMM REGISTERED-INITIATED", MMRegistered: "5GMM REGISTERED", MMServiceRequestInitiated: "5GMM SERVICE-REQUEST-INITIATED", MMDeregistaredInitiated: "5GMM DEREGISTERED-INITIATED", }
var SMstateStr = map[int]string{ SMInactive: "5GSM PDU SESSION INACTIVE", SMActivePending: "5GSM PDU SESSION ACTIVE PENDING", SMInactivePending: "5GSM PDU SESSION INACTIVE PENDING", SMModificationPending: "5GSM PDU SESSION MODIFICATION PENDING", SMActive: "5GSM PDU SESSION ACTIVE", }
Functions ¶
func ShiftType1IE ¶
Types ¶
type AuthParam ¶
type AuthParam struct { K string OPc string RESstar []byte Kausf []byte Kseaf []byte Kamf []byte Kenc []byte Kint []byte // contains filtered or unexported fields }
9.11.3.15 Authentication parameter AUTN TS 24.008 10.5.3.1.1 Authentication Parameter AUTN (UMTS and EPS authentication challenge)
type AuthParamRes ¶
type AuthParamRes struct {
// contains filtered or unexported fields
}
9.11.3.17 Authentication response parameter TS 24.301 9.9.3.4 Authentication response parameter
type FiveGMMCapability ¶
type FiveGMMCapability struct {
// contains filtered or unexported fields
}
9.11.3.1 5GMM capability
type FiveGSMobileIDIMEISV ¶
type FiveGSMobileIDIMEISV struct {
// contains filtered or unexported fields
}
type FiveGSMobileIDSUCI ¶
type FiveGSMobileIDSUCI struct {
// contains filtered or unexported fields
}
type UE ¶
type UE struct { Number int SUPI string MSIN string MCC int MNC int IMEISV string RoutingIndicator uint16 ProtectionScheme string AuthParam AuthParam SNSSAI SNSSAI DNN string URL string MMstate int SMstate int Recv struct { PDUAddress net.IP // contains filtered or unexported fields } NasCount uint32 DecodeError error // contains filtered or unexported fields }
func (*UE) ComputeAlgKey ¶
func (ue *UE) ComputeAlgKey()
TS 33.501 A.8 Algorithm key derivation functions
func (*UE) ComputeKausf ¶
TS 33.501 A.2 KAUSF derivation function
func (*UE) ComputeRESstar ¶
TS 33.501 A.4 RES* and XRES* derivation function
func (*UE) Decode5GMM ¶
8.2 5GS mobility management messages
func (*UE) Decode5GSM ¶
8.3 5GS session management messages
func (*UE) MakeAuthenticationResponse ¶
8.2.2 Authentication response
func (*UE) MakeDeregistrationRequest ¶
8.2.12 De-registration request (UE originating de-registration)
func (*UE) MakeNasPdu ¶
func (*UE) MakePDUSessionEstablishmentRequest ¶
8.3.1 PDU session establishment request
func (*UE) MakeRegistrationComplete ¶
8.2.8 Registration complete
func (*UE) MakeRegistrationRequest ¶
8.2.6 Registration request 5.5.1.2 Registration procedure for initial registration
func (*UE) MakeSecurityModeComplete ¶
8.2.26 Security mode complete
func (*UE) MakeULNasTransport ¶
8.2.10 UL NAS transport
func (*UE) SetDebugLevel ¶
type UESecurityCapability ¶
type UESecurityCapability struct {
// contains filtered or unexported fields
}
9.11.3.54 UE security capability