aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-dht-monitor.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dht/gnunet-dht-monitor.c')
-rw-r--r--src/dht/gnunet-dht-monitor.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/dht/gnunet-dht-monitor.c b/src/dht/gnunet-dht-monitor.c
index b7360bbab..a699b3d17 100644
--- a/src/dht/gnunet-dht-monitor.c
+++ b/src/dht/gnunet-dht-monitor.c
@@ -141,7 +141,8 @@ get_callback (void *cls,
141 const struct GNUNET_PeerIdentity *path, 141 const struct GNUNET_PeerIdentity *path,
142 const struct GNUNET_HashCode * key) 142 const struct GNUNET_HashCode * key)
143{ 143{
144 FPRINTF (stdout, "GET #%u: type %d, key `%s'\n", 144 FPRINTF (stdout,
145 "GET #%u: type %d, key `%s'\n",
145 result_count, 146 result_count,
146 (int) type, 147 (int) type,
147 GNUNET_h2s_full(key)); 148 GNUNET_h2s_full(key));
@@ -176,8 +177,11 @@ get_resp_callback (void *cls,
176 size_t size) 177 size_t size)
177{ 178{
178 FPRINTF (stdout, 179 FPRINTF (stdout,
179 "RESPONSE #%u: type %d, key `%s', data `%.*s'\n", 180 (GNUNET_BLOCK_TYPE_TEST == type)
181 ? "RESPONSE #%u (%s): type %d, key `%s', data `%.*s'\n"
182 : "RESPONSE #%u (%s): type %d, key `%s'\n",
180 result_count, 183 result_count,
184 GNUNET_STRINGS_absolute_time_to_string (exp),
181 (int) type, 185 (int) type,
182 GNUNET_h2s_full (key), 186 GNUNET_h2s_full (key),
183 (unsigned int) size, 187 (unsigned int) size,
@@ -215,8 +219,11 @@ put_callback (void *cls,
215 size_t size) 219 size_t size)
216{ 220{
217 FPRINTF (stdout, 221 FPRINTF (stdout,
218 "PUT %u: type %d, key `%s', data `%.*s'\n", 222 (GNUNET_BLOCK_TYPE_TEST == type)
223 ? "PUT %u (%s): type %d, key `%s', data `%.*s'\n"
224 : "PUT %u (%s): type %d, key `%s'\n",
219 result_count, 225 result_count,
226 GNUNET_STRINGS_absolute_time_to_string (exp),
220 (int) type, 227 (int) type,
221 GNUNET_h2s_full(key), 228 GNUNET_h2s_full(key),
222 (unsigned int) size, 229 (unsigned int) size,
@@ -234,7 +241,9 @@ put_callback (void *cls,
234 * @param c configuration 241 * @param c configuration
235 */ 242 */
236static void 243static void
237run (void *cls, char *const *args, const char *cfgfile, 244run (void *cls,
245 char *const *args,
246 const char *cfgfile,
238 const struct GNUNET_CONFIGURATION_Handle *c) 247 const struct GNUNET_CONFIGURATION_Handle *c)
239{ 248{
240 struct GNUNET_HashCode *key; 249 struct GNUNET_HashCode *key;
@@ -291,30 +300,30 @@ int
291main (int argc, char *const *argv) 300main (int argc, char *const *argv)
292{ 301{
293 struct GNUNET_GETOPT_CommandLineOption options[] = { 302 struct GNUNET_GETOPT_CommandLineOption options[] = {
294 303
295 GNUNET_GETOPT_option_string ('k', 304 GNUNET_GETOPT_option_string ('k',
296 "key", 305 "key",
297 "KEY", 306 "KEY",
298 gettext_noop ("the query key"), 307 gettext_noop ("the query key"),
299 &query_key), 308 &query_key),
300 309
301 GNUNET_GETOPT_option_uint ('t', 310 GNUNET_GETOPT_option_uint ('t',
302 "type", 311 "type",
303 "TYPE", 312 "TYPE",
304 gettext_noop ("the type of data to look for"), 313 gettext_noop ("the type of data to look for"),
305 &block_type), 314 &block_type),
306 315
307 GNUNET_GETOPT_option_relative_time ('T', 316 GNUNET_GETOPT_option_relative_time ('T',
308 "timeout", 317 "timeout",
309 "TIMEOUT", 318 "TIMEOUT",
310 gettext_noop ("how long should the monitor command run"), 319 gettext_noop ("how long should the monitor command run"),
311 &timeout_request), 320 &timeout_request),
312 321
313 GNUNET_GETOPT_option_flag ('V', 322 GNUNET_GETOPT_option_flag ('V',
314 "verbose", 323 "verbose",
315 gettext_noop ("be verbose (print progress information)"), 324 gettext_noop ("be verbose (print progress information)"),
316 &verbose), 325 &verbose),
317 326
318 GNUNET_GETOPT_OPTION_END 327 GNUNET_GETOPT_OPTION_END
319 }; 328 };
320 329