projects
/
oweals
/
gnunet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
spell out message types more, use correct conversion direction
[oweals/gnunet.git]
/
src
/
identity
/
gnunet-identity.c
diff --git
a/src/identity/gnunet-identity.c
b/src/identity/gnunet-identity.c
index c1803ea1d03ddd31a9fedd5f6a5a1213d91bf624..f632aa0a8d76979ee8d9c0d237e85858506eedb3 100644
(file)
--- a/
src/identity/gnunet-identity.c
+++ b/
src/identity/gnunet-identity.c
@@
-1,6
+1,6
@@
/*
This file is part of GNUnet.
/*
This file is part of GNUnet.
- (C) 2013 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2013 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
@@
-14,8
+14,8
@@
You should have received a copy of the GNU General Public License
along with GNUnet; see the file COPYING. If not, write to the
You should have received a copy of the GNU General Public License
along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 5
9 Temple Place - Suite 330
,
- Boston, MA 0211
1-1307
, USA.
+ Free Software Foundation, Inc., 5
1 Franklin Street, Fifth Floor
,
+ Boston, MA 0211
0-1301
, USA.
*/
/**
* @file identity/gnunet-identity.c
*/
/**
* @file identity/gnunet-identity.c
@@
-84,11
+84,9
@@
static struct GNUNET_IDENTITY_Operation *delete_op;
* Task run on shutdown.
*
* @param cls NULL
* Task run on shutdown.
*
* @param cls NULL
- * @param tc unused
*/
static void
*/
static void
-shutdown_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+shutdown_task (void *cls)
{
if (NULL != set_op)
{
{
if (NULL != set_op)
{
@@
-104,7
+102,7
@@
shutdown_task (void *cls,
{
GNUNET_IDENTITY_cancel (delete_op);
delete_op = NULL;
{
GNUNET_IDENTITY_cancel (delete_op);
delete_op = NULL;
- }
+ }
GNUNET_IDENTITY_disconnect (sh);
sh = NULL;
}
GNUNET_IDENTITY_disconnect (sh);
sh = NULL;
}
@@
-121,7
+119,7
@@
test_finished ()
(NULL == set_op) &&
(NULL == set_ego) &&
(! list) &&
(NULL == set_op) &&
(NULL == set_ego) &&
(! list) &&
- (! monitor) )
+ (! monitor) )
GNUNET_SCHEDULER_shutdown ();
}
GNUNET_SCHEDULER_shutdown ();
}
@@
-201,11
+199,11
@@
set_done (void *cls,
* 'ego' does indicate an error (i.e. name is taken or no default
* value is known). If 'ego' is non-NULL and if '*ctx'
* is set in those callbacks, the value WILL be passed to a subsequent
* 'ego' does indicate an error (i.e. name is taken or no default
* value is known). If 'ego' is non-NULL and if '*ctx'
* is set in those callbacks, the value WILL be passed to a subsequent
- * call to the identity callback of 'GNUNET_IDENTITY_connect' (if
+ * call to the identity callback of 'GNUNET_IDENTITY_connect' (if
* that one was not NULL).
*
* When an identity is renamed, this function is called with the
* that one was not NULL).
*
* When an identity is renamed, this function is called with the
- * (known) ego but the NEW identifier.
+ * (known) ego but the NEW identifier.
*
* When an identity is deleted, this function is called with the
* (known) ego and "NULL" for the 'identifier'. In this case,
*
* When an identity is deleted, this function is called with the
* (known) ego and "NULL" for the 'identifier'. In this case,
@@
-226,13
+224,13
@@
print_ego (void *cls,
void **ctx,
const char *identifier)
{
void **ctx,
const char *identifier)
{
- struct GNUNET_CRYPTO_Ec
c
PublicKey pk;
+ struct GNUNET_CRYPTO_Ec
dsa
PublicKey pk;
char *s;
if ( (NULL != set_ego) &&
(NULL != ego) &&
(NULL != identifier) &&
char *s;
if ( (NULL != set_ego) &&
(NULL != ego) &&
(NULL != identifier) &&
- (0 == strcmp (identifier,
+ (0 == strcmp (identifier,
set_ego)) )
{
set_op = GNUNET_IDENTITY_set (sh,
set_ego)) )
{
set_op = GNUNET_IDENTITY_set (sh,
@@
-264,10
+262,13
@@
print_ego (void *cls,
}
if (! (list | monitor))
return;
}
if (! (list | monitor))
return;
+ if (NULL == ego)
+ return;
GNUNET_IDENTITY_ego_get_public_key (ego, &pk);
GNUNET_IDENTITY_ego_get_public_key (ego, &pk);
- s = GNUNET_CRYPTO_ec
c
_public_key_to_string (&pk);
+ s = GNUNET_CRYPTO_ec
dsa
_public_key_to_string (&pk);
if ( (monitor) || (NULL != identifier) )
if ( (monitor) || (NULL != identifier) )
- fprintf (stderr, "%s - %s\n", identifier, s);
+ fprintf (stdout, "%s - %s\n", identifier, s);
+ GNUNET_free (s);
}
}
@@
-301,8
+302,7
@@
run (void *cls, char *const *args, const char *cfgfile,
create_ego,
&create_finished,
&create_op);
create_ego,
&create_finished,
&create_op);
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
- &shutdown_task, NULL);
+ GNUNET_SCHEDULER_add_shutdown (&shutdown_task, NULL);
test_finished ();
}
test_finished ();
}
@@
-335,7
+335,7
@@
main (int argc, char *const *argv)
{'m', "monitor", NULL,
gettext_noop ("run in monitor mode egos"),
0, &GNUNET_GETOPT_set_one, &monitor},
{'m', "monitor", NULL,
gettext_noop ("run in monitor mode egos"),
0, &GNUNET_GETOPT_set_one, &monitor},
- {'s', "set", "SUBSYS
YS
TEM",
+ {'s', "set", "SUBSYSTEM",
gettext_noop ("set default identity to EGO for a subsystem SUBSYSTEM (use together with -e)"),
1, &GNUNET_GETOPT_set_string, &set_subsystem},
GNUNET_GETOPT_OPTION_END
gettext_noop ("set default identity to EGO for a subsystem SUBSYSTEM (use together with -e)"),
1, &GNUNET_GETOPT_set_string, &set_subsystem},
GNUNET_GETOPT_OPTION_END
@@
-345,7
+345,7
@@
main (int argc, char *const *argv)
return 2;
res = GNUNET_PROGRAM_run (argc, argv, "gnunet-identity",
return 2;
res = GNUNET_PROGRAM_run (argc, argv, "gnunet-identity",
- gettext_noop ("Maintain egos"),
+ gettext_noop ("Maintain egos"),
options, &run,
NULL);
GNUNET_free ((void *) argv);
options, &run,
NULL);
GNUNET_free ((void *) argv);