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
d83daf07
Commit
d83daf07
authored
Apr 05, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Service reject handling
parent
156c4ac7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
7 deletions
+70
-7
src/nas/utils.cpp
src/nas/utils.cpp
+54
-1
src/nas/utils.hpp
src/nas/utils.hpp
+3
-1
src/ue/nas/mm/radio.cpp
src/ue/nas/mm/radio.cpp
+7
-1
src/ue/nas/mm/service.cpp
src/ue/nas/mm/service.cpp
+3
-3
src/ue/nas/usim.hpp
src/ue/nas/usim.hpp
+3
-1
No files found.
src/nas/utils.cpp
View file @
d83daf07
...
...
@@ -8,6 +8,7 @@
#include "utils.hpp"
#include <algorithm>
#include <cstring>
namespace
nas
::
utils
...
...
@@ -262,7 +263,7 @@ IEDnn DnnFromApn(const std::string &apn)
return
dnn
;
}
void
AddToPlmnList
(
IEPlmnList
&
list
,
VPlmn
item
)
void
AddToPlmnList
(
IEPlmnList
&
list
,
const
VPlmn
&
item
)
{
if
(
!
std
::
any_of
(
list
.
plmns
.
begin
(),
list
.
plmns
.
end
(),
[
&
item
](
auto
&
i
)
{
return
DeepEqualsV
(
i
,
item
);
}))
list
.
plmns
.
push_back
(
item
);
...
...
@@ -381,4 +382,56 @@ bool ServiceAreaListForbidsTai(const VPartialServiceAreaList &list, const VTrack
return
false
;
}
void
AddToTaiList
(
IE5gsTrackingAreaIdentityList
&
list
,
const
VTrackingAreaIdentity
&
tai
)
{
if
(
!
TaiListContains
(
list
,
tai
))
{
VPartialTrackingAreaIdentityList
ls
{};
ls
.
list01
=
VPartialTrackingAreaIdentityList01
{
tai
.
plmn
,
tai
.
tac
};
ls
.
present
=
1
;
list
.
list
.
push_back
(
ls
);
}
}
void
RemoveFromTaiList
(
IE5gsTrackingAreaIdentityList
&
list
,
const
VTrackingAreaIdentity
&
tai
)
{
list
.
list
.
erase
(
std
::
remove_if
(
list
.
list
.
begin
(),
list
.
list
.
end
(),
[
&
tai
](
auto
&
itemList
)
{
return
itemList
.
present
==
1
&&
DeepEqualsV
(
itemList
.
list01
->
plmn
,
tai
.
plmn
)
&&
(
int
)
itemList
.
list01
->
tac
==
(
int
)
tai
.
tac
;
}),
list
.
list
.
end
());
for
(
auto
&
itemList
:
list
.
list
)
{
if
(
itemList
.
present
==
0
)
{
auto
&
list0
=
itemList
.
list00
;
if
(
DeepEqualsV
(
list0
->
plmn
,
tai
.
plmn
))
{
list0
->
tacs
.
erase
(
std
::
remove_if
(
list0
->
tacs
.
begin
(),
list0
->
tacs
.
end
(),
[
&
tai
](
auto
tac
)
{
return
(
int
)
tac
==
(
int
)
tai
.
tac
;
}),
list0
->
tacs
.
end
());
}
}
else
if
(
itemList
.
present
==
2
)
{
auto
&
list2
=
itemList
.
list10
;
list2
->
tais
.
erase
(
std
::
remove_if
(
list2
->
tais
.
begin
(),
list2
->
tais
.
end
(),
[
&
tai
](
auto
&
i
)
{
return
DeepEqualsV
(
i
,
tai
);
}),
list2
->
tais
.
end
());
}
}
list
.
list
.
erase
(
std
::
remove_if
(
list
.
list
.
begin
(),
list
.
list
.
end
(),
[](
auto
&
itemList
)
{
return
itemList
.
present
==
0
&&
itemList
.
list00
->
tacs
.
empty
();
}),
list
.
list
.
end
());
list
.
list
.
erase
(
std
::
remove_if
(
list
.
list
.
begin
(),
list
.
list
.
end
(),
[](
auto
&
itemList
)
{
return
itemList
.
present
==
2
&&
itemList
.
list10
->
tais
.
empty
();
}),
list
.
list
.
end
());
}
}
// namespace nas::utils
src/nas/utils.hpp
View file @
d83daf07
...
...
@@ -24,7 +24,9 @@ SingleSlice SNssaiTo(const IESNssai &v);
bool
HasValue
(
const
IEGprsTimer3
&
v
);
bool
HasValue
(
const
IEGprsTimer2
&
v
);
void
AddToPlmnList
(
IEPlmnList
&
list
,
VPlmn
item
);
void
AddToPlmnList
(
IEPlmnList
&
list
,
const
VPlmn
&
item
);
void
AddToTaiList
(
nas
::
IE5gsTrackingAreaIdentityList
&
list
,
const
VTrackingAreaIdentity
&
tai
);
void
RemoveFromTaiList
(
nas
::
IE5gsTrackingAreaIdentityList
&
list
,
const
VTrackingAreaIdentity
&
tai
);
bool
PlmnListContains
(
const
IEPlmnList
&
list
,
VPlmn
item
);
bool
PlmnListContains
(
const
IEPlmnList
&
list
,
Plmn
item
);
bool
TaiListContains
(
const
nas
::
IE5gsTrackingAreaIdentityList
&
list
,
const
VTrackingAreaIdentity
&
tai
);
...
...
src/ue/nas/mm/radio.cpp
View file @
d83daf07
...
...
@@ -68,7 +68,10 @@ void NasMm::handlePlmnSearchResponse(const std::vector<UeCellMeasurement> &measu
continue
;
}
if
(
nas
::
utils
::
TaiListContains
(
m_usim
->
m_forbiddenTaiList
,
m_usim
->
m_forbiddenTaiListRps
,
nas
::
VTrackingAreaIdentity
{
nas
::
utils
::
PlmnFrom
(
item
.
cellId
.
plmn
),
octet3
{
item
.
tac
}})
||
nas
::
utils
::
TaiListContains
(
m_usim
->
m_forbiddenTaiListRoaming
,
nas
::
VTrackingAreaIdentity
{
nas
::
utils
::
PlmnFrom
(
item
.
cellId
.
plmn
),
octet3
{
item
.
tac
}}))
{
listedAsForbiddenTai
++
;
...
...
@@ -185,6 +188,8 @@ void NasMm::handleServingCellChange(const UeCellInfo &servingCell)
m_usim
->
m_servingCell
=
servingCell
;
m_usim
->
m_currentPlmn
=
servingCell
.
cellId
.
plmn
;
m_usim
->
m_currentTai
=
nas
::
VTrackingAreaIdentity
{
nas
::
utils
::
PlmnFrom
(
servingCell
.
cellId
.
plmn
),
octet3
{
servingCell
.
tac
}};
}
void
NasMm
::
handleRrcConnectionSetup
()
...
...
@@ -206,6 +211,7 @@ void NasMm::handleRadioLinkFailure()
m_usim
->
m_servingCell
=
std
::
nullopt
;
m_usim
->
m_currentPlmn
=
std
::
nullopt
;
m_usim
->
m_currentTai
=
std
::
nullopt
;
handleRrcConnectionRelease
();
...
...
src/ue/nas/mm/service.cpp
View file @
d83daf07
...
...
@@ -258,13 +258,13 @@ void NasMm::receiveServiceReject(const nas::ServiceReject &msg)
if
(
cause
==
nas
::
EMmCause
::
TA_NOT_ALLOWED
)
{
// TODO: add current tai to 5GS forbidden tracking areas for regional provision of service
nas
::
utils
::
AddToTaiList
(
m_usim
->
m_forbiddenTaiListRps
,
*
m_usim
->
m_currentTai
);
}
if
(
cause
==
nas
::
EMmCause
::
ROAMING_NOT_ALLOWED_IN_TA
||
cause
==
nas
::
EMmCause
::
NO_SUITIBLE_CELLS_IN_TA
)
{
// TODO: add current tai to 5GS forbidden tracking areas for roaming
// TODO: remove current tai from stored tai list if present
nas
::
utils
::
AddToTaiList
(
m_usim
->
m_forbiddenTaiListRoaming
,
*
m_usim
->
m_currentTai
);
nas
::
utils
::
RemoveFromTaiList
(
m_usim
->
m_taiList
,
*
m_usim
->
m_currentTai
);
}
if
(
cause
==
nas
::
EMmCause
::
ILLEGAL_UE
||
cause
==
nas
::
EMmCause
::
ILLEGAL_ME
||
...
...
src/ue/nas/usim.hpp
View file @
d83daf07
...
...
@@ -34,9 +34,11 @@ class Usim
// Plmn related
std
::
optional
<
UeCellInfo
>
m_servingCell
{};
std
::
optional
<
Plmn
>
m_currentPlmn
{};
std
::
optional
<
nas
::
VTrackingAreaIdentity
>
m_currentTai
{};
std
::
optional
<
nas
::
IE5gsTrackingAreaIdentity
>
m_lastVisitedRegisteredTai
{};
nas
::
IE5gsTrackingAreaIdentityList
m_taiList
{};
nas
::
IE5gsTrackingAreaIdentityList
m_forbiddenTaiList
{};
nas
::
IE5gsTrackingAreaIdentityList
m_forbiddenTaiListRoaming
{};
// 5GS TAs for roaming
nas
::
IE5gsTrackingAreaIdentityList
m_forbiddenTaiListRps
{};
// 5GS forbidden TAs for regional provision of service
nas
::
IEPlmnList
m_equivalentPlmnList
{};
nas
::
IEPlmnList
m_forbiddenPlmnList
{};
nas
::
IEServiceAreaList
m_serviceAreaList
{};
...
...
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