X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fsocial%2Fgnunet-social.c;h=12c5bf2e189f3de339d42614cd676266d0286cba;hb=896b0c669cbcdf548d1c8d603ccc3d9067237340;hp=b7a1314c224dd9ab6d7bb82f1a0104e185f92d14;hpb=24063cff9c2e4ba0196d2c63e7a1485e1425a11c;p=oweals%2Fgnunet.git diff --git a/src/social/gnunet-social.c b/src/social/gnunet-social.c index b7a1314c2..12c5bf2e1 100644 --- a/src/social/gnunet-social.c +++ b/src/social/gnunet-social.c @@ -29,7 +29,6 @@ #include "platform.h" #include "gnunet_util_lib.h" #include "gnunet_social_service.h" -#include "gnunet_core_service.h" #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) @@ -68,10 +67,10 @@ static int op_guest_leave; static int op_guest_talk; /** --replay */ -static char *op_replay; +static int op_replay; /** --replay-latest */ -static char *op_replay_latest; +static int op_replay_latest; /** --look-at */ static int op_look_at; @@ -117,13 +116,13 @@ static char *opt_data; static char *opt_name; /** --start */ -static uint64_t opt_start; +static unsigned long long opt_start; /** --until */ -static uint64_t opt_until; +static unsigned long long opt_until; /** --limit */ -static int opt_limit; +static unsigned long long opt_limit; /* global vars */ @@ -131,12 +130,14 @@ static int opt_limit; /** exit code */ static int ret = 1; +/** are we waiting for service to close our connection */ +static char is_disconnecting = 0; + /** Task handle for timeout termination. */ struct GNUNET_SCHEDULER_Task *timeout_task; const struct GNUNET_CONFIGURATION_Handle *cfg; -struct GNUNET_CORE_Handle *core; struct GNUNET_PeerIdentity peer, this_peer; struct GNUNET_SOCIAL_App *app; @@ -153,6 +154,8 @@ struct GNUNET_SOCIAL_Host *hst; struct GNUNET_SOCIAL_Guest *gst; struct GNUNET_SOCIAL_Place *plc; +const char *method_received; + /* DISCONNECT */ @@ -199,8 +202,18 @@ app_disconnected (void *cls) static void disconnect () { - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "disconnect()\n"); - GNUNET_SOCIAL_app_disconnect (app, app_disconnected, NULL); + // handle that we get called several times from several places, but should we? + if (!is_disconnecting++) { + GNUNET_SOCIAL_app_disconnect (app, app_disconnected, NULL); + } + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "disconnect() called for the #%d time\n", is_disconnecting); +} + + +static void +scheduler_shutdown (void *cls) +{ + disconnect (); } @@ -268,9 +281,9 @@ exit_fail () * This also indicates the end of the connection to the service. */ static void -host_left () +host_left (void *cls) { - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, "The host has left the place.\n"); exit_success (); } @@ -296,8 +309,8 @@ host_leave () static void guest_left (void *cls) { - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, - "The guest has left the place.\n"); + GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, + "Guest has left the place.\n"); } @@ -342,14 +355,14 @@ notify_data (void *cls, uint16_t *data_size, void *data) struct TransmitClosure *tmit = cls; uint16_t size = tmit->size < *data_size ? tmit->size : *data_size; *data_size = size; - memcpy (data, tmit->data, size); + GNUNET_memcpy (data, tmit->data, size); tmit->size -= size; tmit->data += size; if (0 == tmit->size) { - if (op_host_announce || op_host_assign || op_guest_talk) + if ((op_host_announce || op_host_assign || op_guest_talk) && !opt_follow) { exit_success (); } @@ -379,6 +392,7 @@ host_announce (const char *method, const char *data, size_t data_size) GNUNET_SOCIAL_host_announce (hst, method, env, notify_data, &tmit, GNUNET_SOCIAL_ANNOUNCE_NONE); + GNUNET_PSYC_env_destroy (env); } @@ -396,6 +410,7 @@ host_assign (const char *name, const char *data, size_t data_size) GNUNET_SOCIAL_host_announce (hst, "_assign", env, notify_data, &tmit, GNUNET_SOCIAL_ANNOUNCE_NONE); + GNUNET_PSYC_env_destroy (env); } @@ -417,6 +432,7 @@ guest_talk (const char *method, GNUNET_SOCIAL_guest_talk (gst, method, env, notify_data, &tmit, GNUNET_SOCIAL_TALK_NONE); + GNUNET_PSYC_env_destroy (env); } @@ -502,7 +518,7 @@ look_var (void *cls, uint32_t value_size, uint32_t full_value_size) { - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, "Received var: %s\n%.*s\n", name, value_size, (const char *) value); } @@ -541,10 +557,15 @@ slicer_recv_method (void *cls, uint64_t message_id, const char *method_name) { - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + method_received = method_name; + GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, "Received method for message ID %" PRIu64 ":\n" "%s (flags: %x)\n", message_id, method_name, ntohl (meth->flags)); + /* routing header is missing, so we just print double newline */ + printf("\n"); + /* we output . instead of | to indicate that this is not proper PSYC syntax */ + /* FIXME: use libpsyc here */ } @@ -562,10 +583,16 @@ slicer_recv_modifier (void *cls, uint16_t value_size, uint16_t full_value_size) { - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, +#if 0 + GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, "Received modifier for message ID %" PRIu64 ":\n" "%c%s: %.*s (size: %u)\n", message_id, oper, name, value_size, (const char *) value, value_size); +#else + /* obviously not binary safe */ + printf("%c%s\t%.*s\n", + oper, name, value_size, (const char *) value); +#endif } @@ -580,10 +607,16 @@ slicer_recv_data (void *cls, const void *data, uint16_t data_size) { - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, +#if 0 + GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, "Received data for message ID %" PRIu64 ":\n" "%.*s\n", message_id, data_size, (const char *) data); +#else + /* obviously not binary safe */ + printf("%s\n%.*s\n", + method_received, data_size, (const char *) data); +#endif } @@ -597,7 +630,8 @@ slicer_recv_eom (void *cls, uint64_t message_id, uint8_t is_cancelled) { - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + printf(".\n"); + GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, "Received end of message ID %" PRIu64 ", cancelled: %u\n", message_id, is_cancelled); @@ -634,7 +668,7 @@ guest_recv_entry_decision (void *cls, int is_admitted, const struct GNUNET_PSYC_Message *entry_msg) { - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, "Guest received entry decision %d\n", is_admitted); @@ -649,7 +683,7 @@ guest_recv_entry_decision (void *cls, GNUNET_PSYC_message_parse (pmsg, &method_name, env, &data, &data_size); GNUNET_free (pmsg); - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, "%s\n%.*s\n", method_name, data_size, (const char *) data); } @@ -670,9 +704,10 @@ guest_recv_local_enter (void *cls, int result, uint64_t max_message_id) { char *pub_str = GNUNET_CRYPTO_eddsa_public_key_to_string (pub_key); - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, - "Guest entered to local place: %s, max_message_id: %" PRIu64 "\n", + GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, + "Guest entered local place: %s, max_message_id: %" PRIu64 "\n", pub_str, max_message_id); + GNUNET_free (pub_str); GNUNET_assert (0 <= result); if (op_guest_enter && !opt_follow) @@ -683,7 +718,7 @@ guest_recv_local_enter (void *cls, int result, /** - * Create entry requset message. + * Create entry request message. */ static struct GNUNET_PSYC_Message * guest_enter_msg_create () @@ -716,12 +751,13 @@ guest_enter (const struct GNUNET_CRYPTO_EddsaPublicKey *pub_key, return; } + struct GNUNET_PSYC_Message *join_msg = guest_enter_msg_create (); gst = GNUNET_SOCIAL_guest_enter (app, ego, pub_key, GNUNET_PSYC_SLAVE_JOIN_NONE, - peer, 0, NULL, guest_enter_msg_create (), - slicer_create (), + peer, 0, NULL, join_msg, slicer_create (), guest_recv_local_enter, guest_recv_entry_decision, NULL); + GNUNET_free (join_msg); plc = GNUNET_SOCIAL_guest_get_place (gst); } @@ -735,10 +771,12 @@ guest_enter_by_name (const char *gns_name) GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Entering to place by name as guest.\n"); + struct GNUNET_PSYC_Message *join_msg = guest_enter_msg_create (); gst = GNUNET_SOCIAL_guest_enter_by_name (app, ego, gns_name, NULL, - guest_enter_msg_create (), slicer, + join_msg, slicer, guest_recv_local_enter, guest_recv_entry_decision, NULL); + GNUNET_free (join_msg); plc = GNUNET_SOCIAL_guest_get_place (gst); } @@ -764,7 +802,7 @@ host_answer_door (void *cls, char * nym_str = GNUNET_CRYPTO_ecdsa_public_key_to_string (nym_key); - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, "Entry request: %s\n", nym_str); GNUNET_free (nym_str); @@ -802,7 +840,7 @@ host_farewell (void *cls, char * nym_str = GNUNET_CRYPTO_ecdsa_public_key_to_string (nym_key); - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, "Farewell: %s\n", nym_str); GNUNET_free (nym_str); } @@ -818,9 +856,10 @@ host_entered (void *cls, int result, { place_pub_key = *pub_key; char *pub_str = GNUNET_CRYPTO_eddsa_public_key_to_string (pub_key); - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, "Host entered: %s, max_message_id: %" PRIu64 "\n", pub_str, max_message_id); + GNUNET_free (pub_str); if (op_host_enter && !opt_follow) { @@ -915,8 +954,10 @@ guest_reconnected (void *cls, int result, const struct GNUNET_CRYPTO_EddsaPublicKey *place_pub_key, uint64_t max_message_id) { + char *place_pub_str = GNUNET_CRYPTO_eddsa_public_key_to_string (place_pub_key); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Guest reconnected.\n"); + "Guest reconnected to place %s.\n", place_pub_str); + GNUNET_free (place_pub_str); if (op_guest_leave) { guest_leave (); @@ -977,6 +1018,7 @@ app_connected (void *cls) guest_enter (&place_pub_key, &peer); } } + printf(".\n"); } @@ -991,8 +1033,7 @@ app_recv_host (void *cls, enum GNUNET_SOCIAL_AppPlaceState place_state) { char *host_pub_str = GNUNET_CRYPTO_eddsa_public_key_to_string (host_pub_key); - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, - "Host: %s\n", host_pub_str); + printf ("Host\t%s\n", host_pub_str); GNUNET_free (host_pub_str); if ((op_host_reconnect || op_host_leave || op_host_announce || op_host_assign @@ -1018,8 +1059,7 @@ app_recv_guest (void *cls, enum GNUNET_SOCIAL_AppPlaceState place_state) { char *guest_pub_str = GNUNET_CRYPTO_eddsa_public_key_to_string (guest_pub_key); - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, - "Guest: %s\n", guest_pub_str); + printf ("Guest\t%s\n", guest_pub_str); GNUNET_free (guest_pub_str); if ((op_guest_reconnect || op_guest_leave || op_guest_talk @@ -1043,9 +1083,9 @@ app_recv_ego (void *cls, const struct GNUNET_CRYPTO_EcdsaPublicKey *pub_key, const char *name) { - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, - "Ego: %s\t%s\n", - GNUNET_CRYPTO_ecdsa_public_key_to_string (pub_key), name); + char *s = GNUNET_CRYPTO_ecdsa_public_key_to_string (pub_key); + printf ("Ego\t%s\t%s\n", s, name); + GNUNET_free (s); if (0 == memcmp (&ego_pub_key, pub_key, sizeof (*pub_key)) || (NULL != opt_ego && 0 == strcmp (opt_ego, name))) @@ -1063,9 +1103,6 @@ app_recv_ego (void *cls, static void app_connect (void *cls) { - GNUNET_CORE_disconnect (core); - core = NULL; - app = GNUNET_SOCIAL_app_connect (cfg, opt_app, app_recv_ego, app_recv_host, @@ -1075,37 +1112,20 @@ app_connect (void *cls) } -/* CORE */ - - -static void -core_connected (void *cls, const struct GNUNET_PeerIdentity *my_identity) -{ - this_peer = *my_identity; - GNUNET_SCHEDULER_add_now (app_connect, NULL); -} - - -/* RUN */ - - /** * Main function run by the scheduler. * * @param cls closure * @param args remaining command-line arguments * @param cfgfile name of the configuration file used (for saving, can be NULL!) - * @param cfg configuration + * @param c configuration */ static void run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c) { -// GNUNET_SIGNAL_handler_install (SIGINT, disconnect); -// GNUNET_SIGNAL_handler_install (SIGTERM, disconnect); -// GNUNET_SIGNAL_handler_install (SIGKILL, disconnect); - cfg = c; + GNUNET_CRYPTO_get_peer_identity (cfg, &this_peer); if (!opt_method) opt_method = "message"; @@ -1123,8 +1143,10 @@ run (void *cls, char *const *args, const char *cfgfile, || op_look_at || op_look_for)) { op_status = 1; + fputs("Caution: This tool does not produce correct binary safe PSYC syntax.\n\n", stderr); } + GNUNET_SCHEDULER_add_shutdown (scheduler_shutdown, NULL); if (!opt_follow) { timeout_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, timeout, NULL); @@ -1142,19 +1164,27 @@ run (void *cls, char *const *args, const char *cfgfile, { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("--place missing or invalid.\n")); + /* FIXME: why does it segfault here? */ exit_fail (); return; } if (opt_ego) { - GNUNET_CRYPTO_ecdsa_public_key_from_string (opt_ego, + if (GNUNET_OK != + GNUNET_CRYPTO_ecdsa_public_key_from_string (opt_ego, strlen (opt_ego), - &ego_pub_key); + &ego_pub_key)) + { + FPRINTF (stderr, + _("Public key `%s' malformed\n"), + opt_ego); + exit_fail (); + return; + } } - core = GNUNET_CORE_connect (cfg, NULL, &core_connected, NULL, NULL, - NULL, GNUNET_NO, NULL, GNUNET_NO, NULL); + GNUNET_SCHEDULER_add_now (app_connect, NULL); } @@ -1169,7 +1199,7 @@ int main (int argc, char *const *argv) { int res; - static const struct GNUNET_GETOPT_CommandLineOption options[] = { + struct GNUNET_GETOPT_CommandLineOption options[] = { /* * gnunet program options in addition to the ones below: * @@ -1182,120 +1212,160 @@ main (int argc, char *const *argv) /* operations */ - { 'A', "host-assign", NULL, - gettext_noop ("assign --name in state to --data"), - GNUNET_NO, &GNUNET_GETOPT_set_one, &op_host_assign }, - - { 'B', "guest-leave", NULL, - gettext_noop ("say good-bye and leave somebody else's place"), - GNUNET_NO, &GNUNET_GETOPT_set_one, &op_guest_leave }, - - { 'C', "host-enter", NULL, - gettext_noop ("create a place"), - GNUNET_NO, &GNUNET_GETOPT_set_one, &op_host_enter }, - - { 'D', "host-leave", NULL, - gettext_noop ("destroy a place we were hosting"), - GNUNET_NO, &GNUNET_GETOPT_set_one, &op_host_leave }, - - { 'E', "guest-enter", NULL, - gettext_noop ("enter somebody else's place"), - GNUNET_NO, &GNUNET_GETOPT_set_one, &op_guest_enter }, - - { 'F', "look-for", NULL, - gettext_noop ("find state matching name prefix"), - GNUNET_NO, &GNUNET_GETOPT_set_one, &op_look_for }, - - { 'H', "replay-latest", NULL, - gettext_noop ("replay history of messages up to the given --limit"), - GNUNET_NO, &GNUNET_GETOPT_set_one, &op_replay_latest }, - - { 'N', "host-reconnect", NULL, - gettext_noop ("reconnect to a previously created place"), - GNUNET_NO, &GNUNET_GETOPT_set_one, &op_host_reconnect }, - - { 'P', "host-announce", NULL, - gettext_noop ("publish something to a place we are hosting"), - GNUNET_NO, &GNUNET_GETOPT_set_one, &op_host_announce }, - - { 'R', "guest-reconnect", NULL, - gettext_noop ("reconnect to a previously entered place"), - GNUNET_NO, &GNUNET_GETOPT_set_one, &op_guest_reconnect }, - - { 'S', "look-at", NULL, - gettext_noop ("search for state matching exact name"), - GNUNET_NO, &GNUNET_GETOPT_set_one, &op_look_at }, - - { 'T', "guest-talk", NULL, - gettext_noop ("submit something to somebody's place"), - GNUNET_NO, &GNUNET_GETOPT_set_one, &op_guest_talk }, - - { 'U', "status", NULL, - gettext_noop ("list of egos and subscribed places"), - GNUNET_NO, &GNUNET_GETOPT_set_one, &op_status }, - - { 'X', "replay", NULL, - gettext_noop ("extract and replay history between message IDs --start and --until"), - GNUNET_NO, &GNUNET_GETOPT_set_one, &op_replay }, + GNUNET_GETOPT_option_flag ('A', + "host-assign", + gettext_noop ("assign --name in state to --data"), + &op_host_assign), + + GNUNET_GETOPT_option_flag ('B', + "guest-leave", + gettext_noop ("say good-bye and leave somebody else's place"), + &op_guest_leave), + + GNUNET_GETOPT_option_flag ('C', + "host-enter", + gettext_noop ("create a place"), + &op_host_enter), + + GNUNET_GETOPT_option_flag ('D', + "host-leave", + gettext_noop ("destroy a place we were hosting"), + &op_host_leave), + + GNUNET_GETOPT_option_flag ('E', + "guest-enter", + gettext_noop ("enter somebody else's place"), + &op_guest_enter), + + + GNUNET_GETOPT_option_flag ('F', + "look-for", + gettext_noop ("find state matching name prefix"), + &op_look_for), + + GNUNET_GETOPT_option_flag ('H', + "replay-latest", + gettext_noop ("replay history of messages up to the given --limit"), + &op_replay_latest), + + GNUNET_GETOPT_option_flag ('N', + "host-reconnect", + gettext_noop ("reconnect to a previously created place"), + &op_host_reconnect), + + GNUNET_GETOPT_option_flag ('P', + "host-announce", + gettext_noop ("publish something to a place we are hosting"), + &op_host_announce), + + GNUNET_GETOPT_option_flag ('R', + "guest-reconnect", + gettext_noop ("reconnect to a previously entered place"), + &op_guest_reconnect), + + GNUNET_GETOPT_option_flag ('S', + "look-at", + gettext_noop ("search for state matching exact name"), + &op_look_at), + + GNUNET_GETOPT_option_flag ('T', + "guest-talk", + gettext_noop ("submit something to somebody's place"), + &op_guest_talk), + + GNUNET_GETOPT_option_flag ('U', + "status", + gettext_noop ("list of egos and subscribed places"), + &op_status), + + GNUNET_GETOPT_option_flag ('X', + "replay", + gettext_noop ("extract and replay history between message IDs --start and --until"), + &op_replay), /* options */ - { 'a', "app", "APPLICATION_ID", - gettext_noop ("application ID to use when connecting"), - GNUNET_YES, &GNUNET_GETOPT_set_string, &opt_app }, - - { 'd', "data", "DATA", - gettext_noop ("message body or state value"), - GNUNET_YES, &GNUNET_GETOPT_set_string, &opt_data }, - - { 'e', "ego", "NAME|PUBKEY", - gettext_noop ("name or public key of ego"), - GNUNET_YES, &GNUNET_GETOPT_set_string, &opt_ego }, - - { 'f', "follow", NULL, - gettext_noop ("wait for incoming messages"), - GNUNET_NO, &GNUNET_GETOPT_set_one, &opt_follow }, - - { 'g', "gns", "GNS_NAME", - gettext_noop ("GNS name"), - GNUNET_YES, &GNUNET_GETOPT_set_string, &opt_gns }, - - { 'i', "peer", "PEER_ID", - gettext_noop ("peer ID for --guest-enter"), - GNUNET_YES, &GNUNET_GETOPT_set_string, &opt_peer }, - - { 'k', "name", "VAR_NAME", - gettext_noop ("name (key) to query from state"), - GNUNET_YES, &GNUNET_GETOPT_set_string, &opt_name }, - - { 'm', "method", "METHOD_NAME", - gettext_noop ("method name"), - GNUNET_YES, &GNUNET_GETOPT_set_string, &opt_method }, - - { 'n', "limit", NULL, - gettext_noop ("number of messages to replay from history"), - GNUNET_YES, &GNUNET_GETOPT_set_ulong, &opt_limit }, - - { 'p', "place", "PUBKEY", - gettext_noop ("key address of place"), - GNUNET_YES, &GNUNET_GETOPT_set_string, &opt_place }, - - { 's', "start", NULL, - gettext_noop ("start message ID for history replay"), - GNUNET_YES, &GNUNET_GETOPT_set_ulong, &opt_start }, - - { 'w', "welcome", NULL, - gettext_noop ("respond to entry requests by admitting all guests"), - GNUNET_NO, &GNUNET_GETOPT_set_one, &opt_welcome }, - - { 'u', "until", NULL, - gettext_noop ("end message ID for history replay"), - GNUNET_YES, &GNUNET_GETOPT_set_ulong, &opt_until }, - - { 'y', "deny", NULL, - gettext_noop ("respond to entry requests by refusing all guests"), - GNUNET_NO, &GNUNET_GETOPT_set_one, &opt_deny }, + GNUNET_GETOPT_option_string ('a', + "app", + "APPLICATION_ID", + gettext_noop ("application ID to use when connecting"), + &opt_app), + + GNUNET_GETOPT_option_string ('d', + "data", + "DATA", + gettext_noop ("message body or state value"), + &opt_data), + + GNUNET_GETOPT_option_string ('e', + "ego", + "NAME|PUBKEY", + gettext_noop ("name or public key of ego"), + &opt_ego), + + GNUNET_GETOPT_option_flag ('f', + "follow", + gettext_noop ("wait for incoming messages"), + &opt_follow), + + GNUNET_GETOPT_option_string ('g', + "gns", + "GNS_NAME", + gettext_noop ("GNS name"), + &opt_gns), + + GNUNET_GETOPT_option_string ('i', + "peer", + "PEER_ID", + gettext_noop ("peer ID for --guest-enter"), + &opt_peer), + + GNUNET_GETOPT_option_string ('k', + "name", + "VAR_NAME", + gettext_noop ("name (key) to query from state"), + &opt_name), + + GNUNET_GETOPT_option_string ('m', + "method", + "METHOD_NAME", + gettext_noop ("method name"), + &opt_method), + + GNUNET_GETOPT_option_ulong ('n', + "limit", + NULL, + gettext_noop ("number of messages to replay from history"), + &opt_limit), + + GNUNET_GETOPT_option_string ('p', + "place", + "PUBKEY", + gettext_noop ("key address of place"), + &opt_place), + + GNUNET_GETOPT_option_ulong ('s', + "start", + NULL, + gettext_noop ("start message ID for history replay"), + &opt_start), + + GNUNET_GETOPT_option_flag ('w', + "welcome", + gettext_noop ("respond to entry requests by admitting all guests"), + &opt_welcome), + + GNUNET_GETOPT_option_ulong ('u', + "until", + NULL, + gettext_noop ("end message ID for history replay"), + &opt_until), + + GNUNET_GETOPT_option_flag ('y', + "deny", + gettext_noop ("respond to entry requests by refusing all guests"), + &opt_deny), GNUNET_GETOPT_OPTION_END }; @@ -1324,8 +1394,8 @@ main (int argc, char *const *argv) "gnunet-social --guest-leave --place \n" "gnunet-social --guest-talk --place --method --data \n" "\n" - "gnunet-social --history-replay --place --start --until [--method ]\n" - "gnunet-social --history-replay-latest --place --limit [--method ]\n" + "gnunet-social --replay --place --start --until [--method ]\n" + "gnunet-social --replay-latest --place --limit [--method ]\n" "\n" "gnunet-social --look-at --place --name \n" "gnunet-social --look-for --place --name \n";