}
-
/**
* Client asked to obtain information about a specific or all peers
* Process the request.
if (0 == GNUNET_SERVER_notification_context_get_size (plugin_nc))
{
+ fprintf (stderr, "UNSUB!\n");
GST_plugins_monitor_subscribe (NULL, NULL);
return;
}
{
GNUNET_SERVER_client_mark_monitor (client);
GNUNET_SERVER_disable_receive_done_warning (client);
- if (0 == GNUNET_SERVER_notification_context_get_size (plugin_nc))
- GST_plugins_monitor_subscribe (&plugin_session_info_cb, NULL);
GNUNET_SERVER_notification_context_add (plugin_nc, client);
+ if (1 == GNUNET_SERVER_notification_context_get_size (plugin_nc))
+ GST_plugins_monitor_subscribe (&plugin_session_info_cb, NULL);
}
* @param may_drop #GNUNET_YES if the message can be dropped / is payload
*/
void
-GST_clients_broadcast (const struct GNUNET_MessageHeader *msg, int may_drop)
+GST_clients_broadcast (const struct GNUNET_MessageHeader *msg,
+ int may_drop)
{
struct TransportClient *tc;
*/
void
GST_clients_unicast (struct GNUNET_SERVER_Client *client,
- const struct GNUNET_MessageHeader *msg, int may_drop)
+ const struct GNUNET_MessageHeader *msg,
+ int may_drop)
{
struct TransportClient *tc;
enum GNUNET_TRANSPORT_PeerState state,
struct GNUNET_TIME_Absolute state_timeout)
{
+ static struct GNUNET_PeerIdentity all_zeros;
struct PeerIterateResponseMessage *msg;
struct MonitoringClient *mc;
- static struct GNUNET_PeerIdentity all_zeros;
+
msg = compose_address_iterate_response_message (peer, address);
msg->state = htonl (state);
msg->state_timeout = GNUNET_TIME_absolute_hton (state_timeout);
/*
This file is part of GNUnet.
(C) 2010-2014 Christian Grothoff (and other contributing authors)
-
+
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 3, or (at your
static struct TransportPlugin *plugins_tail;
-
/**
* Load and initialize all plugins. The respective functions will be
* invoked by the plugins when the respective events happen. The
const char *state;
struct PluginMonitorAddress *addr;
+ fprintf (stderr, "E!\n");
if ( (NULL == info) &&
(NULL == session) )
return; /* in sync with transport service */
+ if (NULL == info)
+ return; /* shutdown */
if ( (NULL != cpid) &&
(0 != memcmp (&info->address->peer,
cpid,
return;
memset (&info, 0, sizeof (info));
info.state = state;
- info.is_inbound = GNUNET_SYSERR; /* hard to say */
+ info.is_inbound = (0 != (GNUNET_HELLO_ADDRESS_INFO_INBOUND & session->address->local_info))
+ ? GNUNET_YES
+ : GNUNET_NO;
info.num_msg_pending = session->msgs_in_queue;
info.num_bytes_pending = session->bytes_in_queue;
if (GNUNET_SCHEDULER_NO_TASK != session->receive_delay_task)
* address and that the next call to this function is allowed
* to override the address again.
*
- * @param cls closure ('struct Plugin*')
+ * @param cls closure (`struct Plugin *`)
* @param addr binary address
- * @param addrlen length of the address
+ * @param addrlen length of @a addr
* @return string representing the same address
*/
static const char *
* @param cls the `struct Plugin`
* @param ucred credentials, if available, otherwise NULL
* @param addr address
- * @param addrlen length of address
+ * @param addrlen length of @a addr
* @return #GNUNET_YES to allow, #GNUNET_NO to deny, #GNUNET_SYSERR
* for unknown address family (will be denied).
*/
t4->options = htonl (TCP_OPTIONS_NONE);
t4->t4_port = s4->sin_port;
t4->ipv4_addr = s4->sin_addr.s_addr;
- session->address = GNUNET_HELLO_address_allocate (
- &tcp_nat_probe->clientIdentity, PLUGIN_NAME, &t4,
- sizeof(struct IPv4TcpAddress),
- GNUNET_HELLO_ADDRESS_INFO_NONE);
+ session->address = GNUNET_HELLO_address_allocate (&tcp_nat_probe->clientIdentity,
+ PLUGIN_NAME,
+ &t4,
+ sizeof(struct IPv4TcpAddress),
+ GNUNET_HELLO_ADDRESS_INFO_NONE);
break;
case AF_INET6:
s6 = vaddr;
t6->options = htonl (TCP_OPTIONS_NONE);
t6->t6_port = s6->sin6_port;
memcpy (&t6->ipv6_addr, &s6->sin6_addr, sizeof(struct in6_addr));
- session->address = GNUNET_HELLO_address_allocate (
- &tcp_nat_probe->clientIdentity,
- PLUGIN_NAME, &t6, sizeof(struct IPv6TcpAddress),
- GNUNET_HELLO_ADDRESS_INFO_NONE);
+ session->address = GNUNET_HELLO_address_allocate (&tcp_nat_probe->clientIdentity,
+ PLUGIN_NAME,
+ &t6,
+ sizeof(struct IPv6TcpAddress),
+ GNUNET_HELLO_ADDRESS_INFO_NONE);
break;
default:
GNUNET_break_op(0);
t4.t4_port = s4->sin_port;
t4.ipv4_addr = s4->sin_addr.s_addr;
address = GNUNET_HELLO_address_allocate (&wm->clientIdentity,
- PLUGIN_NAME, &t4, sizeof(t4),
- GNUNET_HELLO_ADDRESS_INFO_INBOUND);
+ PLUGIN_NAME,
+ &t4,
+ sizeof(t4),
+ GNUNET_HELLO_ADDRESS_INFO_INBOUND);
}
else if (alen == sizeof(struct sockaddr_in6))
{
/*
This file is part of GNUnet.
- (C) 2009, 2010 Christian Grothoff (and other contributing authors)
+ (C) 2009-2014 Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
struct GNUNET_HELLO_Address addr;
struct SearchContext rv;
+ fprintf (stderr, "R\n");
if (NULL == msg)
{
reconnect_plugin_ctx (pm);
NULL,
NULL,
NULL);
+ GNUNET_CLIENT_receive (pm->client,
+ &response_processor,
+ pm,
+ GNUNET_TIME_UNIT_FOREVER_REL);
return;
}
ps));
GNUNET_free (ps);
}
+ GNUNET_CLIENT_receive (pm->client,
+ &response_processor,
+ pm,
+ GNUNET_TIME_UNIT_FOREVER_REL);
}
/**
* Are we currently busy doing receive-processing?
- * GNUNET_YES if so, GNUNET_NO if not.
+ * #GNUNET_YES if so, #GNUNET_NO if not.
*/
int in_receive;