Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
opendht
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
opendht
Commits
c1750886
Commit
c1750886
authored
Mar 16, 2017
by
Simon Désaulniers
Browse files
Options
Downloads
Patches
Plain Diff
tools: add help -h flag for dhtscanner, dhtchat
parent
d5427df9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
tools/dhtchat.cpp
+10
-0
10 additions, 0 deletions
tools/dhtchat.cpp
tools/dhtscanner.cpp
+10
-0
10 additions, 0 deletions
tools/dhtscanner.cpp
with
20 additions
and
0 deletions
tools/dhtchat.cpp
+
10
−
0
View file @
c1750886
...
@@ -43,10 +43,20 @@ void print_node_info(const DhtRunner& dht, const dht_params&) {
...
@@ -43,10 +43,20 @@ void print_node_info(const DhtRunner& dht, const dht_params&) {
std
::
cout
<<
"Public key ID "
<<
dht
.
getId
()
<<
std
::
endl
;
std
::
cout
<<
"Public key ID "
<<
dht
.
getId
()
<<
std
::
endl
;
}
}
void
print_usage
()
{
std
::
cout
<<
"Usage: dhtchat [-n network_id] [-p local_port] [-b bootstrap_host[:port]]"
<<
std
::
endl
<<
std
::
endl
;
std
::
cout
<<
"dhtchat, a simple OpenDHT command line chat client."
<<
std
::
endl
;
std
::
cout
<<
"Report bugs to: http://opendht.net"
<<
std
::
endl
;
}
int
int
main
(
int
argc
,
char
**
argv
)
main
(
int
argc
,
char
**
argv
)
{
{
auto
params
=
parseArgs
(
argc
,
argv
);
auto
params
=
parseArgs
(
argc
,
argv
);
if
(
params
.
help
)
{
print_usage
();
return
0
;
}
#ifdef WIN32_NATIVE
#ifdef WIN32_NATIVE
gnutls_global_init
();
gnutls_global_init
();
#endif
#endif
...
...
This diff is collapsed.
Click to expand it.
tools/dhtscanner.cpp
+
10
−
0
View file @
c1750886
...
@@ -30,6 +30,12 @@ extern "C" {
...
@@ -30,6 +30,12 @@ extern "C" {
using
namespace
dht
;
using
namespace
dht
;
void
print_usage
()
{
std
::
cout
<<
"Usage: dhtscanner [-n network_id] [-p local_port] [-b bootstrap_host[:port]]"
<<
std
::
endl
<<
std
::
endl
;
std
::
cout
<<
"dhtscanner, a simple OpenDHT command line utility generating scan result the network."
<<
std
::
endl
;
std
::
cout
<<
"Report bugs to: http://opendht.net"
<<
std
::
endl
;
}
struct
snode_compare
{
struct
snode_compare
{
bool
operator
()
(
const
std
::
shared_ptr
<
Node
>&
lhs
,
const
std
::
shared_ptr
<
Node
>&
rhs
)
const
{
bool
operator
()
(
const
std
::
shared_ptr
<
Node
>&
lhs
,
const
std
::
shared_ptr
<
Node
>&
rhs
)
const
{
return
(
lhs
->
id
<
rhs
->
id
)
||
return
(
lhs
->
id
<
rhs
->
id
)
||
...
@@ -73,6 +79,10 @@ main(int argc, char **argv)
...
@@ -73,6 +79,10 @@ main(int argc, char **argv)
gnutls_global_init
();
gnutls_global_init
();
#endif
#endif
auto
params
=
parseArgs
(
argc
,
argv
);
auto
params
=
parseArgs
(
argc
,
argv
);
if
(
params
.
help
)
{
print_usage
();
return
0
;
}
DhtRunner
dht
;
DhtRunner
dht
;
dht
.
run
(
params
.
port
,
{},
true
,
params
.
network
);
dht
.
run
(
params
.
port
,
{},
true
,
params
.
network
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment