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
97f76db4
Commit
97f76db4
authored
Feb 21, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PS local release implementation
parent
e121c5c7
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
43 additions
and
42 deletions
+43
-42
src/ue/app/cmd_handler.cpp
src/ue/app/cmd_handler.cpp
+1
-1
src/ue/app/task.cpp
src/ue/app/task.cpp
+15
-5
src/ue/app/task.hpp
src/ue/app/task.hpp
+2
-2
src/ue/mm/dereg.cpp
src/ue/mm/dereg.cpp
+2
-4
src/ue/nts.hpp
src/ue/nts.hpp
+1
-1
src/ue/sm/allocation.cpp
src/ue/sm/allocation.cpp
+2
-18
src/ue/sm/resource.cpp
src/ue/sm/resource.cpp
+15
-3
src/ue/sm/sm.hpp
src/ue/sm/sm.hpp
+1
-0
src/ue/types.hpp
src/ue/types.hpp
+4
-8
No files found.
src/ue/app/cmd_handler.cpp
View file @
97f76db4
...
...
@@ -95,7 +95,7 @@ void UeCmdHandler::handleCmdImpl(NwUeCliCommand &msg)
case
app
:
:
UeCliCommand
::
STATUS
:
{
std
::
vector
<
Json
>
pduSessions
{};
int
index
=
0
;
for
(
auto
&
pduSession
:
m_base
->
appTask
->
m_
statusInfo
.
pduSessions
)
for
(
auto
&
pduSession
:
m_base
->
appTask
->
m_pduSessions
)
{
if
(
pduSession
.
has_value
())
{
...
...
src/ue/app/task.cpp
View file @
97f76db4
...
...
@@ -20,7 +20,7 @@ static constexpr const int SWITCH_OFF_DELAY = 500;
namespace
nr
::
ue
{
UeAppTask
::
UeAppTask
(
TaskBase
*
base
)
:
m_base
{
base
}
,
m_statusInfo
{},
m_tunTasks
{}
UeAppTask
::
UeAppTask
(
TaskBase
*
base
)
:
m_base
{
base
}
{
m_logger
=
m_base
->
logBase
->
makeUniqueLogger
(
m_base
->
config
->
getLoggerPrefix
()
+
"app"
);
}
...
...
@@ -129,12 +129,12 @@ void UeAppTask::receiveStatusUpdate(NwUeStatusUpdate &msg)
{
auto
*
session
=
msg
.
pduSession
;
Ue
StatusInfo
::
Ue
PduSessionInfo
sessionInfo
{};
UePduSessionInfo
sessionInfo
{};
sessionInfo
.
type
=
nas
::
utils
::
EnumToString
(
session
->
sessionType
);
if
(
session
->
pduAddress
.
has_value
())
sessionInfo
.
address
=
utils
::
OctetStringToIp
(
session
->
pduAddress
->
pduAddressInformation
);
m_
statusInfo
.
pduSessions
[
session
->
id
]
=
std
::
move
(
sessionInfo
);
m_pduSessions
[
session
->
id
]
=
std
::
move
(
sessionInfo
);
setupTunInterface
(
session
);
return
;
...
...
@@ -142,8 +142,18 @@ void UeAppTask::receiveStatusUpdate(NwUeStatusUpdate &msg)
if
(
msg
.
what
==
NwUeStatusUpdate
::
SESSION_RELEASE
)
{
// TODO
m_logger
->
err
(
"todo: release"
);
if
(
m_tunTasks
[
msg
.
psi
]
!=
nullptr
)
{
m_tunTasks
[
msg
.
psi
]
->
quit
();
delete
m_tunTasks
[
msg
.
psi
];
m_tunTasks
[
msg
.
psi
]
=
nullptr
;
}
if
(
m_pduSessions
[
msg
.
psi
].
has_value
())
{
m_logger
->
info
(
"PDU session[%d] released"
,
msg
.
psi
);
m_pduSessions
[
msg
.
psi
]
=
{};
}
}
}
...
...
src/ue/app/task.hpp
View file @
97f76db4
...
...
@@ -27,8 +27,8 @@ class UeAppTask : public NtsTask
TaskBase
*
m_base
;
std
::
unique_ptr
<
Logger
>
m_logger
;
UeStatusInfo
m_statusInfo
;
TunTask
*
m_tunTasks
[
16
]
;
std
::
array
<
std
::
optional
<
UePduSessionInfo
>
,
16
>
m_pduSessions
{}
;
std
::
array
<
TunTask
*
,
16
>
m_tunTasks
{}
;
friend
class
UeCmdHandler
;
...
...
src/ue/mm/dereg.cpp
View file @
97f76db4
...
...
@@ -56,8 +56,7 @@ void NasMm::sendDeregistration(nas::ESwitchOff switchOff, bool dueToDisable5g)
switchMmState
(
EMmState
::
MM_DEREGISTERED_INITIATED
,
EMmSubState
::
MM_DEREGISTERED_INITIATED_NA
);
// Release all PDU sessions
m_sm
->
localReleaseSession
(
0
);
m_sm
->
localReleaseAllSessions
();
if
(
switchOff
==
nas
::
ESwitchOff
::
SWITCH_OFF
)
m_base
->
appTask
->
push
(
new
NwUeNasToApp
(
NwUeNasToApp
::
PERFORM_SWITCH_OFF
));
...
...
@@ -138,8 +137,7 @@ void NasMm::receiveDeregistrationRequest(const nas::DeRegistrationRequestUeTermi
msg
.
deRegistrationType
.
reRegistrationRequired
==
nas
::
EReRegistrationRequired
::
REQUIRED
&&
!
forceIgnoreReregistration
;
// Release all PDU sessions
m_sm
->
localReleaseSession
(
0
);
m_sm
->
localReleaseAllSessions
();
if
(
reRegistrationRequired
)
{
...
...
src/ue/nts.hpp
View file @
97f76db4
...
...
@@ -247,7 +247,7 @@ struct NwUeStatusUpdate : NtsMessage
PduSession
*
pduSession
{};
// SESSION_RELEASE
int
psi
{};
// psi=0 means release all of the sessions
int
psi
{};
explicit
NwUeStatusUpdate
(
const
int
what
)
:
NtsMessage
(
NtsMessageType
::
UE_STATUS_UPDATE
),
what
(
what
)
{
...
...
src/ue/sm/allocation.cpp
View file @
97f76db4
...
...
@@ -76,28 +76,12 @@ int NasSm::allocateProcedureTransactionId()
void
NasSm
::
freeProcedureTransactionId
(
int
pti
)
{
if
(
pti
==
0
)
{
for
(
auto
&
transaction
:
m_procedureTransactions
)
transaction
=
{};
}
else
{
m_procedureTransactions
[
pti
].
id
=
0
;
}
m_procedureTransactions
[
pti
]
=
{};
}
void
NasSm
::
freePduSessionId
(
int
psi
)
{
if
(
psi
==
0
)
{
for
(
auto
&
session
:
m_pduSessions
)
session
=
{};
}
else
{
m_pduSessions
[
psi
]
=
{};
}
m_pduSessions
[
psi
]
=
{};
}
}
// namespace nr::ue
\ No newline at end of file
src/ue/sm/resource.cpp
View file @
97f76db4
...
...
@@ -18,11 +18,23 @@ void NasSm::localReleaseSession(int psi)
{
m_logger
->
debug
(
"Performing local release of PDU session[%d]"
,
psi
);
bool
isEstablished
=
m_pduSessions
[
psi
].
isEstablished
;
freePduSessionId
(
psi
);
auto
*
statusUpdate
=
new
NwUeStatusUpdate
(
NwUeStatusUpdate
::
SESSION_RELEASE
);
statusUpdate
->
psi
=
psi
;
m_base
->
appTask
->
push
(
statusUpdate
);
if
(
isEstablished
)
{
auto
*
statusUpdate
=
new
NwUeStatusUpdate
(
NwUeStatusUpdate
::
SESSION_RELEASE
);
statusUpdate
->
psi
=
psi
;
m_base
->
appTask
->
push
(
statusUpdate
);
}
}
void
NasSm
::
localReleaseAllSessions
()
{
for
(
auto
&
session
:
m_pduSessions
)
if
(
session
.
id
!=
0
)
localReleaseSession
(
session
.
id
);
}
}
// namespace nr::ue
\ No newline at end of file
src/ue/sm/sm.hpp
View file @
97f76db4
...
...
@@ -47,6 +47,7 @@ class NasSm
/* Resource */
void
localReleaseSession
(
int
psi
);
void
localReleaseAllSessions
();
private:
/* Transport */
...
...
src/ue/types.hpp
View file @
97f76db4
...
...
@@ -10,6 +10,7 @@
#include <app/monitor.hpp>
#include <app/ue_ctl.hpp>
#include <array>
#include <nas/nas.hpp>
#include <nas/timer.hpp>
#include <utils/common_types.hpp>
...
...
@@ -353,15 +354,10 @@ enum class EAutnValidationRes
SYNCHRONISATION_FAILURE
,
};
struct
Ue
Status
Info
struct
Ue
PduSession
Info
{
struct
UePduSessionInfo
{
std
::
string
type
{};
std
::
string
address
{};
};
std
::
optional
<
UePduSessionInfo
>
pduSessions
[
16
]{};
std
::
string
type
{};
std
::
string
address
{};
};
Json
ToJson
(
const
ECmState
&
state
);
...
...
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