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
a40bb41e
Commit
a40bb41e
authored
May 22, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
L3 RRC/NAS developments
parent
9d841446
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
39 additions
and
27 deletions
+39
-27
src/lib/nas/utils.cpp
src/lib/nas/utils.cpp
+9
-0
src/lib/nas/utils.hpp
src/lib/nas/utils.hpp
+1
-0
src/ue/nas/mm/dereg.cpp
src/ue/nas/mm/dereg.cpp
+2
-2
src/ue/nas/mm/ecall.cpp
src/ue/nas/mm/ecall.cpp
+1
-1
src/ue/nas/mm/radio.cpp
src/ue/nas/mm/radio.cpp
+1
-1
src/ue/nas/mm/register.cpp
src/ue/nas/mm/register.cpp
+18
-16
src/ue/nas/mm/service.cpp
src/ue/nas/mm/service.cpp
+1
-1
src/ue/nas/storage.cpp
src/ue/nas/storage.cpp
+4
-5
src/ue/nas/storage.hpp
src/ue/nas/storage.hpp
+2
-0
src/ue/nas/usim/usim.hpp
src/ue/nas/usim/usim.hpp
+0
-1
No files found.
src/lib/nas/utils.cpp
View file @
a40bb41e
...
...
@@ -501,4 +501,13 @@ bool ServiceAreaListAllowsTai(const VPartialServiceAreaList &list, const VTracki
return
false
;
}
Plmn
PlmnFrom
(
const
VPlmn
&
plmn
)
{
Plmn
res
;
res
.
mcc
=
plmn
.
mcc
;
res
.
mnc
=
plmn
.
mnc
;
res
.
isLongMnc
=
plmn
.
isLongMnc
;
return
res
;
}
}
// namespace nas::utils
src/lib/nas/utils.hpp
View file @
a40bb41e
...
...
@@ -17,6 +17,7 @@ IESNssai SNssaiFrom(const SingleSlice &v);
IENssai
NssaiFrom
(
const
NetworkSlice
&
v
);
IEDnn
DnnFromApn
(
const
std
::
string
&
apn
);
VPlmn
PlmnFrom
(
const
Plmn
&
plmn
);
Plmn
PlmnFrom
(
const
VPlmn
&
plmn
);
NetworkSlice
NssaiTo
(
const
IENssai
&
v
);
SingleSlice
SNssaiTo
(
const
IESNssai
&
v
);
...
...
src/ue/nas/mm/dereg.cpp
View file @
a40bb41e
...
...
@@ -198,7 +198,7 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi
m_storage
->
storedGuti
->
clear
();
m_storage
->
taiList
->
clear
();
m_storage
->
lastVisitedRegisteredTai
->
clear
();
m_
usim
->
m_equivalentPlmnList
=
{}
;
m_
storage
->
equivalentPlmnList
->
clear
()
;
m_usim
->
m_currentNsCtx
=
{};
m_usim
->
m_nonCurrentNsCtx
=
{};
switchUState
(
E5UState
::
U2_NOT_UPDATED
);
...
...
@@ -232,7 +232,7 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi
if
(
cause
==
nas
::
EMmCause
::
ILLEGAL_UE
||
cause
==
nas
::
EMmCause
::
ILLEGAL_ME
||
cause
==
nas
::
EMmCause
::
FIVEG_SERVICES_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
PLMN_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
ROAMING_NOT_ALLOWED_IN_TA
)
m_
usim
->
m_equivalentPlmnList
=
{}
;
m_
storage
->
equivalentPlmnList
->
clear
()
;
if
(
cause
==
nas
::
EMmCause
::
PLMN_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
TA_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
ROAMING_NOT_ALLOWED_IN_TA
||
cause
==
nas
::
EMmCause
::
NO_SUITIBLE_CELLS_IN_TA
||
...
...
src/ue/nas/mm/ecall.cpp
View file @
a40bb41e
...
...
@@ -93,7 +93,7 @@ bool NasMm::switchToECallInactivityIfNeeded()
m_storage
->
storedGuti
->
clear
();
m_storage
->
taiList
->
clear
();
m_storage
->
lastVisitedRegisteredTai
->
clear
();
m_
usim
->
m_equivalentPlmnList
=
{}
;
m_
storage
->
equivalentPlmnList
->
clear
()
;
m_usim
->
m_currentNsCtx
=
{};
m_usim
->
m_nonCurrentNsCtx
=
{};
...
...
src/ue/nas/mm/radio.cpp
View file @
a40bb41e
...
...
@@ -89,7 +89,7 @@ void NasMm::performPlmnSelection()
continue
;
if
(
nas
::
utils
::
ServiceAreaListForbidsPlmn
(
m_storage
->
serviceAreaList
->
get
(),
nas
::
utils
::
PlmnFrom
(
plmn
)))
continue
;
if
(
nas
::
utils
::
PlmnListContains
(
m_usim
->
m_equivalentPlmnList
,
plmn
))
if
(
m_storage
->
equivalentPlmnList
->
contains
(
plmn
))
candidates
.
push_back
(
plmn
);
}
...
...
src/ue/nas/mm/register.cpp
View file @
a40bb41e
...
...
@@ -250,18 +250,19 @@ void NasMm::receiveInitialRegistrationAccept(const nas::RegistrationAccept &msg)
updateForbiddenTaiListsForAllowedIndications
();
// Store the E-PLMN list and ..
m_usim
->
m_equivalentPlmnList
=
msg
.
equivalentPLMNs
.
value_or
(
nas
::
IEPlmnList
{});
m_storage
->
equivalentPlmnList
->
clear
();
if
(
msg
.
equivalentPLMNs
.
has_value
())
for
(
auto
&
item
:
msg
.
equivalentPLMNs
->
plmns
)
m_storage
->
equivalentPlmnList
->
add
(
nas
::
utils
::
PlmnFrom
(
item
));
// .. if the initial registration procedure is not for emergency services, the UE shall remove from the list any
// PLMN code that is already in the list of "forbidden PLMNs". ..
if
(
!
hasEmergency
())
{
utils
::
EraseWhere
(
m_usim
->
m_equivalentPlmnList
.
plmns
,
[
this
](
auto
&
plmn
)
{
return
std
::
any_of
(
m_usim
->
m_forbiddenPlmnList
.
plmns
.
begin
(),
m_usim
->
m_forbiddenPlmnList
.
plmns
.
end
(),
[
&
plmn
](
auto
&
forbidden
)
{
return
nas
::
utils
::
DeepEqualsV
(
plmn
,
forbidden
);
});
});
for
(
auto
&
forbiddenPlmn
:
m_usim
->
m_forbiddenPlmnList
.
plmns
)
m_storage
->
equivalentPlmnList
->
remove
(
nas
::
utils
::
PlmnFrom
(
forbiddenPlmn
));
}
// .. in addition, the UE shall add to the stored list the PLMN code of the registered PLMN that sent the list
nas
::
utils
::
AddToPlmnList
(
m_usim
->
m_equivalentPlmnList
,
nas
::
utils
::
PlmnFrom
(
m_base
->
shCtx
.
getCurrentPlmn
()
));
m_storage
->
equivalentPlmnList
->
add
(
m_base
->
shCtx
.
getCurrentPlmn
(
));
// 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.
...
...
@@ -370,18 +371,19 @@ void NasMm::receiveMobilityRegistrationAccept(const nas::RegistrationAccept &msg
}
// Store the E-PLMN list and ..
m_usim
->
m_equivalentPlmnList
=
msg
.
equivalentPLMNs
.
value_or
(
nas
::
IEPlmnList
{});
m_storage
->
equivalentPlmnList
->
clear
();
if
(
msg
.
equivalentPLMNs
.
has_value
())
for
(
auto
&
item
:
msg
.
equivalentPLMNs
->
plmns
)
m_storage
->
equivalentPlmnList
->
add
(
nas
::
utils
::
PlmnFrom
(
item
));
// .. if the initial registration procedure is not for emergency services, the UE shall remove from the list any
// PLMN code that is already in the list of "forbidden PLMNs". ..
if
(
!
hasEmergency
())
{
utils
::
EraseWhere
(
m_usim
->
m_equivalentPlmnList
.
plmns
,
[
this
](
auto
&
plmn
)
{
return
std
::
any_of
(
m_usim
->
m_forbiddenPlmnList
.
plmns
.
begin
(),
m_usim
->
m_forbiddenPlmnList
.
plmns
.
end
(),
[
&
plmn
](
auto
&
forbidden
)
{
return
nas
::
utils
::
DeepEqualsV
(
plmn
,
forbidden
);
});
});
for
(
auto
&
forbiddenPlmn
:
m_usim
->
m_forbiddenPlmnList
.
plmns
)
m_storage
->
equivalentPlmnList
->
remove
(
nas
::
utils
::
PlmnFrom
(
forbiddenPlmn
));
}
// .. in addition, the UE shall add to the stored list the PLMN code of the registered PLMN that sent the list
nas
::
utils
::
AddToPlmnList
(
m_usim
->
m_equivalentPlmnList
,
nas
::
utils
::
PlmnFrom
(
m_base
->
shCtx
.
getCurrentPlmn
()
));
m_storage
->
equivalentPlmnList
->
add
(
m_base
->
shCtx
.
getCurrentPlmn
(
));
// Store the service area list
m_storage
->
serviceAreaList
->
set
(
msg
.
serviceAreaList
.
value_or
(
nas
::
IEServiceAreaList
{}));
...
...
@@ -589,7 +591,7 @@ void NasMm::receiveInitialRegistrationReject(const nas::RegistrationReject &msg)
if
(
cause
==
nas
::
EMmCause
::
ILLEGAL_UE
||
cause
==
nas
::
EMmCause
::
ILLEGAL_ME
||
cause
==
nas
::
EMmCause
::
PLMN_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
ROAMING_NOT_ALLOWED_IN_TA
)
{
m_
usim
->
m_equivalentPlmnList
=
{}
;
m_
storage
->
equivalentPlmnList
->
clear
()
;
}
if
(
cause
==
nas
::
EMmCause
::
ROAMING_NOT_ALLOWED_IN_TA
||
cause
==
nas
::
EMmCause
::
NO_SUITIBLE_CELLS_IN_TA
)
...
...
@@ -750,7 +752,7 @@ void NasMm::receiveMobilityRegistrationReject(const nas::RegistrationReject &msg
if
(
cause
==
nas
::
EMmCause
::
ILLEGAL_UE
||
cause
==
nas
::
EMmCause
::
ILLEGAL_ME
||
cause
==
nas
::
EMmCause
::
PLMN_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
ROAMING_NOT_ALLOWED_IN_TA
)
{
m_
usim
->
m_equivalentPlmnList
=
{}
;
m_
storage
->
equivalentPlmnList
->
clear
()
;
}
if
(
cause
==
nas
::
EMmCause
::
ROAMING_NOT_ALLOWED_IN_TA
||
cause
==
nas
::
EMmCause
::
NO_SUITIBLE_CELLS_IN_TA
)
...
...
@@ -835,7 +837,7 @@ void NasMm::handleAbnormalInitialRegFailure(nas::ERegistrationType regType)
m_storage
->
storedGuti
->
clear
();
m_storage
->
taiList
->
clear
();
m_storage
->
lastVisitedRegisteredTai
->
clear
();
m_
usim
->
m_equivalentPlmnList
=
{}
;
m_
storage
->
equivalentPlmnList
->
clear
()
;
m_usim
->
m_currentNsCtx
=
{};
m_usim
->
m_nonCurrentNsCtx
=
{};
...
...
@@ -897,7 +899,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
=
{}
;
m_
storage
->
equivalentPlmnList
->
clear
()
;
switchMmState
(
EMmSubState
::
MM_REGISTERED_ATTEMPTING_REGISTRATION_UPDATE
);
}
}
...
...
src/ue/nas/mm/service.cpp
View file @
a40bb41e
...
...
@@ -301,7 +301,7 @@ void NasMm::receiveServiceReject(const nas::ServiceReject &msg)
if
(
cause
==
nas
::
EMmCause
::
PLMN_NOT_ALLOWED
)
{
m_
usim
->
m_equivalentPlmnList
=
{}
;
m_
storage
->
equivalentPlmnList
->
clear
()
;
}
if
(
cause
==
nas
::
EMmCause
::
PLMN_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
SERVING_NETWORK_NOT_AUTHORIZED
)
...
...
src/ue/nas/storage.cpp
View file @
a40bb41e
...
...
@@ -8,9 +8,6 @@
#include "storage.hpp"
static
constexpr
const
size_t
FORBIDDEN_TAI_LIST_SIZE
=
40
;
static
constexpr
const
int64_t
FORBIDDEN_TAI_CLEAR_PERIOD
=
1000ll
*
60ll
*
60ll
*
12ll
;
static
void
BackupTaiListInSharedCtx
(
const
std
::
vector
<
Tai
>
&
buffer
,
size_t
count
,
Locked
<
std
::
vector
<
Tai
>>
&
target
)
{
target
.
mutate
([
count
,
&
buffer
](
auto
&
value
)
{
...
...
@@ -32,18 +29,20 @@ MmStorage::MmStorage(TaskBase *base) : m_base{base}
lastVisitedRegisteredTai
=
std
::
make_unique
<
nas
::
NasSlot
<
Tai
>>
(
0
,
std
::
nullopt
);
forbiddenTaiListRoaming
=
std
::
make_unique
<
nas
::
NasList
<
Tai
>>
(
FORBIDDEN_TAI_LIST_SIZE
,
FORBIDDEN_TAI_CLEAR_PERIOD
,
[
this
](
const
std
::
vector
<
Tai
>
&
buffer
,
size_t
count
)
{
40
,
(
1000ll
*
60ll
*
60ll
*
12ll
)
,
[
this
](
const
std
::
vector
<
Tai
>
&
buffer
,
size_t
count
)
{
BackupTaiListInSharedCtx
(
buffer
,
count
,
m_base
->
shCtx
.
forbiddenTaiRoaming
);
});
forbiddenTaiListRps
=
std
::
make_unique
<
nas
::
NasList
<
Tai
>>
(
FORBIDDEN_TAI_LIST_SIZE
,
FORBIDDEN_TAI_CLEAR_PERIOD
,
[
this
](
const
std
::
vector
<
Tai
>
&
buffer
,
size_t
count
)
{
40
,
(
1000ll
*
60ll
*
60ll
*
12ll
)
,
[
this
](
const
std
::
vector
<
Tai
>
&
buffer
,
size_t
count
)
{
BackupTaiListInSharedCtx
(
buffer
,
count
,
m_base
->
shCtx
.
forbiddenTaiRps
);
});
serviceAreaList
=
std
::
make_unique
<
nas
::
NasSlot
<
nas
::
IEServiceAreaList
>>
(
0
,
std
::
nullopt
);
taiList
=
std
::
make_unique
<
nas
::
NasSlot
<
nas
::
IE5gsTrackingAreaIdentityList
>>
(
0
,
std
::
nullopt
);
equivalentPlmnList
=
std
::
make_unique
<
nas
::
NasList
<
Plmn
>>
(
16
,
0
,
std
::
nullopt
);
}
}
// namespace nr::ue
\ No newline at end of file
src/ue/nas/storage.hpp
View file @
a40bb41e
...
...
@@ -22,6 +22,8 @@ class MmStorage
std
::
unique_ptr
<
nas
::
NasSlot
<
nas
::
IE5gsMobileIdentity
>>
storedSuci
;
std
::
unique_ptr
<
nas
::
NasSlot
<
nas
::
IE5gsMobileIdentity
>>
storedGuti
;
std
::
unique_ptr
<
nas
::
NasList
<
Plmn
>>
equivalentPlmnList
;
std
::
unique_ptr
<
nas
::
NasSlot
<
nas
::
IE5gsTrackingAreaIdentityList
>>
taiList
;
std
::
unique_ptr
<
nas
::
NasSlot
<
Tai
>>
lastVisitedRegisteredTai
;
std
::
unique_ptr
<
nas
::
NasList
<
Tai
>>
forbiddenTaiListRoaming
;
...
...
src/ue/nas/usim/usim.hpp
View file @
a40bb41e
...
...
@@ -31,7 +31,6 @@ class Usim
E5UState
m_uState
{};
// Plmn related
nas
::
IEPlmnList
m_equivalentPlmnList
{};
nas
::
IEPlmnList
m_forbiddenPlmnList
{};
// Security related
...
...
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