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
c0d05ab6
Commit
c0d05ab6
authored
May 22, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
L3 RRC/NAS developments
parent
629a07ad
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
55 additions
and
69 deletions
+55
-69
src/ue/nas/mm/mm.hpp
src/ue/nas/mm/mm.hpp
+1
-2
src/ue/nas/mm/timer.cpp
src/ue/nas/mm/timer.cpp
+1
-1
src/ue/nas/sm/sm.hpp
src/ue/nas/sm/sm.hpp
+2
-3
src/ue/nas/sm/timer.cpp
src/ue/nas/sm/timer.cpp
+6
-6
src/ue/nas/task.cpp
src/ue/nas/task.cpp
+1
-1
src/ue/nas/task.hpp
src/ue/nas/task.hpp
+0
-1
src/ue/nts.hpp
src/ue/nts.hpp
+1
-2
src/ue/timer.cpp
src/ue/timer.cpp
+14
-19
src/ue/timer.hpp
src/ue/timer.hpp
+6
-12
src/ue/types.hpp
src/ue/types.hpp
+23
-22
No files found.
src/ue/nas/mm/mm.hpp
View file @
c0d05ab6
...
...
@@ -10,7 +10,6 @@
#include <lib/crypt/milenage.hpp>
#include <lib/nas/nas.hpp>
#include <lib/nas/timer.hpp>
#include <ue/nas/storage.hpp>
#include <ue/nas/usim/usim.hpp>
#include <ue/nts.hpp>
...
...
@@ -179,7 +178,7 @@ class NasMm
bool
switchToECallInactivityIfNeeded
();
private:
/* Timer */
void
onTimerExpire
(
nas
::
Nas
Timer
&
timer
);
void
onTimerExpire
(
Ue
Timer
&
timer
);
public:
/* Interface */
...
...
src/ue/nas/mm/timer.cpp
View file @
c0d05ab6
...
...
@@ -16,7 +16,7 @@
namespace
nr
::
ue
{
void
NasMm
::
onTimerExpire
(
nas
::
Nas
Timer
&
timer
)
void
NasMm
::
onTimerExpire
(
Ue
Timer
&
timer
)
{
auto
logExpired
=
[
this
,
&
timer
]()
{
m_logger
->
debug
(
"NAS timer[%d] expired [%d]"
,
timer
.
getCode
(),
timer
.
getExpiryCount
());
...
...
src/ue/nas/sm/sm.hpp
View file @
c0d05ab6
...
...
@@ -11,7 +11,6 @@
#include <array>
#include <bitset>
#include <lib/nas/nas.hpp>
#include <lib/nas/timer.hpp>
#include <ue/nts.hpp>
#include <ue/types.hpp>
#include <utils/nts.hpp>
...
...
@@ -84,8 +83,8 @@ class NasSm
void
receiveReleaseCommand
(
const
nas
::
PduSessionReleaseCommand
&
msg
);
/* Timer */
std
::
unique_ptr
<
nas
::
Nas
Timer
>
newTransactionTimer
(
int
code
);
void
onTimerExpire
(
nas
::
Nas
Timer
&
timer
);
std
::
unique_ptr
<
Ue
Timer
>
newTransactionTimer
(
int
code
);
void
onTimerExpire
(
Ue
Timer
&
timer
);
void
onTransactionTimerExpire
(
int
pti
);
/* Procedure */
...
...
src/ue/nas/sm/timer.cpp
View file @
c0d05ab6
...
...
@@ -16,20 +16,20 @@
namespace
nr
::
ue
{
std
::
unique_ptr
<
nas
::
Nas
Timer
>
NasSm
::
newTransactionTimer
(
int
code
)
std
::
unique_ptr
<
Ue
Timer
>
NasSm
::
newTransactionTimer
(
int
code
)
{
std
::
unique_ptr
<
nas
::
Nas
Timer
>
timer
;
std
::
unique_ptr
<
Ue
Timer
>
timer
;
switch
(
code
)
{
case
3580
:
timer
=
std
::
make_unique
<
nas
::
Nas
Timer
>
(
3580
,
false
,
16
);
timer
=
std
::
make_unique
<
Ue
Timer
>
(
3580
,
false
,
16
);
break
;
case
3581
:
timer
=
std
::
make_unique
<
nas
::
Nas
Timer
>
(
3581
,
false
,
16
);
timer
=
std
::
make_unique
<
Ue
Timer
>
(
3581
,
false
,
16
);
break
;
case
3582
:
timer
=
std
::
make_unique
<
nas
::
Nas
Timer
>
(
3582
,
false
,
16
);
timer
=
std
::
make_unique
<
Ue
Timer
>
(
3582
,
false
,
16
);
break
;
default:
m_logger
->
err
(
"Bad SM transaction timer code"
);
...
...
@@ -40,7 +40,7 @@ std::unique_ptr<nas::NasTimer> NasSm::newTransactionTimer(int code)
return
timer
;
}
void
NasSm
::
onTimerExpire
(
nas
::
Nas
Timer
&
timer
)
void
NasSm
::
onTimerExpire
(
Ue
Timer
&
timer
)
{
}
...
...
src/ue/nas/task.cpp
View file @
c0d05ab6
...
...
@@ -122,7 +122,7 @@ void NasTask::onLoop()
void
NasTask
::
performTick
()
{
auto
sendExpireMsg
=
[
this
](
nas
::
Nas
Timer
*
timer
)
{
auto
sendExpireMsg
=
[
this
](
Ue
Timer
*
timer
)
{
auto
*
nw
=
new
NwUeNasToNas
(
NwUeNasToNas
::
NAS_TIMER_EXPIRE
);
nw
->
timer
=
timer
;
push
(
nw
);
...
...
src/ue/nas/task.hpp
View file @
c0d05ab6
...
...
@@ -11,7 +11,6 @@
#include <ue/nas/usim/usim.hpp>
#include <lib/crypt/milenage.hpp>
#include <lib/nas/nas.hpp>
#include <lib/nas/timer.hpp>
#include <ue/nas/mm/mm.hpp>
#include <ue/nas/sm/sm.hpp>
#include <ue/nts.hpp>
...
...
src/ue/nts.hpp
View file @
c0d05ab6
...
...
@@ -14,7 +14,6 @@
#include <utility>
#include <lib/app/cli_base.hpp>
#include <lib/nas/timer.hpp>
#include <lib/rls/rls_base.hpp>
#include <lib/rrc/rrc.hpp>
#include <utils/network.hpp>
...
...
@@ -174,7 +173,7 @@ struct NwUeNasToNas : NtsMessage
}
present
;
// NAS_TIMER_EXPIRE
nas
::
Nas
Timer
*
timer
{};
Ue
Timer
*
timer
{};
explicit
NwUeNasToNas
(
PR
present
)
:
NtsMessage
(
NtsMessageType
::
UE_NAS_TO_NAS
),
present
(
present
)
{
...
...
src/
lib/nas
/timer.cpp
→
src/
ue
/timer.cpp
View file @
c0d05ab6
...
...
@@ -12,31 +12,28 @@
#include <utils/common.hpp>
namespace
nas
{
NasTimer
::
NasTimer
(
int
timerCode
,
bool
isMmTimer
,
int
defaultInterval
)
UeTimer
::
UeTimer
(
int
timerCode
,
bool
isMmTimer
,
int
defaultInterval
)
:
m_code
(
timerCode
),
m_isMm
(
isMmTimer
),
m_interval
(
defaultInterval
),
m_startMillis
(
0
),
m_isRunning
(
false
),
m_expiryCount
(
0
),
m_lastDebugPrintMs
(
0
)
{
}
bool
Nas
Timer
::
isRunning
()
const
bool
Ue
Timer
::
isRunning
()
const
{
return
m_isRunning
;
}
int
Nas
Timer
::
getCode
()
const
int
Ue
Timer
::
getCode
()
const
{
return
m_code
;
}
bool
Nas
Timer
::
isMmTimer
()
const
bool
Ue
Timer
::
isMmTimer
()
const
{
return
m_isMm
;
}
void
Nas
Timer
::
start
(
bool
clearExpiryCount
)
void
Ue
Timer
::
start
(
bool
clearExpiryCount
)
{
if
(
clearExpiryCount
)
resetExpiryCount
();
...
...
@@ -44,7 +41,7 @@ void NasTimer::start(bool clearExpiryCount)
m_isRunning
=
true
;
}
void
Nas
Timer
::
start
(
const
nas
::
IEGprsTimer2
&
v
,
bool
clearExpiryCount
)
void
Ue
Timer
::
start
(
const
nas
::
IEGprsTimer2
&
v
,
bool
clearExpiryCount
)
{
if
(
clearExpiryCount
)
resetExpiryCount
();
...
...
@@ -53,7 +50,7 @@ void NasTimer::start(const nas::IEGprsTimer2 &v, bool clearExpiryCount)
m_isRunning
=
true
;
}
void
Nas
Timer
::
start
(
const
nas
::
IEGprsTimer3
&
v
,
bool
clearExpiryCount
)
void
Ue
Timer
::
start
(
const
nas
::
IEGprsTimer3
&
v
,
bool
clearExpiryCount
)
{
if
(
clearExpiryCount
)
resetExpiryCount
();
...
...
@@ -81,7 +78,7 @@ void NasTimer::start(const nas::IEGprsTimer3 &v, bool clearExpiryCount)
m_isRunning
=
true
;
}
void
Nas
Timer
::
stop
(
bool
clearExpiryCount
)
void
Ue
Timer
::
stop
(
bool
clearExpiryCount
)
{
if
(
clearExpiryCount
)
resetExpiryCount
();
...
...
@@ -93,7 +90,7 @@ void NasTimer::stop(bool clearExpiryCount)
}
}
bool
Nas
Timer
::
performTick
()
bool
Ue
Timer
::
performTick
()
{
if
(
m_isRunning
)
{
...
...
@@ -114,12 +111,12 @@ bool NasTimer::performTick()
return
false
;
}
int
Nas
Timer
::
getInterval
()
const
int
Ue
Timer
::
getInterval
()
const
{
return
m_interval
;
}
int
Nas
Timer
::
getRemaining
()
const
int
Ue
Timer
::
getRemaining
()
const
{
if
(
!
m_isRunning
)
return
0
;
...
...
@@ -128,17 +125,17 @@ int NasTimer::getRemaining() const
return
std
::
max
(
m_interval
-
elapsed
,
0
);
}
void
Nas
Timer
::
resetExpiryCount
()
void
Ue
Timer
::
resetExpiryCount
()
{
m_expiryCount
=
0
;
}
int
Nas
Timer
::
getExpiryCount
()
const
int
Ue
Timer
::
getExpiryCount
()
const
{
return
m_expiryCount
;
}
Json
ToJson
(
const
Nas
Timer
&
v
)
Json
ToJson
(
const
Ue
Timer
&
v
)
{
std
::
stringstream
ss
{};
if
(
v
.
isRunning
())
...
...
@@ -148,5 +145,3 @@ Json ToJson(const NasTimer &v)
return
ss
.
str
();
}
}
// namespace nas
src/
lib/nas
/timer.hpp
→
src/
ue
/timer.hpp
View file @
c0d05ab6
...
...
@@ -8,14 +8,10 @@
#pragma once
#include "ie4.hpp"
#include <lib/nas/ie4.hpp>
#include <utils/json.hpp>
namespace
nas
{
class
NasTimer
class
UeTimer
{
private:
const
int
m_code
;
...
...
@@ -29,12 +25,12 @@ class NasTimer
long
m_lastDebugPrintMs
;
public:
Nas
Timer
(
int
timerCode
,
bool
isMmTimer
,
int
defaultInterval
);
Ue
Timer
(
int
timerCode
,
bool
isMmTimer
,
int
defaultInterval
);
public:
void
start
(
bool
clearExpiryCount
=
true
);
void
start
(
const
IEGprsTimer2
&
v
,
bool
clearExpiryCount
=
true
);
void
start
(
const
IEGprsTimer3
&
v
,
bool
clearExpiryCount
=
true
);
void
start
(
const
nas
::
IEGprsTimer2
&
v
,
bool
clearExpiryCount
=
true
);
void
start
(
const
nas
::
IEGprsTimer3
&
v
,
bool
clearExpiryCount
=
true
);
void
stop
(
bool
clearExpiryCount
=
true
);
void
resetExpiryCount
();
bool
performTick
();
...
...
@@ -46,6 +42,4 @@ class NasTimer
[[
nodiscard
]]
int
getExpiryCount
()
const
;
};
Json
ToJson
(
const
NasTimer
&
v
);
}
// namespace nas
\ No newline at end of file
Json
ToJson
(
const
UeTimer
&
v
);
src/ue/types.hpp
View file @
c0d05ab6
...
...
@@ -8,6 +8,8 @@
#pragma once
#include "timer.hpp"
#include <array>
#include <atomic>
#include <memory>
...
...
@@ -17,7 +19,6 @@
#include <lib/app/monitor.hpp>
#include <lib/app/ue_ctl.hpp>
#include <lib/nas/nas.hpp>
#include <lib/nas/timer.hpp>
#include <utils/common_types.hpp>
#include <utils/json.hpp>
#include <utils/locked.hpp>
...
...
@@ -189,26 +190,26 @@ struct TaskBase
struct
NasTimers
{
nas
::
Nas
Timer
t3346
;
/* MM - ... */
nas
::
Nas
Timer
t3396
;
/* SM - ... */
nas
::
Nas
Timer
t3444
;
/* MM - ... */
nas
::
Nas
Timer
t3445
;
/* MM - ... */
nas
::
Nas
Timer
t3502
;
/* MM - Initiation of the registration procedure, if still required */
nas
::
Nas
Timer
t3510
;
/* MM - Registration Request transmission timer */
nas
::
Nas
Timer
t3511
;
/* MM - Retransmission of the REGISTRATION REQUEST, if still required */
nas
::
Nas
Timer
t3512
;
/* MM - Periodic registration update timer */
nas
::
Nas
Timer
t3516
;
/* MM - 5G AKA - RAND and RES* storing timer */
nas
::
Nas
Timer
t3517
;
/* MM - Service Request transmission timer */
nas
::
Nas
Timer
t3519
;
/* MM - Transmission with fresh SUCI timer */
nas
::
Nas
Timer
t3520
;
/* MM - ... */
nas
::
Nas
Timer
t3521
;
/* MM - De-registration transmission timer for not switch off */
nas
::
Nas
Timer
t3525
;
/* MM - ... */
nas
::
Nas
Timer
t3540
;
/* MM - ... */
nas
::
Nas
Timer
t3584
;
/* SM - ... */
nas
::
Nas
Timer
t3585
;
/* SM - ... */
Ue
Timer
t3346
;
/* MM - ... */
Ue
Timer
t3396
;
/* SM - ... */
Ue
Timer
t3444
;
/* MM - ... */
Ue
Timer
t3445
;
/* MM - ... */
Ue
Timer
t3502
;
/* MM - Initiation of the registration procedure, if still required */
Ue
Timer
t3510
;
/* MM - Registration Request transmission timer */
Ue
Timer
t3511
;
/* MM - Retransmission of the REGISTRATION REQUEST, if still required */
Ue
Timer
t3512
;
/* MM - Periodic registration update timer */
Ue
Timer
t3516
;
/* MM - 5G AKA - RAND and RES* storing timer */
Ue
Timer
t3517
;
/* MM - Service Request transmission timer */
Ue
Timer
t3519
;
/* MM - Transmission with fresh SUCI timer */
Ue
Timer
t3520
;
/* MM - ... */
Ue
Timer
t3521
;
/* MM - De-registration transmission timer for not switch off */
Ue
Timer
t3525
;
/* MM - ... */
Ue
Timer
t3540
;
/* MM - ... */
Ue
Timer
t3584
;
/* SM - ... */
Ue
Timer
t3585
;
/* SM - ... */
NasTimers
();
};
...
...
@@ -333,7 +334,7 @@ struct ProcedureTransaction
static
constexpr
const
int
MAX_ID
=
254
;
EPtState
state
{};
std
::
unique_ptr
<
nas
::
Nas
Timer
>
timer
{};
std
::
unique_ptr
<
Ue
Timer
>
timer
{};
std
::
unique_ptr
<
nas
::
SmMessage
>
message
{};
int
psi
{};
};
...
...
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