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
9d841446
Commit
9d841446
authored
May 22, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
L3 RRC/NAS developments
parent
6818bd98
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
107 additions
and
0 deletions
+107
-0
src/lib/nas/utils.cpp
src/lib/nas/utils.cpp
+47
-0
src/lib/nas/utils.hpp
src/lib/nas/utils.hpp
+4
-0
src/ue/nas/mm/config.cpp
src/ue/nas/mm/config.cpp
+38
-0
src/ue/nas/mm/mm.hpp
src/ue/nas/mm/mm.hpp
+1
-0
src/ue/nas/mm/register.cpp
src/ue/nas/mm/register.cpp
+3
-0
src/utils/common_types.cpp
src/utils/common_types.cpp
+8
-0
src/utils/common_types.hpp
src/utils/common_types.hpp
+6
-0
No files found.
src/lib/nas/utils.cpp
View file @
9d841446
...
...
@@ -454,4 +454,51 @@ int TaiListSize(const VPartialTrackingAreaIdentityList &list)
return
static_cast
<
int
>
(
size
);
}
bool
ServiceAreaListAllowsPlmn
(
const
IEServiceAreaList
&
list
,
const
VPlmn
&
plmn
)
{
return
std
::
any_of
(
list
.
list
.
begin
(),
list
.
list
.
end
(),
[
&
plmn
](
auto
&
item
)
{
return
ServiceAreaListAllowsPlmn
(
item
,
plmn
);
});
}
bool
ServiceAreaListAllowsTai
(
const
IEServiceAreaList
&
list
,
const
VTrackingAreaIdentity
&
tai
)
{
return
std
::
any_of
(
list
.
list
.
begin
(),
list
.
list
.
end
(),
[
&
tai
](
auto
&
item
)
{
return
ServiceAreaListAllowsTai
(
item
,
tai
);
});
}
bool
ServiceAreaListAllowsPlmn
(
const
VPartialServiceAreaList
&
list
,
const
VPlmn
&
plmn
)
{
if
(
list
.
present
==
3
)
{
if
(
list
.
list11
->
allowedType
==
EAllowedType
::
IN_THE_ALLOWED_AREA
&&
DeepEqualsV
(
list
.
list11
->
plmn
,
plmn
))
return
true
;
}
return
false
;
}
bool
ServiceAreaListAllowsTai
(
const
VPartialServiceAreaList
&
list
,
const
VTrackingAreaIdentity
&
tai
)
{
if
(
list
.
present
==
0
)
{
if
(
list
.
list00
->
allowedType
==
EAllowedType
::
IN_THE_ALLOWED_AREA
&&
DeepEqualsV
(
list
.
list00
->
plmn
,
tai
.
plmn
)
&&
std
::
any_of
(
list
.
list00
->
tacs
.
begin
(),
list
.
list00
->
tacs
.
end
(),
[
&
tai
](
auto
&
i
)
{
return
(
int
)
i
==
(
int
)
tai
.
tac
;
}))
return
true
;
}
else
if
(
list
.
present
==
1
)
{
if
(
list
.
list01
->
allowedType
==
EAllowedType
::
IN_THE_ALLOWED_AREA
&&
DeepEqualsV
(
list
.
list01
->
plmn
,
tai
.
plmn
)
&&
(
int
)
list
.
list01
->
tac
==
(
int
)
tai
.
tac
)
return
true
;
}
else
if
(
list
.
present
==
2
)
{
if
(
list
.
list10
->
allowedType
==
EAllowedType
::
IN_THE_ALLOWED_AREA
&&
std
::
any_of
(
list
.
list10
->
tais
.
begin
(),
list
.
list10
->
tais
.
end
(),
[
tai
](
auto
&
i
)
{
return
DeepEqualsV
(
i
,
tai
);
}))
return
true
;
}
return
false
;
}
}
// namespace nas::utils
src/lib/nas/utils.hpp
View file @
9d841446
...
...
@@ -37,6 +37,10 @@ bool ServiceAreaListForbidsPlmn(const nas::IEServiceAreaList &list, const VPlmn
bool
ServiceAreaListForbidsTai
(
const
nas
::
IEServiceAreaList
&
list
,
const
VTrackingAreaIdentity
&
tai
);
bool
ServiceAreaListForbidsPlmn
(
const
nas
::
VPartialServiceAreaList
&
list
,
const
VPlmn
&
plmn
);
bool
ServiceAreaListForbidsTai
(
const
nas
::
VPartialServiceAreaList
&
list
,
const
VTrackingAreaIdentity
&
tai
);
bool
ServiceAreaListAllowsPlmn
(
const
nas
::
IEServiceAreaList
&
list
,
const
VPlmn
&
plmn
);
bool
ServiceAreaListAllowsTai
(
const
nas
::
IEServiceAreaList
&
list
,
const
VTrackingAreaIdentity
&
tai
);
bool
ServiceAreaListAllowsPlmn
(
const
nas
::
VPartialServiceAreaList
&
list
,
const
VPlmn
&
plmn
);
bool
ServiceAreaListAllowsTai
(
const
nas
::
VPartialServiceAreaList
&
list
,
const
VTrackingAreaIdentity
&
tai
);
const
char
*
EnumToString
(
ERegistrationType
v
);
const
char
*
EnumToString
(
EMmCause
v
);
...
...
src/ue/nas/mm/config.cpp
View file @
9d841446
...
...
@@ -8,6 +8,8 @@
#include "mm.hpp"
#include <unordered_set>
#include <lib/nas/utils.hpp>
#include <ue/nas/sm/sm.hpp>
...
...
@@ -16,6 +18,8 @@ namespace nr::ue
void
NasMm
::
receiveConfigurationUpdate
(
const
nas
::
ConfigurationUpdateCommand
&
msg
)
{
m_logger
->
debug
(
"Configuration Update Command received"
);
// Abnormal case: 5.4.4.5, c) Generic UE configuration update and de-registration procedure collision
if
(
m_mmState
==
EMmState
::
MM_DEREGISTERED_INITIATED
)
{
...
...
@@ -58,6 +62,7 @@ void NasMm::receiveConfigurationUpdate(const nas::ConfigurationUpdateCommand &ms
hasNewConfig
=
true
;
m_storage
->
taiList
->
set
(
*
msg
.
taiList
);
updateForbiddenTaiListsForAllowedIndications
();
Tai
currentTai
=
m_base
->
shCtx
.
getCurrentTai
();
if
(
currentTai
.
hasValue
()
&&
...
...
@@ -73,6 +78,7 @@ void NasMm::receiveConfigurationUpdate(const nas::ConfigurationUpdateCommand &ms
{
hasNewConfig
=
true
;
m_storage
->
serviceAreaList
->
set
(
*
msg
.
serviceAreaList
);
updateForbiddenTaiListsForAllowedIndications
();
}
// "If the UE receives new NITZ information in the CONFIGURATION UPDATE COMMAND message, the UE considers the new
...
...
@@ -199,4 +205,36 @@ void NasMm::receiveConfigurationUpdate(const nas::ConfigurationUpdateCommand &ms
}
}
void
NasMm
::
updateForbiddenTaiListsForAllowedIndications
()
{
// "A tracking area shall be removed from the list of "5GS forbidden tracking areas for roaming", as well as the
// list of "5GS forbidden tracking areas for regional provision of service", if the UE receives the tracking area in
// the TAI list or the Service area list of "allowed tracking areas" in REGISTRATION ACCEPT message or a
// CONFIGURATION UPDATE COMMAND message. The UE shall not remove the tracking area from "5GS forbidden tracking
// areas for roaming" or "5GS forbidden tracking areas for regional provision of service" if the UE is registered
// for emergency services"
std
::
unordered_set
<
Tai
>
taiSet
;
m_storage
->
forbiddenTaiListRoaming
->
forEach
([
&
taiSet
,
this
](
auto
&
value
)
{
if
(
nas
::
utils
::
TaiListContains
(
m_storage
->
taiList
->
get
(),
nas
::
VTrackingAreaIdentity
{
value
}))
taiSet
.
insert
(
value
);
if
(
nas
::
utils
::
ServiceAreaListAllowsTai
(
m_storage
->
serviceAreaList
->
get
(),
nas
::
VTrackingAreaIdentity
{
value
}))
taiSet
.
insert
(
value
);
});
m_storage
->
forbiddenTaiListRps
->
forEach
([
&
taiSet
,
this
](
auto
&
value
)
{
if
(
nas
::
utils
::
TaiListContains
(
m_storage
->
taiList
->
get
(),
nas
::
VTrackingAreaIdentity
{
value
}))
taiSet
.
insert
(
value
);
if
(
nas
::
utils
::
ServiceAreaListAllowsTai
(
m_storage
->
serviceAreaList
->
get
(),
nas
::
VTrackingAreaIdentity
{
value
}))
taiSet
.
insert
(
value
);
});
for
(
auto
&
tai
:
taiSet
)
{
m_storage
->
forbiddenTaiListRoaming
->
remove
(
tai
);
m_storage
->
forbiddenTaiListRps
->
remove
(
tai
);
}
}
}
// namespace nr::ue
src/ue/nas/mm/mm.hpp
View file @
9d841446
...
...
@@ -142,6 +142,7 @@ class NasMm
private:
/* Configuration */
void
receiveConfigurationUpdate
(
const
nas
::
ConfigurationUpdateCommand
&
msg
);
void
updateForbiddenTaiListsForAllowedIndications
();
private:
/* Identity */
void
receiveIdentityRequest
(
const
nas
::
IdentityRequest
&
msg
);
...
...
src/ue/nas/mm/register.cpp
View file @
9d841446
...
...
@@ -247,6 +247,8 @@ void NasMm::receiveInitialRegistrationAccept(const nas::RegistrationAccept &msg)
// Store the service area list
m_storage
->
serviceAreaList
->
set
(
msg
.
serviceAreaList
.
value_or
(
nas
::
IEServiceAreaList
{}));
updateForbiddenTaiListsForAllowedIndications
();
// Store the E-PLMN list and ..
m_usim
->
m_equivalentPlmnList
=
msg
.
equivalentPLMNs
.
value_or
(
nas
::
IEPlmnList
{});
// .. if the initial registration procedure is not for emergency services, the UE shall remove from the list any
...
...
@@ -383,6 +385,7 @@ void NasMm::receiveMobilityRegistrationAccept(const nas::RegistrationAccept &msg
// Store the service area list
m_storage
->
serviceAreaList
->
set
(
msg
.
serviceAreaList
.
value_or
(
nas
::
IEServiceAreaList
{}));
updateForbiddenTaiListsForAllowedIndications
();
// "Upon receipt of the REGISTRATION ACCEPT message, the UE shall reset the registration attempt counter and service
// request attempt counter, enter state 5GMM-REGISTERED and set the 5GS update status to 5U1 UPDATED."
...
...
src/utils/common_types.cpp
View file @
9d841446
...
...
@@ -166,6 +166,14 @@ std::size_t std::hash<GlobalNci>::operator()(const GlobalNci &v) const noexcept
return
h
;
}
std
::
size_t
std
::
hash
<
Tai
>::
operator
()(
const
Tai
&
v
)
const
noexcept
{
std
::
size_t
h
=
0
;
utils
::
HashCombine
(
h
,
v
.
plmn
);
utils
::
HashCombine
(
h
,
v
.
tac
);
return
h
;
}
bool
Plmn
::
hasValue
()
const
{
return
this
->
mcc
!=
0
;
...
...
src/utils/common_types.hpp
View file @
9d841446
...
...
@@ -217,6 +217,12 @@ struct hash<Plmn>
std
::
size_t
operator
()(
const
Plmn
&
v
)
const
noexcept
;
};
template
<
>
struct
hash
<
Tai
>
{
std
::
size_t
operator
()(
const
Tai
&
v
)
const
noexcept
;
};
template
<
>
struct
hash
<
GlobalNci
>
{
...
...
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