- struct GNUNET_SERVER_TransmitContext *tc = cls;
- char *addr_buf;
-
- /* FIXME: move to a binary format!!! */
- GNUNET_asprintf (&addr_buf,
- "%s: %s",
- GNUNET_i2s(neighbour),
- GST_plugins_a2s ("FIXME", NULL, 0));
- transmit_address_to_client (tc, addr_buf);
- GNUNET_free (addr_buf);
+ static const struct GNUNET_SERVER_MessageHandler handlers[] = {
+ {&clients_handle_start, NULL,
+ GNUNET_MESSAGE_TYPE_TRANSPORT_START, sizeof (struct StartMessage)},
+ {&clients_handle_hello, NULL,
+ GNUNET_MESSAGE_TYPE_HELLO, 0},
+ {&clients_handle_send, NULL,
+ GNUNET_MESSAGE_TYPE_TRANSPORT_SEND, 0},
+ {&clients_handle_request_connect, NULL,
+ GNUNET_MESSAGE_TYPE_TRANSPORT_REQUEST_CONNECT,
+ sizeof (struct TransportRequestConnectMessage)},
+ {&clients_handle_address_to_string, NULL,
+ GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_TO_STRING, 0},
+ {&clients_handle_address_iterate, NULL,
+ GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_ITERATE,
+ sizeof (struct AddressIterateMessage)},
+ {&GST_blacklist_handle_init, NULL,
+ GNUNET_MESSAGE_TYPE_TRANSPORT_BLACKLIST_INIT,
+ sizeof (struct GNUNET_MessageHeader)},
+ {&GST_blacklist_handle_reply, NULL,
+ GNUNET_MESSAGE_TYPE_TRANSPORT_BLACKLIST_REPLY,
+ sizeof (struct BlacklistMessage)},
+ {NULL, NULL, 0, 0}
+ };
+ GNUNET_SERVER_add_handlers (server, handlers);
+ GNUNET_SERVER_disconnect_notify (server, &client_disconnect_notification,
+ NULL);