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
70e69d74
Commit
70e69d74
authored
Mar 31, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Options parser improvement
parent
668787e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
src/app/cli_cmd.cpp
src/app/cli_cmd.cpp
+27
-0
No files found.
src/app/cli_cmd.cpp
View file @
70e69d74
...
...
@@ -273,6 +273,33 @@ static std::unique_ptr<UeCliCommand> UeCliParseImpl(const std::string &subCmd, c
std
::
string
type
=
options
.
getPositional
(
0
);
if
(
type
!=
"IPv4"
&&
type
!=
"ipv4"
&&
type
!=
"IPV4"
&&
type
!=
"Ipv4"
&&
type
!=
"IpV4"
)
CMD_ERR
(
"Only IPv4 is supported for now"
)
cmd
->
isEmergency
=
options
.
hasFlag
(
'e'
,
"emergency"
);
if
(
cmd
->
isEmergency
)
{
if
(
options
.
hasFlag
(
std
::
nullopt
,
"sst"
)
||
options
.
hasFlag
(
std
::
nullopt
,
"sd"
)
||
options
.
hasFlag
(
'n'
,
"dnn"
))
CMD_ERR
(
"SST, SD, and DNN parameters cannot be used for emergency PDU sessions"
)
}
if
(
options
.
hasFlag
(
'n'
,
"dnn"
))
cmd
->
apn
=
options
.
getOption
(
'n'
,
"dnn"
);
if
(
options
.
hasFlag
(
std
::
nullopt
,
"sd"
)
&&
!
options
.
hasFlag
(
std
::
nullopt
,
"sst"
))
CMD_ERR
(
"SST is also required in case of an SD is provided"
)
if
(
options
.
hasFlag
(
std
::
nullopt
,
"sst"
))
{
int
n
=
0
;
if
(
!
utils
::
TryParseInt
(
options
.
getOption
(
std
::
nullopt
,
"sst"
),
n
)
||
n
<=
0
||
n
>=
256
)
CMD_ERR
(
"Invalid SST value"
)
cmd
->
sNssai
=
SingleSlice
{};
cmd
->
sNssai
->
sst
=
static_cast
<
uint8_t
>
(
n
);
if
(
options
.
hasFlag
(
std
::
nullopt
,
"sd"
))
{
if
(
!
utils
::
TryParseInt
(
options
.
getOption
(
std
::
nullopt
,
"sd"
),
n
)
||
n
<=
0
||
n
>
0xFFFFFF
)
CMD_ERR
(
"Invalid SD value"
)
cmd
->
sNssai
->
sd
=
octet3
{
n
};
}
return
cmd
;
}
}
return
nullptr
;
...
...
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