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
9ff9c6f4
Commit
9ff9c6f4
authored
Feb 14, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CLI improvements
parent
cc926d1a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
src/cli.cpp
src/cli.cpp
+15
-5
No files found.
src/cli.cpp
View file @
9ff9c6f4
...
@@ -45,7 +45,7 @@ static std::set<int> FindProcesses()
...
@@ -45,7 +45,7 @@ static std::set<int> FindProcesses()
return
res
;
return
res
;
}
}
static
uint16_t
DiscoverNode
(
const
std
::
string
&
node
)
static
uint16_t
DiscoverNode
(
const
std
::
string
&
node
,
int
&
skippedDueToVersion
)
{
{
if
(
!
io
::
Exists
(
cons
::
PROC_TABLE_DIR
))
if
(
!
io
::
Exists
(
cons
::
PROC_TABLE_DIR
))
return
0
;
return
0
;
...
@@ -65,6 +65,7 @@ static uint16_t DiscoverNode(const std::string &node)
...
@@ -65,6 +65,7 @@ static uint16_t DiscoverNode(const std::string &node)
}
}
uint16_t
found
=
0
;
uint16_t
found
=
0
;
skippedDueToVersion
=
0
;
for
(
auto
&
e
:
entries
)
for
(
auto
&
e
:
entries
)
{
{
...
@@ -79,8 +80,13 @@ static uint16_t DiscoverNode(const std::string &node)
...
@@ -79,8 +80,13 @@ static uint16_t DiscoverNode(const std::string &node)
// If searching node exists in this file, extract port number from it.
// If searching node exists in this file, extract port number from it.
for
(
auto
&
n
:
e
.
second
.
nodes
)
for
(
auto
&
n
:
e
.
second
.
nodes
)
{
{
if
(
n
==
node
)
// TODO: version checking
if
(
n
==
node
)
found
=
e
.
second
.
port
;
{
if
(
e
.
second
.
major
==
cons
::
Major
&&
e
.
second
.
minor
==
cons
::
Minor
&&
e
.
second
.
patch
==
cons
::
Patch
)
found
=
e
.
second
.
port
;
else
skippedDueToVersion
++
;
}
}
}
}
}
...
@@ -278,11 +284,12 @@ int main(int argc, char **argv)
...
@@ -278,11 +284,12 @@ int main(int argc, char **argv)
exit
(
1
);
exit
(
1
);
}
}
uint16_t
cmdPort
;
uint16_t
cmdPort
{};
int
skippedDueToVersion
{};
try
try
{
{
cmdPort
=
DiscoverNode
(
g_options
.
nodeName
);
cmdPort
=
DiscoverNode
(
g_options
.
nodeName
,
skippedDueToVersion
);
}
}
catch
(
const
std
::
runtime_error
&
e
)
catch
(
const
std
::
runtime_error
&
e
)
{
{
...
@@ -292,6 +299,9 @@ int main(int argc, char **argv)
...
@@ -292,6 +299,9 @@ int main(int argc, char **argv)
if
(
cmdPort
==
0
)
if
(
cmdPort
==
0
)
{
{
std
::
cerr
<<
"ERROR: No node found with name: "
<<
g_options
.
nodeName
<<
std
::
endl
;
std
::
cerr
<<
"ERROR: No node found with name: "
<<
g_options
.
nodeName
<<
std
::
endl
;
if
(
skippedDueToVersion
>
0
)
std
::
cerr
<<
"WARNING: "
<<
skippedDueToVersion
<<
" node(s) skipped due to version mismatch between the node and the CLI"
<<
std
::
endl
;
return
1
;
return
1
;
}
}
...
...
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