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
db31bdad
Commit
db31bdad
authored
May 17, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
L3 RRC/NAS developments
parent
b0ff6730
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
76 additions
and
9 deletions
+76
-9
src/lib/nas/storage.hpp
src/lib/nas/storage.hpp
+40
-2
src/ue/nas/mm/dereg.cpp
src/ue/nas/mm/dereg.cpp
+7
-1
src/ue/nas/mm/register.cpp
src/ue/nas/mm/register.cpp
+14
-2
src/ue/nas/mm/service.cpp
src/ue/nas/mm/service.cpp
+15
-2
src/ue/nas/usim/usim.hpp
src/ue/nas/usim/usim.hpp
+0
-2
No files found.
src/lib/nas/storage.hpp
View file @
db31bdad
...
@@ -18,6 +18,7 @@ namespace nas
...
@@ -18,6 +18,7 @@ namespace nas
* - Items are unique, if already exists, deletes the previous one
* - Items are unique, if already exists, deletes the previous one
* - List have fixed size, if capacity is full, oldest item is deleted
* - List have fixed size, if capacity is full, oldest item is deleted
* - Automatically cleared after specified period
* - Automatically cleared after specified period
* - Can be asked if it has a changes after the last one
*/
*/
template
<
typename
T
>
template
<
typename
T
>
class
NasListT1
class
NasListT1
...
@@ -29,17 +30,20 @@ class NasListT1
...
@@ -29,17 +30,20 @@ class NasListT1
std
::
vector
<
T
>
m_data
;
std
::
vector
<
T
>
m_data
;
size_t
m_size
;
size_t
m_size
;
int64_t
m_lastAutoCleared
;
int64_t
m_lastAutoCleared
;
int64_t
m_lastChange
;
int64_t
m_lastChangeQueried
;
public:
public:
NasListT1
(
size_t
sizeLimit
,
int64_t
autoClearingPeriod
)
NasListT1
(
size_t
sizeLimit
,
int64_t
autoClearingPeriod
)
:
m_sizeLimit
{
sizeLimit
},
m_autoClearingPeriod
{
autoClearingPeriod
},
m_data
{
sizeLimit
},
m_size
{},
:
m_sizeLimit
{
sizeLimit
},
m_autoClearingPeriod
{
autoClearingPeriod
},
m_data
{
sizeLimit
},
m_size
{},
m_lastAutoCleared
{
::
utils
::
CurrentTimeMillis
()}
m_lastAutoCleared
{
::
utils
::
CurrentTimeMillis
()}
,
m_lastChange
{},
m_lastChangeQueried
{}
{
{
}
}
public:
public:
void
add
(
const
T
&
item
)
void
add
(
const
T
&
item
)
{
{
touch
();
autoClearIfNecessary
();
autoClearIfNecessary
();
remove
(
item
);
remove
(
item
);
makeSlotForNewItem
();
makeSlotForNewItem
();
...
@@ -50,6 +54,7 @@ class NasListT1
...
@@ -50,6 +54,7 @@ class NasListT1
void
add
(
T
&&
item
)
void
add
(
T
&&
item
)
{
{
touch
();
autoClearIfNecessary
();
autoClearIfNecessary
();
remove
(
item
);
remove
(
item
);
makeSlotForNewItem
();
makeSlotForNewItem
();
...
@@ -70,6 +75,7 @@ class NasListT1
...
@@ -70,6 +75,7 @@ class NasListT1
void
remove
(
const
T
&
item
)
void
remove
(
const
T
&
item
)
{
{
touch
();
autoClearIfNecessary
();
autoClearIfNecessary
();
size_t
index
=
~
0u
;
size_t
index
=
~
0u
;
...
@@ -91,13 +97,28 @@ class NasListT1
...
@@ -91,13 +97,28 @@ class NasListT1
{
{
autoClearIfNecessary
();
autoClearIfNecessary
();
for
(
size_t
i
=
0
;
i
<
m_size
;
i
++
)
fun
((
const
T
&
)
m_data
[
i
]);
}
template
<
typename
Functor
>
void
mutateForEach
(
Functor
&&
fun
)
{
touch
();
autoClearIfNecessary
();
for
(
size_t
i
=
0
;
i
<
m_size
;
i
++
)
for
(
size_t
i
=
0
;
i
<
m_size
;
i
++
)
fun
(
m_data
[
i
]);
fun
(
m_data
[
i
]);
}
}
void
clear
()
void
clear
()
{
{
autoClearIfNecessary
();
touch
();
int64_t
currentTime
=
::
utils
::
CurrentTimeMillis
();
if
(
currentTime
-
m_lastAutoCleared
>=
m_autoClearingPeriod
)
m_lastAutoCleared
=
currentTime
;
m_data
.
clear
();
m_data
.
clear
();
m_size
=
0
;
m_size
=
0
;
...
@@ -110,6 +131,16 @@ class NasListT1
...
@@ -110,6 +131,16 @@ class NasListT1
return
m_data
.
size
();
return
m_data
.
size
();
}
}
bool
hasChange
()
{
if
(
m_lastChangeQueried
==
0
||
m_lastChangeQueried
!=
m_lastChange
)
{
m_lastChangeQueried
=
m_lastChange
;
return
true
;
}
return
false
;
}
private:
private:
void
autoClearIfNecessary
()
void
autoClearIfNecessary
()
{
{
...
@@ -129,10 +160,17 @@ class NasListT1
...
@@ -129,10 +160,17 @@ class NasListT1
void
removeAt
(
size_t
index
)
void
removeAt
(
size_t
index
)
{
{
touch
();
for
(
size_t
i
=
index
;
i
<
m_size
;
++
i
)
for
(
size_t
i
=
index
;
i
<
m_size
;
++
i
)
m_data
[
i
]
=
i
+
1
<
m_sizeLimit
?
m_data
[
i
+
1
]
:
T
{};
m_data
[
i
]
=
i
+
1
<
m_sizeLimit
?
m_data
[
i
+
1
]
:
T
{};
m_size
--
;
m_size
--
;
}
}
void
touch
()
{
m_lastChange
=
utils
::
CurrentTimeMillis
();
}
};
};
}
// namespace nas
}
// namespace nas
src/ue/nas/mm/dereg.cpp
View file @
db31bdad
...
@@ -247,7 +247,13 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi
...
@@ -247,7 +247,13 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi
if
(
cause
==
nas
::
EMmCause
::
TA_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
ROAMING_NOT_ALLOWED_IN_TA
||
if
(
cause
==
nas
::
EMmCause
::
TA_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
ROAMING_NOT_ALLOWED_IN_TA
||
cause
==
nas
::
EMmCause
::
NO_SUITIBLE_CELLS_IN_TA
)
cause
==
nas
::
EMmCause
::
NO_SUITIBLE_CELLS_IN_TA
)
{
{
nas
::
utils
::
AddToTaiList
(
m_usim
->
m_forbiddenTaiListRoaming
,
*
m_usim
->
m_currentTai
);
Tai
tai
;
tai
.
plmn
.
mcc
=
m_usim
->
m_currentTai
->
plmn
.
mcc
;
tai
.
plmn
.
mnc
=
m_usim
->
m_currentTai
->
plmn
.
mnc
;
tai
.
plmn
.
isLongMnc
=
m_usim
->
m_currentTai
->
plmn
.
isLongMnc
;
tai
.
tac
=
(
int
)
m_usim
->
m_currentTai
->
tac
;
m_storage
.
m_forbiddenTaiListRoaming
.
add
(
tai
);
}
}
if
(
cause
==
nas
::
EMmCause
::
ILLEGAL_UE
||
cause
==
nas
::
EMmCause
::
FIVEG_SERVICES_NOT_ALLOWED
)
if
(
cause
==
nas
::
EMmCause
::
ILLEGAL_UE
||
cause
==
nas
::
EMmCause
::
FIVEG_SERVICES_NOT_ALLOWED
)
...
...
src/ue/nas/mm/register.cpp
View file @
db31bdad
...
@@ -563,7 +563,13 @@ void NasMm::receiveInitialRegistrationReject(const nas::RegistrationReject &msg)
...
@@ -563,7 +563,13 @@ void NasMm::receiveInitialRegistrationReject(const nas::RegistrationReject &msg)
if
(
cause
==
nas
::
EMmCause
::
ROAMING_NOT_ALLOWED_IN_TA
||
cause
==
nas
::
EMmCause
::
NO_SUITIBLE_CELLS_IN_TA
)
if
(
cause
==
nas
::
EMmCause
::
ROAMING_NOT_ALLOWED_IN_TA
||
cause
==
nas
::
EMmCause
::
NO_SUITIBLE_CELLS_IN_TA
)
{
{
nas
::
utils
::
AddToTaiList
(
m_usim
->
m_forbiddenTaiListRoaming
,
*
m_usim
->
m_currentTai
);
Tai
tai
;
tai
.
plmn
.
mcc
=
m_usim
->
m_currentTai
->
plmn
.
mcc
;
tai
.
plmn
.
mnc
=
m_usim
->
m_currentTai
->
plmn
.
mnc
;
tai
.
plmn
.
isLongMnc
=
m_usim
->
m_currentTai
->
plmn
.
isLongMnc
;
tai
.
tac
=
(
int
)
m_usim
->
m_currentTai
->
tac
;
m_storage
.
m_forbiddenTaiListRoaming
.
add
(
tai
);
}
}
if
(
cause
==
nas
::
EMmCause
::
PLMN_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
SERVING_NETWORK_NOT_AUTHORIZED
)
if
(
cause
==
nas
::
EMmCause
::
PLMN_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
SERVING_NETWORK_NOT_AUTHORIZED
)
...
@@ -721,7 +727,13 @@ void NasMm::receiveMobilityRegistrationReject(const nas::RegistrationReject &msg
...
@@ -721,7 +727,13 @@ void NasMm::receiveMobilityRegistrationReject(const nas::RegistrationReject &msg
if
(
cause
==
nas
::
EMmCause
::
ROAMING_NOT_ALLOWED_IN_TA
||
cause
==
nas
::
EMmCause
::
NO_SUITIBLE_CELLS_IN_TA
)
if
(
cause
==
nas
::
EMmCause
::
ROAMING_NOT_ALLOWED_IN_TA
||
cause
==
nas
::
EMmCause
::
NO_SUITIBLE_CELLS_IN_TA
)
{
{
nas
::
utils
::
AddToTaiList
(
m_usim
->
m_forbiddenTaiListRoaming
,
*
m_usim
->
m_currentTai
);
Tai
tai
;
tai
.
plmn
.
mcc
=
m_usim
->
m_currentTai
->
plmn
.
mcc
;
tai
.
plmn
.
mnc
=
m_usim
->
m_currentTai
->
plmn
.
mnc
;
tai
.
plmn
.
isLongMnc
=
m_usim
->
m_currentTai
->
plmn
.
isLongMnc
;
tai
.
tac
=
(
int
)
m_usim
->
m_currentTai
->
tac
;
m_storage
.
m_forbiddenTaiListRoaming
.
add
(
tai
);
}
}
if
(
cause
==
nas
::
EMmCause
::
PLMN_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
SERVING_NETWORK_NOT_AUTHORIZED
)
if
(
cause
==
nas
::
EMmCause
::
PLMN_NOT_ALLOWED
||
cause
==
nas
::
EMmCause
::
SERVING_NETWORK_NOT_AUTHORIZED
)
...
...
src/ue/nas/mm/service.cpp
View file @
db31bdad
...
@@ -310,12 +310,25 @@ void NasMm::receiveServiceReject(const nas::ServiceReject &msg)
...
@@ -310,12 +310,25 @@ void NasMm::receiveServiceReject(const nas::ServiceReject &msg)
if
(
cause
==
nas
::
EMmCause
::
TA_NOT_ALLOWED
)
if
(
cause
==
nas
::
EMmCause
::
TA_NOT_ALLOWED
)
{
{
nas
::
utils
::
AddToTaiList
(
m_usim
->
m_forbiddenTaiListRps
,
*
m_usim
->
m_currentTai
);
Tai
tai
;
tai
.
plmn
.
mcc
=
m_usim
->
m_currentTai
->
plmn
.
mcc
;
tai
.
plmn
.
mnc
=
m_usim
->
m_currentTai
->
plmn
.
mnc
;
tai
.
plmn
.
isLongMnc
=
m_usim
->
m_currentTai
->
plmn
.
isLongMnc
;
tai
.
tac
=
(
int
)
m_usim
->
m_currentTai
->
tac
;
m_storage
.
m_forbiddenTaiListRps
.
add
(
tai
);
}
}
if
(
cause
==
nas
::
EMmCause
::
ROAMING_NOT_ALLOWED_IN_TA
||
cause
==
nas
::
EMmCause
::
NO_SUITIBLE_CELLS_IN_TA
)
if
(
cause
==
nas
::
EMmCause
::
ROAMING_NOT_ALLOWED_IN_TA
||
cause
==
nas
::
EMmCause
::
NO_SUITIBLE_CELLS_IN_TA
)
{
{
nas
::
utils
::
AddToTaiList
(
m_usim
->
m_forbiddenTaiListRoaming
,
*
m_usim
->
m_currentTai
);
Tai
tai
;
tai
.
plmn
.
mcc
=
m_usim
->
m_currentTai
->
plmn
.
mcc
;
tai
.
plmn
.
mnc
=
m_usim
->
m_currentTai
->
plmn
.
mnc
;
tai
.
plmn
.
isLongMnc
=
m_usim
->
m_currentTai
->
plmn
.
isLongMnc
;
tai
.
tac
=
(
int
)
m_usim
->
m_currentTai
->
tac
;
m_storage
.
m_forbiddenTaiListRoaming
.
add
(
tai
);
nas
::
utils
::
RemoveFromTaiList
(
m_usim
->
m_taiList
,
*
m_usim
->
m_currentTai
);
nas
::
utils
::
RemoveFromTaiList
(
m_usim
->
m_taiList
,
*
m_usim
->
m_currentTai
);
}
}
...
...
src/ue/nas/usim/usim.hpp
View file @
db31bdad
...
@@ -40,8 +40,6 @@ class Usim
...
@@ -40,8 +40,6 @@ class Usim
std
::
optional
<
nas
::
VTrackingAreaIdentity
>
m_currentTai
{};
std
::
optional
<
nas
::
VTrackingAreaIdentity
>
m_currentTai
{};
std
::
optional
<
nas
::
IE5gsTrackingAreaIdentity
>
m_lastVisitedRegisteredTai
{};
std
::
optional
<
nas
::
IE5gsTrackingAreaIdentity
>
m_lastVisitedRegisteredTai
{};
nas
::
IE5gsTrackingAreaIdentityList
m_taiList
{};
nas
::
IE5gsTrackingAreaIdentityList
m_taiList
{};
nas
::
IE5gsTrackingAreaIdentityList
m_forbiddenTaiListRoaming
{};
// 5GS forbidden TAs for roaming
nas
::
IE5gsTrackingAreaIdentityList
m_forbiddenTaiListRps
{};
// 5GS forbidden TAs for regional provision of service
nas
::
IEPlmnList
m_equivalentPlmnList
{};
nas
::
IEPlmnList
m_equivalentPlmnList
{};
nas
::
IEPlmnList
m_forbiddenPlmnList
{};
nas
::
IEPlmnList
m_forbiddenPlmnList
{};
nas
::
IEServiceAreaList
m_serviceAreaList
{};
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