aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-06-22 14:05:29 +0000
committerChristian Grothoff <christian@grothoff.org>2014-06-22 14:05:29 +0000
commit323b7225e6173544de255541087df8bd22ad1644 (patch)
tree0ec1dcf83dc3867487c61efe7eea8cae0aa89ff3
parent68af1b34807c447d4e01d947ae103d54246244fc (diff)
output public key of peer
-rw-r--r--src/hello/gnunet-hello.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/hello/gnunet-hello.c b/src/hello/gnunet-hello.c
index 93eaeef2bb..d18ae6a4e2 100644
--- a/src/hello/gnunet-hello.c
+++ b/src/hello/gnunet-hello.c
@@ -56,10 +56,11 @@ static int address_count;
* @param cls closure
* @param address address to add
* @param expiration old expiration
- * @return GNUNET_OK keep iterating
+ * @return #GNUNET_OK keep iterating
*/
static int
-add_to_buf (void *cls, const struct GNUNET_HELLO_Address *address,
+add_to_buf (void *cls,
+ const struct GNUNET_HELLO_Address *address,
struct GNUNET_TIME_Absolute expiration)
{
struct AddContext *ac = cls;
@@ -86,7 +87,9 @@ add_to_buf (void *cls, const struct GNUNET_HELLO_Address *address,
* @return number of bytes added, 0 to terminate
*/
static ssize_t
-add_from_hello (void *cls, size_t max, void *buf)
+add_from_hello (void *cls,
+ size_t max,
+ void *buf)
{
struct GNUNET_HELLO_Message **orig = cls;
struct AddContext ac;
@@ -171,8 +174,18 @@ main (int argc, char *argv[])
argv[1]);
return 1;
}
- result = GNUNET_HELLO_create (&pk, &add_from_hello, &orig,
- GNUNET_HELLO_is_friend_only (orig));
+ {
+ char *pid;
+
+ pid = GNUNET_CRYPTO_eddsa_public_key_to_string (&pk);
+ fprintf (stdout,
+ "Processing HELLO for peer `%s'\n",
+ pid);
+ GNUNET_free (pid);
+ }
+ result = GNUNET_HELLO_create (&pk, &add_from_hello,
+ &orig,
+ GNUNET_HELLO_is_friend_only (orig));
GNUNET_assert (NULL != result);
fh = GNUNET_DISK_file_open (argv[1],
GNUNET_DISK_OPEN_WRITE,