{
struct PeerRecord *pr = impl_state;
+ (void) mq;
GNUNET_assert (NULL != pr->env);
GNUNET_MQ_discard (pr->env);
pr->env = NULL;
core_mq_error_handler (void *cls, enum GNUNET_MQ_Error error)
{
/* struct PeerRecord *pr = cls; */
-
+ (void) cls;
+ (void) error;
GNUNET_break_op (0);
}
uint16_t msize;
const struct GNUNET_MessageHeader *em;
+ (void) cls;
msize = ntohs (ntm->header.size) - sizeof (struct NotifyTrafficMessage);
if (msize < sizeof (struct GNUNET_MessageHeader))
{
* Closure for @e peer_cb.
*/
void *peer_cb_cls;
-
};
* @param error error code
*/
static void
-handle_mq_error (void *cls,
- enum GNUNET_MQ_Error error)
+handle_mq_error (void *cls, enum GNUNET_MQ_Error error)
{
struct GNUNET_CORE_MonitorHandle *mh = cls;
+ (void) error;
reconnect (mh);
}
* @param mon_message monitor message
*/
static void
-handle_receive_info (void *cls,
- const struct MonitorNotifyMessage *mon_message)
+handle_receive_info (void *cls, const struct MonitorNotifyMessage *mon_message)
{
struct GNUNET_CORE_MonitorHandle *mh = cls;
static void
reconnect (struct GNUNET_CORE_MonitorHandle *mh)
{
- struct GNUNET_MQ_MessageHandler handlers[] = {
- GNUNET_MQ_hd_fixed_size (receive_info,
- GNUNET_MESSAGE_TYPE_CORE_MONITOR_NOTIFY,
- struct MonitorNotifyMessage,
- mh),
- GNUNET_MQ_handler_end ()
- };
+ struct GNUNET_MQ_MessageHandler handlers[] =
+ {GNUNET_MQ_hd_fixed_size (receive_info,
+ GNUNET_MESSAGE_TYPE_CORE_MONITOR_NOTIFY,
+ struct MonitorNotifyMessage,
+ mh),
+ GNUNET_MQ_handler_end ()};
struct GNUNET_MQ_Envelope *env;
struct GNUNET_MessageHeader *msg;
if (NULL != mh->mq)
GNUNET_MQ_destroy (mh->mq);
/* FIXME: use backoff? */
- mh->mq = GNUNET_CLIENT_connect (mh->cfg,
- "core",
- handlers,
- &handle_mq_error,
- mh);
+ mh->mq =
+ GNUNET_CLIENT_connect (mh->cfg, "core", handlers, &handle_mq_error, mh);
if (NULL == mh->mq)
return;
/* notify callback about reconnect */
NULL,
GNUNET_CORE_KX_CORE_DISCONNECT,
GNUNET_TIME_UNIT_FOREVER_ABS);
- env = GNUNET_MQ_msg (msg,
- GNUNET_MESSAGE_TYPE_CORE_MONITOR_PEERS);
- GNUNET_MQ_send (mh->mq,
- env);
+ env = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_CORE_MONITOR_PEERS);
+ GNUNET_MQ_send (mh->mq, env);
}
static void
shutdown_task (void *cls)
{
+ (void) cls;
if (NULL != mh)
{
GNUNET_CORE_monitor_stop (mh);
enum GNUNET_CORE_KxState state,
struct GNUNET_TIME_Absolute timeout)
{
- struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get();
+ struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get ();
const char *now_str;
const char *state_str;
- if ( ( (NULL == peer) ||
- (GNUNET_CORE_KX_ITERATION_FINISHED == state) ) &&
- (GNUNET_NO == monitor_connections) )
+ (void) cls;
+ if (((NULL == peer) || (GNUNET_CORE_KX_ITERATION_FINISHED == state)) &&
+ (GNUNET_NO == monitor_connections))
{
GNUNET_SCHEDULER_shutdown ();
return;
{
case GNUNET_CORE_KX_STATE_DOWN:
/* should never happen, as we immediately send the key */
- state_str = _("fresh connection");
+ state_str = _ ("fresh connection");
break;
case GNUNET_CORE_KX_STATE_KEY_SENT:
- state_str = _("key sent");
+ state_str = _ ("key sent");
break;
case GNUNET_CORE_KX_STATE_KEY_RECEIVED:
- state_str = _("key received");
+ state_str = _ ("key received");
break;
case GNUNET_CORE_KX_STATE_UP:
- state_str = _("connection established");
+ state_str = _ ("connection established");
break;
case GNUNET_CORE_KX_STATE_REKEY_SENT:
- state_str = _("rekeying");
+ state_str = _ ("rekeying");
break;
case GNUNET_CORE_KX_PEER_DISCONNECT:
- state_str = _("disconnected");
+ state_str = _ ("disconnected");
break;
case GNUNET_CORE_KX_ITERATION_FINISHED:
return;
case GNUNET_CORE_KX_CORE_DISCONNECT:
FPRINTF (stderr,
"%s\n",
- _("Connection to CORE service lost (reconnecting)"));
+ _ ("Connection to CORE service lost (reconnecting)"));
return;
default:
- state_str = _("unknown state");
+ state_str = _ ("unknown state");
break;
}
now_str = GNUNET_STRINGS_absolute_time_to_string (now);
FPRINTF (stdout,
- _("%24s: %-30s %4s (timeout in %6s)\n"),
+ _ ("%24s: %-30s %4s (timeout in %6s)\n"),
now_str,
state_str,
GNUNET_i2s (peer),
- GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_remaining (timeout),
- GNUNET_YES));
+ GNUNET_STRINGS_relative_time_to_string (
+ GNUNET_TIME_absolute_get_remaining (timeout),
+ GNUNET_YES));
}
* @param cfg configuration
*/
static void
-run (void *cls, char *const *args, const char *cfgfile,
+run (void *cls,
+ char *const *args,
+ const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *cfg)
{
+ (void) cls;
+ (void) cfgfile;
if (NULL != args[0])
{
- FPRINTF (stderr,
- _("Invalid command line argument `%s'\n"),
- args[0]);
+ FPRINTF (stderr, _ ("Invalid command line argument `%s'\n"), args[0]);
return;
}
- mh = GNUNET_CORE_monitor_start (cfg,
- &monitor_cb,
- NULL);
+ mh = GNUNET_CORE_monitor_start (cfg, &monitor_cb, NULL);
if (NULL == mh)
{
- FPRINTF (stderr,
- "%s",
- _("Failed to connect to CORE service!\n"));
+ FPRINTF (stderr, "%s", _ ("Failed to connect to CORE service!\n"));
return;
}
GNUNET_SCHEDULER_add_shutdown (&shutdown_task, NULL);
* @return 0 ok, 1 on error
*/
int
-main (int argc,
- char *const *argv)
+main (int argc, char *const *argv)
{
int res;
- struct GNUNET_GETOPT_CommandLineOption options[] = {
- GNUNET_GETOPT_option_flag ('m',
- "monitor",
- gettext_noop ("provide information about all current connections (continuously)"),
- &monitor_connections),
- GNUNET_GETOPT_OPTION_END
- };
+ struct GNUNET_GETOPT_CommandLineOption options[] =
+ {GNUNET_GETOPT_option_flag (
+ 'm',
+ "monitor",
+ gettext_noop (
+ "provide information about all current connections (continuously)"),
+ &monitor_connections),
+ GNUNET_GETOPT_OPTION_END};
if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
return 2;
- res = GNUNET_PROGRAM_run (argc, argv, "gnunet-core",
- gettext_noop
- ("Print information about connected peers."),
- options, &run, NULL);
+ res = GNUNET_PROGRAM_run (argc,
+ argv,
+ "gnunet-core",
+ gettext_noop (
+ "Print information about connected peers."),
+ options,
+ &run,
+ NULL);
GNUNET_free ((void *) argv);
if (GNUNET_OK == res)
struct GNUNET_NSE_ClientMessage em;
struct GNUNET_MQ_Envelope *env;
+ (void) message;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received START message from client\n");
mq = GNUNET_SERVICE_client_get_mq (client);
GNUNET_notification_context_add (nc, mq);
struct NSEPeerEntry *peer_entry = value;
struct GNUNET_TIME_Relative delay;
+ (void) cls;
+ (void) key;
if (NULL != peer_entry->transmit_task)
{
GNUNET_SCHEDULER_cancel (peer_entry->transmit_task);
update_flood_message (void *cls)
{
struct GNUNET_TIME_Relative offset;
- unsigned int i;
+ (void) cls;
flood_task = NULL;
offset = GNUNET_TIME_absolute_get_remaining (next_timestamp);
if (0 != offset.rel_value_us)
setup_flood_message (estimate_index, current_timestamp);
next_message.matching_bits = htonl (0); /* reset for 'next' round */
hop_count_max = 0;
- for (i = 0; i < HISTORY_SIZE; i++)
+ for (unsigned int i = 0; i < HISTORY_SIZE; i++)
hop_count_max =
GNUNET_MAX (ntohl (size_estimate_messages[i].hop_count), hop_count_max);
GNUNET_CONTAINER_multipeermap_iterate (peers, &schedule_current_round, NULL);
struct GNUNET_HashCode result;
unsigned int i;
+ (void) cls;
proof_task = NULL;
GNUNET_memcpy (&buf[sizeof (uint64_t)],
&my_identity,
struct NSEPeerEntry *peer_entry = value;
struct GNUNET_TIME_Relative delay;
+ (void) key;
if (peer_entry == exclude)
return GNUNET_OK; /* trigger of the update */
if (GNUNET_NO == peer_entry->previous_round)
{
struct NSEPeerEntry *peer_entry;
+ (void) cls;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Peer `%s' connected to us\n",
GNUNET_i2s (peer));
{
struct NSEPeerEntry *pos = internal_cls;
+ (void) cls;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Peer `%s' disconnected from us\n",
GNUNET_i2s (peer));
static void
flush_comp_cb (void *cls, size_t size)
{
+ (void) cls;
+ (void) size;
GNUNET_TESTBED_LOGGER_disconnect (lh);
lh = NULL;
}
static void
shutdown_task (void *cls)
{
+ (void) cls;
if (NULL != flood_task)
{
GNUNET_SCHEDULER_cancel (flood_task);
struct GNUNET_TIME_Absolute now;
struct GNUNET_TIME_Absolute prev_time;
+ (void) cls;
if (NULL == identity)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Connection to core FAILED!\n");
static void
status_cb (void *cls, int status)
{
+ (void) cls;
logger_test = NULL;
if (GNUNET_YES != status)
{
char *proof;
struct GNUNET_CRYPTO_EddsaPrivateKey *pk;
+ (void) cls;
+ (void) service;
cfg = c;
if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_time (cfg,
"NSE",
struct GNUNET_SERVICE_Client *c,
struct GNUNET_MQ_Handle *mq)
{
+ (void) cls;
+ (void) mq;
return c;
}
struct GNUNET_SERVICE_Client *c,
void *internal_cls)
{
+ (void) cls;
GNUNET_assert (c == internal_cls);
}