/**
- * Data structure for each client connected to the core service.
+ * Data structure for each client connected to the CORE service.
*/
struct GSC_Client
{
/**
* Array of the types of messages this peer cares
- * about (with "tcnt" entries). Allocated as part
+ * about (with @e tcnt entries). Allocated as part
* of this client struct, do not free!
*/
const uint16_t *types;
/**
* Map of peer identities to active transmission requests of this
- * client to the peer (of type 'struct GSC_ClientActiveRequest').
+ * client to the peer (of type `struct GSC_ClientActiveRequest`).
*/
struct GNUNET_CONTAINER_MultiPeerMap *requests;
/**
* Number of types of incoming messages this client
- * specifically cares about. Size of the "types" array.
+ * specifically cares about. Size of the @e types array.
*/
unsigned int tcnt;
*
* @param type message type
* @param c client to test
- * @return GNUNET_YES if 'c' is interested, GNUNET_NO if not.
+ * @return #GNUNET_YES if @a c is interested, #GNUNET_NO if not.
*/
static int
type_match (uint16_t type, struct GSC_Client *c)
struct GSC_Client *c;
int tm;
- for (c = client_head; c != NULL; c = c->next)
+ for (c = client_head; NULL != c; c = c->next)
{
tm = type_match (type, c);
if (! ( (0 != (c->options & options)) ||
/**
- * Closure for the 'client_tokenizer_callback'.
+ * Closure for the #client_tokenizer_callback().
*/
struct TokenizerContext
{
*
* @param cls unused
* @param client the client issuing the request
- * @param message the "struct SendMessage"
+ * @param message the `struct SendMessage`
*/
static void
handle_client_send (void *cls, struct GNUNET_SERVER_Client *client,
* @param client identification of the client
*/
static void
-handle_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client)
+handle_client_disconnect (void *cls,
+ struct GNUNET_SERVER_Client *client)
{
struct GSC_Client *c;
- if (client == NULL)
+ if (NULL == client)
return;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Client %p has disconnected from core service.\n", client);
static const struct GNUNET_SERVER_MessageHandler handlers[] = {
{&handle_client_init, NULL,
GNUNET_MESSAGE_TYPE_CORE_INIT, 0},
- {&GSC_SESSIONS_handle_client_iterate_peers, NULL,
- GNUNET_MESSAGE_TYPE_CORE_ITERATE_PEERS,
+ {&GSC_KX_handle_client_monitor_peers, NULL,
+ GNUNET_MESSAGE_TYPE_CORE_MONITOR_PEERS,
sizeof (struct GNUNET_MessageHeader)},
{&handle_client_send_request, NULL,
GNUNET_MESSAGE_TYPE_CORE_SEND_REQUEST,
client_mst = GNUNET_SERVER_mst_create (&client_tokenizer_callback, NULL);
notifier =
GNUNET_SERVER_notification_context_create (server, MAX_NOTIFY_QUEUE);
- GNUNET_SERVER_disconnect_notify (server, &handle_client_disconnect, NULL);
+ GNUNET_SERVER_disconnect_notify (server,
+ &handle_client_disconnect, NULL);
GNUNET_SERVER_add_handlers (server, handlers);
}