}
static void
-core_startup (void *cls,
- struct GNUNET_CORE_Handle *core __attribute__ ((unused)),
+core_startup (void *cls, struct GNUNET_CORE_Handle *core
+ __attribute__ ((unused)),
const struct GNUNET_PeerIdentity *my_identity,
const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *publicKey
__attribute__ ((unused)))
*
*/
static void
-core_connect (void *cls,
- const struct GNUNET_PeerIdentity *peer,
+core_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_TRANSPORT_ATS_Information *atsi)
{
struct GNUNET_MESH_Handle *handle = cls;
"Core tells us we are connected to peer %s\n", GNUNET_i2s (peer));
/* Send a hello to this peer */
- GNUNET_CORE_notify_transmit_ready (handle->core,
- GNUNET_NO,
- 42,
- GNUNET_TIME_UNIT_SECONDS,
- peer,
+ GNUNET_CORE_notify_transmit_ready (handle->core, GNUNET_NO, 42,
+ GNUNET_TIME_UNIT_SECONDS, peer,
sizeof (struct GNUNET_MessageHeader) +
handle->hello_message_size,
&send_hello_message, cls);
* This is a hello-message, containing the application-types the other peer can receive
*/
static int
-receive_hello (void *cls,
- const struct GNUNET_PeerIdentity *other,
+receive_hello (void *cls, const struct GNUNET_PeerIdentity *other,
const struct GNUNET_MessageHeader *message,
const struct GNUNET_TRANSPORT_ATS_Information *atsi)
{
* Receive a message from core.
*/
static int
-core_receive (void *cls,
- const struct GNUNET_PeerIdentity *other,
+core_receive (void *cls, const struct GNUNET_PeerIdentity *other,
const struct GNUNET_MessageHeader *message,
const struct GNUNET_TRANSPORT_ATS_Information *atsi)
{
for (handler = handle->handlers; handler->callback != NULL; handler++)
{
- if ((ntohs (rmessage->type) == handler->type)
- && ((handler->expected_size == 0)
- || (handler->expected_size == ntohs (rmessage->size))))
+ if ((ntohs (rmessage->type) == handler->type) &&
+ ((handler->expected_size == 0) ||
+ (handler->expected_size == ntohs (rmessage->size))))
{
break;
}
if (tunnel->tunnel.id.id == tmessage->id.id &&
(0 ==
memcmp (&tmessage->id.initiator, &tunnel->tunnel.id.initiator,
- sizeof (struct GNUNET_PeerIdentity)))
- && (0 ==
- memcmp (&tmessage->id.target, &tunnel->tunnel.id.target,
- sizeof (struct GNUNET_PeerIdentity))))
+ sizeof (struct GNUNET_PeerIdentity))) &&
+ (0 ==
+ memcmp (&tmessage->id.target, &tunnel->tunnel.id.target,
+ sizeof (struct GNUNET_PeerIdentity))))
break;
tunnel = tunnel->next;
}
"Inbound message from peer %s; type %d.\n", GNUNET_i2s (other),
ntohs (rmessage->type));
- return handler->callback (handle->cls, &tunnel->tunnel,
- &tunnel->tunnel.ctx, other, rmessage, atsi);
+ return handler->callback (handle->cls, &tunnel->tunnel, &tunnel->tunnel.ctx,
+ other, rmessage, atsi);
}
struct GNUNET_MESH_Tunnel *
* @param cork is corking allowed for this transmission?
* @param priority how important is the message?
* @param maxdelay how long can the message wait?
- * @param target destination for the message, NULL for multicast to all tunnel targets
+ * @param target destination for the message, NULL for multicast to all tunnel targets
* @param notify_size how many bytes of buffer space does notify want?
* @param notify function to call when buffer space is available;
* will be called with NULL on timeout or if the overall queue
* memory); if NULL is returned, "notify" will NOT be called.
*/
struct GNUNET_MESH_TransmitHandle *
-GNUNET_MESH_notify_transmit_ready (struct
- GNUNET_MESH_Tunnel
- *tunnel,
- int cork,
+GNUNET_MESH_notify_transmit_ready (struct GNUNET_MESH_Tunnel *tunnel, int cork,
uint32_t priority,
- struct
- GNUNET_TIME_Relative
- maxdelay,
+ struct GNUNET_TIME_Relative maxdelay,
const struct GNUNET_PeerIdentity *target
- __attribute__ ((unused)),
- size_t notify_size,
- GNUNET_CONNECTION_TransmitReadyNotify
- notify, void *notify_cls)
+ __attribute__ ((unused)), size_t notify_size,
+ GNUNET_CONNECTION_TransmitReadyNotify notify,
+ void *notify_cls)
{
if (NULL != tunnel->notify_handle)
{
cls->notify = notify;
cls->tunnel = tunnel;
- tunnel->notify_handle = (struct GNUNET_MESH_TransmitHandle *)
+ tunnel->notify_handle =
+ (struct GNUNET_MESH_TransmitHandle *)
GNUNET_CORE_notify_transmit_ready (tunnel->handle->core, cork, priority,
maxdelay, &tunnel->peer,
notify_size +
struct GNUNET_MESH_Handle *
-GNUNET_MESH_connect (const struct
- GNUNET_CONFIGURATION_Handle
- *cfg, void *cls,
- GNUNET_MESH_TunnelEndHandler
- cleaner,
+GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, void *cls,
+ GNUNET_MESH_TunnelEndHandler cleaner,
const struct GNUNET_MESH_MessageHandler *handlers,
const GNUNET_MESH_ApplicationType *stypes)
{
{NULL, 0, 0}
};
- ret->core = GNUNET_CORE_connect (cfg,
- 42,
- ret,
- &core_startup,
- &core_connect,
- &core_disconnect,
- NULL,
- NULL,
- GNUNET_NO, NULL, GNUNET_NO, core_handlers);
+ ret->core =
+ GNUNET_CORE_connect (cfg, 42, ret, &core_startup, &core_connect,
+ &core_disconnect, NULL, NULL, GNUNET_NO, NULL,
+ GNUNET_NO, core_handlers);
return ret;
}