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
96073581
Commit
96073581
authored
May 28, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
L3 RRC/NAS developments
parent
ade2494e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
75 additions
and
8 deletions
+75
-8
src/lib/app/cli_cmd.cpp
src/lib/app/cli_cmd.cpp
+5
-0
src/lib/app/cli_cmd.hpp
src/lib/app/cli_cmd.hpp
+1
-0
src/lib/nas/enums.cpp
src/lib/nas/enums.cpp
+24
-0
src/lib/nas/enums.hpp
src/lib/nas/enums.hpp
+4
-0
src/lib/nas/ie4.cpp
src/lib/nas/ie4.cpp
+18
-0
src/lib/nas/ie4.hpp
src/lib/nas/ie4.hpp
+4
-0
src/ue/app/cmd_handler.cpp
src/ue/app/cmd_handler.cpp
+19
-8
No files found.
src/lib/app/cli_cmd.cpp
View file @
96073581
...
...
@@ -160,6 +160,7 @@ static OrderedMap<std::string, CmdEntry> g_ueCmdEntries = {
{
"timers"
,
{
"Dump current status of the timers in the UE"
,
""
,
DefaultDesc
,
false
}},
{
"ps-establish"
,
{
"Trigger a PDU session establishment procedure"
,
"<session-type> [options]"
,
DescForPsEstablish
,
true
}},
{
"ps-list"
,
{
"List all PDU sessions"
,
""
,
DefaultDesc
,
false
}},
{
"ps-release"
,
{
"Trigger a PDU session release procedure"
,
"<pdu-session-id>..."
,
DefaultDesc
,
true
}},
{
"ps-release-all"
,
{
"Trigger PDU session release procedures for all active sessions"
,
""
,
DefaultDesc
,
false
}},
{
"deregister"
,
...
...
@@ -316,6 +317,10 @@ static std::unique_ptr<UeCliCommand> UeCliParseImpl(const std::string &subCmd, c
}
return
cmd
;
}
else
if
(
subCmd
==
"ps-list"
)
{
return
std
::
make_unique
<
UeCliCommand
>
(
UeCliCommand
::
PS_LIST
);
}
return
nullptr
;
}
...
...
src/lib/app/cli_cmd.hpp
View file @
96073581
...
...
@@ -52,6 +52,7 @@ struct UeCliCommand
PS_ESTABLISH
,
PS_RELEASE
,
PS_RELEASE_ALL
,
PS_LIST
,
DE_REGISTER
,
}
present
;
...
...
src/lib/nas/enums.cpp
View file @
96073581
...
...
@@ -7,3 +7,27 @@
//
#include "enums.hpp"
namespace
nas
{
Json
ToJson
(
const
EPduSessionType
&
v
)
{
switch
(
v
)
{
case
EPduSessionType
:
:
IPV4
:
return
"IPv4"
;
case
EPduSessionType
:
:
IPV6
:
return
"IPv6"
;
case
EPduSessionType
:
:
IPV4V6
:
return
"IPv4v6"
;
case
EPduSessionType
:
:
UNSTRUCTURED
:
return
"unstructured"
;
case
EPduSessionType
:
:
ETHERNET
:
return
"ethernet"
;
default:
return
"?"
;
}
}
}
// namespace nas
src/lib/nas/enums.hpp
View file @
96073581
...
...
@@ -8,6 +8,8 @@
#pragma once
#include <utils/json.hpp>
namespace
nas
{
...
...
@@ -750,4 +752,6 @@ enum class EQoSOperationCode
MODIFY_EXISTING
=
0b011
,
};
Json
ToJson
(
const
EPduSessionType
&
v
);
}
// namespace nas
\ No newline at end of file
src/lib/nas/ie4.cpp
View file @
96073581
...
...
@@ -8,6 +8,8 @@
#include "ie4.hpp"
#include <utils/common.hpp>
namespace
nas
{
...
...
@@ -1075,4 +1077,20 @@ void IE5gsTrackingAreaIdentityList::Encode(const IE5gsTrackingAreaIdentityList &
VPartialTrackingAreaIdentityList
::
Encode
(
x
,
stream
);
}
Json
ToJson
(
const
IEPduAddress
&
v
)
{
switch
(
v
.
sessionType
)
{
case
EPduSessionType
:
:
IPV4
:
case
EPduSessionType
:
:
IPV6
:
case
EPduSessionType
:
:
IPV4V6
:
return
utils
::
OctetStringToIp
(
v
.
pduAddressInformation
);
case
EPduSessionType
:
:
UNSTRUCTURED
:
case
EPduSessionType
:
:
ETHERNET
:
return
v
.
pduAddressInformation
.
toHexString
();
default:
return
"?"
;
}
}
}
// namespace nas
\ No newline at end of file
src/lib/nas/ie4.hpp
View file @
96073581
...
...
@@ -14,6 +14,8 @@
#include <optional>
#include <utility>
#include <utils/json.hpp>
namespace
nas
{
...
...
@@ -570,4 +572,6 @@ struct IE5gsTrackingAreaIdentityList : InformationElement4
static
void
Encode
(
const
IE5gsTrackingAreaIdentityList
&
ie
,
OctetString
&
stream
);
};
Json
ToJson
(
const
IEPduAddress
&
v
);
}
// namespace nas
src/ue/app/cmd_handler.cpp
View file @
96073581
...
...
@@ -105,13 +105,6 @@ void UeCmdHandler::handleCmdImpl(NmUeCliCommand &msg)
switch
(
msg
.
cmd
->
present
)
{
case
app
:
:
UeCliCommand
::
STATUS
:
{
// TODO
// std::vector<Json> pduSessions{};
// for (auto &pduSession : m_base->appTask->m_pduSessions)
// if (pduSession.has_value())
// pduSessions.push_back(ToJson(*pduSession));
// TODO: include SST, SD, DNN as well..
Json
json
=
Json
::
Obj
({
{
"cm-state"
,
ToJson
(
m_base
->
nasTask
->
mm
->
m_cmState
)},
{
"rm-state"
,
ToJson
(
m_base
->
nasTask
->
mm
->
m_rmState
)},
...
...
@@ -121,7 +114,6 @@ void UeCmdHandler::handleCmdImpl(NmUeCliCommand &msg)
{
"stored-suci"
,
ToJson
(
m_base
->
nasTask
->
mm
->
m_storage
->
storedSuci
->
get
())},
{
"stored-guti"
,
ToJson
(
m_base
->
nasTask
->
mm
->
m_storage
->
storedGuti
->
get
())},
{
"has-emergency"
,
::
ToJson
(
m_base
->
nasTask
->
mm
->
hasEmergency
())},
// TODO {"pdu-sessions", Json::Arr(std::move(pduSessions))},
});
sendResult
(
msg
.
address
,
json
.
dumpYaml
());
break
;
...
...
@@ -164,6 +156,25 @@ void UeCmdHandler::handleCmdImpl(NmUeCliCommand &msg)
sendResult
(
msg
.
address
,
"PDU session establishment procedure triggered"
);
break
;
}
case
app
:
:
UeCliCommand
::
PS_LIST
:
{
std
::
vector
<
Json
>
arr
{};
for
(
auto
*
pduSession
:
m_base
->
nasTask
->
sm
->
m_pduSessions
)
{
arr
.
push_back
(
Json
::
Obj
({
{
"ID"
,
pduSession
->
psi
},
{
"state"
,
ToJson
(
pduSession
->
psState
)},
{
"session-type"
,
ToJson
(
pduSession
->
sessionType
)},
{
"apn"
,
::
ToJson
(
pduSession
->
apn
)},
{
"s-nssai"
,
ToJson
(
pduSession
->
sNssai
)},
{
"emergency"
,
pduSession
->
isEmergency
},
{
"address"
,
::
ToJson
(
pduSession
->
pduAddress
)},
{
"ambr"
,
""
},
// TODO
{
"data-pending"
,
pduSession
->
uplinkPending
},
}));
}
sendResult
(
msg
.
address
,
Json
::
Arr
(
arr
).
dumpYaml
());
break
;
}
}
}
...
...
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