* @param client reservation request ('struct GSC_ClientActiveRequest')
* @param message the actual message
*/
-static void
+static int
client_tokenizer_callback (void *cls, void *client,
const struct GNUNET_MessageHeader *message)
{
GNUNET_CORE_OPTION_SEND_HDR_OUTBOUND);
GSC_SESSIONS_transmit (car, message, tc->cork);
}
+ return GNUNET_OK;
}
* @param client who sent us the message (struct GSC_KeyExchangeInfo)
* @param m the message
*/
-static void
+static int
deliver_message (void *cls, void *client, const struct GNUNET_MessageHeader *m)
{
struct DeliverMessageContext *dmc = client;
case GNUNET_MESSAGE_TYPE_CORE_BINARY_TYPE_MAP:
case GNUNET_MESSAGE_TYPE_CORE_COMPRESSED_TYPE_MAP:
GSC_SESSIONS_set_typemap (dmc->peer, m);
- return;
+ return GNUNET_OK;
default:
GSC_CLIENTS_deliver_message (dmc->peer, dmc->atsi, dmc->atsi_count, m,
ntohs (m->size),
sizeof (struct GNUNET_MessageHeader),
GNUNET_CORE_OPTION_SEND_HDR_INBOUND);
}
+ return GNUNET_OK;
}
* @param client identification of the client
* @param message the actual message, a DNS request we should handle
*/
-static void
+static int
process_helper_messages (void *cls GNUNET_UNUSED, void *client,
const struct GNUNET_MessageHeader *message)
{
{
/* non-IP packet received on TUN!? */
GNUNET_break (0);
- return;
+ return GNUNET_OK;
}
msize -= sizeof (struct GNUNET_MessageHeader);
tun = (const struct GNUNET_TUN_Layer2PacketHeader *) &message[1];
/* non-IP/UDP packet received on TUN (or with options) */
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
_("Received malformed IPv4-UDP packet on TUN interface.\n"));
- return;
+ return GNUNET_OK;
}
udp = (const struct GNUNET_TUN_UdpHeader*) &ip4[1];
msize -= sizeof (struct GNUNET_TUN_IPv4Header);
/* non-IP/UDP packet received on TUN (or with extensions) */
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
_("Received malformed IPv6-UDP packet on TUN interface.\n"));
- return;
+ return GNUNET_OK;
}
udp = (const struct GNUNET_TUN_UdpHeader*) &ip6[1];
msize -= sizeof (struct GNUNET_TUN_IPv6Header);
_("Got non-IP packet with %u bytes and protocol %u from TUN\n"),
(unsigned int) msize,
ntohs (tun->proto));
- return;
+ return GNUNET_OK;
}
if (msize <= sizeof (struct GNUNET_TUN_UdpHeader) + sizeof (struct GNUNET_TUN_DnsHeader))
{
GNUNET_STATISTICS_update (stats,
gettext_noop ("# Non-DNS UDP packet received via TUN interface"),
1, GNUNET_NO);
- return;
+ return GNUNET_OK;
}
msize -= sizeof (struct GNUNET_TUN_UdpHeader);
dns = (const struct GNUNET_TUN_DnsHeader*) &udp[1];
1, GNUNET_NO);
/* start request processing state machine */
next_phase (rr);
+ return GNUNET_OK;
}
* @param client the TokenizedMessageContext which contains message information
* @param message the actual message
*/
-void
+int
tokenized_message_handler (void *cls, void *client,
const struct GNUNET_MessageHeader *message)
{
send_to_plugin (ctx->peer, message, ntohs (message->size),
&ctx->distant->identity, ctx->distant->cost);
}
+ return GNUNET_OK;
}
#if DELAY_FORWARDS
* @param client unsued
* @param message message received from helper
*/
-static void
+static int
message_token (void *cls GNUNET_UNUSED, void *client GNUNET_UNUSED,
const struct GNUNET_MessageHeader *message)
{
if (ntohs (message->type) != GNUNET_MESSAGE_TYPE_VPN_HELPER)
{
GNUNET_break (0);
- return;
+ return GNUNET_OK;
}
size = ntohs (message->size);
if (size < sizeof (struct GNUNET_TUN_Layer2PacketHeader) + sizeof (struct GNUNET_MessageHeader))
{
GNUNET_break (0);
- return;
+ return GNUNET_OK;
}
GNUNET_STATISTICS_update (stats,
gettext_noop ("# Bytes received from TUN"),
{
/* Kernel to blame? */
GNUNET_break (0);
- return;
+ return GNUNET_OK;
}
pkt4 = (const struct GNUNET_TUN_IPv4Header *) &pkt_tun[1];
if (size != ntohs (pkt4->total_length))
{
/* Kernel to blame? */
GNUNET_break (0);
- return;
+ return GNUNET_OK;
}
if (pkt4->header_length * 4 != sizeof (struct GNUNET_TUN_IPv4Header))
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
_("IPv4 packet options received. Ignored.\n"));
- return;
+ return GNUNET_OK;
}
size -= sizeof (struct GNUNET_TUN_IPv4Header);
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
_("IPv4 packet with unsupported next header %u received. Ignored.\n"),
(int) pkt4->protocol);
- return;
+ return GNUNET_OK;
}
}
break;
{
/* Kernel to blame? */
GNUNET_break (0);
- return;
+ return GNUNET_OK;
}
pkt6 = (struct GNUNET_TUN_IPv6Header *) &pkt_tun[1];
if (size != ntohs (pkt6->payload_length) + sizeof (struct GNUNET_TUN_IPv6Header))
{
/* Kernel to blame? */
GNUNET_break (0);
- return;
+ return GNUNET_OK;
}
size -= sizeof (struct GNUNET_TUN_IPv6Header);
switch (pkt6->next_header)
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
_("IPv6 packet with unsupported next header %d received. Ignored.\n"),
pkt6->next_header);
- return;
+ return GNUNET_OK;
}
}
break;
ntohs (pkt_tun->proto));
break;
}
+ return GNUNET_OK;
}
* @param client always NULL
* @param msg message from the helper process
*/
-static void
+static int
process_helper_msgs (void *cls,
void *client,
const struct GNUNET_MessageHeader *msg)
else
(void) expand_tree (ds->pos,
filename, GNUNET_NO);
- return;
+ return GNUNET_OK;
case GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_PROGRESS_DIRECTORY:
if (filename[left-1] != '\0')
{
break;
}
ds->pos = ds->pos->parent;
- return;
+ return GNUNET_OK;
}
ds->progress_callback (ds->progress_callback_cls,
filename, GNUNET_YES,
filename, GNUNET_YES);
if (NULL == ds->toplevel)
ds->toplevel = ds->pos;
- return;
+ return GNUNET_OK;
case GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_ERROR:
break;
case GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_SKIP_FILE:
ds->progress_callback (ds->progress_callback_cls,
filename, GNUNET_SYSERR,
GNUNET_FS_DIRSCANNER_FILE_IGNORED);
- return;
+ return GNUNET_OK;
case GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_COUNTING_DONE:
if (0 != left)
{
ds->pos = ds->toplevel;
if (GNUNET_YES == ds->pos->is_directory)
ds->pos = advance (ds->pos);
- return;
+ return GNUNET_OK;
case GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_META_DATA:
{
size_t nlen;
}
ds->pos->ksk_uri = GNUNET_FS_uri_ksk_create_from_meta_data (ds->pos->meta);
ds->pos = advance (ds->pos);
- return;
+ return GNUNET_OK;
}
case GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_FINISHED:
if (NULL != ds->pos)
}
ds->stop_task = GNUNET_SCHEDULER_add_now (&finish_scan,
ds);
- return;
+ return GNUNET_OK;
default:
GNUNET_break (0);
break;
ds->progress_callback (ds->progress_callback_cls,
NULL, GNUNET_SYSERR,
GNUNET_FS_DIRSCANNER_INTERNAL_ERROR);
+ return GNUNET_OK;
}
* @param client unused
* @param msg message to inject
*/
-static void
+static int
inject_message (void *cls, void *client, const struct GNUNET_MessageHeader *msg)
{
struct GNUNET_SERVER_Handle *server = cls;
GNUNET_break (GNUNET_OK == GNUNET_SERVER_inject (server, NULL, msg));
+ return GNUNET_OK;
}
* @param client unused
* @param hdr inbound message from the FIFO
*/
-static void
+static int
stdin_send (void *cls, void *client, const struct GNUNET_MessageHeader *hdr)
{
struct SendBuffer *write_pout = cls;
&in[1],
payload_size);
write_pout->size += payload_size;
+ return GNUNET_OK;
}
* @param client unused
* @param hdr the message we received to copy to the buffer
*/
-static void
+static int
file_in_send (void *cls, void *client, const struct GNUNET_MessageHeader *hdr)
{
struct SendBuffer *write_std = cls;
}
memcpy (write_std->buf + write_std->size, hdr, sendsize);
write_std->size += sendsize;
+ return GNUNET_OK;
}
if (NULL == message)
goto end;
type = ntohs (message->type);
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received Message with type %u from peer `%s'\n", type, GNUNET_i2s (peer));
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Received Message with type %u from peer `%s'\n", type, GNUNET_i2s (peer));
GNUNET_STATISTICS_update (GST_stats,
gettext_noop
return res;
}
-static void
+static int
client_receive_mst_cb (void *cls, void *client,
const struct GNUNET_MessageHeader *message)
{
if (GNUNET_YES != exist_session(p, s))
{
GNUNET_break (0);
- return;
+ return GNUNET_OK;
}
delay = http_plugin_receive (s, &s->target, message, s, s->addr, s->addrlen);
GNUNET_i2s (&s->target), GNUNET_a2s (s->addr, s->addrlen),
delay);
}
+ return GNUNET_OK;
}
static void
* @param client clien
* @param message the message to be forwarded to transport service
*/
-static void
+static int
server_receive_mst_cb (void *cls, void *client,
const struct GNUNET_MessageHeader *message)
{
GNUNET_assert (NULL != p);
if (GNUNET_NO == exist_session(p, s))
- return;
+ return GNUNET_OK;
struct Plugin *plugin = s->plugin;
struct GNUNET_TIME_Relative delay;
http_plugin_address_to_string (NULL, s->addr, s->addrlen),
delay);
}
+ return GNUNET_OK;
}
/**
* @param client the 'struct SourceInformation'
* @param hdr the actual message
*/
-static void
+static int
process_inbound_tokenized_messages (void *cls, void *client,
const struct GNUNET_MessageHeader *hdr)
{
GNUNET_assert (si->session != NULL);
if (GNUNET_YES == si->session->in_destroy)
- return;
+ return GNUNET_OK;
/* setup ATS */
ats[0].type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE);
ats[0].value = htonl (1);
si->arg,
si->args);
si->session->flow_delay_for_other_peer = delay;
+ return GNUNET_OK;
}
-void
+int
broadcast_ipv6_mst_cb (void *cls, void *client,
const struct GNUNET_MessageHeader *message)
{
if (GNUNET_MESSAGE_TYPE_TRANSPORT_BROADCAST_BEACON !=
ntohs (msg->header.type))
- return;
+ return GNUNET_OK;
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Received beacon with %u bytes from peer `%s' via address `%s'\n",
ntohs (msg->header.size), GNUNET_i2s (&msg->sender),
("# IPv6 multicast HELLO beacons received via udp"),
1, GNUNET_NO);
GNUNET_free (mc);
+ return GNUNET_OK;
}
-void
+int
broadcast_ipv4_mst_cb (void *cls, void *client,
const struct GNUNET_MessageHeader *message)
{
if (GNUNET_MESSAGE_TYPE_TRANSPORT_BROADCAST_BEACON !=
ntohs (msg->header.type))
- return;
+ return GNUNET_OK;
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Received beacon with %u bytes from peer `%s' via address `%s'\n",
ntohs (msg->header.size), GNUNET_i2s (&msg->sender),
("# IPv4 broadcast HELLO beacons received via udp"),
1, GNUNET_NO);
GNUNET_free (mc);
+ return GNUNET_OK;
}
void
* @param client pointer to the session this message belongs to
* @param hdr start of the message
*/
-static void
+static int
process_data (void *cls, void *client, const struct GNUNET_MessageHeader *hdr)
{
struct Plugin *plugin = cls;
(mas->endpoint == NULL) ? 0 : sizeof (struct GNUNET_TRANSPORT_WLAN_MacAddress));
break;
}
+ return GNUNET_OK;
}
#undef NUM_ATS
* @param client client that send the data (not used)
* @param hdr header of the GNUNET_MessageHeader
*/
-static void
+static int
handle_helper_message (void *cls, void *client,
const struct GNUNET_MessageHeader *hdr)
{
ntohs (hdr->type), ntohs (hdr->size));
break;
}
+ return GNUNET_OK;
}
* @param client NULL
* @param message message we got from the client (VPN tunnel interface)
*/
-static void
+static int
message_token (void *cls GNUNET_UNUSED, void *client GNUNET_UNUSED,
const struct GNUNET_MessageHeader *message)
{
(mlen < sizeof (struct GNUNET_MessageHeader) + sizeof (struct GNUNET_TUN_Layer2PacketHeader)) )
{
GNUNET_break (0);
- return;
+ return GNUNET_OK;
}
tun = (const struct GNUNET_TUN_Layer2PacketHeader *) &message[1];
mlen -= (sizeof (struct GNUNET_MessageHeader) + sizeof (struct GNUNET_TUN_Layer2PacketHeader));
{
/* blame kernel */
GNUNET_break (0);
- return;
+ return GNUNET_OK;
}
pkt6 = (const struct GNUNET_TUN_IPv6Header *) &tun[1];
get_destination_key_from_ip (AF_INET6,
&pkt6->destination_address,
buf,
sizeof (buf)));
- return;
+ return GNUNET_OK;
}
route_packet (de,
AF_INET6,
{
/* blame kernel */
GNUNET_break (0);
- return;
+ return GNUNET_OK;
}
pkt4 = (struct GNUNET_TUN_IPv4Header *) &tun[1];
get_destination_key_from_ip (AF_INET,
&pkt4->destination_address,
buf,
sizeof (buf)));
- return;
+ return GNUNET_OK;
}
if (pkt4->header_length * 4 != sizeof (struct GNUNET_TUN_IPv4Header))
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
_("Received IPv4 packet with options (dropping it)\n"));
- return;
+ return GNUNET_OK;
}
route_packet (de,
AF_INET,
(unsigned int) ntohs (tun->proto));
break;
}
+ return GNUNET_OK;
}