diff options
Diffstat (limited to 'src/peerinfo-tool/gnunet-peerinfo.c')
-rw-r--r-- | src/peerinfo-tool/gnunet-peerinfo.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/peerinfo-tool/gnunet-peerinfo.c b/src/peerinfo-tool/gnunet-peerinfo.c index ba6609596..ba9832099 100644 --- a/src/peerinfo-tool/gnunet-peerinfo.c +++ b/src/peerinfo-tool/gnunet-peerinfo.c | |||
@@ -228,9 +228,33 @@ run (void *cls, | |||
228 | struct GNUNET_PeerIdentity pid; | 228 | struct GNUNET_PeerIdentity pid; |
229 | struct GNUNET_CRYPTO_HashAsciiEncoded enc; | 229 | struct GNUNET_CRYPTO_HashAsciiEncoded enc; |
230 | char *fn; | 230 | char *fn; |
231 | int delta; | ||
231 | 232 | ||
232 | sched = s; | 233 | sched = s; |
233 | cfg = c; | 234 | cfg = c; |
235 | delta = 0; | ||
236 | if ( (args[0] != NULL) && | ||
237 | (args[1] != NULL) && | ||
238 | (1 == sscanf(args[0], "%d", &delta)) && | ||
239 | (GNUNET_OK == | ||
240 | GNUNET_CRYPTO_hash_from_string (args[1], | ||
241 | &pid.hashPubKey)) ) | ||
242 | { | ||
243 | peerinfo = GNUNET_PEERINFO_connect (sched, cfg); | ||
244 | GNUNET_PEERINFO_iterate (peerinfo, | ||
245 | &pid, | ||
246 | delta, | ||
247 | GNUNET_TIME_UNIT_SECONDS, | ||
248 | &print_peer_info, NULL); | ||
249 | return; | ||
250 | } | ||
251 | else if (args[0] != NULL) | ||
252 | { | ||
253 | fprintf (stderr, | ||
254 | _("Invalid command line argument `%s'\n"), | ||
255 | args[0]); | ||
256 | return; | ||
257 | } | ||
234 | if (get_self != GNUNET_YES) | 258 | if (get_self != GNUNET_YES) |
235 | { | 259 | { |
236 | peerinfo = GNUNET_PEERINFO_connect (sched, cfg); | 260 | peerinfo = GNUNET_PEERINFO_connect (sched, cfg); |