diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-04-23 09:46:25 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-04-23 09:46:25 +0000 |
commit | b03c1fcb8458283526af2ef15f8dab7edf7c14f8 (patch) | |
tree | 3d87a7670c1fa32bfeb334ad5ce194e68d6309d5 /src/peerinfo-tool/gnunet-peerinfo.c | |
parent | 597e676a39da448348164042bb0e0b1f9b957c40 (diff) | |
download | gnunet-b03c1fcb8458283526af2ef15f8dab7edf7c14f8.tar.gz gnunet-b03c1fcb8458283526af2ef15f8dab7edf7c14f8.zip |
peerinfo
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); |