Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
UERANSIM
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
UERANSIM
Commits
2342f910
Commit
2342f910
authored
May 21, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
L3 RRC/NAS developments
parent
8eb13e64
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
121 additions
and
83 deletions
+121
-83
src/ue/nas/mm/auth.cpp
src/ue/nas/mm/auth.cpp
+1
-1
src/ue/nas/mm/base.cpp
src/ue/nas/mm/base.cpp
+47
-9
src/ue/nas/mm/dereg.cpp
src/ue/nas/mm/dereg.cpp
+11
-11
src/ue/nas/mm/ecall.cpp
src/ue/nas/mm/ecall.cpp
+1
-1
src/ue/nas/mm/mm.hpp
src/ue/nas/mm/mm.hpp
+1
-1
src/ue/nas/mm/radio.cpp
src/ue/nas/mm/radio.cpp
+8
-8
src/ue/nas/mm/register.cpp
src/ue/nas/mm/register.cpp
+21
-21
src/ue/nas/mm/service.cpp
src/ue/nas/mm/service.cpp
+12
-12
src/ue/nas/mm/timer.cpp
src/ue/nas/mm/timer.cpp
+4
-4
src/ue/nas/mm/transport.cpp
src/ue/nas/mm/transport.cpp
+1
-1
src/ue/types.cpp
src/ue/types.cpp
+8
-8
src/ue/types.hpp
src/ue/types.hpp
+6
-6
No files found.
src/ue/nas/mm/auth.cpp
View file @
2342f910
...
...
@@ -446,7 +446,7 @@ void NasMm::receiveAuthenticationReject(const nas::AuthenticationReject &msg)
m_timers
->
t3519
.
stop
();
m_timers
->
t3521
.
stop
();
// .. and enter state 5GMM-DEREGISTERED.
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmSubState
::
MM_DEREGISTERED_NA
);
switchMmState
(
EMmS
ubState
::
MM_DEREGISTERED_PS
);
}
void
NasMm
::
receiveEapSuccessMessage
(
const
eap
::
Eap
&
eap
)
...
...
src/ue/nas/mm/base.cpp
View file @
2342f910
...
...
@@ -18,6 +18,42 @@
namespace
nr
::
ue
{
static
EMmState
GetMmStateFromSubState
(
EMmSubState
subState
)
{
switch
(
subState
)
{
case
EMmSubState
:
:
MM_NULL_PS
:
return
EMmState
::
MM_NULL
;
case
EMmSubState
:
:
MM_DEREGISTERED_PS
:
case
EMmSubState
:
:
MM_DEREGISTERED_NORMAL_SERVICE
:
case
EMmSubState
:
:
MM_DEREGISTERED_LIMITED_SERVICE
:
case
EMmSubState
:
:
MM_DEREGISTERED_ATTEMPTING_REGISTRATION
:
case
EMmSubState
:
:
MM_DEREGISTERED_PLMN_SEARCH
:
case
EMmSubState
:
:
MM_DEREGISTERED_NO_SUPI
:
case
EMmSubState
:
:
MM_DEREGISTERED_NO_CELL_AVAILABLE
:
case
EMmSubState
:
:
MM_DEREGISTERED_ECALL_INACTIVE
:
case
EMmSubState
:
:
MM_DEREGISTERED_INITIAL_REGISTRATION_NEEDED
:
return
EMmState
::
MM_DEREGISTERED
;
case
EMmSubState
:
:
MM_REGISTERED_INITIATED_PS
:
return
EMmState
::
MM_REGISTERED_INITIATED
;
case
EMmSubState
:
:
MM_REGISTERED_PS
:
case
EMmSubState
:
:
MM_REGISTERED_NORMAL_SERVICE
:
case
EMmSubState
:
:
MM_REGISTERED_NON_ALLOWED_SERVICE
:
case
EMmSubState
:
:
MM_REGISTERED_ATTEMPTING_REGISTRATION_UPDATE
:
case
EMmSubState
:
:
MM_REGISTERED_LIMITED_SERVICE
:
case
EMmSubState
:
:
MM_REGISTERED_PLMN_SEARCH
:
case
EMmSubState
:
:
MM_REGISTERED_NO_CELL_AVAILABLE
:
case
EMmSubState
:
:
MM_REGISTERED_UPDATE_NEEDED
:
return
EMmState
::
MM_REGISTERED
;
case
EMmSubState
:
:
MM_DEREGISTERED_INITIATED_PS
:
return
EMmState
::
MM_DEREGISTERED_INITIATED
;
case
EMmSubState
:
:
MM_SERVICE_REQUEST_INITIATED_PS
:
return
EMmState
::
MM_SERVICE_REQUEST_INITIATED
;
}
std
::
terminate
();
}
NasMm
::
NasMm
(
TaskBase
*
base
,
UeTimers
*
timers
)
:
m_base
{
base
},
m_timers
{
timers
},
m_sm
{},
m_usim
{}
{
m_logger
=
base
->
logBase
->
makeUniqueLogger
(
base
->
config
->
getLoggerPrefix
()
+
"nas"
);
...
...
@@ -25,7 +61,7 @@ NasMm::NasMm(TaskBase *base, UeTimers *timers) : m_base{base}, m_timers{timers},
m_rmState
=
ERmState
::
RM_DEREGISTERED
;
m_cmState
=
ECmState
::
CM_IDLE
;
m_mmState
=
EMmState
::
MM_DEREGISTERED
;
m_mmSubState
=
EMmSubState
::
MM_DEREGISTERED_
NA
;
m_mmSubState
=
EMmSubState
::
MM_DEREGISTERED_
PS
;
m_storage
=
new
MmStorage
(
m_base
);
}
...
...
@@ -57,9 +93,9 @@ void NasMm::performMmCycle()
if
(
switchToECallInactivityIfNeeded
())
return
;
if
(
m_mmSubState
==
EMmSubState
::
MM_DEREGISTERED_
NA
)
if
(
m_mmSubState
==
EMmSubState
::
MM_DEREGISTERED_
PS
)
{
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmS
ubState
::
MM_DEREGISTERED_PLMN_SEARCH
);
switchMmState
(
EMmSubState
::
MM_DEREGISTERED_PLMN_SEARCH
);
return
;
}
else
if
(
m_mmSubState
==
EMmSubState
::
MM_DEREGISTERED_NORMAL_SERVICE
)
...
...
@@ -106,9 +142,9 @@ void NasMm::performMmCycle()
if
(
startECallInactivityIfNeeded
())
return
;
if
(
m_mmSubState
==
EMmSubState
::
MM_REGISTERED_
NA
)
if
(
m_mmSubState
==
EMmSubState
::
MM_REGISTERED_
PS
)
{
switchMmState
(
EMmS
tate
::
MM_REGISTERED
,
EMmS
ubState
::
MM_REGISTERED_PLMN_SEARCH
);
switchMmState
(
EMmSubState
::
MM_REGISTERED_PLMN_SEARCH
);
return
;
}
else
if
(
m_mmSubState
==
EMmSubState
::
MM_REGISTERED_NORMAL_SERVICE
)
...
...
@@ -160,8 +196,10 @@ void NasMm::performMmCycle()
}
}
void
NasMm
::
switchMmState
(
EMmS
tate
state
,
EMmS
ubState
subState
)
void
NasMm
::
switchMmState
(
EMmSubState
subState
)
{
EMmState
state
=
GetMmStateFromSubState
(
subState
);
ERmState
oldRmState
=
m_rmState
;
if
(
state
==
EMmState
::
MM_DEREGISTERED
||
state
==
EMmState
::
MM_REGISTERED_INITIATED
)
m_rmState
=
ERmState
::
RM_DEREGISTERED
;
...
...
@@ -298,7 +336,7 @@ void NasMm::onSwitchCmState(ECmState oldState, ECmState newState)
if
(
regType
==
nas
::
ERegistrationType
::
INITIAL_REGISTRATION
||
regType
==
nas
::
ERegistrationType
::
EMERGENCY_REGISTRATION
)
{
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmSubState
::
MM_DEREGISTERED_NA
);
switchMmState
(
EMmS
ubState
::
MM_DEREGISTERED_PS
);
switchUState
(
E5UState
::
U2_NOT_UPDATED
);
handleAbnormalInitialRegFailure
(
regType
);
...
...
@@ -315,12 +353,12 @@ void NasMm::onSwitchCmState(ECmState oldState, ECmState newState)
// if the de-registration procedure was performed due to disabling of 5GS services, the UE shall enter the
// 5GMM-NULL state;
if
(
m_lastDeregCause
==
EDeregCause
::
DISABLE_5G
)
switchMmState
(
EMmS
tate
::
MM_NULL
,
EMmSubState
::
MM_NULL_NA
);
switchMmState
(
EMmS
ubState
::
MM_NULL_PS
);
// if the de-registration type "normal de-registration" was requested for reasons other than disabling of
// 5GS services, the UE shall enter the 5GMM-DEREGISTERED state.
else
if
(
m_lastDeregistrationRequest
->
deRegistrationType
.
switchOff
==
nas
::
ESwitchOff
::
NORMAL_DE_REGISTRATION
)
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmSubState
::
MM_DEREGISTERED_NA
);
switchMmState
(
EMmS
ubState
::
MM_DEREGISTERED_PS
);
}
// If the UE enters the 5GMM-IDLE, the RAND and RES* values stored
...
...
src/ue/nas/mm/dereg.cpp
View file @
2342f910
...
...
@@ -79,10 +79,10 @@ void NasMm::sendDeregistration(EDeregCause deregCause)
m_sm
->
localReleaseAllSessions
();
if
(
m_lastDeregistrationRequest
->
deRegistrationType
.
switchOff
==
nas
::
ESwitchOff
::
NORMAL_DE_REGISTRATION
)
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED_INITIATED
,
EMmSubState
::
MM_DEREGISTERED_INITIATED_NA
);
switchMmState
(
EMmS
ubState
::
MM_DEREGISTERED_INITIATED_PS
);
else
{
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmSubState
::
MM_DEREGISTERED_NA
);
switchMmState
(
EMmS
ubState
::
MM_DEREGISTERED_PS
);
}
}
...
...
@@ -90,7 +90,7 @@ void NasMm::receiveDeregistrationAccept(const nas::DeRegistrationAcceptUeOrigina
{
m_logger
->
debug
(
"De-registration accept received"
);
if
(
m_mmS
ubState
!=
EMmSubState
::
MM_DEREGISTERED_INITIATED_NA
)
if
(
m_mmS
tate
!=
EMmState
::
MM_DEREGISTERED_INITIATED
)
{
m_logger
->
warn
(
"De-registration accept message ignored. UE is not in MM_DEREGISTERED_INITIATED"
);
sendMmStatus
(
nas
::
EMmCause
::
MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE
);
...
...
@@ -105,9 +105,9 @@ void NasMm::receiveDeregistrationAccept(const nas::DeRegistrationAcceptUeOrigina
m_sm
->
localReleaseAllSessions
();
if
(
m_lastDeregCause
==
EDeregCause
::
DISABLE_5G
)
switchMmState
(
EMmS
tate
::
MM_NULL
,
EMmSubState
::
MM_NULL_NA
);
switchMmState
(
EMmS
ubState
::
MM_NULL_PS
);
else
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmSubState
::
MM_DEREGISTERED_NA
);
switchMmState
(
EMmS
ubState
::
MM_DEREGISTERED_PS
);
m_logger
->
info
(
"De-registration is successful"
);
}
...
...
@@ -203,7 +203,7 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi
m_usim
->
m_nonCurrentNsCtx
=
{};
switchUState
(
E5UState
::
U2_NOT_UPDATED
);
m_timers
->
t3502
.
start
();
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmS
ubState
::
MM_DEREGISTERED_PLMN_SEARCH
);
switchMmState
(
EMmSubState
::
MM_DEREGISTERED_PLMN_SEARCH
);
};
// "If the de-registration type indicates "re-registration not required", the UE shall take the actions depending on
...
...
@@ -258,19 +258,19 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi
}
if
(
cause
==
nas
::
EMmCause
::
ILLEGAL_UE
||
cause
==
nas
::
EMmCause
::
FIVEG_SERVICES_NOT_ALLOWED
)
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmSubState
::
MM_DEREGISTERED_NA
);
switchMmState
(
EMmS
ubState
::
MM_DEREGISTERED_PS
);
if
(
cause
==
nas
::
EMmCause
::
PLMN_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
ROAMING_NOT_ALLOWED_IN_TA
)
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmS
ubState
::
MM_DEREGISTERED_PLMN_SEARCH
);
switchMmState
(
EMmSubState
::
MM_DEREGISTERED_PLMN_SEARCH
);
if
(
cause
==
nas
::
EMmCause
::
TA_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
NO_SUITIBLE_CELLS_IN_TA
)
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmS
ubState
::
MM_DEREGISTERED_LIMITED_SERVICE
);
switchMmState
(
EMmSubState
::
MM_DEREGISTERED_LIMITED_SERVICE
);
if
(
cause
==
nas
::
EMmCause
::
CONGESTION
)
{
m_timers
->
t3346
.
stop
();
switchUState
(
E5UState
::
U2_NOT_UPDATED
);
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmS
ubState
::
MM_DEREGISTERED_ATTEMPTING_REGISTRATION
);
switchMmState
(
EMmSubState
::
MM_DEREGISTERED_ATTEMPTING_REGISTRATION
);
if
(
msg
.
t3346Value
.
has_value
()
&&
nas
::
utils
::
HasValue
(
*
msg
.
t3346Value
))
m_timers
->
t3346
.
start
(
*
msg
.
t3346Value
);
...
...
@@ -278,7 +278,7 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi
if
(
cause
==
nas
::
EMmCause
::
N1_MODE_NOT_ALLOWED
)
{
switchMmState
(
EMmS
tate
::
MM_NULL
,
EMmSubState
::
MM_NULL_NA
);
switchMmState
(
EMmS
ubState
::
MM_NULL_PS
);
setN1Capability
(
false
);
}
...
...
src/ue/nas/mm/ecall.cpp
View file @
2342f910
...
...
@@ -95,7 +95,7 @@ bool NasMm::switchToECallInactivityIfNeeded()
m_usim
->
m_nonCurrentNsCtx
=
{};
// Perform item d) in 5.5.3
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmS
ubState
::
MM_DEREGISTERED_ECALL_INACTIVE
);
switchMmState
(
EMmSubState
::
MM_DEREGISTERED_ECALL_INACTIVE
);
return
true
;
}
...
...
src/ue/nas/mm/mm.hpp
View file @
2342f910
...
...
@@ -79,7 +79,7 @@ class NasMm
private:
/* Base */
void
triggerMmCycle
();
void
performMmCycle
();
void
switchMmState
(
EMmS
tate
state
,
EMmS
ubState
subState
);
void
switchMmState
(
EMmSubState
subState
);
void
switchCmState
(
ECmState
state
);
void
switchUState
(
E5UState
state
);
void
onSwitchMmState
(
EMmState
oldState
,
EMmState
newState
,
EMmSubState
oldSubState
,
EMmSubState
newSubSate
);
...
...
src/ue/nas/mm/radio.cpp
View file @
2342f910
...
...
@@ -28,12 +28,12 @@ void NasMm::performPlmnSelection()
{
if
(
m_mmSubState
==
EMmSubState
::
MM_REGISTERED_PLMN_SEARCH
)
{
switchMmState
(
EMmS
tate
::
MM_REGISTERED
,
EMmS
ubState
::
MM_REGISTERED_NO_CELL_AVAILABLE
);
switchMmState
(
EMmSubState
::
MM_REGISTERED_NO_CELL_AVAILABLE
);
return
;
}
else
if
(
m_mmSubState
==
EMmSubState
::
MM_DEREGISTERED_PLMN_SEARCH
)
{
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmS
ubState
::
MM_DEREGISTERED_NO_CELL_AVAILABLE
);
switchMmState
(
EMmSubState
::
MM_DEREGISTERED_NO_CELL_AVAILABLE
);
return
;
}
}
...
...
@@ -128,16 +128,16 @@ void NasMm::performPlmnSelection()
if
(
cellCategory
==
ECellCategory
::
SUITABLE_CELL
)
{
if
(
m_mmState
==
EMmState
::
MM_REGISTERED
)
switchMmState
(
EMmS
tate
::
MM_REGISTERED
,
EMmS
ubState
::
MM_REGISTERED_NORMAL_SERVICE
);
switchMmState
(
EMmSubState
::
MM_REGISTERED_NORMAL_SERVICE
);
else
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmS
ubState
::
MM_DEREGISTERED_NORMAL_SERVICE
);
switchMmState
(
EMmSubState
::
MM_DEREGISTERED_NORMAL_SERVICE
);
}
else
{
if
(
m_mmState
==
EMmState
::
MM_REGISTERED
)
switchMmState
(
EMmS
tate
::
MM_REGISTERED
,
EMmS
ubState
::
MM_REGISTERED_LIMITED_SERVICE
);
switchMmState
(
EMmSubState
::
MM_REGISTERED_LIMITED_SERVICE
);
else
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmS
ubState
::
MM_DEREGISTERED_LIMITED_SERVICE
);
switchMmState
(
EMmSubState
::
MM_DEREGISTERED_LIMITED_SERVICE
);
}
}
}
...
...
@@ -201,9 +201,9 @@ void NasMm::handleRadioLinkFailure()
handleRrcConnectionRelease
();
if
(
m_mmState
==
EMmState
::
MM_REGISTERED
)
switchMmState
(
EMmS
tate
::
MM_REGISTERED
,
EMmSubState
::
MM_REGISTERED_NA
);
switchMmState
(
EMmS
ubState
::
MM_REGISTERED_PS
);
else
if
(
m_mmState
==
EMmState
::
MM_DEREGISTERED
)
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmSubState
::
MM_DEREGISTERED_NA
);
switchMmState
(
EMmS
ubState
::
MM_DEREGISTERED_PS
);
}
void
NasMm
::
localReleaseConnection
()
...
...
src/ue/nas/mm/register.cpp
View file @
2342f910
...
...
@@ -51,7 +51,7 @@ void NasMm::sendInitialRegistration(EInitialRegCause regCause)
m_usim
->
m_currentNsCtx
=
{};
// Switch MM state
switchMmState
(
EMmS
tate
::
MM_REGISTERED_INITIATED
,
EMmSubState
::
MM_REGISTERED_INITIATED_NA
);
switchMmState
(
EMmS
ubState
::
MM_REGISTERED_INITIATED_PS
);
// Prepare requested NSSAI
bool
isDefaultNssai
{};
...
...
@@ -140,7 +140,7 @@ void NasMm::sendMobilityRegistration(ERegUpdateCause updateCause)
ToJson
(
updateCause
).
str
().
c_str
());
// Switch state
switchMmState
(
EMmS
tate
::
MM_REGISTERED_INITIATED
,
EMmSubState
::
MM_REGISTERED_INITIATED_NA
);
switchMmState
(
EMmS
ubState
::
MM_REGISTERED_INITIATED_PS
);
// Prepare FOR pending field
nas
::
EFollowOnRequest
followOn
=
nas
::
EFollowOnRequest
::
FOR_PENDING
;
...
...
@@ -251,7 +251,7 @@ void NasMm::receiveInitialRegistrationAccept(const nas::RegistrationAccept &msg)
// Upon receipt of the REGISTRATION ACCEPT message, the UE shall reset the registration attempt counter, enter state
// 5GMM-REGISTERED and set the 5GS update status to 5U1 UPDATED.
resetRegAttemptCounter
();
switchMmState
(
EMmS
tate
::
MM_REGISTERED
,
EMmS
ubState
::
MM_REGISTERED_NORMAL_SERVICE
);
switchMmState
(
EMmSubState
::
MM_REGISTERED_NORMAL_SERVICE
);
switchUState
(
E5UState
::
U1_UPDATED
);
// If the REGISTRATION ACCEPT message included a T3512 value IE, the UE shall use the value in the T3512 value IE as
...
...
@@ -361,7 +361,7 @@ void NasMm::receiveMobilityRegistrationAccept(const nas::RegistrationAccept &msg
// request attempt counter, enter state 5GMM-REGISTERED and set the 5GS update status to 5U1 UPDATED."
resetRegAttemptCounter
();
m_serCounter
=
0
;
switchMmState
(
EMmS
tate
::
MM_REGISTERED
,
EMmS
ubState
::
MM_REGISTERED_NORMAL_SERVICE
);
switchMmState
(
EMmSubState
::
MM_REGISTERED_NORMAL_SERVICE
);
switchUState
(
E5UState
::
U1_UPDATED
);
// "If the ACCEPT message included a T3512 value IE, the UE shall use the value in T3512 value IE as
...
...
@@ -528,24 +528,24 @@ void NasMm::receiveInitialRegistrationReject(const nas::RegistrationReject &msg)
if
(
cause
==
nas
::
EMmCause
::
ILLEGAL_UE
||
cause
==
nas
::
EMmCause
::
ILLEGAL_ME
||
cause
==
nas
::
EMmCause
::
FIVEG_SERVICES_NOT_ALLOWED
)
{
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmSubState
::
MM_DEREGISTERED_NA
);
switchMmState
(
EMmS
ubState
::
MM_DEREGISTERED_PS
);
}
if
(
cause
==
nas
::
EMmCause
::
TA_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
ROAMING_NOT_ALLOWED_IN_TA
||
cause
==
nas
::
EMmCause
::
NO_SUITIBLE_CELLS_IN_TA
)
{
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmS
ubState
::
MM_DEREGISTERED_LIMITED_SERVICE
);
switchMmState
(
EMmSubState
::
MM_DEREGISTERED_LIMITED_SERVICE
);
}
if
(
cause
==
nas
::
EMmCause
::
N1_MODE_NOT_ALLOWED
)
{
switchMmState
(
EMmS
tate
::
MM_NULL
,
EMmSubState
::
MM_NULL_NA
);
switchMmState
(
EMmS
ubState
::
MM_NULL_PS
);
setN1Capability
(
false
);
}
if
(
cause
==
nas
::
EMmCause
::
PLMN_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
SERVING_NETWORK_NOT_AUTHORIZED
)
{
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmS
ubState
::
MM_DEREGISTERED_PLMN_SEARCH
);
switchMmState
(
EMmSubState
::
MM_DEREGISTERED_PLMN_SEARCH
);
}
if
(
cause
==
nas
::
EMmCause
::
PLMN_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
TA_NOT_ALLOWED
||
...
...
@@ -583,7 +583,7 @@ void NasMm::receiveInitialRegistrationReject(const nas::RegistrationReject &msg)
if
(
msg
.
t3346value
.
has_value
()
&&
nas
::
utils
::
HasValue
(
*
msg
.
t3346value
))
{
switchUState
(
E5UState
::
U2_NOT_UPDATED
);
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmS
ubState
::
MM_DEREGISTERED_ATTEMPTING_REGISTRATION
);
switchMmState
(
EMmSubState
::
MM_DEREGISTERED_ATTEMPTING_REGISTRATION
);
m_timers
->
t3346
.
stop
();
if
(
msg
.
sht
!=
nas
::
ESecurityHeaderType
::
NOT_PROTECTED
)
...
...
@@ -609,7 +609,7 @@ void NasMm::receiveInitialRegistrationReject(const nas::RegistrationReject &msg)
else
if
(
regType
==
nas
::
ERegistrationType
::
EMERGENCY_REGISTRATION
)
{
if
(
cause
==
nas
::
EMmCause
::
PEI_NOT_ACCEPTED
)
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmS
ubState
::
MM_DEREGISTERED_NO_SUPI
);
switchMmState
(
EMmSubState
::
MM_DEREGISTERED_NO_SUPI
);
else
{
// Spec says that upper layers should be informed as well, for additional action for emergency
...
...
@@ -688,29 +688,29 @@ void NasMm::receiveMobilityRegistrationReject(const nas::RegistrationReject &msg
cause
==
nas
::
EMmCause
::
FIVEG_SERVICES_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
UE_IDENTITY_CANNOT_BE_DERIVED_FROM_NETWORK
)
{
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmSubState
::
MM_DEREGISTERED_NA
);
switchMmState
(
EMmS
ubState
::
MM_DEREGISTERED_PS
);
}
if
(
cause
==
nas
::
EMmCause
::
IMPLICITY_DEREGISTERED
)
{
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmS
ubState
::
MM_DEREGISTERED_NORMAL_SERVICE
);
switchMmState
(
EMmSubState
::
MM_DEREGISTERED_NORMAL_SERVICE
);
}
if
(
cause
==
nas
::
EMmCause
::
TA_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
ROAMING_NOT_ALLOWED_IN_TA
||
cause
==
nas
::
EMmCause
::
NO_SUITIBLE_CELLS_IN_TA
)
{
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmS
ubState
::
MM_DEREGISTERED_LIMITED_SERVICE
);
switchMmState
(
EMmSubState
::
MM_DEREGISTERED_LIMITED_SERVICE
);
}
if
(
cause
==
nas
::
EMmCause
::
N1_MODE_NOT_ALLOWED
)
{
switchMmState
(
EMmS
tate
::
MM_NULL
,
EMmSubState
::
MM_NULL_NA
);
switchMmState
(
EMmS
ubState
::
MM_NULL_PS
);
setN1Capability
(
false
);
}
if
(
cause
==
nas
::
EMmCause
::
PLMN_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
SERVING_NETWORK_NOT_AUTHORIZED
)
{
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmS
ubState
::
MM_DEREGISTERED_PLMN_SEARCH
);
switchMmState
(
EMmSubState
::
MM_DEREGISTERED_PLMN_SEARCH
);
}
if
(
cause
==
nas
::
EMmCause
::
PLMN_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
TA_NOT_ALLOWED
||
...
...
@@ -749,7 +749,7 @@ void NasMm::receiveMobilityRegistrationReject(const nas::RegistrationReject &msg
if
(
!
hasEmergency
())
{
switchUState
(
E5UState
::
U2_NOT_UPDATED
);
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmS
ubState
::
MM_DEREGISTERED_ATTEMPTING_REGISTRATION
);
switchMmState
(
EMmSubState
::
MM_DEREGISTERED_ATTEMPTING_REGISTRATION
);
}
m_timers
->
t3346
.
stop
();
...
...
@@ -803,7 +803,7 @@ void NasMm::handleAbnormalInitialRegFailure(nas::ERegistrationType regType)
if
(
!
hasEmergency
())
{
m_timers
->
t3511
.
start
();
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmS
ubState
::
MM_DEREGISTERED_ATTEMPTING_REGISTRATION
);
switchMmState
(
EMmSubState
::
MM_DEREGISTERED_ATTEMPTING_REGISTRATION
);
}
}
else
...
...
@@ -823,7 +823,7 @@ void NasMm::handleAbnormalInitialRegFailure(nas::ERegistrationType regType)
// 5GMM-DEREGISTERED.ATTEMPTING-REGISTRATION or optionally to 5GMM-DEREGISTERED.PLMN-SEARCH in order to perform
// a PLMN selection according to 3GPP TS 23.122 [5].
switchUState
(
E5UState
::
U2_NOT_UPDATED
);
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmS
ubState
::
MM_DEREGISTERED_ATTEMPTING_REGISTRATION
);
switchMmState
(
EMmSubState
::
MM_DEREGISTERED_ATTEMPTING_REGISTRATION
);
}
}
...
...
@@ -851,7 +851,7 @@ void NasMm::handleAbnormalMobilityRegFailure(nas::ERegistrationType regType)
// procedure is triggered again"
m_timers
->
t3511
.
start
();
// todo
switchUState
(
E5UState
::
U2_NOT_UPDATED
);
switchMmState
(
EMmS
tate
::
MM_REGISTERED
,
EMmS
ubState
::
MM_REGISTERED_ATTEMPTING_REGISTRATION_UPDATE
);
switchMmState
(
EMmSubState
::
MM_REGISTERED_ATTEMPTING_REGISTRATION_UPDATE
);
}
// "If the TAI of the current serving cell is included in the TAI list, the 5GS update status is equal to 5U1
...
...
@@ -860,7 +860,7 @@ void NasMm::handleAbnormalMobilityRegFailure(nas::ERegistrationType regType)
if
(
includedInTaiList
&&
m_usim
->
m_uState
==
E5UState
::
U1_UPDATED
)
{
// "The UE shall keep the 5GS update status to 5U1 UPDATED and enter state 5GMM-REGISTERED.NORMAL-SERVICE."
switchMmState
(
EMmS
tate
::
MM_REGISTERED
,
EMmS
ubState
::
MM_REGISTERED_NORMAL_SERVICE
);
switchMmState
(
EMmSubState
::
MM_REGISTERED_NORMAL_SERVICE
);
// "The UE shall start timer T3511"
m_timers
->
t3511
.
start
();
}
...
...
@@ -874,7 +874,7 @@ void NasMm::handleAbnormalMobilityRegFailure(nas::ERegistrationType regType)
// "The UE shall delete the list of equivalent PLMNs and shall change to state
// 5GMM-REGISTERED.ATTEMPTING-REGISTRATION-UPDATE UPDATE"
m_usim
->
m_equivalentPlmnList
=
{};
switchMmState
(
EMmS
tate
::
MM_REGISTERED
,
EMmS
ubState
::
MM_REGISTERED_ATTEMPTING_REGISTRATION_UPDATE
);
switchMmState
(
EMmSubState
::
MM_REGISTERED_ATTEMPTING_REGISTRATION_UPDATE
);
}
}
...
...
src/ue/nas/mm/service.cpp
View file @
2342f910
...
...
@@ -159,7 +159,7 @@ void NasMm::sendServiceRequest(EServiceReqCause reqCause)
m_lastServiceRequest
=
std
::
move
(
request
);
m_lastServiceReqCause
=
reqCause
;
m_timers
->
t3517
.
start
();
switchMmState
(
EMmS
tate
::
MM_SERVICE_REQUEST_INITIATED
,
EMmSubState
::
MM_SERVICE_REQUEST_INITIATED_NA
);
switchMmState
(
EMmS
ubState
::
MM_SERVICE_REQUEST_INITIATED_PS
);
}
void
NasMm
::
receiveServiceAccept
(
const
nas
::
ServiceAccept
&
msg
)
...
...
@@ -176,7 +176,7 @@ void NasMm::receiveServiceAccept(const nas::ServiceAccept &msg)
m_logger
->
info
(
"Service Accept received"
);
m_serCounter
=
0
;
m_timers
->
t3517
.
stop
();
switchMmState
(
EMmS
tate
::
MM_REGISTERED
,
EMmSubState
::
MM_REGISTERED_NA
);
switchMmState
(
EMmS
ubState
::
MM_REGISTERED_PS
);
}
else
{
...
...
@@ -245,7 +245,7 @@ void NasMm::receiveServiceReject(const nas::ServiceReject &msg)
auto
handleAbnormalCase
=
[
this
]()
{
m_logger
->
debug
(
"Handling Service Reject abnormal case"
);
switchMmState
(
EMmS
tate
::
MM_REGISTERED
,
EMmSubState
::
MM_REGISTERED_NA
);
switchMmState
(
EMmS
ubState
::
MM_REGISTERED_PS
);
m_timers
->
t3517
.
stop
();
};
...
...
@@ -342,37 +342,37 @@ void NasMm::receiveServiceReject(const nas::ServiceReject &msg)
cause
==
nas
::
EMmCause
::
FIVEG_SERVICES_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
UE_IDENTITY_CANNOT_BE_DERIVED_FROM_NETWORK
)
{
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmSubState
::
MM_DEREGISTERED_NA
);
switchMmState
(
EMmS
ubState
::
MM_DEREGISTERED_PS
);
}
if
(
cause
==
nas
::
EMmCause
::
IMPLICITY_DEREGISTERED
)
{
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmS
ubState
::
MM_DEREGISTERED_NORMAL_SERVICE
);
switchMmState
(
EMmSubState
::
MM_DEREGISTERED_NORMAL_SERVICE
);
}
if
(
cause
==
nas
::
EMmCause
::
PLMN_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
SERVING_NETWORK_NOT_AUTHORIZED
)
{
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmS
ubState
::
MM_DEREGISTERED_PLMN_SEARCH
);
switchMmState
(
EMmSubState
::
MM_DEREGISTERED_PLMN_SEARCH
);
}
if
(
cause
==
nas
::
EMmCause
::
TA_NOT_ALLOWED
)
{
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmS
ubState
::
MM_DEREGISTERED_LIMITED_SERVICE
);
switchMmState
(
EMmSubState
::
MM_DEREGISTERED_LIMITED_SERVICE
);
}
if
(
cause
==
nas
::
EMmCause
::
ROAMING_NOT_ALLOWED_IN_TA
)
{
switchMmState
(
EMmS
tate
::
MM_REGISTERED
,
EMmS
ubState
::
MM_REGISTERED_PLMN_SEARCH
);
switchMmState
(
EMmSubState
::
MM_REGISTERED_PLMN_SEARCH
);
}
if
(
cause
==
nas
::
EMmCause
::
NO_SUITIBLE_CELLS_IN_TA
)
{
switchMmState
(
EMmS
tate
::
MM_REGISTERED
,
EMmS
ubState
::
MM_REGISTERED_LIMITED_SERVICE
);
switchMmState
(
EMmSubState
::
MM_REGISTERED_LIMITED_SERVICE
);
}
if
(
cause
==
nas
::
EMmCause
::
N1_MODE_NOT_ALLOWED
)
{
switchMmState
(
EMmS
tate
::
MM_NULL
,
EMmSubState
::
MM_NULL_NA
);
switchMmState
(
EMmS
ubState
::
MM_NULL_PS
);
setN1Capability
(
false
);
}
...
...
@@ -394,7 +394,7 @@ void NasMm::receiveServiceReject(const nas::ServiceReject &msg)
{
if
(
!
hasEmergency
())
{
switchMmState
(
EMmS
tate
::
MM_REGISTERED
,
EMmSubState
::
MM_REGISTERED_NA
);
switchMmState
(
EMmS
ubState
::
MM_REGISTERED_PS
);
m_timers
->
t3517
.
stop
();
}
...
...
@@ -414,7 +414,7 @@ void NasMm::receiveServiceReject(const nas::ServiceReject &msg)
if
(
cause
==
nas
::
EMmCause
::
RESTRICTED_SERVICE_AREA
)
{
switchMmState
(
EMmS
tate
::
MM_REGISTERED
,
EMmS
ubState
::
MM_REGISTERED_NON_ALLOWED_SERVICE
);
switchMmState
(
EMmSubState
::
MM_REGISTERED_NON_ALLOWED_SERVICE
);
if
(
m_lastServiceRequest
->
serviceType
.
serviceType
!=
nas
::
EServiceType
::
ELEVATED_SIGNALLING
)
sendMobilityRegistration
(
ERegUpdateCause
::
RESTRICTED_SERVICE_AREA
);
...
...
src/ue/nas/mm/timer.cpp
View file @
2342f910
...
...
@@ -53,7 +53,7 @@ void NasMm::onTimerExpire(nas::NasTimer &timer)
// The UE shall abort the registration procedure for initial registration and the NAS signalling
// connection, if any, shall be released locally if the initial registration request is not for
// emergency services..
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmSubState
::
MM_DEREGISTERED_NA
);
switchMmState
(
EMmS
ubState
::
MM_DEREGISTERED_PS
);
switchUState
(
E5UState
::
U2_NOT_UPDATED
);
if
(
m_lastRegistrationRequest
->
registrationType
.
registrationType
!=
...
...
@@ -95,7 +95,7 @@ void NasMm::onTimerExpire(nas::NasTimer &timer)
{
logExpired
();
switchMmState
(
EMmS
tate
::
MM_REGISTERED
,
EMmSubState
::
MM_REGISTERED_NA
);
switchMmState
(
EMmS
ubState
::
MM_REGISTERED_PS
);
if
(
m_cmState
==
ECmState
::
CM_IDLE
&&
m_lastServiceReqCause
!=
EServiceReqCause
::
EMERGENCY_FALLBACK
)
{
...
...
@@ -129,10 +129,10 @@ void NasMm::onTimerExpire(nas::NasTimer &timer)
m_logger
->
debug
(
"De-registration aborted"
);
if
(
m_lastDeregCause
==
EDeregCause
::
DISABLE_5G
)
switchMmState
(
EMmS
tate
::
MM_NULL
,
EMmSubState
::
MM_NULL_NA
);
switchMmState
(
EMmS
ubState
::
MM_NULL_PS
);
else
if
(
m_lastDeregistrationRequest
->
deRegistrationType
.
switchOff
==
nas
::
ESwitchOff
::
NORMAL_DE_REGISTRATION
)
switchMmState
(
EMmS
tate
::
MM_DEREGISTERED
,
EMmSubState
::
MM_DEREGISTERED_NA
);
switchMmState
(
EMmS
ubState
::
MM_DEREGISTERED_PS
);
}
}
else
...
...
src/ue/nas/mm/transport.cpp
View file @
2342f910
...
...
@@ -82,7 +82,7 @@ void NasMm::receiveDlNasTransport(const nas::DlNasTransport &msg)
case
nas
:
:
EMmCause
::
RESTRICTED_SERVICE_AREA
:
{
if
(
m_rmState
==
ERmState
::
RM_REGISTERED
)
{
switchMmState
(
EMmS
tate
::
MM_REGISTERED
,
EMmS
ubState
::
MM_REGISTERED_NON_ALLOWED_SERVICE
);
switchMmState
(
EMmSubState
::
MM_REGISTERED_NON_ALLOWED_SERVICE
);
sendMobilityRegistration
(
ERegUpdateCause
::
RESTRICTED_SERVICE_AREA
);
}
m_sm
->
receiveForwardingFailure
(
smMessage
,
msg
.
mmCause
->
value
,
std
::
nullopt
);
...
...
src/ue/types.cpp
View file @
2342f910
...
...
@@ -87,10 +87,10 @@ Json ToJson(const EMmSubState &state)
{
switch
(
state
)
{
case
EMmSubState
:
:
MM_NULL_
NA
:
case
EMmSubState
:
:
MM_NULL_
PS
:
return
"MM-NULL"
;
case
EMmSubState
:
:
MM_DEREGISTERED_
NA
:
return
"MM-DEREGISTERED/
NA
"
;
case
EMmSubState
:
:
MM_DEREGISTERED_
PS
:
return
"MM-DEREGISTERED/
PS
"
;
case
EMmSubState
:
:
MM_DEREGISTERED_NORMAL_SERVICE
:
return
"MM-DEREGISTERED/NORMAL-SERVICE"
;
case
EMmSubState
:
:
MM_DEREGISTERED_LIMITED_SERVICE
:
...
...
@@ -107,10 +107,10 @@ Json ToJson(const EMmSubState &state)
return
"MM-DEREGISTERED/ECALL-INACTIVE"
;
case
EMmSubState
:
:
MM_DEREGISTERED_INITIAL_REGISTRATION_NEEDED
:
return
"MM-DEREGISTERED/INITIAL-REGISTRATION-NEEDED"
;
case
EMmSubState
:
:
MM_REGISTERED_INITIATED_
NA
:
case
EMmSubState
:
:
MM_REGISTERED_INITIATED_
PS
:
return
"MM-REGISTER-INITIATED"
;
case
EMmSubState
:
:
MM_REGISTERED_
NA
:
return
"MM-REGISTERED/
NA
"
;
case
EMmSubState
:
:
MM_REGISTERED_
PS
:
return
"MM-REGISTERED/
PS
"
;
case
EMmSubState
:
:
MM_REGISTERED_NORMAL_SERVICE
:
return
"MM-REGISTERED/NORMAL-SERVICE"
;
case
EMmSubState
:
:
MM_REGISTERED_NON_ALLOWED_SERVICE
:
...
...
@@ -125,9 +125,9 @@ Json ToJson(const EMmSubState &state)
return
"MM-REGISTERED/NO-CELL-AVAILABLE"
;
case
EMmSubState
:
:
MM_REGISTERED_UPDATE_NEEDED
:
return
"MM-REGISTERED/UPDATE-NEEDED"
;
case
EMmSubState
:
:
MM_DEREGISTERED_INITIATED_
NA
:
case
EMmSubState
:
:
MM_DEREGISTERED_INITIATED_
PS
:
return
"MM-DEREGISTER-INITIATED"
;
case
EMmSubState
:
:
MM_SERVICE_REQUEST_INITIATED_
NA
:
case
EMmSubState
:
:
MM_SERVICE_REQUEST_INITIATED_
PS
:
return
"MM-SERVICE-REQUEST-INITIATED"
;
default:
return
"?"
;
...
...
src/ue/types.hpp
View file @
2342f910
...
...
@@ -259,9 +259,9 @@ enum class EMmState
enum
class
EMmSubState
{
MM_NULL_
NA
,
MM_NULL_
PS
,
MM_DEREGISTERED_
NA
,
MM_DEREGISTERED_
PS
,
MM_DEREGISTERED_NORMAL_SERVICE
,
MM_DEREGISTERED_LIMITED_SERVICE
,
MM_DEREGISTERED_ATTEMPTING_REGISTRATION
,
...
...
@@ -271,9 +271,9 @@ enum class EMmSubState
MM_DEREGISTERED_ECALL_INACTIVE
,
MM_DEREGISTERED_INITIAL_REGISTRATION_NEEDED
,
MM_REGISTERED_INITIATED_
NA
,
MM_REGISTERED_INITIATED_
PS
,
MM_REGISTERED_
NA
,
MM_REGISTERED_
PS
,
MM_REGISTERED_NORMAL_SERVICE
,
MM_REGISTERED_NON_ALLOWED_SERVICE
,
MM_REGISTERED_ATTEMPTING_REGISTRATION_UPDATE
,
...
...
@@ -282,9 +282,9 @@ enum class EMmSubState
MM_REGISTERED_NO_CELL_AVAILABLE
,
MM_REGISTERED_UPDATE_NEEDED
,
MM_DEREGISTERED_INITIATED_
NA
,
MM_DEREGISTERED_INITIATED_
PS
,
MM_SERVICE_REQUEST_INITIATED_
NA
MM_SERVICE_REQUEST_INITIATED_
PS
};
enum
class
EPsState
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment