+//LRN extension for return values for prototypes
+-nddd
//GNU (default) style:
//
//-nbad -bap -nbc -bbo -bl -bli2 -bls -ncdb -nce -cp1 -cs -di2
#!/bin/sh
find src/ -name "*.c" -exec indent {} \;
-find src/ -name "*.c" -exec indent {} \;
+find src/ -name "*.h" -exec indent {} \;
if test -x "`which 'dos2unix'`"
then
find src/ -name "*.c" -exec dos2unix {} \;
- find src/ -name "*.c" -exec dos2unix {} \;
+ find src/ -name "*.h" -exec dos2unix {} \;
fi
* @param cls closure, unused
* @param tc context, unused
*/
-static void cps_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+cps_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
{
GNUNET_ARM_stop_service (h, "arm",
(0 ==
- timeout.
- rel_value) ? STOP_TIMEOUT_ARM : timeout,
- &confirm_cb, "arm");
+ timeout.rel_value) ? STOP_TIMEOUT_ARM :
+ timeout, &confirm_cb, "arm");
return;
}
break;
{
GNUNET_CLIENT_service_test (test, cfg,
(0 ==
- timeout.
- rel_value) ? TEST_TIMEOUT : timeout,
- &confirm_task, test);
+ timeout.rel_value) ? TEST_TIMEOUT :
+ timeout, &confirm_task, test);
return;
}
break;
{
lowestRestartDelay =
GNUNET_TIME_relative_min (lowestRestartDelay,
- GNUNET_TIME_absolute_get_remaining (pos->
- restartAt));
+ GNUNET_TIME_absolute_get_remaining
+ (pos->restartAt));
}
}
pos = pos->next;
* @param lsocks -1 terminated list of listen sockets to pass (systemd style), or NULL
* @return GNUNET_OK on success
*/
-int start_service (struct GNUNET_SERVER_Client *client, const char *servicename,
- const int *lsocks);
+int
+start_service (struct GNUNET_SERVER_Client *client, const char *servicename,
+ const int *lsocks);
/**
* Stop listening for connections to a service.
* @return GNUNET_OK if we stopped to listen, GNUNET_NO if we were
* not listening
*/
-int stop_listening (const char *serviceName);
+int
+stop_listening (const char *serviceName);
-void prepareServices (const struct GNUNET_CONFIGURATION_Handle
- *configurationHandle);
+void
+prepareServices (const struct GNUNET_CONFIGURATION_Handle *configurationHandle);
#endif
* @param cls callback data, struct ForwardedConnection for the communication between client and service
* @param tc context
*/
-static void receiveFromClient (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+receiveFromClient (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
* @param cls callback data, struct ForwardedConnection for the communication between client and service
* @param tc scheduler context
*/
-static void receiveFromService (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+receiveFromService (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
*
*/
-static void start_forwarding (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+start_forwarding (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
GNUNET_a2s (fc->listen_info->service_addr,
fc->listen_info->service_addr_len),
(unsigned long long) GNUNET_TIME_relative_min (fc->back_off,
- rem).
- rel_value);
+ rem).rel_value);
#endif
rem = GNUNET_TIME_absolute_get_remaining (fc->timeout);
GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == fc->start_task);
GNUNET_a2s (fc->listen_info->service_addr,
fc->listen_info->service_addr_len),
(unsigned long long) GNUNET_TIME_relative_min (fc->back_off,
- rem).
- rel_value);
+ rem).rel_value);
#endif
rem = GNUNET_TIME_absolute_get_remaining (fc->timeout);
GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == fc->start_task);
* @param cls callback data, struct ServiceListeningInfo describing a listen socket
* @param tc context
*/
-static void acceptConnection (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+acceptConnection (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
static void
return;
}
GNUNET_break (GNUNET_OK ==
- GNUNET_NETWORK_socket_close (serviceListeningInfo->
- listeningSocket));
+ GNUNET_NETWORK_socket_close
+ (serviceListeningInfo->listeningSocket));
start_service (NULL, serviceListeningInfo->serviceName, NULL);
GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Service `%s' started\n"),
fc->listen_info->serviceName);
}
-static void kill_task (void *cbData,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+kill_task (void *cbData, const struct GNUNET_SCHEDULER_TaskContext *tc);
static void
}
-static void kill_task (void *cbData,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+kill_task (void *cbData, const struct GNUNET_SCHEDULER_TaskContext *tc);
static void
/**
* Ask client to send a join request.
*/
-static int rejoin_room (struct GNUNET_CHAT_Room *chat_room);
+static int
+rejoin_room (struct GNUNET_CHAT_Room *chat_room);
/**
if (NULL != room->confirmation_callback)
room->confirmation_callback (room->confirmation_cls, room,
ntohl (receipt->sequence_number),
- GNUNET_TIME_absolute_ntoh (receipt->
- timestamp),
- &receipt->target);
+ GNUNET_TIME_absolute_ntoh
+ (receipt->timestamp), &receipt->target);
break;
default:
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Unknown message type: '%u'\n"),
}
}
-static int do_help (const char *args, const void *xtra);
+static int
+do_help (const char *args, const void *xtra);
/**
*
* @param h our handle to the core service
*/
-static void reconnect (struct GNUNET_CORE_Handle *h);
+static void
+reconnect (struct GNUNET_CORE_Handle *h);
/**
* @param h core handle
* @param ignore_currently_down transmit message even if not initialized?
*/
-static void trigger_next_request (struct GNUNET_CORE_Handle *h,
- int ignore_currently_down);
+static void
+trigger_next_request (struct GNUNET_CORE_Handle *h, int ignore_currently_down);
/**
* @param cls the transmit handle of the request that timed out
* @param tc context, can be NULL (!)
*/
-static void transmission_timeout (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext
- *tc);
+static void
+transmission_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
}
if (h->control_pending_head != NULL)
msize =
- ntohs (((struct GNUNET_MessageHeader *) &h->control_pending_head[1])->
- size);
+ ntohs (((struct GNUNET_MessageHeader *) &h->
+ control_pending_head[1])->size);
else if (h->ready_peer_head != NULL)
msize =
h->ready_peer_head->pending_head->msize + sizeof (struct SendMessage);
*
* @param n neighbour to check.
*/
-static void process_encrypted_neighbour_queue (struct Neighbour *n);
+static void
+process_encrypted_neighbour_queue (struct Neighbour *n);
/**
*
* @param n neighbour to consider discarding
*/
-static void consider_free_neighbour (struct Neighbour *n);
+static void
+consider_free_neighbour (struct Neighbour *n);
/**
#if DEBUG_CORE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Copied message of type %u and size %u into transport buffer for `%4s'\n",
- (unsigned int) ntohs (((struct GNUNET_MessageHeader *) &m[1])->
- type), (unsigned int) ret,
- GNUNET_i2s (&n->peer));
+ (unsigned int)
+ ntohs (((struct GNUNET_MessageHeader *) &m[1])->type),
+ (unsigned int) ret, GNUNET_i2s (&n->peer));
#endif
process_encrypted_neighbour_queue (n);
}
#if DEBUG_CORE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Transmission of message of type %u and size %u failed\n",
- (unsigned int) ntohs (((struct GNUNET_MessageHeader *) &m[1])->
- type), (unsigned int) m->size);
+ (unsigned int)
+ ntohs (((struct GNUNET_MessageHeader *) &m[1])->type),
+ (unsigned int) m->size);
#endif
}
GNUNET_free (m);
*
* @param n neighbour to check.
*/
-static void process_plaintext_neighbour_queue (struct Neighbour *n);
+static void
+process_plaintext_neighbour_queue (struct Neighbour *n);
/**
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Asking transport for transmission of %u bytes to `%4s' in next %llu ms\n",
(unsigned int) m->size, GNUNET_i2s (&n->peer),
- (unsigned long long) GNUNET_TIME_absolute_get_remaining (m->
- deadline).
- rel_value);
+ (unsigned long long)
+ GNUNET_TIME_absolute_get_remaining (m->deadline).rel_value);
#endif
n->th =
GNUNET_TRANSPORT_notify_transmit_ready (transport, &n->peer, m->size,
(unsigned int)
ntohs (((const struct GNUNET_MessageHeader *) &pos[1])->type),
(unsigned int)
- ntohs (((const struct GNUNET_MessageHeader *) &pos[1])->
- size));
+ ntohs (((const struct GNUNET_MessageHeader *)
+ &pos[1])->size));
#endif
/* copy for encrypted transmission */
memcpy (&buf[ret], &pos[1], pos->size);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Adding plaintext message of size %u with deadline %llu ms to batch\n",
(unsigned int) pos->size,
- (unsigned long long) GNUNET_TIME_absolute_get_remaining (pos->
- deadline).
- rel_value);
+ (unsigned long long)
+ GNUNET_TIME_absolute_get_remaining (pos->deadline).rel_value);
#endif
deadline->abs_value =
GNUNET_MIN (deadline->abs_value, pos->deadline.abs_value);
*
* @param n the other peer
*/
-static void send_key (struct Neighbour *n);
+static void
+send_key (struct Neighbour *n);
/**
* Task that will retry "send_key" if our previous attempt failed
* @param cls neighbour for the quota update
* @param tc context
*/
-static void neighbour_quota_update (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext
- *tc);
+static void
+neighbour_quota_update (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
#if DEBUG_CORE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Have %llu ms left for `%s' transmission.\n",
- (unsigned long long) GNUNET_TIME_absolute_get_remaining (me->
- deadline).
- rel_value, "SET_KEY");
+ (unsigned long long)
+ GNUNET_TIME_absolute_get_remaining (me->deadline).rel_value,
+ "SET_KEY");
#endif
trigger_processing:
/* trigger queue processing */
* @param ats performance data
* @param ats_count number of entries in ats (excluding 0-termination)
*/
-static void handle_set_key (struct Neighbour *n, const struct SetKeyMessage *m,
- const struct GNUNET_TRANSPORT_ATS_Information *ats,
- uint32_t ats_count);
+static void
+handle_set_key (struct Neighbour *n, const struct SetKeyMessage *m,
+ const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ uint32_t ats_count);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Core service passes message from `%4s' of type %u to client.\n",
GNUNET_i2s (&sender->peer),
- (unsigned int) ntohs (((const struct GNUNET_MessageHeader *) m)->
- type));
+ (unsigned int)
+ ntohs (((const struct GNUNET_MessageHeader *) m)->type));
#endif
ntm = (struct NotifyTrafficMessage *) buf;
ntm->header.size = htons (size);
static unsigned int total_reserve = 5;
-static void process_hello (void *cls,
- const struct GNUNET_MessageHeader *message);
+static void
+process_hello (void *cls, const struct GNUNET_MessageHeader *message);
static void
terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
return sizeof (struct GNUNET_MessageHeader);
}
-static void preference_cb (void *cls, const struct GNUNET_PeerIdentity *peer,
- struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
- int32_t amount,
- struct GNUNET_TIME_Relative res_delay,
- uint64_t preference);
+static void
+preference_cb (void *cls, const struct GNUNET_PeerIdentity *peer,
+ struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, int32_t amount,
+ struct GNUNET_TIME_Relative res_delay, uint64_t preference);
static void
do_reserve (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
return sizeof (struct TestMessage) + (ret % 60000);
}
-static void process_hello (void *cls,
- const struct GNUNET_MessageHeader *message);
+static void
+process_hello (void *cls, const struct GNUNET_MessageHeader *message);
static void
terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
}
-static size_t transmit_ready (void *cls, size_t size, void *buf);
+static size_t
+transmit_ready (void *cls, size_t size, void *buf);
static int
process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer,
uint32_t num;
};
-static void process_hello (void *cls,
- const struct GNUNET_MessageHeader *message);
+static void
+process_hello (void *cls, const struct GNUNET_MessageHeader *message);
static void
terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
}
-static size_t transmit_ready (void *cls, size_t size, void *buf);
+static size_t
+transmit_ready (void *cls, size_t size, void *buf);
static int
process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer,
}
fprintf (stderr, "\n");
fprintf (stdout, "Stored %u items in %llums\n", ITERATIONS,
- (unsigned long long) GNUNET_TIME_absolute_get_duration (start).
- rel_value);
+ (unsigned long long)
+ GNUNET_TIME_absolute_get_duration (start).rel_value);
GNUNET_snprintf (gstr, sizeof (gstr), "DATACACHE-%s", plugin_name);
GAUGER (gstr, "Time to PUT item in datacache",
GNUNET_TIME_absolute_get_duration (start).rel_value / ITERATIONS,
fprintf (stdout,
"Found %u/%u items in %llums (%u were deleted during storage processing)\n",
found, ITERATIONS,
- (unsigned long long) GNUNET_TIME_absolute_get_duration (start).
- rel_value, ITERATIONS - found);
+ (unsigned long long)
+ GNUNET_TIME_absolute_get_duration (start).rel_value,
+ ITERATIONS - found);
if (found > 0)
GAUGER (gstr, "Time to GET item from datacache",
GNUNET_TIME_absolute_get_duration (start).rel_value / found,
*
* @param h handle to the datastore
*/
-static void process_queue (struct GNUNET_DATASTORE_Handle *h);
+static void
+process_queue (struct GNUNET_DATASTORE_Handle *h);
/**
* @param cls not used
* @param tc task context
*/
-static void delete_expired (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+delete_expired (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
-static void run_continuation (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+run_continuation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
stored_entries++;
}
-static void test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
static int
{
ret =
prepared_statement_run_select (plugin,
- plugin->count_entry_by_hash_vhash_and_type,
- 1, cbind, MYSQL_TYPE_BLOB, key,
- hashSize, &hashSize, MYSQL_TYPE_BLOB,
- vhash, hashSize2, &hashSize2,
- MYSQL_TYPE_LONG, &type, GNUNET_YES,
- -1);
+ plugin->
+ count_entry_by_hash_vhash_and_type, 1,
+ cbind, MYSQL_TYPE_BLOB, key, hashSize,
+ &hashSize, MYSQL_TYPE_BLOB, vhash,
+ hashSize2, &hashSize2, MYSQL_TYPE_LONG,
+ &type, GNUNET_YES, -1);
}
else
{
};
-static void run_continuation (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+run_continuation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
static void
};
-static void run_continuation (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+run_continuation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
static void
}
-static void test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
static uint64_t guid;
/**
* Transmit the next pending message, called by notify_transmit_ready
*/
-static size_t transmit_pending (void *cls, size_t size, void *buf);
+static size_t
+transmit_pending (void *cls, size_t size, void *buf);
/**
* a demultiplexer which handles numerous message types
*
*/
-static void service_message_handler (void *cls,
- const struct GNUNET_MessageHeader *msg);
+static void
+service_message_handler (void *cls, const struct GNUNET_MessageHeader *msg);
* Try to send messages from list of messages to send
* @param handle DHT_Handle
*/
-static void process_pending_messages (struct GNUNET_DHT_Handle *handle);
+static void
+process_pending_messages (struct GNUNET_DHT_Handle *handle);
/**
route_handle->message);
}
GNUNET_assert (GNUNET_YES ==
- GNUNET_CONTAINER_multihashmap_remove (route_handle->
- dht_handle->
- active_requests,
- &route_handle->key,
- route_handle));
+ GNUNET_CONTAINER_multihashmap_remove
+ (route_handle->dht_handle->active_requests, &route_handle->key,
+ route_handle));
GNUNET_free (route_handle->message);
GNUNET_free (route_handle);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "DHT route stop request processed\n");
*
* @param c a configuration to use
*/
-struct GNUNET_DHTLOG_Handle *GNUNET_DHTLOG_connect (const struct
- GNUNET_CONFIGURATION_Handle
- *c);
+struct GNUNET_DHTLOG_Handle *
+GNUNET_DHTLOG_connect (const struct GNUNET_CONFIGURATION_Handle *c);
/**
* Shutdown the module.
*/
-void GNUNET_DHTLOG_disconnect (struct GNUNET_DHTLOG_Handle *api);
+void
+GNUNET_DHTLOG_disconnect (struct GNUNET_DHTLOG_Handle *api);
#if 0 /* keep Emacsens' auto-indent happy */
/**
* Forward declaration.
*/
-static void do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
* Forward declaration.
*/
-static void do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
* Iterator over hash map entries.
GNUNET_TESTING_daemons_connect (d1, d2, timeout, DEFAULT_RECONNECT_ATTEMPTS,
GNUNET_YES, NULL, NULL);
}
- if (GNUNET_TIME_absolute_get_remaining (find_peer_context->endtime).
- rel_value > 0)
+ if (GNUNET_TIME_absolute_get_remaining (find_peer_context->endtime).rel_value
+ > 0)
return GNUNET_YES;
else
return GNUNET_NO;
/**
* Forward declaration.
*/
-static void schedule_churn_find_peer_requests (void *cls,
- const struct
- GNUNET_SCHEDULER_TaskContext
- *tc);
+static void
+schedule_churn_find_peer_requests (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext
+ *tc);
/**
* Callback for iterating over all the peer connections of a peer group.
*/
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Out of %u peers, fewest connections is %d\n",
- GNUNET_CONTAINER_heap_get_size (find_peer_context->
- peer_min_heap),
- peer_count->count);
+ GNUNET_CONTAINER_heap_get_size
+ (find_peer_context->peer_min_heap), peer_count->count);
if ((peer_count->count == 0) &&
- (GNUNET_TIME_absolute_get_remaining (find_peer_context->endtime).
- rel_value > 0))
+ (GNUNET_TIME_absolute_get_remaining
+ (find_peer_context->endtime).rel_value > 0))
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Found peer with no connections, will choose some peer(s) at random to connect to!\n");
GNUNET_SCHEDULER_add_now (&schedule_churn_find_peer_requests,
find_peer_context);
}
- else if ((GNUNET_TIME_absolute_get_remaining (find_peer_context->endtime).
- rel_value > 0) && (find_peer_context->last_sent != 0))
+ else if ((GNUNET_TIME_absolute_get_remaining
+ (find_peer_context->endtime).rel_value > 0) &&
+ (find_peer_context->last_sent != 0))
{
GNUNET_SCHEDULER_add_now (&schedule_churn_find_peer_requests,
find_peer_context);
}
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Added %d peers to heap, total size %d\n", count_added,
- GNUNET_CONTAINER_heap_get_size (find_peer_context->
- peer_min_heap));
+ GNUNET_CONTAINER_heap_get_size
+ (find_peer_context->peer_min_heap));
GNUNET_SCHEDULER_add_delayed (DEFAULT_PEER_DISCONNECT_TIMEOUT,
&schedule_churn_get_topology,
find_peer_context);
test_put->next);
}
-static void schedule_find_peer_requests (void *cls,
- const struct
- GNUNET_SCHEDULER_TaskContext *tc);
+static void
+schedule_find_peer_requests (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc);
#if HAVE_MALICIOUS
-static void setup_malicious_peers (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext
- *tc);
+static void
+setup_malicious_peers (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc);
#endif
/**
if ((find_peer_context->last_sent < 8) ||
((find_peer_context->current_peers <
2 * connection_estimate (num_peers, DEFAULT_BUCKET_SIZE)) &&
- (GNUNET_TIME_absolute_get_remaining (find_peer_context->endtime).
- rel_value > 0) &&
+ (GNUNET_TIME_absolute_get_remaining
+ (find_peer_context->endtime).rel_value > 0) &&
(find_peer_context->current_peers < target_total_connections)))
{
GNUNET_SCHEDULER_add_now (&schedule_find_peer_requests,
peer_count =
GNUNET_CONTAINER_heap_remove_root (find_peer_ctx->peer_min_heap);
GNUNET_assert (GNUNET_YES ==
- GNUNET_CONTAINER_multihashmap_remove (find_peer_ctx->
- peer_hash,
- &peer_count->peer_id.
- hashPubKey,
- peer_count));
+ GNUNET_CONTAINER_multihashmap_remove
+ (find_peer_ctx->peer_hash, &peer_count->peer_id.hashPubKey,
+ peer_count));
test_find_peer->daemon =
GNUNET_TESTING_daemon_get_by_id (pg, &peer_count->peer_id);
GNUNET_assert (test_find_peer->daemon != NULL);
#if ONLY_TESTING
/* Forward declaration */
-static void topology_callback (void *cls,
- const struct GNUNET_PeerIdentity *first,
- const struct GNUNET_PeerIdentity *second,
- uint32_t distance,
- const struct GNUNET_CONFIGURATION_Handle
- *first_cfg,
- const struct GNUNET_CONFIGURATION_Handle
- *second_cfg,
- struct GNUNET_TESTING_Daemon *first_daemon,
- struct GNUNET_TESTING_Daemon *second_daemon,
- const char *emsg);
+static void
+topology_callback (void *cls, const struct GNUNET_PeerIdentity *first,
+ const struct GNUNET_PeerIdentity *second, uint32_t distance,
+ const struct GNUNET_CONFIGURATION_Handle *first_cfg,
+ const struct GNUNET_CONFIGURATION_Handle *second_cfg,
+ struct GNUNET_TESTING_Daemon *first_daemon,
+ struct GNUNET_TESTING_Daemon *second_daemon,
+ const char *emsg);
/**
* Retry connecting two specific peers until they connect,
/* Get duration in seconds */
duration =
GNUNET_TIME_absolute_get_difference (connect_last_time,
- GNUNET_TIME_absolute_get ()).
- rel_value / 1000;
+ GNUNET_TIME_absolute_get
+ ()).rel_value / 1000;
total_duration =
GNUNET_TIME_absolute_get_difference (connect_start_time,
- GNUNET_TIME_absolute_get ()).
- rel_value / 1000;
+ GNUNET_TIME_absolute_get
+ ()).rel_value / 1000;
failed_conns_per_sec_recent =
(double) new_failed_connections / (double) duration;
total_duration =
GNUNET_TIME_absolute_get_difference (connect_start_time,
- GNUNET_TIME_absolute_get ()).
- rel_value / 1000;
+ GNUNET_TIME_absolute_get
+ ()).rel_value / 1000;
failed_conns_per_sec_total =
(long double) failed_connections / total_duration;
conns_per_sec_total = (long double) total_connections / total_duration;
GNUNET_CONFIGURATION_have_value (config, "TESTING", "HOSTKEYSFILE"))
{
GAUGER_ID ("DHT_TESTING", "HOSTKEY_GENERATION",
- GNUNET_TIME_absolute_get_duration (hostkey_start_time).
- rel_value / (double) num_peers, "ms/hostkey", revision_str);
+ GNUNET_TIME_absolute_get_duration
+ (hostkey_start_time).rel_value / (double) num_peers,
+ "ms/hostkey", revision_str);
}
else
{
GAUGER_ID ("DHT_TESTING", "HOSTKEY_GENERATION_REAL",
- GNUNET_TIME_absolute_get_duration (hostkey_start_time).
- rel_value / (double) num_peers, "ms/hostkey", revision_str);
+ GNUNET_TIME_absolute_get_duration
+ (hostkey_start_time).rel_value / (double) num_peers,
+ "ms/hostkey", revision_str);
}
}
/**
* Forward declaration.
*/
-static size_t send_generic_reply (void *cls, size_t size, void *buf);
+static size_t
+send_generic_reply (void *cls, size_t size, void *buf);
/** Declare here so retry_core_send is aware of it */
-static size_t core_transmit_notify (void *cls, size_t size, void *buf);
+static size_t
+core_transmit_notify (void *cls, size_t size, void *buf);
/**
* Convert unique ID to hash code.
result_message->hop_count = htonl (msg_ctx->hop_count + 1);
GNUNET_assert (GNUNET_OK ==
GNUNET_CONTAINER_bloomfilter_get_raw_data (msg_ctx->bloom,
- result_message->bloomfilter,
+ result_message->
+ bloomfilter,
DHT_BLOOM_SIZE));
result_message->unique_id = GNUNET_htonll (msg_ctx->unique_id);
memcpy (&result_message->key, &msg_ctx->key, sizeof (GNUNET_HashCode));
}
/* Forward declaration */
-static void update_core_preference (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext
- *tc);
+static void
+update_core_preference (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
* Function called with statistics about the given peer.
*
if (msg_ctx->bloom != NULL)
GNUNET_assert (GNUNET_OK ==
GNUNET_CONTAINER_bloomfilter_get_raw_data (msg_ctx->bloom,
- route_message->bloomfilter,
+ route_message->
+ bloomfilter,
DHT_BLOOM_SIZE));
memcpy (&route_message->key, &msg_ctx->key, sizeof (GNUNET_HashCode));
memcpy (&route_message[1], msg, ntohs (msg->size));
client->transmit_handle =
GNUNET_SERVER_notify_transmit_ready (client->client_handle,
- ntohs (client->pending_head->msg->
- size),
+ ntohs (client->pending_head->
+ msg->size),
GNUNET_TIME_UNIT_FOREVER_REL,
&send_generic_reply, client);
}
* @param msg the message to be routed
* @param msg_ctx the context containing all pertinent information about the message
*/
-static void route_message (const struct GNUNET_MessageHeader *msg,
- struct DHT_MessageContext *msg_ctx);
+static void
+route_message (const struct GNUNET_MessageHeader *msg,
+ struct DHT_MessageContext *msg_ctx);
/**
* @param cls closure (a struct RepublishContext)
* @param tc runtime context for this task
*/
-static void republish_content (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+republish_content (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
* Server handler for initiating local dht put requests
break; /* overflow case */
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Choose %d matching bits (%d bits match me) (%.2f percent) converge ret %llu\n",
- GNUNET_CRYPTO_hash_matching_bits (&sorted_closest[i]->
- id.hashPubKey, target),
- GNUNET_CRYPTO_hash_matching_bits (&sorted_closest[i]->
- id.hashPubKey,
+ GNUNET_CRYPTO_hash_matching_bits (&sorted_closest[i]->id.
+ hashPubKey, target),
+ GNUNET_CRYPTO_hash_matching_bits (&sorted_closest[i]->id.
+ hashPubKey,
&my_identity.hashPubKey),
(temp_converge_distance / (double) total_distance) * 100,
temp_converge_distance);
temp_bloom);
GNUNET_assert (GNUNET_OK ==
GNUNET_CONTAINER_bloomfilter_get_raw_data (temp_bloom,
- find_peer_msg->bloomfilter,
+ find_peer_msg->
+ bloomfilter,
DHT_BLOOM_SIZE));
GNUNET_CONTAINER_bloomfilter_free (temp_bloom);
memset (&msg_ctx, 0, sizeof (struct DHT_MessageContext));
*
* @return GNUNET_OK on success, GNUNET_SYSERR on failure
*/
-int insert_stat (const struct GNUNET_PeerIdentity *peer,
- unsigned int route_requests, unsigned int route_forwards,
- unsigned int result_requests, unsigned int client_requests,
- unsigned int result_forwards, unsigned int gets,
- unsigned int puts, unsigned int data_inserts,
- unsigned int find_peer_requests,
- unsigned int find_peers_started, unsigned int gets_started,
- unsigned int puts_started,
- unsigned int find_peer_responses_received,
- unsigned int get_responses_received,
- unsigned int find_peer_responses_sent,
- unsigned int get_responses_sent)
+int
+insert_stat (const struct GNUNET_PeerIdentity *peer,
+ unsigned int route_requests, unsigned int route_forwards,
+ unsigned int result_requests, unsigned int client_requests,
+ unsigned int result_forwards, unsigned int gets, unsigned int puts,
+ unsigned int data_inserts, unsigned int find_peer_requests,
+ unsigned int find_peers_started, unsigned int gets_started,
+ unsigned int puts_started,
+ unsigned int find_peer_responses_received,
+ unsigned int get_responses_received,
+ unsigned int find_peer_responses_sent,
+ unsigned int get_responses_sent)
{
return GNUNET_OK;
}
* @param cls closure
* @param tc context information (why was this task triggered now?)
*/
-void retry_find_peer_stop (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+void
+retry_find_peer_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
* Retry the find_peer task on timeout.
}
/* Forward declaration */
-static void do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
* Iterator called on each result obtained for a DHT
}
-static void stop_retry_get (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+stop_retry_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
static void
get_stop_finished (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
} p2p_dv_MESSAGE_Disconnect;
-struct GNUNET_DV_Handle *GNUNET_DV_connect (const struct
- GNUNET_CONFIGURATION_Handle *cfg,
- GNUNET_DV_MessageReceivedHandler
- receive_handler,
- void *receive_handler_cls);
+struct GNUNET_DV_Handle *
+GNUNET_DV_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ GNUNET_DV_MessageReceivedHandler receive_handler,
+ void *receive_handler_cls);
/**
* Disconnect from the DV service
*
* @param handle the current handle to the service to disconnect
*/
-void GNUNET_DV_disconnect (struct GNUNET_DV_Handle *handle);
+void
+GNUNET_DV_disconnect (struct GNUNET_DV_Handle *handle);
#endif
return GNUNET_NO;
}
-static void process_pending_message (struct GNUNET_DV_Handle *handle);
+static void
+process_pending_message (struct GNUNET_DV_Handle *handle);
/**
* Send complete, schedule next
if (NULL ==
(handle->th =
GNUNET_CLIENT_notify_transmit_ready (handle->client,
- ntohs (handle->current->msg->header.
- size),
+ ntohs (handle->current->msg->
+ header.size),
handle->current->msg->timeout,
GNUNET_YES, &transmit_pending,
handle)))
if (plugin_pending_head != NULL)
plugin_transmit_handle =
GNUNET_SERVER_notify_transmit_ready (client_handle,
- ntohs (plugin_pending_head->
- msg->size),
+ ntohs (plugin_pending_head->msg->
+ size),
GNUNET_TIME_UNIT_FOREVER_REL,
&transmit_to_plugin, NULL);
}
/* Declare here so retry_core_send is aware of it */
-size_t core_transmit_notify (void *cls, size_t size, void *buf);
+size_t
+core_transmit_notify (void *cls, size_t size, void *buf);
/**
* Try to send another message from our core sending list
find_context.via = recipient;
find_context.tid = 0;
GNUNET_CONTAINER_multihashmap_get_multiple (extended_neighbors,
- &send_context->distant_peer->
- hashPubKey, &find_specific_id,
- &find_context);
+ &send_context->
+ distant_peer->hashPubKey,
+ &find_specific_id, &find_context);
if (find_context.tid == 0)
{
}
/** Forward declarations **/
-static int handle_dv_gossip_message (void *cls,
- const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_MessageHeader *message,
- const struct
- GNUNET_TRANSPORT_ATS_Information *atsi);
-
-static int handle_dv_disconnect_message (void *cls,
- const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_MessageHeader
- *message,
- const struct
- GNUNET_TRANSPORT_ATS_Information
- *atsi);
+static int
+handle_dv_gossip_message (void *cls, const struct GNUNET_PeerIdentity *peer,
+ const struct GNUNET_MessageHeader *message,
+ const struct GNUNET_TRANSPORT_ATS_Information *atsi);
+
+static int
+handle_dv_disconnect_message (void *cls, const struct GNUNET_PeerIdentity *peer,
+ const struct GNUNET_MessageHeader *message,
+ const struct GNUNET_TRANSPORT_ATS_Information
+ *atsi);
/** End forward declarations **/
atsi[0].value = htonl (referrer->pending_messages[i].distance);
atsi[1].type = htonl (GNUNET_TRANSPORT_ATS_QUALITY_NET_DELAY);
atsi[1].value =
- htonl ((uint32_t) referrer->pending_messages[i].latency.
- rel_value);
+ htonl ((uint32_t) referrer->pending_messages[i].
+ latency.rel_value);
atsi[2].type = htonl (GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR);
atsi[2].value = htonl (0);
handle_dv_data_message (NULL, &referrer->pending_messages[i].sender,
}
}
-static void send_other_messages (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+send_other_messages (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
* Get distance information from 'atsi'.
qe->h->active_blocks -= qe->blocks;
qe->run_time =
GNUNET_TIME_relative_add (qe->run_time,
- GNUNET_TIME_absolute_get_duration (qe->
- start_time));
+ GNUNET_TIME_absolute_get_duration
+ (qe->start_time));
GNUNET_CONTAINER_DLL_remove (qe->h->running_head, qe->h->running_tail, qe);
GNUNET_CONTAINER_DLL_insert_after (qe->h->pending_head, qe->h->pending_tail,
qe->h->pending_tail, qe);
* the infromation
* @return NULL on error
*/
-static struct GNUNET_FS_FileInformation *deserialize_file_information (struct
- GNUNET_FS_Handle
- *h,
- const
- char
- *filename);
+static struct GNUNET_FS_FileInformation *
+deserialize_file_information (struct GNUNET_FS_Handle *h, const char *filename);
/**
(GNUNET_OK !=
GNUNET_BIO_write_string (wh,
(fi->data.dir.entries ==
- NULL) ? NULL : fi->data.dir.entries->
- serialization)))
+ NULL) ? NULL : fi->data.dir.
+ entries->serialization)))
{
GNUNET_break (0);
goto cleanup;
(GNUNET_OK != GNUNET_BIO_read_int32 (rh, &dr->num_children)) ||
(dr->num_children > CHK_PER_INODE) ||
(GNUNET_OK != GNUNET_BIO_read_int32 (rh, &dr->depth)) || ((dr->depth == 0)
- && (dr->
- num_children
- > 0)) ||
+ &&
+ (dr->num_children
+ > 0)) ||
((dr->depth > 0) && (dr->num_children == 0)))
{
GNUNET_break (0);
* @param search associated search
* @param serialization name under which the search was serialized
*/
-static void deserialize_download (struct GNUNET_FS_Handle *h,
- struct GNUNET_BIO_ReadHandle *rh,
- struct GNUNET_FS_DownloadContext *parent,
- struct GNUNET_FS_SearchResult *search,
- const char *serialization);
+static void
+deserialize_download (struct GNUNET_FS_Handle *h,
+ struct GNUNET_BIO_ReadHandle *rh,
+ struct GNUNET_FS_DownloadContext *parent,
+ struct GNUNET_FS_SearchResult *search,
+ const char *serialization);
/**
* @param psearch_result parent search result
* @param serialization name under which the search was serialized
*/
-static struct GNUNET_FS_SearchContext *deserialize_search (struct
- GNUNET_FS_Handle *h,
- struct
- GNUNET_BIO_ReadHandle
- *rh,
- struct
- GNUNET_FS_SearchResult
- *psearch_result,
- const char
- *serialization);
+static struct GNUNET_FS_SearchContext *
+deserialize_search (struct GNUNET_FS_Handle *h,
+ struct GNUNET_BIO_ReadHandle *rh,
+ struct GNUNET_FS_SearchResult *psearch_result,
+ const char *serialization);
/**
*
* @param sc search being resumed
*/
-static void signal_search_resume (struct GNUNET_FS_SearchContext *sc);
+static void
+signal_search_resume (struct GNUNET_FS_SearchContext *sc);
/**
*
* @param sc search context to free
*/
-static void free_search_context (struct GNUNET_FS_SearchContext *sc);
+static void
+free_search_context (struct GNUNET_FS_SearchContext *sc);
/**
* @param blocks number of blocks this download has
* @return queue handle
*/
-struct GNUNET_FS_QueueEntry *GNUNET_FS_queue_ (struct GNUNET_FS_Handle *h,
- GNUNET_FS_QueueStart start,
- GNUNET_FS_QueueStop stop,
- void *cls, unsigned int blocks);
+struct GNUNET_FS_QueueEntry *
+GNUNET_FS_queue_ (struct GNUNET_FS_Handle *h, GNUNET_FS_QueueStart start,
+ GNUNET_FS_QueueStop stop, void *cls, unsigned int blocks);
/**
* Dequeue a job from the queue.
* @param qh handle for the job
*/
-void GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qh);
+void
+GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qh);
/**
* @param emsg location for the reader to store an error message
* @return number of bytes written, usually "max", 0 on error
*/
-size_t GNUNET_FS_data_reader_file_ (void *cls, uint64_t offset,
- size_t max, void *buf,
- char **emsg);
+size_t
+GNUNET_FS_data_reader_file_ (void *cls, uint64_t offset, size_t max, void *buf,
+ char **emsg);
/**
* @param filename file to read
* @return closure to use
*/
-void *GNUNET_FS_make_file_reader_context_ (const char *filename);
+void *
+GNUNET_FS_make_file_reader_context_ (const char *filename);
* @param emsg location for the reader to store an error message
* @return number of bytes written, usually "max", 0 on error
*/
-size_t GNUNET_FS_data_reader_copy_ (void *cls, uint64_t offset, size_t max,
- void *buf, char **emsg);
+size_t
+GNUNET_FS_data_reader_copy_ (void *cls, uint64_t offset, size_t max, void *buf,
+ char **emsg);
/**
* Notification of FS that a search probe has made progress.
* will be passed to future callbacks in the respective
* field in the GNUNET_FS_ProgressInfo struct.
*/
-void *GNUNET_FS_search_probe_progress_ (void *cls,
- const struct GNUNET_FS_ProgressInfo
- *info);
+void *
+GNUNET_FS_search_probe_progress_ (void *cls,
+ const struct GNUNET_FS_ProgressInfo *info);
/**
* @param cls "struct GNUNET_FS_PublishContext" identifies the upload
* @param tc task context
*/
-void GNUNET_FS_publish_main_ (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+void
+GNUNET_FS_publish_main_ (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
* @param cls closure, unindex context
* @param file_id computed hash, NULL on error
*/
-void GNUNET_FS_unindex_process_hash_ (void *cls,
- const GNUNET_HashCode * file_id);
+void
+GNUNET_FS_unindex_process_hash_ (void *cls, const GNUNET_HashCode * file_id);
/**
* @param offset where in the file are we so far
* @return value returned from callback
*/
-void *GNUNET_FS_publish_make_status_ (struct GNUNET_FS_ProgressInfo *pi,
- struct GNUNET_FS_PublishContext *sc,
- const struct GNUNET_FS_FileInformation *p,
- uint64_t offset);
+void *
+GNUNET_FS_publish_make_status_ (struct GNUNET_FS_ProgressInfo *pi,
+ struct GNUNET_FS_PublishContext *sc,
+ const struct GNUNET_FS_FileInformation *p,
+ uint64_t offset);
/**
* @param pi structure to fill in
* @param dc overall download context
*/
-void GNUNET_FS_download_make_status_ (struct GNUNET_FS_ProgressInfo *pi,
- struct GNUNET_FS_DownloadContext *dc);
+void
+GNUNET_FS_download_make_status_ (struct GNUNET_FS_ProgressInfo *pi,
+ struct GNUNET_FS_DownloadContext *dc);
/**
* @param cls the 'struct GNUNET_FS_DownloadContext'
* @param tc scheduler context
*/
-void GNUNET_FS_download_start_task_ (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext
- *tc);
+void
+GNUNET_FS_download_start_task_ (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc);
* @param uc overall unindex context
* @param offset where we are in the file (for progress)
*/
-void GNUNET_FS_unindex_make_status_ (struct GNUNET_FS_ProgressInfo *pi,
- struct GNUNET_FS_UnindexContext *uc,
- uint64_t offset);
+void
+GNUNET_FS_unindex_make_status_ (struct GNUNET_FS_ProgressInfo *pi,
+ struct GNUNET_FS_UnindexContext *uc,
+ uint64_t offset);
/**
* Fill in all of the generic fields for a search event and
* @param sc overall search context
* @return value returned by the callback
*/
-void *GNUNET_FS_search_make_status_ (struct GNUNET_FS_ProgressInfo *pi,
- struct GNUNET_FS_SearchContext *sc);
+void *
+GNUNET_FS_search_make_status_ (struct GNUNET_FS_ProgressInfo *pi,
+ struct GNUNET_FS_SearchContext *sc);
/**
*
* @param uc context for the unindex operation.
*/
-void GNUNET_FS_unindex_do_remove_ (struct GNUNET_FS_UnindexContext *uc);
+void
+GNUNET_FS_unindex_do_remove_ (struct GNUNET_FS_UnindexContext *uc);
/**
* Build the request and actually initiate the search using the
* @param sc search context
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
-int GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc);
+int
+GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc);
/**
* Start the downloading process (by entering the queue).
*
* @param dc our download context
*/
-void GNUNET_FS_download_start_downloading_ (struct GNUNET_FS_DownloadContext
- *dc);
+void
+GNUNET_FS_download_start_downloading_ (struct GNUNET_FS_DownloadContext *dc);
/**
*
* @param sr the search result
*/
-void GNUNET_FS_search_start_probe_ (struct GNUNET_FS_SearchResult *sr);
+void
+GNUNET_FS_search_start_probe_ (struct GNUNET_FS_SearchResult *sr);
/**
* Remove serialization/deserialization file from disk.
* @param ext component of the path
* @param ent entity identifier
*/
-void GNUNET_FS_remove_sync_file_ (struct GNUNET_FS_Handle *h, const char *ext,
- const char *ent);
+void
+GNUNET_FS_remove_sync_file_ (struct GNUNET_FS_Handle *h, const char *ext,
+ const char *ent);
/**
* @param ext component of the path
* @param uni unique name of parent
*/
-void GNUNET_FS_remove_sync_dir_ (struct GNUNET_FS_Handle *h, const char *ext,
- const char *uni);
+void
+GNUNET_FS_remove_sync_dir_ (struct GNUNET_FS_Handle *h, const char *ext,
+ const char *uni);
/**
*
* @param fi the struct to sync
*/
-void GNUNET_FS_file_information_sync_ (struct GNUNET_FS_FileInformation *f);
+void
+GNUNET_FS_file_information_sync_ (struct GNUNET_FS_FileInformation *f);
/**
* Synchronize this publishing struct with its mirror
*
* @param pc the struct to sync
*/
-void GNUNET_FS_publish_sync_ (struct GNUNET_FS_PublishContext *pc);
+void
+GNUNET_FS_publish_sync_ (struct GNUNET_FS_PublishContext *pc);
/**
* Synchronize this unindex struct with its mirror
*
* @param uc the struct to sync
*/
-void GNUNET_FS_unindex_sync_ (struct GNUNET_FS_UnindexContext *uc);
+void
+GNUNET_FS_unindex_sync_ (struct GNUNET_FS_UnindexContext *uc);
/**
* Synchronize this search struct with its mirror
*
* @param sc the struct to sync
*/
-void GNUNET_FS_search_sync_ (struct GNUNET_FS_SearchContext *sc);
+void
+GNUNET_FS_search_sync_ (struct GNUNET_FS_SearchContext *sc);
/**
* Synchronize this search result with its mirror
*
* @param sr the struct to sync
*/
-void GNUNET_FS_search_result_sync_ (struct GNUNET_FS_SearchResult *sr);
+void
+GNUNET_FS_search_result_sync_ (struct GNUNET_FS_SearchResult *sr);
/**
* Synchronize this download struct with its mirror
*
* @param dc the struct to sync
*/
-void GNUNET_FS_download_sync_ (struct GNUNET_FS_DownloadContext *dc);
+void
+GNUNET_FS_download_sync_ (struct GNUNET_FS_DownloadContext *dc);
/**
* Create SUSPEND event for the given publish operation
*
* @param cls the 'struct GNUNET_FS_PublishContext' to signal for
*/
-void GNUNET_FS_publish_signal_suspend_ (void *cls);
+void
+GNUNET_FS_publish_signal_suspend_ (void *cls);
/**
* Create SUSPEND event for the given search operation
*
* @param cls the 'struct GNUNET_FS_SearchContext' to signal for
*/
-void GNUNET_FS_search_signal_suspend_ (void *cls);
+void
+GNUNET_FS_search_signal_suspend_ (void *cls);
/**
* Create SUSPEND event for the given download operation
*
* @param cls the 'struct GNUNET_FS_DownloadContext' to signal for
*/
-void GNUNET_FS_download_signal_suspend_ (void *cls);
+void
+GNUNET_FS_download_signal_suspend_ (void *cls);
/**
* Create SUSPEND event for the given unindex operation
*
* @param cls the 'struct GNUNET_FS_UnindexContext' to signal for
*/
-void GNUNET_FS_unindex_signal_suspend_ (void *cls);
+void
+GNUNET_FS_unindex_signal_suspend_ (void *cls);
/**
* Function signature of the functions that can be called
* @param ssf_cls closure for ssf
* @return fresh top-level activity handle
*/
-struct TopLevelActivity *GNUNET_FS_make_top (struct GNUNET_FS_Handle *h,
- SuspendSignalFunction ssf,
- void *ssf_cls);
+struct TopLevelActivity *
+GNUNET_FS_make_top (struct GNUNET_FS_Handle *h, SuspendSignalFunction ssf,
+ void *ssf_cls);
/**
* @param h global fs handle
* @param top top level activity entry
*/
-void GNUNET_FS_end_top (struct GNUNET_FS_Handle *h,
- struct TopLevelActivity *top);
+void
+GNUNET_FS_end_top (struct GNUNET_FS_Handle *h, struct TopLevelActivity *top);
*
* @param dr request to free
*/
-void GNUNET_FS_free_download_request_ (struct DownloadRequest *dr);
+void
+GNUNET_FS_free_download_request_ (struct DownloadRequest *dr);
/**
* @param buf where the callee should write the message
* @return number of bytes written to buf
*/
-static size_t transmit_download_request (void *cls, size_t size, void *buf);
+static size_t
+transmit_download_request (void *cls, size_t size, void *buf);
/**
* @param value value in the hash map (a 'struct DownloadRequest')
* @return GNUNET_YES (we should continue to iterate); unless serious error
*/
-static int process_result_with_request (void *cls, const GNUNET_HashCode * key,
- void *value);
+static int
+process_result_with_request (void *cls, const GNUNET_HashCode * key,
+ void *value);
/**
*
* @param dc download context that is having trouble
*/
-static void try_reconnect (struct GNUNET_FS_DownloadContext *dc);
+static void
+try_reconnect (struct GNUNET_FS_DownloadContext *dc);
/**
* @param length number of bytes in data
* @param data contents of the file (or NULL if they were not inlined)
*/
-static void trigger_recursive_download (void *cls, const char *filename,
- const struct GNUNET_FS_Uri *uri,
- const struct GNUNET_CONTAINER_MetaData
- *meta, size_t length, const void *data);
+static void
+trigger_recursive_download (void *cls, const char *filename,
+ const struct GNUNET_FS_Uri *uri,
+ const struct GNUNET_CONTAINER_MetaData *meta,
+ size_t length, const void *data);
/**
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Received block `%s' matching pending request at depth %u and offset %llu/%llu\n",
GNUNET_h2s (key), dr->depth, (unsigned long long) dr->offset,
- (unsigned long long) GNUNET_ntohll (dc->uri->data.chk.
- file_length));
+ (unsigned long long) GNUNET_ntohll (dc->uri->data.
+ chk.file_length));
#endif
bs = GNUNET_FS_tree_calculate_block_size (GNUNET_ntohll
_
("Internal error or bogus download URI (expected %u bytes at depth %u and offset %llu/%llu, got %u bytes)\n"),
bs, dr->depth, (unsigned long long) dr->offset,
- (unsigned long long) GNUNET_ntohll (dc->uri->data.chk.
- file_length),
+ (unsigned long long) GNUNET_ntohll (dc->uri->data.
+ chk.file_length),
prc->size);
GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "%s", dc->emsg);
while (dr->parent != NULL)
#if DEBUG_DOWNLOAD
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Download completed, truncating file to desired length %llu\n",
- (unsigned long long) GNUNET_ntohll (dc->uri->data.chk.
- file_length));
+ (unsigned long long) GNUNET_ntohll (dc->uri->data.
+ chk.file_length));
#endif
/* truncate file to size (since we store IBlocks at the end) */
if (dc->filename != NULL)
GNUNET_DISK_OPEN_READWRITE |
GNUNET_DISK_OPEN_CREATE |
((0 ==
- GNUNET_FS_uri_chk_get_file_size (dc->
- uri)) ?
+ GNUNET_FS_uri_chk_get_file_size (dc->uri)) ?
GNUNET_DISK_OPEN_TRUNCATE : 0),
GNUNET_DISK_PERM_USER_READ |
GNUNET_DISK_PERM_USER_WRITE |
no = GNUNET_NO;
if (GNUNET_OK !=
proc (proc_cls, dir,
- (dir->is_directory) ? dir->data.dir.dir_size : dir->data.file.
- file_size, dir->meta, &dir->keywords, &dir->bo,
+ (dir->is_directory) ? dir->data.dir.dir_size : dir->data.
+ file.file_size, dir->meta, &dir->keywords, &dir->bo,
(dir->is_directory) ? &no : &dir->data.file.do_index,
&dir->client_info))
return;
no = GNUNET_NO;
if (GNUNET_OK !=
proc (proc_cls, pos,
- (pos->is_directory) ? pos->data.dir.dir_size : pos->data.file.
- file_size, pos->meta, &pos->keywords, &pos->bo,
+ (pos->is_directory) ? pos->data.dir.dir_size : pos->data.
+ file.file_size, pos->meta, &pos->keywords, &pos->bo,
(dir->is_directory) ? &no : &dir->data.file.do_index,
&pos->client_info))
break;
pi.value.publish.specifics.completed.chk_uri = p->chk_uri;
p->client_info =
GNUNET_FS_publish_make_status_ (&pi, pc, p,
- GNUNET_ntohll (p->chk_uri->data.chk.
- file_length));
+ GNUNET_ntohll (p->chk_uri->data.
+ chk.file_length));
}
* @param cls closure of type "struct PublishKskContext*"
* @param tc unused
*/
-static void publish_ksk_cont (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+publish_ksk_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
* @param psearch parent search result (for namespace update searches)
* @return context that can be used to control the search
*/
-static struct GNUNET_FS_SearchContext *search_start (struct GNUNET_FS_Handle *h,
- const struct GNUNET_FS_Uri
- *uri, uint32_t anonymity,
- enum
- GNUNET_FS_SearchOptions
- options, void *cctx,
- struct
- GNUNET_FS_SearchResult
- *psearch);
+static struct GNUNET_FS_SearchContext *
+search_start (struct GNUNET_FS_Handle *h, const struct GNUNET_FS_Uri *uri,
+ uint32_t anonymity, enum GNUNET_FS_SearchOptions options,
+ void *cctx, struct GNUNET_FS_SearchResult *psearch);
/**
*
* @param sc the search to reconnec
*/
-static void try_reconnect (struct GNUNET_FS_SearchContext *sc);
+static void
+try_reconnect (struct GNUNET_FS_SearchContext *sc);
/**
*
* @param sc context for the search
*/
-static void schedule_transmit_search_request (struct GNUNET_FS_SearchContext
- *sc);
+static void
+schedule_transmit_search_request (struct GNUNET_FS_SearchContext *sc);
/**
* 'GNUNET_FS_TEST_daemons_stop'!
* @param cont_cls closure for cont
*/
-void GNUNET_FS_TEST_daemons_start (const char *template_cfg_file,
- struct GNUNET_TIME_Relative timeout,
- unsigned int total,
- struct GNUNET_FS_TestDaemon **daemons,
- GNUNET_SCHEDULER_Task cont, void *cont_cls);
+void
+GNUNET_FS_TEST_daemons_start (const char *template_cfg_file,
+ struct GNUNET_TIME_Relative timeout,
+ unsigned int total,
+ struct GNUNET_FS_TestDaemon **daemons,
+ GNUNET_SCHEDULER_Task cont, void *cont_cls);
/**
* @param cont function to call when done
* @param cont_cls closure for cont
*/
-void GNUNET_FS_TEST_daemons_connect (struct GNUNET_FS_TestDaemon *daemon1,
- struct GNUNET_FS_TestDaemon *daemon2,
- struct GNUNET_TIME_Relative timeout,
- GNUNET_SCHEDULER_Task cont,
- void *cont_cls);
+void
+GNUNET_FS_TEST_daemons_connect (struct GNUNET_FS_TestDaemon *daemon1,
+ struct GNUNET_FS_TestDaemon *daemon2,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_SCHEDULER_Task cont, void *cont_cls);
/**
* @param daemons array with the daemons (must contain at least one)
* @return peer group
*/
-struct GNUNET_TESTING_PeerGroup *GNUNET_FS_TEST_get_group (struct
- GNUNET_FS_TestDaemon
- **daemons);
+struct GNUNET_TESTING_PeerGroup *
+GNUNET_FS_TEST_get_group (struct GNUNET_FS_TestDaemon **daemons);
* @param off which configuration to get
* @return peer configuration
*/
-const struct GNUNET_CONFIGURATION_Handle
- *GNUNET_FS_TEST_get_configuration (struct GNUNET_FS_TestDaemon **daemons,
- unsigned int off);
+const struct GNUNET_CONFIGURATION_Handle *
+GNUNET_FS_TEST_get_configuration (struct GNUNET_FS_TestDaemon **daemons,
+ unsigned int off);
/**
* Stop daemons used for testing.
* @param total number of daemons to stop
* @param daemons array with the daemons (values will be clobbered)
*/
-void GNUNET_FS_TEST_daemons_stop (unsigned int total,
- struct GNUNET_FS_TestDaemon **daemons);
+void
+GNUNET_FS_TEST_daemons_stop (unsigned int total,
+ struct GNUNET_FS_TestDaemon **daemons);
/**
* @param cont function to call when done
* @param cont_cls closure for cont
*/
-void GNUNET_FS_TEST_publish (struct GNUNET_FS_TestDaemon *daemon,
- struct GNUNET_TIME_Relative timeout,
- uint32_t anonymity, int do_index, uint64_t size,
- uint32_t seed, unsigned int verbose,
- GNUNET_FS_TEST_UriContinuation cont,
- void *cont_cls);
+void
+GNUNET_FS_TEST_publish (struct GNUNET_FS_TestDaemon *daemon,
+ struct GNUNET_TIME_Relative timeout, uint32_t anonymity,
+ int do_index, uint64_t size, uint32_t seed,
+ unsigned int verbose,
+ GNUNET_FS_TEST_UriContinuation cont, void *cont_cls);
/**
* @param cont function to call when done
* @param cont_cls closure for cont
*/
-void GNUNET_FS_TEST_download (struct GNUNET_FS_TestDaemon *daemon,
- struct GNUNET_TIME_Relative timeout,
- uint32_t anonymity, uint32_t seed,
- const struct GNUNET_FS_Uri *uri,
- unsigned int verbose, GNUNET_SCHEDULER_Task cont,
- void *cont_cls);
+void
+GNUNET_FS_TEST_download (struct GNUNET_FS_TestDaemon *daemon,
+ struct GNUNET_TIME_Relative timeout,
+ uint32_t anonymity, uint32_t seed,
+ const struct GNUNET_FS_Uri *uri, unsigned int verbose,
+ GNUNET_SCHEDULER_Task cont, void *cont_cls);
if (NULL != te->proc)
te->proc (te->cls, mychk, te->publish_offset, te->current_depth,
(0 ==
- te->
- current_depth) ? GNUNET_BLOCK_TYPE_FS_DBLOCK :
+ te->current_depth) ? GNUNET_BLOCK_TYPE_FS_DBLOCK :
GNUNET_BLOCK_TYPE_FS_IBLOCK, enc, pt_size);
if (NULL != te->progress)
te->progress (te->cls, te->publish_offset, pt_block, pt_size,
* @param flen file length for which to compute the depth
* @return depth of the tree, always > 0. A depth of 1 means only a DBLOCK.
*/
-unsigned int GNUNET_FS_compute_depth (uint64_t flen);
+unsigned int
+GNUNET_FS_compute_depth (uint64_t flen);
/**
* @param depth depth of the block. depth==0 is a DBLOCK.
* @return number of bytes of payload a subtree of this depth may correspond to
*/
-uint64_t GNUNET_FS_tree_compute_tree_size (unsigned int depth);
+uint64_t
+GNUNET_FS_tree_compute_tree_size (unsigned int depth);
/**
* @param depth depth of the node in the tree, 0 for DBLOCK
* @return number of bytes stored in this node
*/
-size_t GNUNET_FS_tree_calculate_block_size (uint64_t fsize, uint64_t offset,
- unsigned int depth);
+size_t
+GNUNET_FS_tree_calculate_block_size (uint64_t fsize, uint64_t offset,
+ unsigned int depth);
/**
* @param cont function to call when done
* @return tree encoder context
*/
-struct GNUNET_FS_TreeEncoder *GNUNET_FS_tree_encoder_create (struct
- GNUNET_FS_Handle
- *h, uint64_t size,
- void *cls,
- GNUNET_FS_DataReader
- reader,
- GNUNET_FS_TreeBlockProcessor
- proc,
- GNUNET_FS_TreeProgressCallback
- progress,
- GNUNET_SCHEDULER_Task
- cont);
+struct GNUNET_FS_TreeEncoder *
+GNUNET_FS_tree_encoder_create (struct GNUNET_FS_Handle *h, uint64_t size,
+ void *cls, GNUNET_FS_DataReader reader,
+ GNUNET_FS_TreeBlockProcessor proc,
+ GNUNET_FS_TreeProgressCallback progress,
+ GNUNET_SCHEDULER_Task cont);
/**
*
* @param te tree encoder to use
*/
-void GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te);
+void
+GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te);
/**
* prior to completion and prior to an internal error,
* both "*uri" and "*emsg" will be set to NULL).
*/
-void GNUNET_FS_tree_encoder_finish (struct GNUNET_FS_TreeEncoder *te,
- struct GNUNET_FS_Uri **uri, char **emsg);
+void
+GNUNET_FS_tree_encoder_finish (struct GNUNET_FS_TreeEncoder *te,
+ struct GNUNET_FS_Uri **uri, char **emsg);
#if 0
* @param data set to the resume data
* @param size set to the size of the resume data
*/
-void GNUNET_FS_tree_encoder_resume_get_data (const struct GNUNET_FS_TreeEncoder
- *te, void **data, size_t * size);
+void
+GNUNET_FS_tree_encoder_resume_get_data (const struct GNUNET_FS_TreeEncoder *te,
+ void **data, size_t * size);
/**
* @param data the resume data
* @param size the size of the resume data
*/
-void GNUNET_FS_tree_encoder_resume (struct GNUNET_FS_TreeEncoder *te,
- const void *data, size_t size);
+void
+GNUNET_FS_tree_encoder_resume (struct GNUNET_FS_TreeEncoder *te,
+ const void *data, size_t size);
#endif
#endif
GNUNET_asprintf (&ret, "%s%s%s.%s.%llu.%s.%s.%llu", GNUNET_FS_URI_PREFIX,
GNUNET_FS_URI_LOC_INFIX, (const char *) &keyhash,
(const char *) &queryhash,
- (unsigned long long) GNUNET_ntohll (uri->data.loc.fi.
- file_length), peerId,
+ (unsigned long long) GNUNET_ntohll (uri->data.loc.
+ fi.file_length), peerId,
peerSig,
(unsigned long long) uri->data.loc.expirationTime.abs_value);
GNUNET_free (peerSig);
s = GNUNET_STRINGS_relative_time_to_string (info->value.download.eta);
t = GNUNET_STRINGS_byte_size_fancy (info->value.download.completed *
1000LL /
- (info->value.download.duration.
- rel_value + 1));
+ (info->value.download.
+ duration.rel_value + 1));
fprintf (stdout,
_("Downloading `%s' at %llu/%llu (%s remaining, %s/s)\n"),
info->value.download.filename,
break;
case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED:
s = GNUNET_STRINGS_byte_size_fancy (info->value.download.completed * 1000 /
- (info->value.download.duration.
- rel_value + 1));
+ (info->value.download.
+ duration.rel_value + 1));
fprintf (stdout, _("Downloading `%s' done (%s/s).\n"),
info->value.download.filename, s);
GNUNET_free (s);
case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
fprintf (stdout, _("Publishing `%s' done.\n"),
info->value.publish.filename);
- s = GNUNET_FS_uri_to_string (info->value.publish.specifics.completed.
- chk_uri);
+ s = GNUNET_FS_uri_to_string (info->value.publish.specifics.
+ completed.chk_uri);
fprintf (stdout, _("URI is `%s'.\n"), s);
GNUNET_free (s);
if (info->value.publish.pctx == NULL)
uri = GNUNET_FS_uri_to_string (info->value.search.specifics.result.uri);
printf ("#%u:\n", cnt++);
filename =
- GNUNET_CONTAINER_meta_data_get_by_type (info->value.search.specifics.
- result.meta,
+ GNUNET_CONTAINER_meta_data_get_by_type (info->value.search.
+ specifics.result.meta,
EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME);
if (filename != NULL)
{
else
printf ("gnunet-download %s\n", uri);
if (verbose)
- GNUNET_CONTAINER_meta_data_iterate (info->value.search.specifics.result.
- meta, &item_printer, NULL);
+ GNUNET_CONTAINER_meta_data_iterate (info->value.search.specifics.
+ result.meta, &item_printer, NULL);
printf ("\n");
fflush (stdout);
GNUNET_free_non_null (filename);
* GNUNET_NO to process normally (load normal)
* GNUNET_SYSERR to process for free (load low)
*/
-int GSF_test_get_load_too_high_ (uint32_t priority);
+int
+GSF_test_get_load_too_high_ (uint32_t priority);
/**
*
* @param start time when the datastore request was issued
*/
-void GSF_update_datastore_delay_ (struct GNUNET_TIME_Absolute start);
+void
+GSF_update_datastore_delay_ (struct GNUNET_TIME_Absolute start);
* @param buf where to copy the message
* @return number of bytes copied to buf
*/
-static size_t peer_transmit_ready_cb (void *cls, size_t size, void *buf);
+static size_t
+peer_transmit_ready_cb (void *cls, size_t size, void *buf);
* long should the client wait until re-trying?
* @param preference current traffic preference for the given peer
*/
-static void core_reserve_callback (void *cls,
- const struct GNUNET_PeerIdentity *peer,
- struct GNUNET_BANDWIDTH_Value32NBO
- bandwidth_out, int32_t amount,
- struct GNUNET_TIME_Relative res_delay,
- uint64_t preference);
+static void
+core_reserve_callback (void *cls, const struct GNUNET_PeerIdentity *peer,
+ struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
+ int32_t amount, struct GNUNET_TIME_Relative res_delay,
+ uint64_t preference);
/**
GNUNET_assert (0 < cp->ppd.pending_replies--);
}
GNUNET_LOAD_update (cp->ppd.transmission_delay,
- GNUNET_TIME_absolute_get_duration (pth->
- transmission_request_start_time).
- rel_value);
+ GNUNET_TIME_absolute_get_duration
+ (pth->transmission_request_start_time).rel_value);
ret = pth->gmc (pth->gmc_cls, size, buf);
GNUNET_assert (NULL == pth->cth);
for (pos = cp->pth_head; pos != NULL; pos = pos->next)
#if DEBUG_FS && 0
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Migration already blocked for another %llu ms\n",
- (unsigned long long) GNUNET_TIME_absolute_get_remaining (cp->
- last_migration_block).
- rel_value);
+ (unsigned long long)
+ GNUNET_TIME_absolute_get_remaining
+ (cp->last_migration_block).rel_value);
#endif
return; /* already blocked */
}
* @param atsi performance data for the connection
* @return handle to connected peer entry
*/
-struct GSF_ConnectedPeer *GSF_peer_connect_handler_ (const struct
- GNUNET_PeerIdentity *peer,
- const struct
- GNUNET_TRANSPORT_ATS_Information
- *atsi);
+struct GSF_ConnectedPeer *
+GSF_peer_connect_handler_ (const struct GNUNET_PeerIdentity *peer,
+ const struct GNUNET_TRANSPORT_ATS_Information *atsi);
/**
* @param peer peer's identity
* @return NULL if this peer is not currently connected
*/
-struct GSF_ConnectedPeer *GSF_peer_get_ (const struct GNUNET_PeerIdentity
- *peer);
+struct GSF_ConnectedPeer *
+GSF_peer_get_ (const struct GNUNET_PeerIdentity *peer);
/**
* @param gmc_cls closure for gmc
* @return handle to cancel request
*/
-struct GSF_PeerTransmitHandle *GSF_peer_transmit_ (struct GSF_ConnectedPeer *cp,
- int is_query,
- uint32_t priority,
- struct GNUNET_TIME_Relative
- timeout, size_t size,
- GSF_GetMessageCallback gmc,
- void *gmc_cls);
+struct GSF_PeerTransmitHandle *
+GSF_peer_transmit_ (struct GSF_ConnectedPeer *cp, int is_query,
+ uint32_t priority, struct GNUNET_TIME_Relative timeout,
+ size_t size, GSF_GetMessageCallback gmc, void *gmc_cls);
/**
*
* @param pth request to cancel
*/
-void GSF_peer_transmit_cancel_ (struct GSF_PeerTransmitHandle *pth);
+void
+GSF_peer_transmit_cancel_ (struct GSF_PeerTransmitHandle *pth);
/**
* @param request_time time at which the original query was transmitted
* @param request_priority priority of the original request
*/
-void GSF_peer_update_performance_ (struct GSF_ConnectedPeer *cp,
- struct GNUNET_TIME_Absolute request_time,
- uint32_t request_priority);
+void
+GSF_peer_update_performance_ (struct GSF_ConnectedPeer *cp,
+ struct GNUNET_TIME_Absolute request_time,
+ uint32_t request_priority);
/**
* @param cp responding peer (will be updated)
* @param initiator_client local client on responsible for query
*/
-void GSF_peer_update_responder_client_ (struct GSF_ConnectedPeer *cp,
- struct GSF_LocalClient
- *initiator_client);
+void
+GSF_peer_update_responder_client_ (struct GSF_ConnectedPeer *cp,
+ struct GSF_LocalClient *initiator_client);
/**
* @param cp responding peer (will be updated)
* @param initiator_peer other peer responsible for query
*/
-void GSF_peer_update_responder_peer_ (struct GSF_ConnectedPeer *cp,
- const struct GSF_ConnectedPeer
- *initiator_peer);
+void
+GSF_peer_update_responder_peer_ (struct GSF_ConnectedPeer *cp,
+ const struct GSF_ConnectedPeer
+ *initiator_peer);
/**
* unless we see some further activity from it
* @param atsi status information
*/
-void GSF_peer_status_handler_ (void *cls,
- const struct GNUNET_PeerIdentity *peer,
- struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
- struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
- struct GNUNET_TIME_Absolute timeout,
- const struct GNUNET_TRANSPORT_ATS_Information
- *atsi);
+void
+GSF_peer_status_handler_ (void *cls, const struct GNUNET_PeerIdentity *peer,
+ struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
+ struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
+ struct GNUNET_TIME_Absolute timeout,
+ const struct GNUNET_TRANSPORT_ATS_Information *atsi);
/**
* @return GNUNET_OK to keep the connection open,
* GNUNET_SYSERR to close it (signal serious error)
*/
-int GSF_handle_p2p_migration_stop_ (void *cls,
- const struct GNUNET_PeerIdentity *other,
- const struct GNUNET_MessageHeader *message,
- const struct
- GNUNET_TRANSPORT_ATS_Information *atsi);
+int
+GSF_handle_p2p_migration_stop_ (void *cls,
+ const struct GNUNET_PeerIdentity *other,
+ const struct GNUNET_MessageHeader *message,
+ const struct GNUNET_TRANSPORT_ATS_Information
+ *atsi);
/**
* @param message the actual message
* @return pending request handle, NULL on error
*/
-struct GSF_PendingRequest *GSF_handle_p2p_query_ (const struct
- GNUNET_PeerIdentity *other,
- const struct
- GNUNET_MessageHeader
- *message);
+struct GSF_PendingRequest *
+GSF_handle_p2p_query_ (const struct GNUNET_PeerIdentity *other,
+ const struct GNUNET_MessageHeader *message);
/**
* @param cp peer to query
* @return performance data record for the peer
*/
-struct GSF_PeerPerformanceData *GSF_get_peer_performance_data_ (struct
- GSF_ConnectedPeer
- *cp);
+struct GSF_PeerPerformanceData *
+GSF_get_peer_performance_data_ (struct GSF_ConnectedPeer *cp);
/**
* @param cp peer to ask
* @param block_time until when to block
*/
-void GSF_block_peer_migration_ (struct GSF_ConnectedPeer *cp,
- struct GNUNET_TIME_Relative block_time);
+void
+GSF_block_peer_migration_ (struct GSF_ConnectedPeer *cp,
+ struct GNUNET_TIME_Relative block_time);
/**
* @param cls unused
* @param peer identity of peer that connected
*/
-void GSF_peer_disconnect_handler_ (void *cls,
- const struct GNUNET_PeerIdentity *peer);
+void
+GSF_peer_disconnect_handler_ (void *cls,
+ const struct GNUNET_PeerIdentity *peer);
/**
*
* @param lc handle to the local client (henceforth invalid)
*/
-void GSF_handle_local_client_disconnect_ (const struct GSF_LocalClient *lc);
+void
+GSF_handle_local_client_disconnect_ (const struct GSF_LocalClient *lc);
/**
* @param cp peer to reserve bandwidth from
* @param pref preference change
*/
-void GSF_connected_peer_change_preference_ (struct GSF_ConnectedPeer *cp,
- uint64_t pref);
+void
+GSF_connected_peer_change_preference_ (struct GSF_ConnectedPeer *cp,
+ uint64_t pref);
/**
* @param cp peer to reserve bandwidth from
* @param id identity to set (written to)
*/
-void GSF_connected_peer_get_identity_ (const struct GSF_ConnectedPeer *cp,
- struct GNUNET_PeerIdentity *id);
+void
+GSF_connected_peer_get_identity_ (const struct GSF_ConnectedPeer *cp,
+ struct GNUNET_PeerIdentity *id);
/**
* @param it function to call for each peer
* @param it_cls closure for it
*/
-void GSF_iterate_connected_peers_ (GSF_ConnectedPeerIterator it, void *it_cls);
+void
+GSF_iterate_connected_peers_ (GSF_ConnectedPeerIterator it, void *it_cls);
/**
* Initialize peer management subsystem.
*/
-void GSF_connected_peer_init_ (void);
+void
+GSF_connected_peer_init_ (void);
/**
* Shutdown peer management subsystem.
*/
-void GSF_connected_peer_done_ (void);
+void
+GSF_connected_peer_done_ (void);
#endif
("Index request received for file `%s' is already indexed as `%s'. Permitting anyway.\n"),
ii->filename,
(const char *) GNUNET_CONTAINER_multihashmap_get (ifm,
- &ii->
- file_id));
+ &ii->file_id));
GNUNET_SERVER_transmit_context_append_data (ii->tc, NULL, 0,
GNUNET_MESSAGE_TYPE_FS_INDEX_START_OK);
GNUNET_SERVER_transmit_context_run (ii->tc, GNUNET_TIME_UNIT_MINUTES);
prev->next = next;
GNUNET_break (GNUNET_OK ==
GNUNET_CONTAINER_multihashmap_remove (ifm, &pos->file_id,
- (void *) pos->
- filename));
+ (void *)
+ pos->filename));
GNUNET_free (pos);
found = GNUNET_YES;
}
* @param cont_cls closure for cont
* @return GNUNET_OK on success
*/
-int GNUNET_FS_handle_on_demand_block (const GNUNET_HashCode * key,
- uint32_t size, const void *data,
- enum GNUNET_BLOCK_Type type,
- uint32_t priority, uint32_t anonymity,
- struct GNUNET_TIME_Absolute expiration,
- uint64_t uid,
- GNUNET_DATASTORE_DatumProcessor cont,
- void *cont_cls);
+int
+GNUNET_FS_handle_on_demand_block (const GNUNET_HashCode * key, uint32_t size,
+ const void *data, enum GNUNET_BLOCK_Type type,
+ uint32_t priority, uint32_t anonymity,
+ struct GNUNET_TIME_Absolute expiration,
+ uint64_t uid,
+ GNUNET_DATASTORE_DatumProcessor cont,
+ void *cont_cls);
/**
* Handle INDEX_START-message.
* @param client identification of the client
* @param message the actual message
*/
-void GNUNET_FS_handle_index_start (void *cls,
- struct GNUNET_SERVER_Client *client,
- const struct GNUNET_MessageHeader *message);
+void
+GNUNET_FS_handle_index_start (void *cls, struct GNUNET_SERVER_Client *client,
+ const struct GNUNET_MessageHeader *message);
/**
* @param client identification of the client
* @param message the actual message
*/
-void GNUNET_FS_handle_index_list_get (void *cls,
- struct GNUNET_SERVER_Client *client,
- const struct GNUNET_MessageHeader
- *message);
+void
+GNUNET_FS_handle_index_list_get (void *cls, struct GNUNET_SERVER_Client *client,
+ const struct GNUNET_MessageHeader *message);
/**
* @param client identification of the client
* @param message the actual message
*/
-void GNUNET_FS_handle_unindex (void *cls, struct GNUNET_SERVER_Client *client,
- const struct GNUNET_MessageHeader *message);
+void
+GNUNET_FS_handle_unindex (void *cls, struct GNUNET_SERVER_Client *client,
+ const struct GNUNET_MessageHeader *message);
/**
* @param d datastore to use
* @return GNUNET_OK on success
*/
-int GNUNET_FS_indexing_init (const struct GNUNET_CONFIGURATION_Handle *c,
- struct GNUNET_DATASTORE_Handle *d);
+int
+GNUNET_FS_indexing_init (const struct GNUNET_CONFIGURATION_Handle *c,
+ struct GNUNET_DATASTORE_Handle *d);
/**
* Shutdown the module.
*/
-void GNUNET_FS_indexing_done (void);
+void
+GNUNET_FS_indexing_done (void);
#endif
* @param client handle of the client
* @return handle to local client entry
*/
-struct GSF_LocalClient *GSF_local_client_lookup_ (struct GNUNET_SERVER_Client
- *client);
+struct GSF_LocalClient *
+GSF_local_client_lookup_ (struct GNUNET_SERVER_Client *client);
/**
* @param message the actual message
* @return pending request handle for the request, NULL on error
*/
-struct GSF_PendingRequest *GSF_local_client_start_search_handler_ (struct
- GNUNET_SERVER_Client
- *client,
- const struct
- GNUNET_MessageHeader
- *message);
+struct GSF_PendingRequest *
+GSF_local_client_start_search_handler_ (struct GNUNET_SERVER_Client *client,
+ const struct GNUNET_MessageHeader
+ *message);
/**
* @param lc recipient
* @param msg message to transmit to client
*/
-void GSF_local_client_transmit_ (struct GSF_LocalClient *lc,
- const struct GNUNET_MessageHeader *msg);
+void
+GSF_local_client_transmit_ (struct GSF_LocalClient *lc,
+ const struct GNUNET_MessageHeader *msg);
/**
* @param cls unused
* @param client handle of the client
*/
-void GSF_client_disconnect_handler_ (void *cls,
- struct GNUNET_SERVER_Client *client);
+void
+GSF_client_disconnect_handler_ (void *cls, struct GNUNET_SERVER_Client *client);
#endif
* @param cls the 'struct GSF_ConnectedPeer' for transmission
* @param tc scheduler context
*/
-static void schedule_peer_transmission (void *cls,
- const struct
- GNUNET_SCHEDULER_TaskContext *tc);
+static void
+schedule_peer_transmission (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
#endif
GNUNET_assert (rp->hn == NULL);
- if (GNUNET_TIME_absolute_get_remaining (rp->earliest_transmission).
- rel_value == 0)
+ if (GNUNET_TIME_absolute_get_remaining (rp->earliest_transmission).rel_value
+ == 0)
rp->hn = GNUNET_CONTAINER_heap_insert (pp->priority_heap, rp, rp->priority);
else
rp->hn =
}
/* move ready requests to priority queue */
while ((NULL != (rp = GNUNET_CONTAINER_heap_peek (pp->delay_heap))) &&
- (GNUNET_TIME_absolute_get_remaining (rp->earliest_transmission).
- rel_value == 0))
+ (GNUNET_TIME_absolute_get_remaining
+ (rp->earliest_transmission).rel_value == 0))
{
GNUNET_assert (rp == GNUNET_CONTAINER_heap_remove_root (pp->delay_heap));
rp->hn = GNUNET_CONTAINER_heap_insert (pp->priority_heap, rp, rp->priority);
#if DEBUG_FS
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Sleeping for %llu ms before retrying requests on plan %p.\n",
- (unsigned long long) GNUNET_TIME_absolute_get_remaining (rp->
- earliest_transmission).
- rel_value, pp);
+ (unsigned long long)
+ GNUNET_TIME_absolute_get_remaining
+ (rp->earliest_transmission).rel_value, pp);
#endif
pp->task =
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining
* @param cp peer with the entry
* @param pr request with the entry
*/
-void GSF_plan_add_ (struct GSF_ConnectedPeer *cp,
- struct GSF_PendingRequest *pr);
+void
+GSF_plan_add_ (struct GSF_ConnectedPeer *cp, struct GSF_PendingRequest *pr);
/**
*
* @param cp connected peer
*/
-void GSF_plan_notify_peer_disconnect_ (const struct GSF_ConnectedPeer *cp);
+void
+GSF_plan_notify_peer_disconnect_ (const struct GSF_ConnectedPeer *cp);
/**
*
* @param pr request that is done
*/
-void GSF_plan_notify_request_done_ (struct GSF_PendingRequest *pr);
+void
+GSF_plan_notify_request_done_ (struct GSF_PendingRequest *pr);
/**
* Initialize plan subsystem.
*/
-void GSF_plan_init (void);
+void
+GSF_plan_init (void);
/**
* Shutdown plan subsystem.
*/
-void GSF_plan_done (void);
+void
+GSF_plan_done (void);
#endif
/* short cut: stop processing early, no BF-update, etc. */
update_request_performance_data (prq, pr);
GNUNET_LOAD_update (GSF_rt_entry_lifetime,
- GNUNET_TIME_absolute_get_duration (pr->public_data.
- start_time).
- rel_value);
+ GNUNET_TIME_absolute_get_duration (pr->
+ public_data.start_time).rel_value);
/* pass on to other peers / local clients */
pr->rh (pr->rh_cls, prq->eval, pr, prq->anonymity_level, prq->expiration,
prq->type, prq->data, prq->size);
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
_("Datastore lookup already took %llu ms!\n"),
- (unsigned long long) GNUNET_TIME_absolute_get_duration (pr->
- qe_start).
- rel_value);
+ (unsigned long long)
+ GNUNET_TIME_absolute_get_duration (pr->qe_start).rel_value);
pr->warn_task =
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, &warn_delay_task,
pr);
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
_("On-demand lookup already took %llu ms!\n"),
- (unsigned long long) GNUNET_TIME_absolute_get_duration (pr->
- qe_start).
- rel_value);
+ (unsigned long long)
+ GNUNET_TIME_absolute_get_duration (pr->qe_start).rel_value);
pr->warn_task =
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES,
&odc_warn_delay_task, pr);
GNUNET_BLOCK_TYPE_FS_DBLOCK ?
GNUNET_BLOCK_TYPE_ANY : pr->public_data.type,
(0 !=
- (GSF_PRO_PRIORITY_UNLIMITED & pr->
- public_data.options)) ? UINT_MAX : 1
+ (GSF_PRO_PRIORITY_UNLIMITED &
+ pr->public_data.options)) ? UINT_MAX : 1
/* queue priority */ ,
(0 !=
- (GSF_PRO_PRIORITY_UNLIMITED & pr->
- public_data.options)) ? UINT_MAX : 1
+ (GSF_PRO_PRIORITY_UNLIMITED &
+ pr->public_data.options)) ? UINT_MAX : 1
/* max queue size */ ,
GNUNET_TIME_UNIT_FOREVER_REL,
&process_local_reply, pr);
GNUNET_BLOCK_TYPE_FS_DBLOCK ?
GNUNET_BLOCK_TYPE_ANY : pr->public_data.type,
(0 !=
- (GSF_PRO_PRIORITY_UNLIMITED & pr->
- public_data.options)) ? UINT_MAX : 1
+ (GSF_PRO_PRIORITY_UNLIMITED &
+ pr->public_data.options)) ? UINT_MAX : 1
/* queue priority */ ,
(0 !=
- (GSF_PRO_PRIORITY_UNLIMITED & pr->
- public_data.options)) ? UINT_MAX : 1
+ (GSF_PRO_PRIORITY_UNLIMITED &
+ pr->public_data.options)) ? UINT_MAX : 1
/* max queue size */ ,
GNUNET_TIME_UNIT_FOREVER_REL,
&process_local_reply, pr);
GNUNET_BLOCK_TYPE_FS_DBLOCK ?
GNUNET_BLOCK_TYPE_ANY : pr->public_data.type,
(0 !=
- (GSF_PRO_PRIORITY_UNLIMITED & pr->public_data.
- options)) ? UINT_MAX : 1
+ (GSF_PRO_PRIORITY_UNLIMITED & pr->
+ public_data.options)) ? UINT_MAX : 1
/* queue priority */ ,
(0 !=
- (GSF_PRO_PRIORITY_UNLIMITED & pr->public_data.
- options)) ? UINT_MAX : 1
+ (GSF_PRO_PRIORITY_UNLIMITED & pr->
+ public_data.options)) ? UINT_MAX : 1
/* max queue size */ ,
GNUNET_TIME_UNIT_FOREVER_REL,
&process_local_reply, pr);
GNUNET_BLOCK_TYPE_FS_DBLOCK ?
GNUNET_BLOCK_TYPE_ANY : pr->public_data.type,
(0 !=
- (GSF_PRO_PRIORITY_UNLIMITED & pr->public_data.
- options)) ? UINT_MAX : 1
+ (GSF_PRO_PRIORITY_UNLIMITED & pr->
+ public_data.options)) ? UINT_MAX : 1
/* queue priority */ ,
(0 !=
- (GSF_PRO_PRIORITY_UNLIMITED & pr->public_data.
- options)) ? UINT_MAX : 1
+ (GSF_PRO_PRIORITY_UNLIMITED & pr->
+ public_data.options)) ? UINT_MAX : 1
/* max queue size */ ,
GNUNET_TIME_UNIT_FOREVER_REL,
&process_local_reply, pr);
* @param rh_cls closure for rh
* @return handle for the new pending request
*/
-struct GSF_PendingRequest *GSF_pending_request_create_ (enum
- GSF_PendingRequestOptions
- options,
- enum GNUNET_BLOCK_Type
- type,
- const GNUNET_HashCode *
- query,
- const GNUNET_HashCode *
- namespace,
- const struct
- GNUNET_PeerIdentity
- *target,
- const char *bf_data,
- size_t bf_size,
- uint32_t mingle,
- uint32_t
- anonymity_level,
- uint32_t priority,
- int32_t ttl,
- GNUNET_PEER_Id
- sender_pid,
- const GNUNET_HashCode *
- replies_seen,
- unsigned int
- replies_seen_count,
- GSF_PendingRequestReplyHandler
- rh, void *rh_cls);
+struct GSF_PendingRequest *
+GSF_pending_request_create_ (enum GSF_PendingRequestOptions options,
+ enum GNUNET_BLOCK_Type type,
+ const GNUNET_HashCode * query,
+ const GNUNET_HashCode * namespace,
+ const struct GNUNET_PeerIdentity *target,
+ const char *bf_data, size_t bf_size,
+ uint32_t mingle, uint32_t anonymity_level,
+ uint32_t priority, int32_t ttl,
+ GNUNET_PEER_Id sender_pid,
+ const GNUNET_HashCode * replies_seen,
+ unsigned int replies_seen_count,
+ GSF_PendingRequestReplyHandler rh, void *rh_cls);
/**
* @param replies_seen hash codes of replies that we've seen
* @param replies_seen_count size of the replies_seen array
*/
-void GSF_pending_request_update_ (struct GSF_PendingRequest *pr,
- const GNUNET_HashCode * replies_seen,
- unsigned int replies_seen_count);
+void
+GSF_pending_request_update_ (struct GSF_PendingRequest *pr,
+ const GNUNET_HashCode * replies_seen,
+ unsigned int replies_seen_count);
/**
* @param pr pending request
* @return associated public data
*/
-struct GSF_PendingRequestData *GSF_pending_request_get_data_ (struct
- GSF_PendingRequest
- *pr);
+struct GSF_PendingRequestData *
+GSF_pending_request_get_data_ (struct GSF_PendingRequest *pr);
/**
* @param pra another pending request
* @return GNUNET_OK if the requests are compatible
*/
-int GSF_pending_request_is_compatible_ (struct GSF_PendingRequest *pra,
- struct GSF_PendingRequest *prb);
+int
+GSF_pending_request_is_compatible_ (struct GSF_PendingRequest *pra,
+ struct GSF_PendingRequest *prb);
/**
* @param buf where to copy the message (can be NULL)
* @return number of bytes needed (if buf_size too small) or used
*/
-size_t GSF_pending_request_get_message_ (struct GSF_PendingRequest
- *pr, size_t buf_size,
- void *buf);
+size_t
+GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr,
+ size_t buf_size, void *buf);
/**
* @param pr request to cancel
* @param full_cleanup fully purge the request
*/
-void GSF_pending_request_cancel_ (struct GSF_PendingRequest *pr,
- int full_cleanup);
+void
+GSF_pending_request_cancel_ (struct GSF_PendingRequest *pr, int full_cleanup);
/**
* @param it function to call for each request
* @param cls closure for it
*/
-void GSF_iterate_pending_requests_ (GSF_PendingRequestIterator it, void *cls);
+void
+GSF_iterate_pending_requests_ (GSF_PendingRequestIterator it, void *cls);
/**
* GNUNET_SYSERR if the message was malformed (close connection,
* do not cache under any circumstances)
*/
-int GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp,
- const struct GNUNET_MessageHeader *message);
+int
+GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp,
+ const struct GNUNET_MessageHeader *message);
/**
*
* @param pr the pending request to process
*/
-void GSF_dht_lookup_ (struct GSF_PendingRequest *pr);
+void
+GSF_dht_lookup_ (struct GSF_PendingRequest *pr);
/**
* @param cont function to call at the end
* @param cont_cls closure for cont
*/
-void GSF_local_lookup_ (struct GSF_PendingRequest *pr,
- GSF_LocalLookupContinuation cont, void *cont_cls);
+void
+GSF_local_lookup_ (struct GSF_PendingRequest *pr,
+ GSF_LocalLookupContinuation cont, void *cont_cls);
/**
* Setup the subsystem.
*/
-void GSF_pending_request_init_ (void);
+void
+GSF_pending_request_init_ (void);
/**
* Shutdown the subsystem.
*/
-void GSF_pending_request_done_ (void);
+void
+GSF_pending_request_done_ (void);
#endif
/**
* Find content for migration to this peer.
*/
-static void find_content (struct MigrationReadyPeer *mrp);
+static void
+find_content (struct MigrationReadyPeer *mrp);
/**
* If the migration task is not currently running, consider
* (re)scheduling it with the appropriate delay.
*/
-static void consider_gathering (void);
+static void
+consider_gathering (void);
/**
* @param cls unused
* @param tc scheduler context (also unused)
*/
-static void gather_migration_blocks (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext
- *tc);
+static void
+gather_migration_blocks (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
/**
* Setup the module.
*/
-void GSF_push_init_ (void);
+void
+GSF_push_init_ (void);
/**
* Shutdown the module.
*/
-void GSF_push_done_ (void);
+void
+GSF_push_done_ (void);
/**
*
* @param peer handle for the peer that connected
*/
-void GSF_push_start_ (struct GSF_ConnectedPeer *peer);
+void
+GSF_push_start_ (struct GSF_ConnectedPeer *peer);
/**
*
* @param peer handle for the peer that disconnected
*/
-void GSF_push_stop_ (struct GSF_ConnectedPeer *peer);
+void
+GSF_push_stop_ (struct GSF_ConnectedPeer *peer);
#endif
* @param cls type of blocks to gather
* @param tc scheduler context (unused)
*/
-static void gather_dht_put_blocks (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext
- *tc);
+static void
+gather_dht_put_blocks (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
/**
* Setup the module.
*/
-void GSF_put_init_ (void);
+void
+GSF_put_init_ (void);
/**
* Shutdown the module.
*/
-void GSF_put_done_ (void);
+void
+GSF_put_done_ (void);
#endif
/**
* Function that gathers stats from all daemons.
*/
-static void stat_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+stat_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
sm->stat =
GNUNET_STATISTICS_create ("<driver>",
GNUNET_FS_TEST_get_configuration (daemons,
- sm->
- daemon));
+ sm->daemon));
GNUNET_SCHEDULER_add_now (&stat_run, sm);
}
else
/**
* Function that gathers stats from all daemons.
*/
-static void stat_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+stat_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
sm->stat =
GNUNET_STATISTICS_create ("<driver>",
GNUNET_FS_TEST_get_configuration (daemons,
- sm->
- daemon));
+ sm->daemon));
GNUNET_SCHEDULER_add_now (&stat_run, sm);
}
else
(unsigned long long) event->value.publish.completed,
(unsigned long long) event->value.publish.size,
event->value.publish.specifics.progress.depth,
- (unsigned long long) event->value.publish.specifics.progress.
- offset);
+ (unsigned long long) event->value.publish.specifics.
+ progress.offset);
#endif
break;
case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
printf ("Publishing complete, %llu kb/s.\n",
(unsigned long long) (FILESIZE * 1000LL /
(1 +
- GNUNET_TIME_absolute_get_duration (start).
- rel_value) / 1024LL));
+ GNUNET_TIME_absolute_get_duration
+ (start).rel_value) / 1024LL));
GAUGER ("FS", "Publishing speed (insertion)",
(unsigned long long) (FILESIZE * 1000LL /
(1 +
- GNUNET_TIME_absolute_get_duration (start).
- rel_value) / 1024LL), "kb/s");
+ GNUNET_TIME_absolute_get_duration
+ (start).rel_value) / 1024LL), "kb/s");
fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst");
start = GNUNET_TIME_absolute_get ();
download =
GNUNET_FS_download_start (fs,
- event->value.publish.specifics.completed.
- chk_uri, NULL, fn, NULL, 0, FILESIZE, 1,
- GNUNET_FS_DOWNLOAD_OPTION_NONE, "download",
- NULL);
+ event->value.publish.specifics.
+ completed.chk_uri, NULL, fn, NULL, 0,
+ FILESIZE, 1, GNUNET_FS_DOWNLOAD_OPTION_NONE,
+ "download", NULL);
GNUNET_assert (download != NULL);
break;
case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED:
printf ("Download complete, %llu kb/s.\n",
(unsigned long long) (FILESIZE * 1000LL /
(1 +
- GNUNET_TIME_absolute_get_duration (start).
- rel_value) / 1024LL));
+ GNUNET_TIME_absolute_get_duration
+ (start).rel_value) / 1024LL));
GAUGER ("FS", "Local download speed (inserted)",
(unsigned long long) (FILESIZE * 1000LL /
(1 +
- GNUNET_TIME_absolute_get_duration (start).
- rel_value) / 1024LL), "kb/s");
+ GNUNET_TIME_absolute_get_duration
+ (start).rel_value) / 1024LL), "kb/s");
GNUNET_SCHEDULER_add_now (&abort_download_task, NULL);
break;
case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS:
(unsigned long long) event->value.download.completed,
(unsigned long long) event->value.download.size,
event->value.download.specifics.progress.depth,
- (unsigned long long) event->value.download.specifics.progress.
- offset);
+ (unsigned long long) event->value.download.specifics.
+ progress.offset);
#endif
break;
case GNUNET_FS_STATUS_PUBLISH_ERROR:
(unsigned long long) event->value.publish.completed,
(unsigned long long) event->value.publish.size,
event->value.publish.specifics.progress.depth,
- (unsigned long long) event->value.publish.specifics.progress.
- offset);
+ (unsigned long long) event->value.publish.specifics.
+ progress.offset);
#endif
break;
case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
printf ("Publishing complete, %llu kbps.\n",
(unsigned long long) (FILESIZE * 1000LL /
(1 +
- GNUNET_TIME_absolute_get_duration (start).
- rel_value) / 1024LL));
+ GNUNET_TIME_absolute_get_duration
+ (start).rel_value) / 1024LL));
GAUGER ("FS", "Publishing speed (indexing)",
(unsigned long long) (FILESIZE * 1000LL /
(1 +
- GNUNET_TIME_absolute_get_duration (start).
- rel_value) / 1024LL), "kb/s");
+ GNUNET_TIME_absolute_get_duration
+ (start).rel_value) / 1024LL), "kb/s");
fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst");
start = GNUNET_TIME_absolute_get ();
download =
GNUNET_FS_download_start (fs,
- event->value.publish.specifics.completed.
- chk_uri, NULL, fn, NULL, 0, FILESIZE, 1,
- GNUNET_FS_DOWNLOAD_OPTION_NONE, "download",
- NULL);
+ event->value.publish.specifics.
+ completed.chk_uri, NULL, fn, NULL, 0,
+ FILESIZE, 1, GNUNET_FS_DOWNLOAD_OPTION_NONE,
+ "download", NULL);
GNUNET_assert (download != NULL);
break;
case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED:
printf ("Download complete, %llu kbps.\n",
(unsigned long long) (FILESIZE * 1000LL /
(1 +
- GNUNET_TIME_absolute_get_duration (start).
- rel_value) / 1024LL));
+ GNUNET_TIME_absolute_get_duration
+ (start).rel_value) / 1024LL));
GAUGER ("FS", "Local download speed (indexed)",
(unsigned long long) (FILESIZE * 1000LL /
(1 +
- GNUNET_TIME_absolute_get_duration (start).
- rel_value) / 1024LL), "kb/s");
+ GNUNET_TIME_absolute_get_duration
+ (start).rel_value) / 1024LL), "kb/s");
GNUNET_SCHEDULER_add_now (&abort_download_task, NULL);
break;
case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS:
(unsigned long long) event->value.download.completed,
(unsigned long long) event->value.download.size,
event->value.download.specifics.progress.depth,
- (unsigned long long) event->value.download.specifics.progress.
- offset);
+ (unsigned long long) event->value.download.specifics.
+ progress.offset);
#endif
break;
case GNUNET_FS_STATUS_PUBLISH_ERROR:
}
-static void *progress_cb (void *cls,
- const struct GNUNET_FS_ProgressInfo *event);
+static void *
+progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event);
static void
(unsigned long long) event->value.publish.completed,
(unsigned long long) event->value.publish.size,
event->value.publish.specifics.progress.depth,
- (unsigned long long) event->value.publish.specifics.progress.
- offset);
+ (unsigned long long) event->value.publish.specifics.
+ progress.offset);
#endif
break;
case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
printf ("Publishing complete, %llu kbps.\n",
(unsigned long long) (FILESIZE * 1000LL /
(1 +
- GNUNET_TIME_absolute_get_duration (start).
- rel_value) / 1024LL));
+ GNUNET_TIME_absolute_get_duration
+ (start).rel_value) / 1024LL));
fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst");
start = GNUNET_TIME_absolute_get ();
GNUNET_assert (download == NULL);
printf ("Download complete, %llu kbps.\n",
(unsigned long long) (FILESIZE * 1000LL /
(1 +
- GNUNET_TIME_absolute_get_duration (start).
- rel_value) / 1024LL));
+ GNUNET_TIME_absolute_get_duration
+ (start).rel_value) / 1024LL));
GNUNET_SCHEDULER_add_now (&abort_download_task, NULL);
break;
case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS:
(unsigned long long) event->value.download.completed,
(unsigned long long) event->value.download.size,
event->value.download.specifics.progress.depth,
- (unsigned long long) event->value.download.specifics.progress.
- offset);
+ (unsigned long long) event->value.download.specifics.
+ progress.offset);
#endif
break;
case GNUNET_FS_STATUS_PUBLISH_ERROR:
printf ("Publish complete, %llu kbps.\n",
(unsigned long long) (FILESIZE * 1000 /
(1 +
- GNUNET_TIME_absolute_get_duration (start).
- rel_value) / 1024));
+ GNUNET_TIME_absolute_get_duration
+ (start).rel_value) / 1024));
if (0 == strcmp ("list_indexed-context-dir", event->value.publish.cctx))
GNUNET_SCHEDULER_add_continuation (&list_indexed_task, NULL,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
(unsigned long long) event->value.publish.completed,
(unsigned long long) event->value.publish.size,
event->value.publish.specifics.progress.depth,
- (unsigned long long) event->value.publish.specifics.progress.
- offset);
+ (unsigned long long) event->value.publish.specifics.
+ progress.offset);
#endif
break;
case GNUNET_FS_STATUS_PUBLISH_ERROR:
printf ("Publish complete, %llu kbps.\n",
(unsigned long long) (FILESIZE * 1000 /
(1 +
- GNUNET_TIME_absolute_get_duration (start).
- rel_value) / 1024));
+ GNUNET_TIME_absolute_get_duration
+ (start).rel_value) / 1024));
if (0 == strcmp ("publish-context-dir", event->value.publish.cctx))
GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
(unsigned long long) event->value.publish.completed,
(unsigned long long) event->value.publish.size,
event->value.publish.specifics.progress.depth,
- (unsigned long long) event->value.publish.specifics.progress.
- offset);
+ (unsigned long long) event->value.publish.specifics.
+ progress.offset);
#endif
break;
case GNUNET_FS_STATUS_PUBLISH_ERROR:
}
-static void *progress_cb (void *cls,
- const struct GNUNET_FS_ProgressInfo *event);
+static void *
+progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event);
static void
printf ("Publish complete, %llu kbps.\n",
(unsigned long long) (FILESIZE * 1000LL /
(1 +
- GNUNET_TIME_absolute_get_duration (start).
- rel_value) / 1024));
+ GNUNET_TIME_absolute_get_duration
+ (start).rel_value) / 1024));
if (0 == strcmp ("publish-context-dir", event->value.publish.cctx))
GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL);
break;
(unsigned long long) event->value.publish.completed,
(unsigned long long) event->value.publish.size,
event->value.publish.specifics.progress.depth,
- (unsigned long long) event->value.publish.specifics.progress.
- offset);
+ (unsigned long long) event->value.publish.specifics.
+ progress.offset);
#endif
break;
case GNUNET_FS_STATUS_PUBLISH_SUSPEND:
if (NULL == publish)
{
GNUNET_assert (GNUNET_YES ==
- GNUNET_FS_file_information_is_directory (event->value.
- publish.fi));
+ GNUNET_FS_file_information_is_directory (event->
+ value.publish.
+ fi));
publish = event->value.publish.pc;
return "publish-context-dir";
}
(unsigned long long) event->value.publish.completed,
(unsigned long long) event->value.publish.size,
event->value.publish.specifics.progress.depth,
- (unsigned long long) event->value.publish.specifics.progress.
- offset);
+ (unsigned long long) event->value.publish.specifics.
+ progress.offset);
#endif
break;
case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
}
-static void *progress_cb (void *cls,
- const struct GNUNET_FS_ProgressInfo *event);
+static void *
+progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event);
static void
(unsigned long long) event->value.publish.completed,
(unsigned long long) event->value.publish.size,
event->value.publish.specifics.progress.depth,
- (unsigned long long) event->value.publish.specifics.progress.
- offset);
+ (unsigned long long) event->value.publish.specifics.
+ progress.offset);
#endif
break;
case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
(unsigned long long) event->value.publish.completed,
(unsigned long long) event->value.publish.size,
event->value.publish.specifics.progress.depth,
- (unsigned long long) event->value.publish.specifics.progress.
- offset);
+ (unsigned long long) event->value.publish.specifics.
+ progress.offset);
#endif
break;
case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
printf ("Publishing complete, %llu kbps.\n",
(unsigned long long) (FILESIZE * 1000 /
(1 +
- GNUNET_TIME_absolute_get_duration (start).
- rel_value) / 1024));
+ GNUNET_TIME_absolute_get_duration
+ (start).rel_value) / 1024));
start = GNUNET_TIME_absolute_get ();
unindex = GNUNET_FS_unindex_start (fs, fn, "unindex");
GNUNET_assert (unindex != NULL);
printf ("Unindex complete, %llu kbps.\n",
(unsigned long long) (FILESIZE * 1000 /
(1 +
- GNUNET_TIME_absolute_get_duration (start).
- rel_value) / 1024));
+ GNUNET_TIME_absolute_get_duration
+ (start).rel_value) / 1024));
GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, NULL,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
break;
(unsigned long long) event->value.unindex.completed,
(unsigned long long) event->value.unindex.size,
event->value.unindex.specifics.progress.depth,
- (unsigned long long) event->value.unindex.specifics.progress.
- offset);
+ (unsigned long long) event->value.unindex.specifics.
+ progress.offset);
#endif
break;
case GNUNET_FS_STATUS_PUBLISH_ERROR:
}
-static void *progress_cb (void *cls,
- const struct GNUNET_FS_ProgressInfo *event);
+static void *
+progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event);
static void
(unsigned long long) event->value.publish.completed,
(unsigned long long) event->value.publish.size,
event->value.publish.specifics.progress.depth,
- (unsigned long long) event->value.publish.specifics.progress.
- offset);
+ (unsigned long long) event->value.publish.specifics.
+ progress.offset);
#endif
break;
case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
printf ("Publishing complete, %llu kbps.\n",
(unsigned long long) (FILESIZE * 1000 /
(1 +
- GNUNET_TIME_absolute_get_duration (start).
- rel_value) / 1024));
+ GNUNET_TIME_absolute_get_duration
+ (start).rel_value) / 1024));
start = GNUNET_TIME_absolute_get ();
unindex = GNUNET_FS_unindex_start (fs, fn, "unindex");
GNUNET_assert (unindex != NULL);
printf ("Unindex complete, %llu kbps.\n",
(unsigned long long) (FILESIZE * 1000 /
(1 +
- GNUNET_TIME_absolute_get_duration (start).
- rel_value) / 1024));
+ GNUNET_TIME_absolute_get_duration
+ (start).rel_value) / 1024));
GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, NULL,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
break;
(unsigned long long) event->value.unindex.completed,
(unsigned long long) event->value.unindex.size,
event->value.unindex.specifics.progress.depth,
- (unsigned long long) event->value.unindex.specifics.progress.
- offset);
+ (unsigned long long) event->value.unindex.specifics.
+ progress.offset);
#endif
break;
case GNUNET_FS_STATUS_PUBLISH_SUSPEND:
* Method to save hostlist to a file during hostlist client shutdown
* @param shutdown set if called because of shutdown, entries in linked list will be destroyed
*/
-static void save_hostlist_file (int shutdown);
+static void
+save_hostlist_file (int shutdown);
/**
* @param cls closure, unused
* @param tc task context, unused
*/
-static void task_download (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+task_download (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
* @param learn set if client is learning new hostlists
* @return GNUNET_OK on success
*/
-int GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c,
- struct GNUNET_STATISTICS_Handle *st,
- GNUNET_CORE_ConnectEventHandler *ch,
- GNUNET_CORE_DisconnectEventHandler *dh,
- GNUNET_CORE_MessageCallback *msgh, int learn);
+int
+GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c,
+ struct GNUNET_STATISTICS_Handle *st,
+ GNUNET_CORE_ConnectEventHandler *ch,
+ GNUNET_CORE_DisconnectEventHandler *dh,
+ GNUNET_CORE_MessageCallback *msgh, int learn);
/**
* Stop downloading hostlists from hostlist servers as necessary.
*/
-void GNUNET_HOSTLIST_client_stop (void);
+void
+GNUNET_HOSTLIST_client_stop (void);
#endif
* Function that queries MHD's select sets and
* starts the task waiting for them.
*/
-static GNUNET_SCHEDULER_TaskIdentifier prepare_daemon (struct MHD_Daemon
- *daemon_handle);
+static GNUNET_SCHEDULER_TaskIdentifier
+prepare_daemon (struct MHD_Daemon *daemon_handle);
/**
*
* @return GNUNET_OK on success
*/
-int GNUNET_HOSTLIST_server_start (const struct GNUNET_CONFIGURATION_Handle *c,
- struct GNUNET_STATISTICS_Handle *st,
- struct GNUNET_CORE_Handle *core,
- GNUNET_CORE_ConnectEventHandler *server_ch,
- GNUNET_CORE_DisconnectEventHandler *server_dh,
- int advertise);
+int
+GNUNET_HOSTLIST_server_start (const struct GNUNET_CONFIGURATION_Handle *c,
+ struct GNUNET_STATISTICS_Handle *st,
+ struct GNUNET_CORE_Handle *core,
+ GNUNET_CORE_ConnectEventHandler *server_ch,
+ GNUNET_CORE_DisconnectEventHandler *server_dh,
+ int advertise);
/**
* Stop server offering our hostlist.
*/
-void GNUNET_HOSTLIST_server_stop (void);
+void
+GNUNET_HOSTLIST_server_stop (void);
#endif
* @param service service that *this* process is implementing/providing, can be NULL
* @return context to use for further ARM operations, NULL on error
*/
-struct GNUNET_ARM_Handle *GNUNET_ARM_connect (const struct
- GNUNET_CONFIGURATION_Handle *cfg,
- const char *service);
+struct GNUNET_ARM_Handle *
+GNUNET_ARM_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *service);
/**
*
* @param h the handle that was being used
*/
-void GNUNET_ARM_disconnect (struct GNUNET_ARM_Handle *h);
+void
+GNUNET_ARM_disconnect (struct GNUNET_ARM_Handle *h);
/**
* @param cb callback to invoke when service is ready
* @param cb_cls closure for callback
*/
-void GNUNET_ARM_start_service (struct GNUNET_ARM_Handle *h,
- const char *service_name,
- struct GNUNET_TIME_Relative timeout,
- GNUNET_ARM_Callback cb, void *cb_cls);
+void
+GNUNET_ARM_start_service (struct GNUNET_ARM_Handle *h, const char *service_name,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_ARM_Callback cb, void *cb_cls);
/**
* @param cb callback to invoke when service is ready
* @param cb_cls closure for callback
*/
-void GNUNET_ARM_stop_service (struct GNUNET_ARM_Handle *h,
- const char *service_name,
- struct GNUNET_TIME_Relative timeout,
- GNUNET_ARM_Callback cb, void *cb_cls);
+void
+GNUNET_ARM_stop_service (struct GNUNET_ARM_Handle *h, const char *service_name,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_ARM_Callback cb, void *cb_cls);
* @param alloc_cb_cls closure for 'alloc_cb'
* @return ats context
*/
-struct GNUNET_ATS_Handle *GNUNET_ATS_init (const struct
- GNUNET_CONFIGURATION_Handle *cfg,
- GNUNET_TRANSPORT_ATS_AllocationNotification
- alloc_cb, void *alloc_cb_cls);
+struct GNUNET_ATS_Handle *
+GNUNET_ATS_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ GNUNET_TRANSPORT_ATS_AllocationNotification alloc_cb,
+ void *alloc_cb_cls);
/**
*
* @param atc handle
*/
-void GNUNET_ATS_shutdown (struct GNUNET_ATS_Handle *atc);
+void
+GNUNET_ATS_shutdown (struct GNUNET_ATS_Handle *atc);
/**
* @param cb function to call with the address
* @param cb_cls closure for cb
*/
-struct GNUNET_ATS_SuggestionContext *GNUNET_ATS_suggest_address (struct
- GNUNET_ATS_Handle
- *atc,
- const struct
- GNUNET_PeerIdentity
- *peer,
- GNUNET_ATS_AddressSuggestionCallback
- cb,
- void *cb_cls);
+struct GNUNET_ATS_SuggestionContext *
+GNUNET_ATS_suggest_address (struct GNUNET_ATS_Handle *atc,
+ const struct GNUNET_PeerIdentity *peer,
+ GNUNET_ATS_AddressSuggestionCallback cb,
+ void *cb_cls);
/**
*
* @param asc handle of the request to cancel
*/
-void GNUNET_ATS_suggest_address_cancel (struct GNUNET_ATS_SuggestionContext
- *asc);
+void
+GNUNET_ATS_suggest_address_cancel (struct GNUNET_ATS_SuggestionContext *asc);
/**
* @param ats performance data for the connection
* @param ats_count number of performance records in 'ats'
*/
-void GNUNET_ATS_peer_connect (struct GNUNET_ATS_Handle *atc,
- const struct GNUNET_PeerIdentity *peer,
- const char *plugin_name, struct Session *session,
- const void *plugin_addr, size_t plugin_addr_len,
- const struct GNUNET_TRANSPORT_ATS_Information
- *ats, uint32_t ats_count);
+void
+GNUNET_ATS_peer_connect (struct GNUNET_ATS_Handle *atc,
+ const struct GNUNET_PeerIdentity *peer,
+ const char *plugin_name, struct Session *session,
+ const void *plugin_addr, size_t plugin_addr_len,
+ const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ uint32_t ats_count);
/**
* @param atc handle
* @param peer identity of the peer
*/
-void GNUNET_ATS_peer_disconnect (struct GNUNET_ATS_Handle *atc,
- const struct GNUNET_PeerIdentity *peer);
+void
+GNUNET_ATS_peer_disconnect (struct GNUNET_ATS_Handle *atc,
+ const struct GNUNET_PeerIdentity *peer);
/**
* @param peer identity of the peer
* @param session session handle that is no longer valid
*/
-void GNUNET_ATS_session_destroyed (struct GNUNET_ATS_Handle *atc,
- const struct GNUNET_PeerIdentity *peer,
- const struct Session *session);
+void
+GNUNET_ATS_session_destroyed (struct GNUNET_ATS_Handle *atc,
+ const struct GNUNET_PeerIdentity *peer,
+ const struct Session *session);
/**
* @param ats performance data for the address
* @param ats_count number of performance records in 'ats'
*/
-void GNUNET_ATS_address_update (struct GNUNET_ATS_Handle *atc,
- const struct GNUNET_PeerIdentity *peer,
- struct GNUNET_TIME_Absolute valid_until,
- const char *plugin_name,
- struct Session *session,
- const void *plugin_addr, size_t plugin_addr_len,
- const struct GNUNET_TRANSPORT_ATS_Information
- *ats, uint32_t ats_count);
+void
+GNUNET_ATS_address_update (struct GNUNET_ATS_Handle *atc,
+ const struct GNUNET_PeerIdentity *peer,
+ struct GNUNET_TIME_Absolute valid_until,
+ const char *plugin_name, struct Session *session,
+ const void *plugin_addr, size_t plugin_addr_len,
+ const struct GNUNET_TRANSPORT_ATS_Information *ats,
+ uint32_t ats_count);
#endif
* @param bytes_per_second value to create
* @return the new bandwidth value
*/
-struct GNUNET_BANDWIDTH_Value32NBO GNUNET_BANDWIDTH_value_init (uint32_t
- bytes_per_second);
+struct GNUNET_BANDWIDTH_Value32NBO
+GNUNET_BANDWIDTH_value_init (uint32_t bytes_per_second);
/**
* @param deadline when is the deadline
* @return number of bytes available at bps until deadline
*/
-uint64_t GNUNET_BANDWIDTH_value_get_available_until (struct
- GNUNET_BANDWIDTH_Value32NBO
- bps,
- struct
- GNUNET_TIME_Relative
- deadline);
+uint64_t
+GNUNET_BANDWIDTH_value_get_available_until (struct GNUNET_BANDWIDTH_Value32NBO
+ bps,
+ struct GNUNET_TIME_Relative
+ deadline);
/**
* @param size number of bytes we want to have available
* @return how long it would take
*/
-struct GNUNET_TIME_Relative GNUNET_BANDWIDTH_value_get_delay_for (struct
- GNUNET_BANDWIDTH_Value32NBO
- bps,
- uint64_t
- size);
+struct GNUNET_TIME_Relative
+GNUNET_BANDWIDTH_value_get_delay_for (struct GNUNET_BANDWIDTH_Value32NBO bps,
+ uint64_t size);
* @param b2 second value
* @return the min of b1 and b2
*/
-struct GNUNET_BANDWIDTH_Value32NBO GNUNET_BANDWIDTH_value_min (struct
- GNUNET_BANDWIDTH_Value32NBO
- b1,
- struct
- GNUNET_BANDWIDTH_Value32NBO
- b2);
+struct GNUNET_BANDWIDTH_Value32NBO
+GNUNET_BANDWIDTH_value_min (struct GNUNET_BANDWIDTH_Value32NBO b1,
+ struct GNUNET_BANDWIDTH_Value32NBO b2);
/**
* @param max_carry_s maximum number of seconds unused bandwidth
* may accumulate before it expires
*/
-void GNUNET_BANDWIDTH_tracker_init (struct GNUNET_BANDWIDTH_Tracker *av,
- struct GNUNET_BANDWIDTH_Value32NBO
- bytes_per_second_limit,
- uint32_t max_carry_s);
+void
+GNUNET_BANDWIDTH_tracker_init (struct GNUNET_BANDWIDTH_Tracker *av,
+ struct GNUNET_BANDWIDTH_Value32NBO
+ bytes_per_second_limit, uint32_t max_carry_s);
/**
* @param size number of bytes consumed
* @return GNUNET_YES if this consumption is above the limit
*/
-int GNUNET_BANDWIDTH_tracker_consume (struct GNUNET_BANDWIDTH_Tracker *av,
- ssize_t size);
+int
+GNUNET_BANDWIDTH_tracker_consume (struct GNUNET_BANDWIDTH_Tracker *av,
+ ssize_t size);
/**
* @param size number of bytes we would like to consume
* @return time to wait for consumption to be OK
*/
-struct GNUNET_TIME_Relative GNUNET_BANDWIDTH_tracker_get_delay (struct
- GNUNET_BANDWIDTH_Tracker
- *av,
- size_t size);
+struct GNUNET_TIME_Relative
+GNUNET_BANDWIDTH_tracker_get_delay (struct GNUNET_BANDWIDTH_Tracker *av,
+ size_t size);
/**
* @param av tracker to query
* @return number of bytes available for consumption right now
*/
-int64_t GNUNET_BANDWIDTH_tracker_get_available (struct
- GNUNET_BANDWIDTH_Tracker
- *av);
+int64_t
+GNUNET_BANDWIDTH_tracker_get_available (struct GNUNET_BANDWIDTH_Tracker *av);
/**
* @param av tracker to initialize
* @param bytes_per_second_limit new limit to assume
*/
-void GNUNET_BANDWIDTH_tracker_update_quota (struct GNUNET_BANDWIDTH_Tracker *av,
- struct GNUNET_BANDWIDTH_Value32NBO
- bytes_per_second_limit);
+void
+GNUNET_BANDWIDTH_tracker_update_quota (struct GNUNET_BANDWIDTH_Tracker *av,
+ struct GNUNET_BANDWIDTH_Value32NBO
+ bytes_per_second_limit);
#if 0 /* keep Emacsens' auto-indent happy */
* @param fn file name to be opened
* @return IO handle on success, NULL on error
*/
-struct GNUNET_BIO_ReadHandle *GNUNET_BIO_read_open (const char *fn);
+struct GNUNET_BIO_ReadHandle *
+GNUNET_BIO_read_open (const char *fn);
/**
* @param emsg set to the error message
* @return GNUNET_OK on success, GNUNET_SYSERR otherwise
*/
-int GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg);
+int
+GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg);
/**
* @param len the number of bytes to read
* @return GNUNET_OK on success, GNUNET_SYSERR on failure
*/
-int GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, const char *what,
- void *result, size_t len);
+int
+GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, const char *what,
+ void *result, size_t len);
/**
* @param len the number of bytes to read
* @return GNUNET_OK on success, GNUNET_SYSERR on failure
*/
-int GNUNET_BIO_read_fn (struct GNUNET_BIO_ReadHandle *h, const char *file,
- int line, void *result, size_t len);
+int
+GNUNET_BIO_read_fn (struct GNUNET_BIO_ReadHandle *h, const char *file, int line,
+ void *result, size_t len);
/**
* Read 0-terminated string from a file.
* @param maxLen maximum allowed length for the string
* @return GNUNET_OK on success, GNUNET_SYSERR on failure
*/
-int GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, const char *what,
- char **result, size_t maxLen);
+int
+GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, const char *what,
+ char **result, size_t maxLen);
/**
* @param result the buffer to store a pointer to the (allocated) metadata
* @return GNUNET_OK on success, GNUNET_SYSERR on failure
*/
-int GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h,
- const char *what,
- struct GNUNET_CONTAINER_MetaData **result);
+int
+GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, const char *what,
+ struct GNUNET_CONTAINER_MetaData **result);
/**
* @param i address of 32-bit integer to read
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
-int GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h, const char *file,
- int line, int32_t * i);
+int
+GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h, const char *file,
+ int line, int32_t * i);
/**
* @param i address of 64-bit integer to read
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
-int GNUNET_BIO_read_int64__ (struct GNUNET_BIO_ReadHandle *h, const char *file,
- int line, int64_t * i);
+int
+GNUNET_BIO_read_int64__ (struct GNUNET_BIO_ReadHandle *h, const char *file,
+ int line, int64_t * i);
/**
* @param fn file name to be opened
* @return IO handle on success, NULL on error
*/
-struct GNUNET_BIO_WriteHandle *GNUNET_BIO_write_open (const char *fn);
+struct GNUNET_BIO_WriteHandle *
+GNUNET_BIO_write_open (const char *fn);
/**
* @param h file handle
* @return GNUNET_OK on success, GNUNET_SYSERR otherwise
*/
-int GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h);
+int
+GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h);
/**
* @param n number of bytes to write
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
-int GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, const void *buffer,
- size_t n);
+int
+GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, const void *buffer,
+ size_t n);
/**
* @param s string to write (can be NULL)
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
-int GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h, const char *s);
+int
+GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h, const char *s);
* @param m metadata to write
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
-int GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h,
- const struct GNUNET_CONTAINER_MetaData *m);
+int
+GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h,
+ const struct GNUNET_CONTAINER_MetaData *m);
* @param i address of 32-bit integer to write
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
-int GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, int32_t i);
+int
+GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, int32_t i);
/**
* @param i address of 64-bit integer to write
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
-int GNUNET_BIO_write_int64 (struct GNUNET_BIO_WriteHandle *h, int64_t i);
+int
+GNUNET_BIO_write_int64 (struct GNUNET_BIO_WriteHandle *h, int64_t i);
#if 0 /* keep Emacsens' auto-indent happy */
* @param mingle_number number for hash permutation
* @param hc where to store the result.
*/
-void GNUNET_BLOCK_mingle_hash (const GNUNET_HashCode * in,
- uint32_t mingle_number, GNUNET_HashCode * hc);
+void
+GNUNET_BLOCK_mingle_hash (const GNUNET_HashCode * in, uint32_t mingle_number,
+ GNUNET_HashCode * hc);
/**
* @param cfg configuration to use
* @return NULL on error
*/
-struct GNUNET_BLOCK_Context *GNUNET_BLOCK_context_create (const struct
- GNUNET_CONFIGURATION_Handle
- *cfg);
+struct GNUNET_BLOCK_Context *
+GNUNET_BLOCK_context_create (const struct GNUNET_CONFIGURATION_Handle *cfg);
/**
*
* @param ctx context to destroy
*/
-void GNUNET_BLOCK_context_destroy (struct GNUNET_BLOCK_Context *ctx);
+void
+GNUNET_BLOCK_context_destroy (struct GNUNET_BLOCK_Context *ctx);
/**
* @param reply_block_size number of bytes in reply block
* @return characterization of result
*/
-enum GNUNET_BLOCK_EvaluationResult GNUNET_BLOCK_evaluate (struct
- GNUNET_BLOCK_Context
- *ctx,
- enum GNUNET_BLOCK_Type
- type,
- const GNUNET_HashCode
- * query,
- struct
- GNUNET_CONTAINER_BloomFilter
- **bf,
- int32_t bf_mutator,
- const void *xquery,
- size_t xquery_size,
- const void
- *reply_block,
- size_t
- reply_block_size);
+enum GNUNET_BLOCK_EvaluationResult
+GNUNET_BLOCK_evaluate (struct GNUNET_BLOCK_Context *ctx,
+ enum GNUNET_BLOCK_Type type,
+ const GNUNET_HashCode * query,
+ struct GNUNET_CONTAINER_BloomFilter **bf,
+ int32_t bf_mutator, const void *xquery,
+ size_t xquery_size, const void *reply_block,
+ size_t reply_block_size);
/**
* GNUNET_SYSERR if type not supported
* (or if extracting a key from a block of this type does not work)
*/
-int GNUNET_BLOCK_get_key (struct GNUNET_BLOCK_Context *ctx,
- enum GNUNET_BLOCK_Type type, const void *block,
- size_t block_size, GNUNET_HashCode * key);
+int
+GNUNET_BLOCK_get_key (struct GNUNET_BLOCK_Context *ctx,
+ enum GNUNET_BLOCK_Type type, const void *block,
+ size_t block_size, GNUNET_HashCode * key);
#if 0 /* keep Emacsens' auto-indent happy */
* @param me member ID (pseudonym)
* @return NULL on error
*/
-struct GNUNET_CHAT_Room *GNUNET_CHAT_join_room (const struct
- GNUNET_CONFIGURATION_Handle
- *cfg, const char *nick_name,
- struct GNUNET_CONTAINER_MetaData
- *member_info,
- const char *room_name,
- enum GNUNET_CHAT_MsgOptions
- msg_options,
- GNUNET_CHAT_JoinCallback
- joinCallback, void *join_cls,
- GNUNET_CHAT_MessageCallback
- messageCallback,
- void *message_cls,
- GNUNET_CHAT_MemberListCallback
- memberCallback,
- void *member_cls,
- GNUNET_CHAT_MessageConfirmation
- confirmationCallback,
- void *confirmation_cls,
- GNUNET_HashCode * me);
+struct GNUNET_CHAT_Room *
+GNUNET_CHAT_join_room (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *nick_name,
+ struct GNUNET_CONTAINER_MetaData *member_info,
+ const char *room_name,
+ enum GNUNET_CHAT_MsgOptions msg_options,
+ GNUNET_CHAT_JoinCallback joinCallback, void *join_cls,
+ GNUNET_CHAT_MessageCallback messageCallback,
+ void *message_cls,
+ GNUNET_CHAT_MemberListCallback memberCallback,
+ void *member_cls,
+ GNUNET_CHAT_MessageConfirmation confirmationCallback,
+ void *confirmation_cls, GNUNET_HashCode * me);
/**
* Send a message.
* @param receiver use NULL to send to everyone in the room
* @param sequence_number where to write the sequence id of the message
*/
-void GNUNET_CHAT_send_message (struct GNUNET_CHAT_Room *room,
- const char *message,
- enum GNUNET_CHAT_MsgOptions options,
- const struct
- GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
- *receiver, uint32_t * sequence_number);
+void
+GNUNET_CHAT_send_message (struct GNUNET_CHAT_Room *room, const char *message,
+ enum GNUNET_CHAT_MsgOptions options,
+ const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
+ *receiver, uint32_t * sequence_number);
/**
* Leave a chat room.
*/
-void GNUNET_CHAT_leave_room (struct GNUNET_CHAT_Room *chat_room);
+void
+GNUNET_CHAT_leave_room (struct GNUNET_CHAT_Room *chat_room);
#if 0
* List all of the (publically visible) chat rooms.
* @return number of rooms on success, GNUNET_SYSERR if iterator aborted
*/
-int GNUNET_CHAT_list_rooms (struct GNUNET_GE_Context *ectx,
- struct GNUNET_GC_Configuration *cfg,
- GNUNET_CHAT_RoomIterator it, void *cls);
+int
+GNUNET_CHAT_list_rooms (struct GNUNET_GE_Context *ectx,
+ struct GNUNET_GC_Configuration *cfg,
+ GNUNET_CHAT_RoomIterator it, void *cls);
#endif
* @param cfg configuration to use
* @return NULL on error (service unknown to configuration)
*/
-struct GNUNET_CLIENT_Connection *GNUNET_CLIENT_connect (const char
- *service_name,
- const struct
- GNUNET_CONFIGURATION_Handle
- *cfg);
+struct GNUNET_CLIENT_Connection *
+GNUNET_CLIENT_connect (const char *service_name,
+ const struct GNUNET_CONFIGURATION_Handle *cfg);
/**
* @param h client handle
* @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default
*/
-void GNUNET_CLIENT_ignore_shutdown (struct GNUNET_CLIENT_Connection *h,
- int do_ignore);
+void
+GNUNET_CLIENT_ignore_shutdown (struct GNUNET_CLIENT_Connection *h,
+ int do_ignore);
* @param finish_pending_write should a transmission already passed to the
* handle be completed?
*/
-void GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *sock,
- int finish_pending_write);
+void
+GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *sock,
+ int finish_pending_write);
/**
* Type of a function to call when we receive a message
* @param handler_cls closure for handler
* @param timeout how long to wait until timing out
*/
-void GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *sock,
- GNUNET_CLIENT_MessageHandler handler,
- void *handler_cls,
- struct GNUNET_TIME_Relative timeout);
+void
+GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *sock,
+ GNUNET_CLIENT_MessageHandler handler, void *handler_cls,
+ struct GNUNET_TIME_Relative timeout);
/**
* non-NULL if the notify callback was queued (can be used to cancel
* using GNUNET_CONNECTION_notify_transmit_ready_cancel)
*/
-struct GNUNET_CLIENT_TransmitHandle *GNUNET_CLIENT_notify_transmit_ready (struct
- GNUNET_CLIENT_Connection
- *sock,
- size_t
- size,
- struct
- GNUNET_TIME_Relative
- timeout,
- int
- auto_retry,
- GNUNET_CONNECTION_TransmitReadyNotify
- notify,
- void
- *notify_cls);
+struct GNUNET_CLIENT_TransmitHandle *
+GNUNET_CLIENT_notify_transmit_ready (struct GNUNET_CLIENT_Connection *sock,
+ size_t size,
+ struct GNUNET_TIME_Relative timeout,
+ int auto_retry,
+ GNUNET_CONNECTION_TransmitReadyNotify
+ notify, void *notify_cls);
/**
*
* @param th handle from the original request.
*/
-void GNUNET_CLIENT_notify_transmit_ready_cancel (struct
- GNUNET_CLIENT_TransmitHandle
- *th);
+void
+GNUNET_CLIENT_notify_transmit_ready_cancel (struct GNUNET_CLIENT_TransmitHandle
+ *th);
/**
* @return GNUNET_OK on success, GNUNET_SYSERR if a request
* is already pending
*/
-int GNUNET_CLIENT_transmit_and_get_response (struct GNUNET_CLIENT_Connection
- *sock,
- const struct GNUNET_MessageHeader
- *hdr,
- struct GNUNET_TIME_Relative
- timeout, int auto_retry,
- GNUNET_CLIENT_MessageHandler rn,
- void *rn_cls);
+int
+GNUNET_CLIENT_transmit_and_get_response (struct GNUNET_CLIENT_Connection *sock,
+ const struct GNUNET_MessageHeader *hdr,
+ struct GNUNET_TIME_Relative timeout,
+ int auto_retry,
+ GNUNET_CLIENT_MessageHandler rn,
+ void *rn_cls);
/**
* or "TIMEOUT" (service not known to be running))
* @param task_cls closure for task
*/
-void GNUNET_CLIENT_service_test (const char *service,
- const struct GNUNET_CONFIGURATION_Handle *cfg,
- struct GNUNET_TIME_Relative timeout,
- GNUNET_SCHEDULER_Task task, void *task_cls);
+void
+GNUNET_CLIENT_service_test (const char *service,
+ const struct GNUNET_CONFIGURATION_Handle *cfg,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_SCHEDULER_Task task, void *task_cls);
#if 0 /* keep Emacsens' auto-indent happy */
* @param message what is the message (format string)
* @param ... arguments for format string
*/
-void GNUNET_log (enum GNUNET_ErrorType kind, const char *message, ...);
+void
+GNUNET_log (enum GNUNET_ErrorType kind, const char *message, ...);
* @param message what is the message (format string)
* @param ... arguments for format string
*/
-void GNUNET_log_from (enum GNUNET_ErrorType kind, const char *comp,
- const char *message, ...);
+void
+GNUNET_log_from (enum GNUNET_ErrorType kind, const char *comp,
+ const char *message, ...);
/**
* @param n number of log calls to ignore
* @param check_reset GNUNET_YES to assert that the log skip counter is currently zero
*/
-void GNUNET_log_skip (unsigned int n, int check_reset);
+void
+GNUNET_log_skip (unsigned int n, int check_reset);
/**
* @param logfile change logging to logfile (use NULL to keep stderr)
* @return GNUNET_OK on success, GNUNET_SYSERR if logfile could not be opened
*/
-int GNUNET_log_setup (const char *comp, const char *loglevel,
- const char *logfile);
+int
+GNUNET_log_setup (const char *comp, const char *loglevel, const char *logfile);
/**
* @param logger log function
* @param logger_cls closure for logger
*/
-void GNUNET_logger_add (GNUNET_Logger logger, void *logger_cls);
+void
+GNUNET_logger_add (GNUNET_Logger logger, void *logger_cls);
/**
* @param logger log function
* @param logger_cls closure for logger
*/
-void GNUNET_logger_remove (GNUNET_Logger logger, void *logger_cls);
+void
+GNUNET_logger_remove (GNUNET_Logger logger, void *logger_cls);
/**
* @param hc the hash code
* @return string
*/
-const char *GNUNET_h2s (const GNUNET_HashCode * hc);
+const char *
+GNUNET_h2s (const GNUNET_HashCode * hc);
/**
* @param hc the hash code
* @return string
*/
-const char *GNUNET_h2s_full (const GNUNET_HashCode * hc);
+const char *
+GNUNET_h2s_full (const GNUNET_HashCode * hc);
/**
* @return string form of the pid; will be overwritten by next
* call to GNUNET_i2s.
*/
-const char *GNUNET_i2s (const struct GNUNET_PeerIdentity *pid);
+const char *
+GNUNET_i2s (const struct GNUNET_PeerIdentity *pid);
/**
* @return nicely formatted string for the address
* will be overwritten by next call to GNUNET_a2s.
*/
-const char *GNUNET_a2s (const struct sockaddr *addr, socklen_t addrlen);
+const char *
+GNUNET_a2s (const struct sockaddr *addr, socklen_t addrlen);
/**
* Convert error type to string.
* @param kind type to convert
* @return string corresponding to the type
*/
-const char *GNUNET_error_type_to_string (enum GNUNET_ErrorType kind);
+const char *
+GNUNET_error_type_to_string (enum GNUNET_ErrorType kind);
/**
* @param n the value in network byte order
* @return the same value in host byte order
*/
-unsigned long long GNUNET_ntohll (unsigned long long n);
+unsigned long long
+GNUNET_ntohll (unsigned long long n);
/**
* Convert a long long to network-byte-order.
* @param n the value in host byte order
* @return the same value in network byte order
*/
-unsigned long long GNUNET_htonll (unsigned long long n);
+unsigned long long
+GNUNET_htonll (unsigned long long n);
/* ************************* allocation functions ****************** */
* @param ... data for format string
* @return number of bytes written to buf or negative value on error
*/
-int GNUNET_snprintf (char *buf, size_t size, const char *format, ...);
+int
+GNUNET_snprintf (char *buf, size_t size, const char *format, ...);
/**
* @param ... data for format string
* @return number of bytes in "*buf" excluding 0-termination
*/
-int GNUNET_asprintf (char **buf, const char *format, ...);
+int
+GNUNET_asprintf (char **buf, const char *format, ...);
/* ************** internal implementations, use macros above! ************** */
* @param linenumber line where this call is being made (for debugging)
* @return allocated memory, never NULL
*/
-void *GNUNET_xmalloc_ (size_t size, const char *filename, int linenumber);
+void *
+GNUNET_xmalloc_ (size_t size, const char *filename, int linenumber);
* @param linenumber line where this call is being made (for debugging)
* @return allocated memory, never NULL
*/
-void *GNUNET_xmemdup_ (const void *buf, size_t size, const char *filename,
- int linenumber);
+void *
+GNUNET_xmemdup_ (const void *buf, size_t size, const char *filename,
+ int linenumber);
/**
* @param linenumber line where this call is being made (for debugging)
* @return pointer to size bytes of memory, NULL if we do not have enough memory
*/
-void *GNUNET_xmalloc_unchecked_ (size_t size, const char *filename,
- int linenumber);
+void *
+GNUNET_xmalloc_unchecked_ (size_t size, const char *filename, int linenumber);
/**
* Reallocate memory. Checks the return value, aborts if no more
* memory is available.
*/
-void *GNUNET_xrealloc_ (void *ptr, size_t n, const char *filename,
- int linenumber);
+void *
+GNUNET_xrealloc_ (void *ptr, size_t n, const char *filename, int linenumber);
/**
* Free memory. Merely a wrapper for the case that we
* @param filename where is this call being made (for debugging)
* @param linenumber line where this call is being made (for debugging)
*/
-void GNUNET_xfree_ (void *ptr, const char *filename, int linenumber);
+void
+GNUNET_xfree_ (void *ptr, const char *filename, int linenumber);
/**
* @param linenumber line where this call is being made (for debugging)
* @return the duplicated string
*/
-char *GNUNET_xstrdup_ (const char *str, const char *filename, int linenumber);
+char *
+GNUNET_xstrdup_ (const char *str, const char *filename, int linenumber);
/**
* Dup partially a string. Don't call GNUNET_xstrndup_ directly. Use the GNUNET_strndup macro.
* @param linenumber line where this call is being made (for debugging)
* @return the duplicated string
*/
-char *GNUNET_xstrndup_ (const char *str, size_t len, const char *filename,
- int linenumber);
+char *
+GNUNET_xstrndup_ (const char *str, size_t len, const char *filename,
+ int linenumber);
/**
* Grow an array, the new elements are zeroed out.
* @param filename where is this call being made (for debugging)
* @param linenumber line where this call is being made (for debugging)
*/
-void GNUNET_xgrow_ (void **old, size_t elementSize, unsigned int *oldCount,
- unsigned int newCount, const char *filename,
- int linenumber);
+void
+GNUNET_xgrow_ (void **old, size_t elementSize, unsigned int *oldCount,
+ unsigned int newCount, const char *filename, int linenumber);
* Create a new configuration object.
* @return fresh configuration object
*/
-struct GNUNET_CONFIGURATION_Handle *GNUNET_CONFIGURATION_create (void);
+struct GNUNET_CONFIGURATION_Handle *
+GNUNET_CONFIGURATION_create (void);
/**
* @param cfg configuration to duplicate
* @return duplicate configuration
*/
-struct GNUNET_CONFIGURATION_Handle *GNUNET_CONFIGURATION_dup (const struct
- GNUNET_CONFIGURATION_Handle
- *cfg);
+struct GNUNET_CONFIGURATION_Handle *
+GNUNET_CONFIGURATION_dup (const struct GNUNET_CONFIGURATION_Handle *cfg);
/**
*
* @param cfg configuration to destroy
*/
-void GNUNET_CONFIGURATION_destroy (struct GNUNET_CONFIGURATION_Handle *cfg);
+void
+GNUNET_CONFIGURATION_destroy (struct GNUNET_CONFIGURATION_Handle *cfg);
/**
* @param filename name of the configuration file, NULL to load defaults
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
-int GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg,
- const char *filename);
+int
+GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *filename);
/**
* @param filename name of the configuration file
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
-int GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg,
- const char *filename);
+int
+GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *filename);
/**
* @param filename where to write the configuration
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
-int GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg,
- const char *filename);
+int
+GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *filename);
/**
* Write only configuration entries that have been changed to configuration file
* @param filename where to write the configuration diff between default and new
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
-int GNUNET_CONFIGURATION_write_diffs (const struct GNUNET_CONFIGURATION_Handle
- *cfgDefault,
- const struct GNUNET_CONFIGURATION_Handle
- *cfgNew, const char *filename);
+int
+GNUNET_CONFIGURATION_write_diffs (const struct GNUNET_CONFIGURATION_Handle
+ *cfgDefault,
+ const struct GNUNET_CONFIGURATION_Handle
+ *cfgNew, const char *filename);
/**
* Test if there are configuration options that were
* @param cfg configuration to inspect
* @return GNUNET_NO if clean, GNUNET_YES if dirty, GNUNET_SYSERR on error (i.e. last save failed)
*/
-int GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle
- *cfg);
+int
+GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle *cfg);
/**
* @param iter function to call on each option
* @param iter_cls closure for iter
*/
-void GNUNET_CONFIGURATION_iterate (const struct GNUNET_CONFIGURATION_Handle
- *cfg, GNUNET_CONFIGURATION_Iterator iter,
- void *iter_cls);
+void
+GNUNET_CONFIGURATION_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ GNUNET_CONFIGURATION_Iterator iter,
+ void *iter_cls);
/**
* @param iter function to call on each section
* @param iter_cls closure for iter
*/
-void GNUNET_CONFIGURATION_iterate_sections (const struct
- GNUNET_CONFIGURATION_Handle *cfg,
- GNUNET_CONFIGURATION_Section_Iterator
- iter, void *iter_cls);
+void
+GNUNET_CONFIGURATION_iterate_sections (const struct GNUNET_CONFIGURATION_Handle
+ *cfg,
+ GNUNET_CONFIGURATION_Section_Iterator
+ iter, void *iter_cls);
/**
* @param cfg configuration to inspect
* @param section name of the section to remove
*/
-void GNUNET_CONFIGURATION_remove_section (struct GNUNET_CONFIGURATION_Handle
- *cfg, const char *section);
+void
+GNUNET_CONFIGURATION_remove_section (struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *section);
/**
* Get a configuration value that should be a number.
* @param number where to store the numeric value of the option
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
-int GNUNET_CONFIGURATION_get_value_number (const struct
- GNUNET_CONFIGURATION_Handle *cfg,
- const char *section,
- const char *option,
- unsigned long long *number);
+int
+GNUNET_CONFIGURATION_get_value_number (const struct GNUNET_CONFIGURATION_Handle
+ *cfg, const char *section,
+ const char *option,
+ unsigned long long *number);
/**
* @param time set to the time value stored in the configuration
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
-int GNUNET_CONFIGURATION_get_value_time (const struct
- GNUNET_CONFIGURATION_Handle *cfg,
- const char *section,
- const char *option,
- struct GNUNET_TIME_Relative *time);
+int
+GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handle
+ *cfg, const char *section,
+ const char *option,
+ struct GNUNET_TIME_Relative *time);
/**
* @param option option of interest
* @return GNUNET_YES if so, GNUNET_NO if not.
*/
-int GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle
- *cfg, const char *section,
- const char *option);
+int
+GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *section, const char *option);
/**
* value, or NULL if option is not specified
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
-int GNUNET_CONFIGURATION_get_value_string (const struct
- GNUNET_CONFIGURATION_Handle *cfg,
- const char *section,
- const char *option, char **value);
+int
+GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Handle
+ *cfg, const char *section,
+ const char *option, char **value);
/**
* value, or NULL if option is not specified
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
-int GNUNET_CONFIGURATION_get_value_filename (const struct
- GNUNET_CONFIGURATION_Handle *cfg,
- const char *section,
- const char *option, char **value);
+int
+GNUNET_CONFIGURATION_get_value_filename (const struct
+ GNUNET_CONFIGURATION_Handle *cfg,
+ const char *section,
+ const char *option, char **value);
/**
* Iterate over the set of filenames stored in a configuration value.
* @param cb_cls closure for cb
* @return number of filenames iterated over, -1 on error
*/
-int GNUNET_CONFIGURATION_iterate_value_filenames (const struct
- GNUNET_CONFIGURATION_Handle
- *cfg, const char *section,
- const char *option,
- GNUNET_FileNameCallback cb,
- void *cb_cls);
+int
+GNUNET_CONFIGURATION_iterate_value_filenames (const struct
+ GNUNET_CONFIGURATION_Handle *cfg,
+ const char *section,
+ const char *option,
+ GNUNET_FileNameCallback cb,
+ void *cb_cls);
/**
* Iterate over values of a section in the configuration.
* @param iter function to call on each option
* @param iter_cls closure for iter
*/
-void GNUNET_CONFIGURATION_iterate_section_values (const struct
- GNUNET_CONFIGURATION_Handle
- *cfg, const char *section,
- GNUNET_CONFIGURATION_Iterator
- iter, void *iter_cls);
+void
+GNUNET_CONFIGURATION_iterate_section_values (const struct
+ GNUNET_CONFIGURATION_Handle *cfg,
+ const char *section,
+ GNUNET_CONFIGURATION_Iterator iter,
+ void *iter_cls);
/**
* Get a configuration value that should be in a set of
* or NULL if option is not specified and no default given
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
-int GNUNET_CONFIGURATION_get_value_choice (const struct
- GNUNET_CONFIGURATION_Handle *cfg,
- const char *section,
- const char *option,
- const char **choices,
- const char **value);
+int
+GNUNET_CONFIGURATION_get_value_choice (const struct GNUNET_CONFIGURATION_Handle
+ *cfg, const char *section,
+ const char *option, const char **choices,
+ const char **value);
/**
* Get a configuration value that should be in a set of
* @param option option of interest
* @return GNUNET_YES, GNUNET_NO or if option has no valid value, GNUNET_SYSERR
*/
-int GNUNET_CONFIGURATION_get_value_yesno (const struct
- GNUNET_CONFIGURATION_Handle *cfg,
- const char *section,
- const char *option);
+int
+GNUNET_CONFIGURATION_get_value_yesno (const struct GNUNET_CONFIGURATION_Handle
+ *cfg, const char *section,
+ const char *option);
/**
* Expand an expression of the form "$FOO/BAR" to "DIRECTORY/BAR"
* @param orig string to $-expand (will be freed!)
* @return $-expanded string
*/
-char *GNUNET_CONFIGURATION_expand_dollar (const struct
- GNUNET_CONFIGURATION_Handle *cfg,
- char *orig);
+char *
+GNUNET_CONFIGURATION_expand_dollar (const struct GNUNET_CONFIGURATION_Handle
+ *cfg, char *orig);
/**
* @param option option of interest
* @param number value to set
*/
-void GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle
- *cfg, const char *section,
- const char *option,
- unsigned long long number);
+void
+GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *section, const char *option,
+ unsigned long long number);
/**
* @param option option of interest
* @param value value to set
*/
-void GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle
- *cfg, const char *section,
- const char *option,
- const char *value);
+void
+GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *section, const char *option,
+ const char *value);
/**
* Remove a filename from a configuration value that
* @return GNUNET_OK on success,
* GNUNET_SYSERR if the filename is not in the list
*/
-int GNUNET_CONFIGURATION_remove_value_filename (struct
- GNUNET_CONFIGURATION_Handle
- *cfg, const char *section,
- const char *option,
- const char *value);
+int
+GNUNET_CONFIGURATION_remove_value_filename (struct GNUNET_CONFIGURATION_Handle
+ *cfg, const char *section,
+ const char *option,
+ const char *value);
/**
* Append a filename to a configuration value that
* @return GNUNET_OK on success,
* GNUNET_SYSERR if the filename already in the list
*/
-int GNUNET_CONFIGURATION_append_value_filename (struct
- GNUNET_CONFIGURATION_Handle
- *cfg, const char *section,
- const char *option,
- const char *value);
+int
+GNUNET_CONFIGURATION_append_value_filename (struct GNUNET_CONFIGURATION_Handle
+ *cfg, const char *section,
+ const char *option,
+ const char *value);
#if 0 /* keep Emacsens' auto-indent happy */
*
* @param sock the connection to set persistent
*/
-void GNUNET_CONNECTION_persist_ (struct GNUNET_CONNECTION_Handle *sock);
+void
+GNUNET_CONNECTION_persist_ (struct GNUNET_CONNECTION_Handle *sock);
/**
* Disable the "CORK" feature for communication with the given socket,
* @param sock the connection to make flushing and blocking
* @return GNUNET_OK on success
*/
-int GNUNET_CONNECTION_disable_corking (struct GNUNET_CONNECTION_Handle *sock);
+int
+GNUNET_CONNECTION_disable_corking (struct GNUNET_CONNECTION_Handle *sock);
/**
* @param osSocket existing socket to box
* @return the boxed socket handle
*/
-struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_existing (struct
- GNUNET_NETWORK_Handle
- *osSocket);
+struct GNUNET_CONNECTION_Handle *
+GNUNET_CONNECTION_create_from_existing (struct GNUNET_NETWORK_Handle *osSocket);
/**
* @param lsock listen socket
* @return the socket handle, NULL on error (for example, access refused)
*/
-struct GNUNET_CONNECTION_Handle
- *GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck access,
- void *access_cls,
- struct GNUNET_NETWORK_Handle *lsock);
+struct GNUNET_CONNECTION_Handle *
+GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck access,
+ void *access_cls,
+ struct GNUNET_NETWORK_Handle *lsock);
/**
* @param port port to connect to
* @return the socket handle
*/
-struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_connect (const
- struct
- GNUNET_CONFIGURATION_Handle
- *cfg,
- const
- char
- *hostname,
- uint16_t
- port);
+struct GNUNET_CONNECTION_Handle *
+GNUNET_CONNECTION_create_from_connect (const struct GNUNET_CONFIGURATION_Handle
+ *cfg, const char *hostname,
+ uint16_t port);
/**
* @param unixpath path to connect to)
* @return the socket handle, NULL on systems without UNIX support
*/
-struct GNUNET_CONNECTION_Handle
- *GNUNET_CONNECTION_create_from_connect_to_unixpath (const struct
- GNUNET_CONFIGURATION_Handle
- *cfg,
- const char *unixpath);
+struct GNUNET_CONNECTION_Handle *
+GNUNET_CONNECTION_create_from_connect_to_unixpath (const struct
+ GNUNET_CONFIGURATION_Handle
+ *cfg, const char *unixpath);
* @param addrlen length of server address
* @return the socket handle
*/
-struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_sockaddr (int
- af_family,
- const
- struct
- sockaddr
- *serv_addr,
- socklen_t
- addrlen);
+struct GNUNET_CONNECTION_Handle *
+GNUNET_CONNECTION_create_from_sockaddr (int af_family,
+ const struct sockaddr *serv_addr,
+ socklen_t addrlen);
/**
* Check if socket is valid (no fatal errors have happened so far).
* @param sock socket to check
* @return GNUNET_YES if valid, GNUNET_NO otherwise
*/
-int GNUNET_CONNECTION_check (struct GNUNET_CONNECTION_Handle *sock);
+int
+GNUNET_CONNECTION_check (struct GNUNET_CONNECTION_Handle *sock);
/**
* @param addrlen where to store the length of the address
* @return GNUNET_OK on success
*/
-int GNUNET_CONNECTION_get_address (struct GNUNET_CONNECTION_Handle *sock,
- void **addr, size_t * addrlen);
+int
+GNUNET_CONNECTION_get_address (struct GNUNET_CONNECTION_Handle *sock,
+ void **addr, size_t * addrlen);
/**
* read from the application; all other transmissions should be
* aborted using 'GNUNET_CONNECTION_notify_transmit_ready_cancel').
*/
-void GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock,
- int finish_pending_write);
+void
+GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock,
+ int finish_pending_write);
/**
* @param receiver function to call with received data
* @param receiver_cls closure for receiver
*/
-void GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *sock,
- size_t max, struct GNUNET_TIME_Relative timeout,
- GNUNET_CONNECTION_Receiver receiver,
- void *receiver_cls);
+void
+GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *sock, size_t max,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_CONNECTION_Receiver receiver,
+ void *receiver_cls);
/**
* @param sock socket handle
* @return closure of the original receiver callback closure
*/
-void *GNUNET_CONNECTION_receive_cancel (struct GNUNET_CONNECTION_Handle *sock);
+void *
+GNUNET_CONNECTION_receive_cancel (struct GNUNET_CONNECTION_Handle *sock);
/**
* @return non-NULL if the notify callback was queued,
* NULL if we are already going to notify someone else (busy)
*/
-struct GNUNET_CONNECTION_TransmitHandle
- *GNUNET_CONNECTION_notify_transmit_ready (struct GNUNET_CONNECTION_Handle
- *sock, size_t size,
- struct GNUNET_TIME_Relative
- timeout,
- GNUNET_CONNECTION_TransmitReadyNotify
- notify, void *notify_cls);
+struct GNUNET_CONNECTION_TransmitHandle *
+GNUNET_CONNECTION_notify_transmit_ready (struct GNUNET_CONNECTION_Handle *sock,
+ size_t size,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_CONNECTION_TransmitReadyNotify
+ notify, void *notify_cls);
/**
*
* @param h handle for notification to cancel
*/
-void GNUNET_CONNECTION_notify_transmit_ready_cancel (struct
- GNUNET_CONNECTION_TransmitHandle
- *h);
+void
+GNUNET_CONNECTION_notify_transmit_ready_cancel (struct
+ GNUNET_CONNECTION_TransmitHandle
+ *h);
/**
* @param sock socket handle
* @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default
*/
-void GNUNET_CONNECTION_ignore_shutdown (struct GNUNET_CONNECTION_Handle *sock,
- int do_ignore);
+void
+GNUNET_CONNECTION_ignore_shutdown (struct GNUNET_CONNECTION_Handle *sock,
+ int do_ignore);
#if 0 /* keep Emacsens' auto-indent happy */
* element (number of bits set per element in the set)
* @return the bloomfilter
*/
-struct GNUNET_CONTAINER_BloomFilter *GNUNET_CONTAINER_bloomfilter_load (const
- char
- *filename,
- size_t
- size,
- unsigned
- int k);
+struct GNUNET_CONTAINER_BloomFilter *
+GNUNET_CONTAINER_bloomfilter_load (const char *filename, size_t size,
+ unsigned int k);
/**
* element (number of bits set per element in the set)
* @return the bloomfilter
*/
-struct GNUNET_CONTAINER_BloomFilter *GNUNET_CONTAINER_bloomfilter_init (const
- char
- *data,
- size_t
- size,
- unsigned
- int k);
+struct GNUNET_CONTAINER_BloomFilter *
+GNUNET_CONTAINER_bloomfilter_init (const char *data, size_t size,
+ unsigned int k);
/**
* @param size the size of the given data array
* @return GNUNET_SYSERR if the data array of the wrong size
*/
-int GNUNET_CONTAINER_bloomfilter_get_raw_data (const struct
- GNUNET_CONTAINER_BloomFilter *bf,
- char *data, size_t size);
+int
+GNUNET_CONTAINER_bloomfilter_get_raw_data (const struct
+ GNUNET_CONTAINER_BloomFilter *bf,
+ char *data, size_t size);
/**
* @param bf the filter
* @return GNUNET_YES if the element is in the filter, GNUNET_NO if not
*/
-int GNUNET_CONTAINER_bloomfilter_test (const struct GNUNET_CONTAINER_BloomFilter
- *bf, const GNUNET_HashCode * e);
+int
+GNUNET_CONTAINER_bloomfilter_test (const struct GNUNET_CONTAINER_BloomFilter
+ *bf, const GNUNET_HashCode * e);
/**
* @param bf the filter
* @param e the element
*/
-void GNUNET_CONTAINER_bloomfilter_add (struct GNUNET_CONTAINER_BloomFilter *bf,
- const GNUNET_HashCode * e);
+void
+GNUNET_CONTAINER_bloomfilter_add (struct GNUNET_CONTAINER_BloomFilter *bf,
+ const GNUNET_HashCode * e);
/**
* @param bf the filter
* @param e the element to remove
*/
-void GNUNET_CONTAINER_bloomfilter_remove (struct GNUNET_CONTAINER_BloomFilter
- *bf, const GNUNET_HashCode * e);
+void
+GNUNET_CONTAINER_bloomfilter_remove (struct GNUNET_CONTAINER_BloomFilter *bf,
+ const GNUNET_HashCode * e);
/**
* @param bf the filter
* @return copy of bf
*/
-struct GNUNET_CONTAINER_BloomFilter *GNUNET_CONTAINER_bloomfilter_copy (const
- struct
- GNUNET_CONTAINER_BloomFilter
- *bf);
+struct GNUNET_CONTAINER_BloomFilter *
+GNUNET_CONTAINER_bloomfilter_copy (const struct GNUNET_CONTAINER_BloomFilter
+ *bf);
* free the space on the drive)
* @param bf the filter
*/
-void GNUNET_CONTAINER_bloomfilter_free (struct GNUNET_CONTAINER_BloomFilter
- *bf);
+void
+GNUNET_CONTAINER_bloomfilter_free (struct GNUNET_CONTAINER_BloomFilter *bf);
/**
* @param bf the filter
* @return number of bytes used for the data of the bloom filter
*/
-size_t GNUNET_CONTAINER_bloomfilter_get_size (const struct
- GNUNET_CONTAINER_BloomFilter
- *bf);
+size_t
+GNUNET_CONTAINER_bloomfilter_get_size (const struct GNUNET_CONTAINER_BloomFilter
+ *bf);
/**
* Reset a bloom filter to empty.
* @param bf the filter
*/
-void GNUNET_CONTAINER_bloomfilter_clear (struct GNUNET_CONTAINER_BloomFilter
- *bf);
+void
+GNUNET_CONTAINER_bloomfilter_clear (struct GNUNET_CONTAINER_BloomFilter *bf);
/**
* Or the entries of the given raw data array with the
* @param size size of data
* @return GNUNET_OK on success
*/
-int GNUNET_CONTAINER_bloomfilter_or (struct GNUNET_CONTAINER_BloomFilter *bf,
- const char *data, size_t size);
+int
+GNUNET_CONTAINER_bloomfilter_or (struct GNUNET_CONTAINER_BloomFilter *bf,
+ const char *data, size_t size);
/**
* Or the entries of the given raw data array with the
* @param to_or the bloomfilter to or-in
* @param size number of bytes in data
*/
-int GNUNET_CONTAINER_bloomfilter_or2 (struct GNUNET_CONTAINER_BloomFilter *bf,
- const struct GNUNET_CONTAINER_BloomFilter
- *to_or, size_t size);
+int
+GNUNET_CONTAINER_bloomfilter_or2 (struct GNUNET_CONTAINER_BloomFilter *bf,
+ const struct GNUNET_CONTAINER_BloomFilter
+ *to_or, size_t size);
/**
* Resize a bloom filter. Note that this operation
* @param size the new size for the filter
* @param k the new number of GNUNET_CRYPTO_hash-function to apply per element
*/
-void GNUNET_CONTAINER_bloomfilter_resize (struct GNUNET_CONTAINER_BloomFilter
- *bf, GNUNET_HashCodeIterator iterator,
- void *iterator_cls, size_t size,
- unsigned int k);
+void
+GNUNET_CONTAINER_bloomfilter_resize (struct GNUNET_CONTAINER_BloomFilter *bf,
+ GNUNET_HashCodeIterator iterator,
+ void *iterator_cls, size_t size,
+ unsigned int k);
/* ****************** metadata ******************* */
*
* @return empty meta-data container
*/
-struct GNUNET_CONTAINER_MetaData *GNUNET_CONTAINER_meta_data_create (void);
+struct GNUNET_CONTAINER_MetaData *
+GNUNET_CONTAINER_meta_data_create (void);
/**
* Duplicate a MetaData token.
* @param md what to duplicate
* @return duplicate meta-data container
*/
-struct GNUNET_CONTAINER_MetaData *GNUNET_CONTAINER_meta_data_duplicate (const
- struct
- GNUNET_CONTAINER_MetaData
- *md);
+struct GNUNET_CONTAINER_MetaData *
+GNUNET_CONTAINER_meta_data_duplicate (const struct GNUNET_CONTAINER_MetaData
+ *md);
/**
* Free meta data.
*
* @param md what to free
*/
-void GNUNET_CONTAINER_meta_data_destroy (struct GNUNET_CONTAINER_MetaData *md);
+void
+GNUNET_CONTAINER_meta_data_destroy (struct GNUNET_CONTAINER_MetaData *md);
/**
* Test if two MDs are equal. We consider them equal if
* @param md2 other value to check
* @return GNUNET_YES if they are equal
*/
-int GNUNET_CONTAINER_meta_data_test_equal (const struct
- GNUNET_CONTAINER_MetaData *md1,
- const struct
- GNUNET_CONTAINER_MetaData *md2);
+int
+GNUNET_CONTAINER_meta_data_test_equal (const struct GNUNET_CONTAINER_MetaData
+ *md1,
+ const struct GNUNET_CONTAINER_MetaData
+ *md2);
/**
* @return GNUNET_OK on success, GNUNET_SYSERR if this entry already exists
* data_mime_type and plugin_name are not considered for "exists" checks
*/
-int GNUNET_CONTAINER_meta_data_insert (struct GNUNET_CONTAINER_MetaData *md,
- const char *plugin_name,
- enum EXTRACTOR_MetaType type,
- enum EXTRACTOR_MetaFormat format,
- const char *data_mime_type,
- const char *data, size_t data_len);
+int
+GNUNET_CONTAINER_meta_data_insert (struct GNUNET_CONTAINER_MetaData *md,
+ const char *plugin_name,
+ enum EXTRACTOR_MetaType type,
+ enum EXTRACTOR_MetaFormat format,
+ const char *data_mime_type, const char *data,
+ size_t data_len);
/**
* @param md metadata to extend
* @param in metadata to merge
*/
-void GNUNET_CONTAINER_meta_data_merge (struct GNUNET_CONTAINER_MetaData *md,
- const struct GNUNET_CONTAINER_MetaData
- *in);
+void
+GNUNET_CONTAINER_meta_data_merge (struct GNUNET_CONTAINER_MetaData *md,
+ const struct GNUNET_CONTAINER_MetaData *in);
/**
* @param data_len number of bytes in data
* @return GNUNET_OK on success, GNUNET_SYSERR if the item does not exist in md
*/
-int GNUNET_CONTAINER_meta_data_delete (struct GNUNET_CONTAINER_MetaData *md,
- enum EXTRACTOR_MetaType type,
- const char *data, size_t data_len);
+int
+GNUNET_CONTAINER_meta_data_delete (struct GNUNET_CONTAINER_MetaData *md,
+ enum EXTRACTOR_MetaType type,
+ const char *data, size_t data_len);
/**
*
* @param md metadata to manipulate
*/
-void GNUNET_CONTAINER_meta_data_clear (struct GNUNET_CONTAINER_MetaData *md);
+void
+GNUNET_CONTAINER_meta_data_clear (struct GNUNET_CONTAINER_MetaData *md);
/**
*
* @param md metadata to modify
*/
-void GNUNET_CONTAINER_meta_data_add_publication_date (struct
- GNUNET_CONTAINER_MetaData
- *md);
+void
+GNUNET_CONTAINER_meta_data_add_publication_date (struct
+ GNUNET_CONTAINER_MetaData *md);
/**
* @param iter_cls closure for iterator
* @return number of entries
*/
-int GNUNET_CONTAINER_meta_data_iterate (const struct GNUNET_CONTAINER_MetaData
- *md, EXTRACTOR_MetaDataProcessor iter,
- void *iter_cls);
+int
+GNUNET_CONTAINER_meta_data_iterate (const struct GNUNET_CONTAINER_MetaData *md,
+ EXTRACTOR_MetaDataProcessor iter,
+ void *iter_cls);
/**
* Get the first MD entry of the given type. Caller
* @param type type to look for
* @return NULL if no entry was found
*/
-char *GNUNET_CONTAINER_meta_data_get_by_type (const struct
- GNUNET_CONTAINER_MetaData *md,
- enum EXTRACTOR_MetaType type);
+char *
+GNUNET_CONTAINER_meta_data_get_by_type (const struct GNUNET_CONTAINER_MetaData
+ *md, enum EXTRACTOR_MetaType type);
/**
* @return NULL if we do not have any such entry,
* otherwise client is responsible for freeing the value!
*/
-char *GNUNET_CONTAINER_meta_data_get_first_by_types (const struct
- GNUNET_CONTAINER_MetaData
- *md, ...);
+char *
+GNUNET_CONTAINER_meta_data_get_first_by_types (const struct
+ GNUNET_CONTAINER_MetaData *md,
+ ...);
/**
* Get a thumbnail from the meta-data (if present). Only matches meta
* freed by the caller!
* @return number of bytes in thumbnail, 0 if not available
*/
-size_t GNUNET_CONTAINER_meta_data_get_thumbnail (const struct
- GNUNET_CONTAINER_MetaData *md,
- unsigned char **thumb);
+size_t
+GNUNET_CONTAINER_meta_data_get_thumbnail (const struct GNUNET_CONTAINER_MetaData
+ *md, unsigned char **thumb);
* -1 on error (typically: not enough
* space)
*/
-ssize_t
+ssize_t
GNUNET_CONTAINER_meta_data_serialize (const struct GNUNET_CONTAINER_MetaData
*md, char **target, size_t max,
enum
* @param md metadata to inspect
* @return number of bytes needed for serialization, -1 on error
*/
-ssize_t
+ssize_t
GNUNET_CONTAINER_meta_data_get_serialized_size (const struct
GNUNET_CONTAINER_MetaData *md);
* @return MD on success, NULL on error (i.e.
* bad format)
*/
-struct GNUNET_CONTAINER_MetaData *GNUNET_CONTAINER_meta_data_deserialize (const
- char
- *input,
- size_t
- size);
+struct GNUNET_CONTAINER_MetaData *
+GNUNET_CONTAINER_meta_data_deserialize (const char *input, size_t size);
/* ******************************* HashMap **************************** */
* @param len initial size (map will grow as needed)
* @return NULL on error
*/
-struct GNUNET_CONTAINER_MultiHashMap
- *GNUNET_CONTAINER_multihashmap_create (unsigned int len);
+struct GNUNET_CONTAINER_MultiHashMap *
+GNUNET_CONTAINER_multihashmap_create (unsigned int len);
/**
*
* @param map the map
*/
-void GNUNET_CONTAINER_multihashmap_destroy (struct GNUNET_CONTAINER_MultiHashMap
- *map);
+void
+GNUNET_CONTAINER_multihashmap_destroy (struct GNUNET_CONTAINER_MultiHashMap
+ *map);
/**
* happen to be NULL; use "contains" to test for
* key-value pairs with value NULL
*/
-void *GNUNET_CONTAINER_multihashmap_get (const struct
- GNUNET_CONTAINER_MultiHashMap *map,
- const GNUNET_HashCode * key);
+void *
+GNUNET_CONTAINER_multihashmap_get (const struct GNUNET_CONTAINER_MultiHashMap
+ *map, const GNUNET_HashCode * key);
/**
* @return GNUNET_YES on success, GNUNET_NO if the key-value pair
* is not in the map
*/
-int GNUNET_CONTAINER_multihashmap_remove (struct GNUNET_CONTAINER_MultiHashMap
- *map, const GNUNET_HashCode * key,
- void *value);
+int
+GNUNET_CONTAINER_multihashmap_remove (struct GNUNET_CONTAINER_MultiHashMap *map,
+ const GNUNET_HashCode * key, void *value);
/**
* Remove all entries for the given key from the map.
* @param key identifies values to be removed
* @return number of values removed
*/
-int GNUNET_CONTAINER_multihashmap_remove_all (struct
- GNUNET_CONTAINER_MultiHashMap
- *map,
- const GNUNET_HashCode * key);
+int
+GNUNET_CONTAINER_multihashmap_remove_all (struct GNUNET_CONTAINER_MultiHashMap
+ *map, const GNUNET_HashCode * key);
/**
* @return GNUNET_YES if such a value exists,
* GNUNET_NO if not
*/
-int GNUNET_CONTAINER_multihashmap_contains (const struct
- GNUNET_CONTAINER_MultiHashMap *map,
- const GNUNET_HashCode * key);
+int
+GNUNET_CONTAINER_multihashmap_contains (const struct
+ GNUNET_CONTAINER_MultiHashMap *map,
+ const GNUNET_HashCode * key);
/**
* @return GNUNET_YES if such a value exists,
* GNUNET_NO if not
*/
-int GNUNET_CONTAINER_multihashmap_contains_value (const struct
- GNUNET_CONTAINER_MultiHashMap
- *map,
- const GNUNET_HashCode * key,
- const void *value);
+int
+GNUNET_CONTAINER_multihashmap_contains_value (const struct
+ GNUNET_CONTAINER_MultiHashMap
+ *map, const GNUNET_HashCode * key,
+ const void *value);
/**
* GNUNET_SYSERR if UNIQUE_ONLY was the option and the
* value already exists
*/
-int GNUNET_CONTAINER_multihashmap_put (struct GNUNET_CONTAINER_MultiHashMap
- *map, const GNUNET_HashCode * key,
- void *value,
- enum GNUNET_CONTAINER_MultiHashMapOption
- opt);
+int
+GNUNET_CONTAINER_multihashmap_put (struct GNUNET_CONTAINER_MultiHashMap *map,
+ const GNUNET_HashCode * key, void *value,
+ enum GNUNET_CONTAINER_MultiHashMapOption
+ opt);
/**
* Get the number of key-value pairs in the map.
* @param map the map
* @return the number of key value pairs
*/
-unsigned int GNUNET_CONTAINER_multihashmap_size (const struct
- GNUNET_CONTAINER_MultiHashMap
- *map);
+unsigned int
+GNUNET_CONTAINER_multihashmap_size (const struct GNUNET_CONTAINER_MultiHashMap
+ *map);
/**
* @return the number of key value pairs processed,
* GNUNET_SYSERR if it aborted iteration
*/
-int GNUNET_CONTAINER_multihashmap_iterate (const struct
- GNUNET_CONTAINER_MultiHashMap *map,
- GNUNET_CONTAINER_HashMapIterator it,
- void *it_cls);
+int
+GNUNET_CONTAINER_multihashmap_iterate (const struct
+ GNUNET_CONTAINER_MultiHashMap *map,
+ GNUNET_CONTAINER_HashMapIterator it,
+ void *it_cls);
/**
* @return the number of key value pairs processed,
* GNUNET_SYSERR if it aborted iteration
*/
-int GNUNET_CONTAINER_multihashmap_get_multiple (const struct
- GNUNET_CONTAINER_MultiHashMap
- *map,
- const GNUNET_HashCode * key,
- GNUNET_CONTAINER_HashMapIterator
- it, void *it_cls);
+int
+GNUNET_CONTAINER_multihashmap_get_multiple (const struct
+ GNUNET_CONTAINER_MultiHashMap *map,
+ const GNUNET_HashCode * key,
+ GNUNET_CONTAINER_HashMapIterator it,
+ void *it_cls);
/* ******************** doubly-linked list *************** */
* @param order how should the heap be sorted?
* @return handle to the heap
*/
-struct GNUNET_CONTAINER_Heap *GNUNET_CONTAINER_heap_create (enum
- GNUNET_CONTAINER_HeapOrder
- order);
+struct GNUNET_CONTAINER_Heap *
+GNUNET_CONTAINER_heap_create (enum GNUNET_CONTAINER_HeapOrder order);
/**
*
* @param heap heap to destroy
*/
-void GNUNET_CONTAINER_heap_destroy (struct GNUNET_CONTAINER_Heap *heap);
+void
+GNUNET_CONTAINER_heap_destroy (struct GNUNET_CONTAINER_Heap *heap);
/**
* @param heap heap to inspect
* @return NULL if heap is empty
*/
-void *GNUNET_CONTAINER_heap_peek (const struct GNUNET_CONTAINER_Heap *heap);
+void *
+GNUNET_CONTAINER_heap_peek (const struct GNUNET_CONTAINER_Heap *heap);
/**
* @param heap the heap to get the size of
* @return number of elements stored
*/
-unsigned int GNUNET_CONTAINER_heap_get_size (const struct GNUNET_CONTAINER_Heap
- *heap);
+unsigned int
+GNUNET_CONTAINER_heap_get_size (const struct GNUNET_CONTAINER_Heap *heap);
/**
* @param node the node to get the cost of
* @return cost of the node
*/
-GNUNET_CONTAINER_HeapCostType GNUNET_CONTAINER_heap_node_get_cost (const struct
- GNUNET_CONTAINER_HeapNode
- *node);
+GNUNET_CONTAINER_HeapCostType
+GNUNET_CONTAINER_heap_node_get_cost (const struct GNUNET_CONTAINER_HeapNode
+ *node);
/**
* Iterator for heap
* @param iterator function to call on each entry
* @param iterator_cls closure for iterator
*/
-void GNUNET_CONTAINER_heap_iterate (const struct GNUNET_CONTAINER_Heap *heap,
- GNUNET_CONTAINER_HeapIterator iterator,
- void *iterator_cls);
+void
+GNUNET_CONTAINER_heap_iterate (const struct GNUNET_CONTAINER_Heap *heap,
+ GNUNET_CONTAINER_HeapIterator iterator,
+ void *iterator_cls);
/**
* NULL if the heap is empty.
*
*/
-void *GNUNET_CONTAINER_heap_get_random (struct GNUNET_CONTAINER_Heap *heap,
- uint32_t max);
+void *
+GNUNET_CONTAINER_heap_get_random (struct GNUNET_CONTAINER_Heap *heap,
+ uint32_t max);
/**
* @return data stored at the next random node in the walk;
* NULL if the tree is empty.
*/
-void *GNUNET_CONTAINER_heap_walk_get_next (struct GNUNET_CONTAINER_Heap *heap);
+void *
+GNUNET_CONTAINER_heap_walk_get_next (struct GNUNET_CONTAINER_Heap *heap);
/**
* @param cost cost for the element
* @return node for the new element
*/
-struct GNUNET_CONTAINER_HeapNode *GNUNET_CONTAINER_heap_insert (struct
- GNUNET_CONTAINER_Heap
- *heap,
- void *element,
- GNUNET_CONTAINER_HeapCostType
- cost);
+struct GNUNET_CONTAINER_HeapNode *
+GNUNET_CONTAINER_heap_insert (struct GNUNET_CONTAINER_Heap *heap, void *element,
+ GNUNET_CONTAINER_HeapCostType cost);
/**
* @param heap heap to modify
* @return element data stored at the root node
*/
-void *GNUNET_CONTAINER_heap_remove_root (struct GNUNET_CONTAINER_Heap *heap);
+void *
+GNUNET_CONTAINER_heap_remove_root (struct GNUNET_CONTAINER_Heap *heap);
/**
* @param node node to remove
* @return element data stored at the node, NULL if heap is empty
*/
-void *GNUNET_CONTAINER_heap_remove_node (struct GNUNET_CONTAINER_HeapNode
- *node);
+void *
+GNUNET_CONTAINER_heap_remove_node (struct GNUNET_CONTAINER_HeapNode *node);
/**
* @param node node for which the cost is to be changed
* @param new_cost new cost for the node
*/
-void GNUNET_CONTAINER_heap_update_cost (struct GNUNET_CONTAINER_Heap *heap,
- struct GNUNET_CONTAINER_HeapNode *node,
- GNUNET_CONTAINER_HeapCostType new_cost);
+void
+GNUNET_CONTAINER_heap_update_cost (struct GNUNET_CONTAINER_Heap *heap,
+ struct GNUNET_CONTAINER_HeapNode *node,
+ GNUNET_CONTAINER_HeapCostType new_cost);
/* ******************** Singly linked list *************** */
* @param buf payload buffer
* @param len length of the buffer
*/
-void GNUNET_CONTAINER_slist_add (struct GNUNET_CONTAINER_SList *l,
- enum GNUNET_CONTAINER_SListDisposition disp,
- const void *buf, size_t len);
+void
+GNUNET_CONTAINER_slist_add (struct GNUNET_CONTAINER_SList *l,
+ enum GNUNET_CONTAINER_SListDisposition disp,
+ const void *buf, size_t len);
/**
* @param buf payload buffer
* @param len length of the buffer
*/
-void GNUNET_CONTAINER_slist_add_end (struct GNUNET_CONTAINER_SList *l,
- enum GNUNET_CONTAINER_SListDisposition
- disp, const void *buf, size_t len);
+void
+GNUNET_CONTAINER_slist_add_end (struct GNUNET_CONTAINER_SList *l,
+ enum GNUNET_CONTAINER_SListDisposition disp,
+ const void *buf, size_t len);
/**
* @param dst list to append to
* @param src source
*/
-void GNUNET_CONTAINER_slist_append (struct GNUNET_CONTAINER_SList *dst,
- struct GNUNET_CONTAINER_SList *src);
+void
+GNUNET_CONTAINER_slist_append (struct GNUNET_CONTAINER_SList *dst,
+ struct GNUNET_CONTAINER_SList *src);
/**
* Create a new singly linked list
* @return the new list
*/
-struct GNUNET_CONTAINER_SList *GNUNET_CONTAINER_slist_create (void);
+struct GNUNET_CONTAINER_SList *
+GNUNET_CONTAINER_slist_create (void);
/**
* Destroy a singly linked list
* @param l the list to be destroyed
*/
-void GNUNET_CONTAINER_slist_destroy (struct GNUNET_CONTAINER_SList *l);
+void
+GNUNET_CONTAINER_slist_destroy (struct GNUNET_CONTAINER_SList *l);
/**
* @param l list
* @return iterator pointing to the beginning, free using "GNUNET_free"
*/
-struct GNUNET_CONTAINER_SList_Iterator *GNUNET_CONTAINER_slist_begin (struct
- GNUNET_CONTAINER_SList
- *l);
+struct GNUNET_CONTAINER_SList_Iterator *
+GNUNET_CONTAINER_slist_begin (struct GNUNET_CONTAINER_SList *l);
/**
*
* @param l list
*/
-void GNUNET_CONTAINER_slist_clear (struct GNUNET_CONTAINER_SList *l);
+void
+GNUNET_CONTAINER_slist_clear (struct GNUNET_CONTAINER_SList *l);
/**
* @param buf payload buffer to find
* @param len length of the payload (number of bytes in buf)
*/
-int GNUNET_CONTAINER_slist_contains (const struct GNUNET_CONTAINER_SList *l,
- const void *buf, size_t len);
+int
+GNUNET_CONTAINER_slist_contains (const struct GNUNET_CONTAINER_SList *l,
+ const void *buf, size_t len);
/**
* @param l list
* @return number of elements in the list
*/
-int GNUNET_CONTAINER_slist_count (const struct GNUNET_CONTAINER_SList *l);
+int
+GNUNET_CONTAINER_slist_count (const struct GNUNET_CONTAINER_SList *l);
/**
* Remove an element from the list
* @param i iterator that points to the element to be removed
*/
-void GNUNET_CONTAINER_slist_erase (struct GNUNET_CONTAINER_SList_Iterator *i);
+void
+GNUNET_CONTAINER_slist_erase (struct GNUNET_CONTAINER_SList_Iterator *i);
/**
* @param buf payload buffer
* @param len length of the payload
*/
-void GNUNET_CONTAINER_slist_insert (struct GNUNET_CONTAINER_SList_Iterator
- *before,
- enum GNUNET_CONTAINER_SListDisposition disp,
- const void *buf, size_t len);
+void
+GNUNET_CONTAINER_slist_insert (struct GNUNET_CONTAINER_SList_Iterator *before,
+ enum GNUNET_CONTAINER_SListDisposition disp,
+ const void *buf, size_t len);
/**
* @param i iterator
* @return GNUNET_YES on success, GNUNET_NO if the end has been reached
*/
-int GNUNET_CONTAINER_slist_next (struct GNUNET_CONTAINER_SList_Iterator *i);
+int
+GNUNET_CONTAINER_slist_next (struct GNUNET_CONTAINER_SList_Iterator *i);
/**
* @return GNUNET_YES if the end has been reached, GNUNET_NO if the iterator
* points to a valid element
*/
-int GNUNET_CONTAINER_slist_end (struct GNUNET_CONTAINER_SList_Iterator *i);
+int
+GNUNET_CONTAINER_slist_end (struct GNUNET_CONTAINER_SList_Iterator *i);
/**
* @param len set to the payload length
* @return payload
*/
-void *GNUNET_CONTAINER_slist_get (const struct GNUNET_CONTAINER_SList_Iterator
- *i, size_t * len);
+void *
+GNUNET_CONTAINER_slist_get (const struct GNUNET_CONTAINER_SList_Iterator *i,
+ size_t * len);
/**
* Release an iterator
* @param i iterator
*/
-void GNUNET_CONTAINER_slist_iter_destroy (struct GNUNET_CONTAINER_SList_Iterator
- *i);
+void
+GNUNET_CONTAINER_slist_iter_destroy (struct GNUNET_CONTAINER_SList_Iterator *i);
#if 0 /* keep Emacsens' auto-indent happy */
* @return handle to the core service (only useful for disconnect until 'init' is called),
* NULL on error (in this case, init is never called)
*/
-struct GNUNET_CORE_Handle *GNUNET_CORE_connect (const struct
- GNUNET_CONFIGURATION_Handle
- *cfg, unsigned int queue_size,
- void *cls,
- GNUNET_CORE_StartupCallback
- init,
- GNUNET_CORE_ConnectEventHandler
- connects,
- GNUNET_CORE_DisconnectEventHandler
- disconnects,
- GNUNET_CORE_PeerStatusEventHandler
- status_events,
- GNUNET_CORE_MessageCallback
- inbound_notify,
- int inbound_hdr_only,
- GNUNET_CORE_MessageCallback
- outbound_notify,
- int outbound_hdr_only,
- const struct
- GNUNET_CORE_MessageHandler
- *handlers);
+struct GNUNET_CORE_Handle *
+GNUNET_CORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ unsigned int queue_size, void *cls,
+ GNUNET_CORE_StartupCallback init,
+ GNUNET_CORE_ConnectEventHandler connects,
+ GNUNET_CORE_DisconnectEventHandler disconnects,
+ GNUNET_CORE_PeerStatusEventHandler status_events,
+ GNUNET_CORE_MessageCallback inbound_notify,
+ int inbound_hdr_only,
+ GNUNET_CORE_MessageCallback outbound_notify,
+ int outbound_hdr_only,
+ const struct GNUNET_CORE_MessageHandler *handlers);
/**
*
* @param handle connection to core to disconnect
*/
-void GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle);
+void
+GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle);
/**
* @param cont_cls closure for cont
* @return NULL on error (cont will not be called), otherwise handle for cancellation
*/
-struct GNUNET_CORE_PeerRequestHandle *GNUNET_CORE_peer_request_connect (struct
- GNUNET_CORE_Handle
- *h,
- const
- struct
- GNUNET_PeerIdentity
- *peer,
- GNUNET_CORE_ControlContinuation
- cont,
- void
- *cont_cls);
+struct GNUNET_CORE_PeerRequestHandle *
+GNUNET_CORE_peer_request_connect (struct GNUNET_CORE_Handle *h,
+ const struct GNUNET_PeerIdentity *peer,
+ GNUNET_CORE_ControlContinuation cont,
+ void *cont_cls);
/**
*
* @param req request handle that was returned for the original request
*/
-void GNUNET_CORE_peer_request_connect_cancel (struct
- GNUNET_CORE_PeerRequestHandle
- *req);
+void
+GNUNET_CORE_peer_request_connect_cancel (struct GNUNET_CORE_PeerRequestHandle
+ *req);
/**
* @param info_cls closure for info
* @return NULL on error
*/
-struct GNUNET_CORE_InformationRequestContext
- *GNUNET_CORE_peer_change_preference (struct GNUNET_CORE_Handle *h,
- const struct GNUNET_PeerIdentity *peer,
- struct GNUNET_TIME_Relative timeout,
- struct GNUNET_BANDWIDTH_Value32NBO
- bw_out, int32_t amount,
- uint64_t preference,
- GNUNET_CORE_PeerConfigurationInfoCallback
- info, void *info_cls);
+struct GNUNET_CORE_InformationRequestContext *
+GNUNET_CORE_peer_change_preference (struct GNUNET_CORE_Handle *h,
+ const struct GNUNET_PeerIdentity *peer,
+ struct GNUNET_TIME_Relative timeout,
+ struct GNUNET_BANDWIDTH_Value32NBO bw_out,
+ int32_t amount, uint64_t preference,
+ GNUNET_CORE_PeerConfigurationInfoCallback
+ info, void *info_cls);
/**
*
* @param irc context returned by the original GNUNET_CORE_peer_get_info call
*/
-void GNUNET_CORE_peer_change_preference_cancel (struct
- GNUNET_CORE_InformationRequestContext
- *irc);
+void
+GNUNET_CORE_peer_change_preference_cancel (struct
+ GNUNET_CORE_InformationRequestContext
+ *irc);
/**
* @param cb_cls closure for peer_cb
* @return GNUNET_OK on success, GNUNET_SYSERR on errors
*/
-int GNUNET_CORE_iterate_peers (const struct GNUNET_CONFIGURATION_Handle *cfg,
- GNUNET_CORE_ConnectEventHandler peer_cb,
- void *cb_cls);
+int
+GNUNET_CORE_iterate_peers (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ GNUNET_CORE_ConnectEventHandler peer_cb,
+ void *cb_cls);
/**
* Iterate over all currently connected peers.
*
* @return GNUNET_OK if iterating, GNUNET_SYSERR on error
*/
-int GNUNET_CORE_is_peer_connected (const struct GNUNET_CONFIGURATION_Handle
- *cfg, struct GNUNET_PeerIdentity *peer,
- GNUNET_CORE_ConnectEventHandler peer_cb,
- void *cb_cls);
+int
+GNUNET_CORE_is_peer_connected (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ struct GNUNET_PeerIdentity *peer,
+ GNUNET_CORE_ConnectEventHandler peer_cb,
+ void *cb_cls);
/**
* NULL if we can not even queue the request (insufficient
* memory); if NULL is returned, "notify" will NOT be called.
*/
-struct GNUNET_CORE_TransmitHandle *GNUNET_CORE_notify_transmit_ready (struct
- GNUNET_CORE_Handle
- *handle,
- int cork,
- uint32_t
- priority,
- struct
- GNUNET_TIME_Relative
- maxdelay,
- const
- struct
- GNUNET_PeerIdentity
- *target,
- size_t
- notify_size,
- GNUNET_CONNECTION_TransmitReadyNotify
- notify,
- void
- *notify_cls);
+struct GNUNET_CORE_TransmitHandle *
+GNUNET_CORE_notify_transmit_ready (struct GNUNET_CORE_Handle *handle, int cork,
+ uint32_t priority,
+ struct GNUNET_TIME_Relative maxdelay,
+ const struct GNUNET_PeerIdentity *target,
+ size_t notify_size,
+ GNUNET_CONNECTION_TransmitReadyNotify notify,
+ void *notify_cls);
/**
*
* @param th handle that was returned by "notify_transmit_ready".
*/
-void GNUNET_CORE_notify_transmit_ready_cancel (struct GNUNET_CORE_TransmitHandle
- *th);
+void
+GNUNET_CORE_notify_transmit_ready_cancel (struct GNUNET_CORE_TransmitHandle
+ *th);
#if 0 /* keep Emacsens' auto-indent happy */
* @param len the length of the buffer in bytes
* @return the resulting CRC32 checksum
*/
-int32_t GNUNET_CRYPTO_crc32_n (const void *buf, size_t len);
+int32_t
+GNUNET_CRYPTO_crc32_n (const void *buf, size_t len);
/**
* @param i the upper limit (exclusive) for the random number
* @return a random value in the interval [0,i) (exclusive).
*/
-uint32_t GNUNET_CRYPTO_random_u32 (enum GNUNET_CRYPTO_Quality mode, uint32_t i);
+uint32_t
+GNUNET_CRYPTO_random_u32 (enum GNUNET_CRYPTO_Quality mode, uint32_t i);
/**
* @param max value returned will be in range [0,max) (exclusive)
* @return random 64-bit number
*/
-uint64_t GNUNET_CRYPTO_random_u64 (enum GNUNET_CRYPTO_Quality mode,
- uint64_t max);
+uint64_t
+GNUNET_CRYPTO_random_u64 (enum GNUNET_CRYPTO_Quality mode, uint64_t max);
/**
* @param n the size of the array
* @return the permutation array (allocated from heap)
*/
-unsigned int *GNUNET_CRYPTO_random_permute (enum GNUNET_CRYPTO_Quality mode,
- unsigned int n);
+unsigned int *
+GNUNET_CRYPTO_random_permute (enum GNUNET_CRYPTO_Quality mode, unsigned int n);
/**
*
* @param key key to initialize
*/
-void GNUNET_CRYPTO_aes_create_session_key (struct GNUNET_CRYPTO_AesSessionKey
- *key);
+void
+GNUNET_CRYPTO_aes_create_session_key (struct GNUNET_CRYPTO_AesSessionKey *key);
/**
* Check that a new session key is well-formed.
* @param key key to check
* @return GNUNET_OK if the key is valid
*/
-int GNUNET_CRYPTO_aes_check_session_key (const struct
- GNUNET_CRYPTO_AesSessionKey *key);
+int
+GNUNET_CRYPTO_aes_check_session_key (const struct GNUNET_CRYPTO_AesSessionKey
+ *key);
/**
* for streams.
* @return the size of the encrypted block, -1 for errors
*/
-ssize_t GNUNET_CRYPTO_aes_encrypt (const void *block, size_t len,
- const struct GNUNET_CRYPTO_AesSessionKey
- *sessionkey,
- const struct
- GNUNET_CRYPTO_AesInitializationVector *iv,
- void *result);
+ssize_t
+GNUNET_CRYPTO_aes_encrypt (const void *block, size_t len,
+ const struct GNUNET_CRYPTO_AesSessionKey *sessionkey,
+ const struct GNUNET_CRYPTO_AesInitializationVector
+ *iv, void *result);
/**
* @param result address to store the result at
* @return -1 on failure, size of decrypted block on success
*/
-ssize_t GNUNET_CRYPTO_aes_decrypt (const void *block, size_t size,
- const struct GNUNET_CRYPTO_AesSessionKey
- *sessionkey,
- const struct
- GNUNET_CRYPTO_AesInitializationVector *iv,
- void *result);
+ssize_t
+GNUNET_CRYPTO_aes_decrypt (const void *block, size_t size,
+ const struct GNUNET_CRYPTO_AesSessionKey *sessionkey,
+ const struct GNUNET_CRYPTO_AesInitializationVector
+ *iv, void *result);
/**
* @param salt_len size of the salt
* @param ... pairs of void * & size_t for context chunks, terminated by NULL
*/
-void GNUNET_CRYPTO_aes_derive_iv (struct GNUNET_CRYPTO_AesInitializationVector
- *iv,
- const struct GNUNET_CRYPTO_AesSessionKey
- *skey, const void *salt, size_t salt_len,
- ...);
+void
+GNUNET_CRYPTO_aes_derive_iv (struct GNUNET_CRYPTO_AesInitializationVector *iv,
+ const struct GNUNET_CRYPTO_AesSessionKey *skey,
+ const void *salt, size_t salt_len, ...);
/**
* @param salt_len size of the salt
* @param argp pairs of void * & size_t for context chunks, terminated by NULL
*/
-void GNUNET_CRYPTO_aes_derive_iv_v (struct GNUNET_CRYPTO_AesInitializationVector
- *iv,
- const struct GNUNET_CRYPTO_AesSessionKey
- *skey, const void *salt, size_t salt_len,
- va_list argp);
+void
+GNUNET_CRYPTO_aes_derive_iv_v (struct GNUNET_CRYPTO_AesInitializationVector *iv,
+ const struct GNUNET_CRYPTO_AesSessionKey *skey,
+ const void *salt, size_t salt_len, va_list argp);
/**
* @param result where to store the encoding (struct GNUNET_CRYPTO_HashAsciiEncoded can be
* safely cast to char*, a '\\0' termination is set).
*/
-void GNUNET_CRYPTO_hash_to_enc (const GNUNET_HashCode * block,
- struct GNUNET_CRYPTO_HashAsciiEncoded *result);
+void
+GNUNET_CRYPTO_hash_to_enc (const GNUNET_HashCode * block,
+ struct GNUNET_CRYPTO_HashAsciiEncoded *result);
/**
* @param result where to store the GNUNET_CRYPTO_hash code
* @return GNUNET_OK on success, GNUNET_SYSERR if result has the wrong encoding
*/
-int GNUNET_CRYPTO_hash_from_string (const char *enc, GNUNET_HashCode * result);
+int
+GNUNET_CRYPTO_hash_from_string (const char *enc, GNUNET_HashCode * result);
/**
* @param b some hash code
* @return number between 0 and UINT32_MAX
*/
-uint32_t GNUNET_CRYPTO_hash_distance_u32 (const GNUNET_HashCode * a,
- const GNUNET_HashCode * b);
+uint32_t
+GNUNET_CRYPTO_hash_distance_u32 (const GNUNET_HashCode * a,
+ const GNUNET_HashCode * b);
/**
* @param size size of the block
* @param ret pointer to where to write the hashcode
*/
-void GNUNET_CRYPTO_hash (const void *block, size_t size, GNUNET_HashCode * ret);
+void
+GNUNET_CRYPTO_hash (const void *block, size_t size, GNUNET_HashCode * ret);
/**
* @param plaintext_len length of plaintext
* @param hmac where to store the hmac
*/
-void GNUNET_CRYPTO_hmac (const struct GNUNET_CRYPTO_AuthKey *key,
- const void *plaintext, size_t plaintext_len,
- GNUNET_HashCode * hmac);
+void
+GNUNET_CRYPTO_hmac (const struct GNUNET_CRYPTO_AuthKey *key,
+ const void *plaintext, size_t plaintext_len,
+ GNUNET_HashCode * hmac);
/**
* @param callback_cls closure for callback
* @return NULL on (immediate) errror
*/
-struct GNUNET_CRYPTO_FileHashContext *GNUNET_CRYPTO_hash_file (enum
- GNUNET_SCHEDULER_Priority
- priority,
- const char
- *filename,
- size_t blocksize,
- GNUNET_CRYPTO_HashCompletedCallback
- callback,
- void
- *callback_cls);
+struct GNUNET_CRYPTO_FileHashContext *
+GNUNET_CRYPTO_hash_file (enum GNUNET_SCHEDULER_Priority priority,
+ const char *filename, size_t blocksize,
+ GNUNET_CRYPTO_HashCompletedCallback callback,
+ void *callback_cls);
/**
*
* @param fhc operation to cancel (callback must not yet have been invoked)
*/
-void GNUNET_CRYPTO_hash_file_cancel (struct GNUNET_CRYPTO_FileHashContext *fhc);
+void
+GNUNET_CRYPTO_hash_file_cancel (struct GNUNET_CRYPTO_FileHashContext *fhc);
/**
* @param mode desired quality level
* @param result hash code that is randomized
*/
-void GNUNET_CRYPTO_hash_create_random (enum GNUNET_CRYPTO_Quality mode,
- GNUNET_HashCode * result);
+void
+GNUNET_CRYPTO_hash_create_random (enum GNUNET_CRYPTO_Quality mode,
+ GNUNET_HashCode * result);
/**
* @param b some hash code
* @param result set to b - a
*/
-void GNUNET_CRYPTO_hash_difference (const GNUNET_HashCode * a,
- const GNUNET_HashCode * b,
- GNUNET_HashCode * result);
+void
+GNUNET_CRYPTO_hash_difference (const GNUNET_HashCode * a,
+ const GNUNET_HashCode * b,
+ GNUNET_HashCode * result);
/**
* @param delta some hash code
* @param result set to a + delta
*/
-void GNUNET_CRYPTO_hash_sum (const GNUNET_HashCode * a,
- const GNUNET_HashCode * delta,
- GNUNET_HashCode * result);
+void
+GNUNET_CRYPTO_hash_sum (const GNUNET_HashCode * a,
+ const GNUNET_HashCode * delta,
+ GNUNET_HashCode * result);
/**
* @param b some hash code
* @param result set to a ^ b
*/
-void GNUNET_CRYPTO_hash_xor (const GNUNET_HashCode * a,
- const GNUNET_HashCode * b,
- GNUNET_HashCode * result);
+void
+GNUNET_CRYPTO_hash_xor (const GNUNET_HashCode * a, const GNUNET_HashCode * b,
+ GNUNET_HashCode * result);
/**
* @param skey set to a valid session key
* @param iv set to a valid initialization vector
*/
-void GNUNET_CRYPTO_hash_to_aes_key (const GNUNET_HashCode * hc,
- struct GNUNET_CRYPTO_AesSessionKey *skey,
- struct GNUNET_CRYPTO_AesInitializationVector
- *iv);
+void
+GNUNET_CRYPTO_hash_to_aes_key (const GNUNET_HashCode * hc,
+ struct GNUNET_CRYPTO_AesSessionKey *skey,
+ struct GNUNET_CRYPTO_AesInitializationVector
+ *iv);
/**
* @param bit index into the hashcode, [0...159]
* @return Bit \a bit from hashcode \a code, -1 for invalid index
*/
-int GNUNET_CRYPTO_hash_get_bit (const GNUNET_HashCode * code, unsigned int bit);
+int
+GNUNET_CRYPTO_hash_get_bit (const GNUNET_HashCode * code, unsigned int bit);
/**
* Determine how many low order bits match in two
*
* @return the number of bits that match
*/
-unsigned int GNUNET_CRYPTO_hash_matching_bits (const GNUNET_HashCode * first,
- const GNUNET_HashCode * second);
+unsigned int
+GNUNET_CRYPTO_hash_matching_bits (const GNUNET_HashCode * first,
+ const GNUNET_HashCode * second);
/**
* @param h2 some hash code
* @return 1 if h1 > h2, -1 if h1 < h2 and 0 if h1 == h2.
*/
-int GNUNET_CRYPTO_hash_cmp (const GNUNET_HashCode * h1,
- const GNUNET_HashCode * h2);
+int
+GNUNET_CRYPTO_hash_cmp (const GNUNET_HashCode * h1, const GNUNET_HashCode * h2);
/**
* @param target some hash code
* @return -1 if h1 is closer, 1 if h2 is closer and 0 if h1==h2.
*/
-int GNUNET_CRYPTO_hash_xorcmp (const GNUNET_HashCode * h1,
- const GNUNET_HashCode * h2,
- const GNUNET_HashCode * target);
+int
+GNUNET_CRYPTO_hash_xorcmp (const GNUNET_HashCode * h1,
+ const GNUNET_HashCode * h2,
+ const GNUNET_HashCode * target);
/**
* @param salt_len size of the salt
* @param argp pair of void * & size_t for context chunks, terminated by NULL
*/
-void GNUNET_CRYPTO_hmac_derive_key_v (struct GNUNET_CRYPTO_AuthKey *key,
- const struct GNUNET_CRYPTO_AesSessionKey
- *rkey, const void *salt, size_t salt_len,
- va_list argp);
+void
+GNUNET_CRYPTO_hmac_derive_key_v (struct GNUNET_CRYPTO_AuthKey *key,
+ const struct GNUNET_CRYPTO_AesSessionKey *rkey,
+ const void *salt, size_t salt_len,
+ va_list argp);
/**
* @param salt_len size of the salt
* @param ... pair of void * & size_t for context chunks, terminated by NULL
*/
-void GNUNET_CRYPTO_hmac_derive_key (struct GNUNET_CRYPTO_AuthKey *key,
- const struct GNUNET_CRYPTO_AesSessionKey
- *rkey, const void *salt, size_t salt_len,
- ...);
+void
+GNUNET_CRYPTO_hmac_derive_key (struct GNUNET_CRYPTO_AuthKey *key,
+ const struct GNUNET_CRYPTO_AesSessionKey *rkey,
+ const void *salt, size_t salt_len, ...);
/**
* @brief Derive key
* @param skm_len length of skm
* @return GNUNET_YES on success
*/
-int GNUNET_CRYPTO_hkdf (void *result, size_t out_len, int xtr_algo,
- int prf_algo, const void *xts, size_t xts_len,
- const void *skm, size_t skm_len, ...);
+int
+GNUNET_CRYPTO_hkdf (void *result, size_t out_len, int xtr_algo, int prf_algo,
+ const void *xts, size_t xts_len, const void *skm,
+ size_t skm_len, ...);
/**
* @param argp va_list of void * & size_t pairs for context chunks
* @return GNUNET_YES on success
*/
-int GNUNET_CRYPTO_hkdf_v (void *result, size_t out_len, int xtr_algo,
- int prf_algo, const void *xts, size_t xts_len,
- const void *skm, size_t skm_len, va_list argp);
+int
+GNUNET_CRYPTO_hkdf_v (void *result, size_t out_len, int xtr_algo, int prf_algo,
+ const void *xts, size_t xts_len, const void *skm,
+ size_t skm_len, va_list argp);
/**
* @param argp va_list of void * & size_t pairs for context chunks
* @return GNUNET_YES on success
*/
-int GNUNET_CRYPTO_kdf_v (void *result, size_t out_len, const void *xts,
- size_t xts_len, const void *skm, size_t skm_len,
- va_list argp);
+int
+GNUNET_CRYPTO_kdf_v (void *result, size_t out_len, const void *xts,
+ size_t xts_len, const void *skm, size_t skm_len,
+ va_list argp);
/**
* @param ... void * & size_t pairs for context chunks
* @return GNUNET_YES on success
*/
-int GNUNET_CRYPTO_kdf (void *result, size_t out_len, const void *xts,
- size_t xts_len, const void *skm, size_t skm_len, ...);
+int
+GNUNET_CRYPTO_kdf (void *result, size_t out_len, const void *xts,
+ size_t xts_len, const void *skm, size_t skm_len, ...);
/**
*
* @return fresh private key
*/
-struct GNUNET_CRYPTO_RsaPrivateKey *GNUNET_CRYPTO_rsa_key_create (void);
+struct GNUNET_CRYPTO_RsaPrivateKey *
+GNUNET_CRYPTO_rsa_key_create (void);
/**
* Decode the private key from the data-format back
* @param buf the buffer where the private key data is stored
* @param len the length of the data in 'buffer'
*/
-struct GNUNET_CRYPTO_RsaPrivateKey *GNUNET_CRYPTO_rsa_decode_key (const char
- *buf,
- uint16_t len);
+struct GNUNET_CRYPTO_RsaPrivateKey *
+GNUNET_CRYPTO_rsa_decode_key (const char *buf, uint16_t len);
/**
* Create a new private key by reading it from a file. If the
* @return new private key, NULL on error (for example,
* permission denied)
*/
-struct GNUNET_CRYPTO_RsaPrivateKey
- *GNUNET_CRYPTO_rsa_key_create_from_file (const char *filename);
+struct GNUNET_CRYPTO_RsaPrivateKey *
+GNUNET_CRYPTO_rsa_key_create_from_file (const char *filename);
/**
* @param hc "random" input to PRNG
* @return some private key purely dependent on input
*/
-struct GNUNET_CRYPTO_RsaPrivateKey
- *GNUNET_CRYPTO_rsa_key_create_from_hash (const GNUNET_HashCode * hc);
+struct GNUNET_CRYPTO_RsaPrivateKey *
+GNUNET_CRYPTO_rsa_key_create_from_hash (const GNUNET_HashCode * hc);
/**
* Free memory occupied by the private key.
* @param hostkey pointer to the memory to free
*/
-void GNUNET_CRYPTO_rsa_key_free (struct GNUNET_CRYPTO_RsaPrivateKey *hostkey);
+void
+GNUNET_CRYPTO_rsa_key_free (struct GNUNET_CRYPTO_RsaPrivateKey *hostkey);
/**
* @param priv the private key
* @param pub where to write the public key
*/
-void GNUNET_CRYPTO_rsa_key_get_public (const struct GNUNET_CRYPTO_RsaPrivateKey
- *priv,
- struct
- GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
- *pub);
+void
+GNUNET_CRYPTO_rsa_key_get_public (const struct GNUNET_CRYPTO_RsaPrivateKey
+ *priv,
+ struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
+ *pub);
/**
* @param target where to store the encrypted block
* @return GNUNET_SYSERR on error, GNUNET_OK if ok
*/
-int GNUNET_CRYPTO_rsa_encrypt (const void *block, size_t size,
- const struct
- GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
- *publicKey,
- struct GNUNET_CRYPTO_RsaEncryptedData *target);
+int
+GNUNET_CRYPTO_rsa_encrypt (const void *block, size_t size,
+ const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
+ *publicKey,
+ struct GNUNET_CRYPTO_RsaEncryptedData *target);
/**
* @param max how many bytes of a result are expected? Must be exact.
* @return the size of the decrypted block (that is, size) or -1 on error
*/
-ssize_t GNUNET_CRYPTO_rsa_decrypt (const struct GNUNET_CRYPTO_RsaPrivateKey
- *key,
- const struct GNUNET_CRYPTO_RsaEncryptedData
- *block, void *result, size_t max);
+ssize_t
+GNUNET_CRYPTO_rsa_decrypt (const struct GNUNET_CRYPTO_RsaPrivateKey *key,
+ const struct GNUNET_CRYPTO_RsaEncryptedData *block,
+ void *result, size_t max);
/**
* @param sig where to write the signature
* @return GNUNET_SYSERR on error, GNUNET_OK on success
*/
-int GNUNET_CRYPTO_rsa_sign (const struct GNUNET_CRYPTO_RsaPrivateKey *key,
- const struct GNUNET_CRYPTO_RsaSignaturePurpose
- *purpose, struct GNUNET_CRYPTO_RsaSignature *sig);
+int
+GNUNET_CRYPTO_rsa_sign (const struct GNUNET_CRYPTO_RsaPrivateKey *key,
+ const struct GNUNET_CRYPTO_RsaSignaturePurpose *purpose,
+ struct GNUNET_CRYPTO_RsaSignature *sig);
/**
* @param publicKey public key of the signer
* @return GNUNET_OK if ok, GNUNET_SYSERR if invalid
*/
-int GNUNET_CRYPTO_rsa_verify (uint32_t purpose,
- const struct GNUNET_CRYPTO_RsaSignaturePurpose
- *validate,
- const struct GNUNET_CRYPTO_RsaSignature *sig,
- const struct
- GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
- *publicKey);
+int
+GNUNET_CRYPTO_rsa_verify (uint32_t purpose,
+ const struct GNUNET_CRYPTO_RsaSignaturePurpose
+ *validate,
+ const struct GNUNET_CRYPTO_RsaSignature *sig,
+ const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
+ *publicKey);
* where strong entropy gathering is not desired
* (for example, for hostkey generation).
*/
-void GNUNET_CRYPTO_random_disable_entropy_gathering (void);
+void
+GNUNET_CRYPTO_random_disable_entropy_gathering (void);
#if 0 /* keep Emacsens' auto-indent happy */
{
* @param section section in the configuration that contains our options
* @return handle to use to access the service
*/
-struct GNUNET_DATACACHE_Handle *GNUNET_DATACACHE_create (const struct
- GNUNET_CONFIGURATION_Handle
- *cfg,
- const char *section);
+struct GNUNET_DATACACHE_Handle *
+GNUNET_DATACACHE_create (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *section);
/**
*
* @param h handle to the datastore
*/
-void GNUNET_DATACACHE_destroy (struct GNUNET_DATACACHE_Handle *h);
+void
+GNUNET_DATACACHE_destroy (struct GNUNET_DATACACHE_Handle *h);
/**
* @param discard_time when to discard the value in any case
* @return GNUNET_OK on success, GNUNET_SYSERR on error (full, etc.)
*/
-int GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h,
- const GNUNET_HashCode * key, size_t size,
- const char *data, enum GNUNET_BLOCK_Type type,
- struct GNUNET_TIME_Absolute discard_time);
+int
+GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h,
+ const GNUNET_HashCode * key, size_t size,
+ const char *data, enum GNUNET_BLOCK_Type type,
+ struct GNUNET_TIME_Absolute discard_time);
/**
* @param iter_cls closure for iter
* @return the number of results found
*/
-unsigned int GNUNET_DATACACHE_get (struct GNUNET_DATACACHE_Handle *h,
- const GNUNET_HashCode * key,
- enum GNUNET_BLOCK_Type type,
- GNUNET_DATACACHE_Iterator iter,
- void *iter_cls);
+unsigned int
+GNUNET_DATACACHE_get (struct GNUNET_DATACACHE_Handle *h,
+ const GNUNET_HashCode * key, enum GNUNET_BLOCK_Type type,
+ GNUNET_DATACACHE_Iterator iter, void *iter_cls);
#if 0 /* keep Emacsens' auto-indent happy */
* @param cfg configuration to use
* @return handle to use to access the service
*/
-struct GNUNET_DATASTORE_Handle *GNUNET_DATASTORE_connect (const struct
- GNUNET_CONFIGURATION_Handle
- *cfg);
+struct GNUNET_DATASTORE_Handle *
+GNUNET_DATASTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
/**
* @param h handle to the datastore
* @param drop set to GNUNET_YES to delete all data in datastore (!)
*/
-void GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h, int drop);
+void
+GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h, int drop);
/**
* cancel; note that even if NULL is returned, the callback will be invoked
* (or rather, will already have been invoked)
*/
-struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_reserve (struct
- GNUNET_DATASTORE_Handle
- *h,
- uint64_t amount,
- uint32_t entries,
- unsigned int
- queue_priority,
- unsigned int
- max_queue_size,
- struct
- GNUNET_TIME_Relative
- timeout,
- GNUNET_DATASTORE_ContinuationWithStatus
- cont,
- void *cont_cls);
+struct GNUNET_DATASTORE_QueueEntry *
+GNUNET_DATASTORE_reserve (struct GNUNET_DATASTORE_Handle *h, uint64_t amount,
+ uint32_t entries, unsigned int queue_priority,
+ unsigned int max_queue_size,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_DATASTORE_ContinuationWithStatus cont,
+ void *cont_cls);
/**
* cancel; note that even if NULL is returned, the callback will be invoked
* (or rather, will already have been invoked)
*/
-struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_put (struct
- GNUNET_DATASTORE_Handle
- *h, uint32_t rid,
- const GNUNET_HashCode
- * key, size_t size,
- const void *data,
- enum GNUNET_BLOCK_Type
- type,
- uint32_t priority,
- uint32_t anonymity,
- uint32_t replication,
- struct
- GNUNET_TIME_Absolute
- expiration,
- unsigned int
- queue_priority,
- unsigned int
- max_queue_size,
- struct
- GNUNET_TIME_Relative
- timeout,
- GNUNET_DATASTORE_ContinuationWithStatus
- cont, void *cont_cls);
+struct GNUNET_DATASTORE_QueueEntry *
+GNUNET_DATASTORE_put (struct GNUNET_DATASTORE_Handle *h, uint32_t rid,
+ const GNUNET_HashCode * key, size_t size,
+ const void *data, enum GNUNET_BLOCK_Type type,
+ uint32_t priority, uint32_t anonymity,
+ uint32_t replication,
+ struct GNUNET_TIME_Absolute expiration,
+ unsigned int queue_priority, unsigned int max_queue_size,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_DATASTORE_ContinuationWithStatus cont,
+ void *cont_cls);
/**
* cancel; note that even if NULL is returned, the callback will be invoked
* (or rather, will already have been invoked)
*/
-struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_release_reserve (struct
- GNUNET_DATASTORE_Handle
- *h,
- uint32_t
- rid,
- unsigned
- int
- queue_priority,
- unsigned
- int
- max_queue_size,
- struct
- GNUNET_TIME_Relative
- timeout,
- GNUNET_DATASTORE_ContinuationWithStatus
- cont,
- void
- *cont_cls);
+struct GNUNET_DATASTORE_QueueEntry *
+GNUNET_DATASTORE_release_reserve (struct GNUNET_DATASTORE_Handle *h,
+ uint32_t rid, unsigned int queue_priority,
+ unsigned int max_queue_size,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_DATASTORE_ContinuationWithStatus cont,
+ void *cont_cls);
/**
* cancel; note that even if NULL is returned, the callback will be invoked
* (or rather, will already have been invoked)
*/
-struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_update (struct
- GNUNET_DATASTORE_Handle
- *h, uint64_t uid,
- uint32_t priority,
- struct
- GNUNET_TIME_Absolute
- expiration,
- unsigned int
- queue_priority,
- unsigned int
- max_queue_size,
- struct
- GNUNET_TIME_Relative
- timeout,
- GNUNET_DATASTORE_ContinuationWithStatus
- cont,
- void *cont_cls);
+struct GNUNET_DATASTORE_QueueEntry *
+GNUNET_DATASTORE_update (struct GNUNET_DATASTORE_Handle *h, uint64_t uid,
+ uint32_t priority,
+ struct GNUNET_TIME_Absolute expiration,
+ unsigned int queue_priority,
+ unsigned int max_queue_size,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_DATASTORE_ContinuationWithStatus cont,
+ void *cont_cls);
/**
* cancel; note that even if NULL is returned, the callback will be invoked
* (or rather, will already have been invoked)
*/
-struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_remove (struct
- GNUNET_DATASTORE_Handle
- *h,
- const
- GNUNET_HashCode *
- key, size_t size,
- const void *data,
- unsigned int
- queue_priority,
- unsigned int
- max_queue_size,
- struct
- GNUNET_TIME_Relative
- timeout,
- GNUNET_DATASTORE_ContinuationWithStatus
- cont,
- void *cont_cls);
+struct GNUNET_DATASTORE_QueueEntry *
+GNUNET_DATASTORE_remove (struct GNUNET_DATASTORE_Handle *h,
+ const GNUNET_HashCode * key, size_t size,
+ const void *data, unsigned int queue_priority,
+ unsigned int max_queue_size,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_DATASTORE_ContinuationWithStatus cont,
+ void *cont_cls);
/**
* @return NULL if the entry was not queued, otherwise a handle that can be used to
* cancel
*/
-struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_get_key (struct
- GNUNET_DATASTORE_Handle
- *h,
- uint64_t offset,
- const
- GNUNET_HashCode *
- key,
- enum
- GNUNET_BLOCK_Type
- type,
- unsigned int
- queue_priority,
- unsigned int
- max_queue_size,
- struct
- GNUNET_TIME_Relative
- timeout,
- GNUNET_DATASTORE_DatumProcessor
- proc,
- void *proc_cls);
+struct GNUNET_DATASTORE_QueueEntry *
+GNUNET_DATASTORE_get_key (struct GNUNET_DATASTORE_Handle *h, uint64_t offset,
+ const GNUNET_HashCode * key,
+ enum GNUNET_BLOCK_Type type,
+ unsigned int queue_priority,
+ unsigned int max_queue_size,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_DATASTORE_DatumProcessor proc, void *proc_cls);
/**
* @return NULL if the entry was not queued, otherwise a handle that can be used to
* cancel
*/
-struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_get_zero_anonymity (struct
- GNUNET_DATASTORE_Handle
- *h,
- uint64_t
- offset,
- unsigned
- int
- queue_priority,
- unsigned
- int
- max_queue_size,
- struct
- GNUNET_TIME_Relative
- timeout,
- enum
- GNUNET_BLOCK_Type
- type,
- GNUNET_DATASTORE_DatumProcessor
- proc,
- void
- *proc_cls);
+struct GNUNET_DATASTORE_QueueEntry *
+GNUNET_DATASTORE_get_zero_anonymity (struct GNUNET_DATASTORE_Handle *h,
+ uint64_t offset,
+ unsigned int queue_priority,
+ unsigned int max_queue_size,
+ struct GNUNET_TIME_Relative timeout,
+ enum GNUNET_BLOCK_Type type,
+ GNUNET_DATASTORE_DatumProcessor proc,
+ void *proc_cls);
/**
* @return NULL if the entry was not queued, otherwise a handle that can be used to
* cancel
*/
-struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_get_for_replication (struct
- GNUNET_DATASTORE_Handle
- *h,
- unsigned
- int
- queue_priority,
- unsigned
- int
- max_queue_size,
- struct
- GNUNET_TIME_Relative
- timeout,
- GNUNET_DATASTORE_DatumProcessor
- proc,
- void
- *proc_cls);
+struct GNUNET_DATASTORE_QueueEntry *
+GNUNET_DATASTORE_get_for_replication (struct GNUNET_DATASTORE_Handle *h,
+ unsigned int queue_priority,
+ unsigned int max_queue_size,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_DATASTORE_DatumProcessor proc,
+ void *proc_cls);
*
* @param qe operation to cancel
*/
-void GNUNET_DATASTORE_cancel (struct GNUNET_DATASTORE_QueueEntry *qe);
+void
+GNUNET_DATASTORE_cancel (struct GNUNET_DATASTORE_QueueEntry *qe);
#if 0 /* keep Emacsens' auto-indent happy */
* processing multiple GET/FIND requests in parallel
* @return NULL on error
*/
-struct GNUNET_DHT_Handle *GNUNET_DHT_connect (const struct
- GNUNET_CONFIGURATION_Handle *cfg,
- unsigned int ht_len);
+struct GNUNET_DHT_Handle *
+GNUNET_DHT_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ unsigned int ht_len);
/**
*
* @param handle connection to shut down
*/
-void GNUNET_DHT_disconnect (struct GNUNET_DHT_Handle *handle);
+void
+GNUNET_DHT_disconnect (struct GNUNET_DHT_Handle *handle);
/* *************** Standard API: get and put ******************* */
* @param cont continuation to call when done (transmitting request to service)
* @param cont_cls closure for cont
*/
-void GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle,
- const GNUNET_HashCode * key,
- uint32_t desired_replication_level,
- enum GNUNET_DHT_RouteOption options,
- enum GNUNET_BLOCK_Type type, size_t size, const char *data,
- struct GNUNET_TIME_Absolute exp,
- struct GNUNET_TIME_Relative timeout,
- GNUNET_SCHEDULER_Task cont, void *cont_cls);
+void
+GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle, const GNUNET_HashCode * key,
+ uint32_t desired_replication_level,
+ enum GNUNET_DHT_RouteOption options,
+ enum GNUNET_BLOCK_Type type, size_t size, const char *data,
+ struct GNUNET_TIME_Absolute exp,
+ struct GNUNET_TIME_Relative timeout, GNUNET_SCHEDULER_Task cont,
+ void *cont_cls);
/**
*
* @return handle to stop the async get
*/
-struct GNUNET_DHT_GetHandle *GNUNET_DHT_get_start (struct GNUNET_DHT_Handle
- *handle,
- struct GNUNET_TIME_Relative
- timeout,
- enum GNUNET_BLOCK_Type type,
- const GNUNET_HashCode * key,
- uint32_t
- desired_replication_level,
- enum GNUNET_DHT_RouteOption
- options,
- const struct
- GNUNET_CONTAINER_BloomFilter
- *bf, int32_t bf_mutator,
- const void *xquery,
- size_t xquery_size,
- GNUNET_DHT_GetIterator iter,
- void *iter_cls);
+struct GNUNET_DHT_GetHandle *
+GNUNET_DHT_get_start (struct GNUNET_DHT_Handle *handle,
+ struct GNUNET_TIME_Relative timeout,
+ enum GNUNET_BLOCK_Type type, const GNUNET_HashCode * key,
+ uint32_t desired_replication_level,
+ enum GNUNET_DHT_RouteOption options,
+ const struct GNUNET_CONTAINER_BloomFilter *bf,
+ int32_t bf_mutator, const void *xquery,
+ size_t xquery_size, GNUNET_DHT_GetIterator iter,
+ void *iter_cls);
/**
* On return get_handle will no longer be valid, caller
* must not use again!!!
*/
-void GNUNET_DHT_get_stop (struct GNUNET_DHT_GetHandle *get_handle);
+void
+GNUNET_DHT_get_stop (struct GNUNET_DHT_GetHandle *get_handle);
/* ******** Special high-level API for finding peers *********** */
* @param proc_cls closure for proc
* @return handle to stop the async get, NULL on error
*/
-struct GNUNET_DHT_FindPeerHandle *GNUNET_DHT_find_peer_start (struct
- GNUNET_DHT_Handle
- *handle,
- struct
- GNUNET_TIME_Relative
- timeout,
- const
- GNUNET_HashCode *
- key,
- enum
- GNUNET_DHT_RouteOption
- options,
- GNUNET_DHT_FindPeerProcessor
- proc,
- void *proc_cls);
+struct GNUNET_DHT_FindPeerHandle *
+GNUNET_DHT_find_peer_start (struct GNUNET_DHT_Handle *handle,
+ struct GNUNET_TIME_Relative timeout,
+ const GNUNET_HashCode * key,
+ enum GNUNET_DHT_RouteOption options,
+ GNUNET_DHT_FindPeerProcessor proc, void *proc_cls);
/**
*
* @param find_peer_handle GET operation to stop.
*/
-void GNUNET_DHT_find_peer_stop (struct GNUNET_DHT_FindPeerHandle
- *find_peer_handle);
+void
+GNUNET_DHT_find_peer_stop (struct GNUNET_DHT_FindPeerHandle *find_peer_handle);
* @param cont_cls closure for cont
* @return handle to stop the request, NULL if the request is "fire and forget"
*/
-struct GNUNET_DHT_RouteHandle *GNUNET_DHT_route_start (struct GNUNET_DHT_Handle
- *handle,
- const GNUNET_HashCode *
- key,
- uint32_t
- desired_replication_level,
- enum
- GNUNET_DHT_RouteOption
- options,
- const struct
- GNUNET_MessageHeader
- *enc,
- struct
- GNUNET_TIME_Relative
- timeout,
- GNUNET_DHT_ReplyProcessor
- iter, void *iter_cls,
- GNUNET_SCHEDULER_Task
- cont, void *cont_cls);
+struct GNUNET_DHT_RouteHandle *
+GNUNET_DHT_route_start (struct GNUNET_DHT_Handle *handle,
+ const GNUNET_HashCode * key,
+ uint32_t desired_replication_level,
+ enum GNUNET_DHT_RouteOption options,
+ const struct GNUNET_MessageHeader *enc,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_DHT_ReplyProcessor iter, void *iter_cls,
+ GNUNET_SCHEDULER_Task cont, void *cont_cls);
*
* @param route_handle operation to stop.
*/
-void GNUNET_DHT_route_stop (struct GNUNET_DHT_RouteHandle *route_handle);
+void
+GNUNET_DHT_route_stop (struct GNUNET_DHT_RouteHandle *route_handle);
/* ***** Special API for controlling DHT routing maintenance ******* */
* @param cont_cls closure for cont
* @param handle handle to the DHT service
*/
-void GNUNET_DHT_find_peers (struct GNUNET_DHT_Handle *handle,
- GNUNET_SCHEDULER_Task cont, void *cont_cls);
+void
+GNUNET_DHT_find_peers (struct GNUNET_DHT_Handle *handle,
+ GNUNET_SCHEDULER_Task cont, void *cont_cls);
/* ***** Special API for testing robustness with malicious peers ******* */
* @param cont_cls closure for cont
*
*/
-void GNUNET_DHT_set_malicious_dropper (struct GNUNET_DHT_Handle *handle,
- GNUNET_SCHEDULER_Task cont,
- void *cont_cls);
+void
+GNUNET_DHT_set_malicious_dropper (struct GNUNET_DHT_Handle *handle,
+ GNUNET_SCHEDULER_Task cont, void *cont_cls);
/**
* @param cont continuation to call when done (transmitting request to service)
* @param cont_cls closure for cont
*/
-void GNUNET_DHT_set_malicious_putter (struct GNUNET_DHT_Handle *handle,
- struct GNUNET_TIME_Relative frequency,
- GNUNET_SCHEDULER_Task cont,
- void *cont_cls);
+void
+GNUNET_DHT_set_malicious_putter (struct GNUNET_DHT_Handle *handle,
+ struct GNUNET_TIME_Relative frequency,
+ GNUNET_SCHEDULER_Task cont, void *cont_cls);
/**
* @param cont continuation to call when done (transmitting request to service)
* @param cont_cls closure for cont
*/
-void GNUNET_DHT_set_malicious_getter (struct GNUNET_DHT_Handle *handle,
- struct GNUNET_TIME_Relative frequency,
- GNUNET_SCHEDULER_Task cont,
- void *cont_cls);
+void
+GNUNET_DHT_set_malicious_getter (struct GNUNET_DHT_Handle *handle,
+ struct GNUNET_TIME_Relative frequency,
+ GNUNET_SCHEDULER_Task cont, void *cont_cls);
#endif
* @param part a file on the partition to check
* @return -1 on errors, otherwise the number of free blocks
*/
-long GNUNET_DISK_get_blocks_available (const char *part);
+long
+GNUNET_DISK_get_blocks_available (const char *part);
/**
* @param h handle to check
* @return GNUNET_YES if invalid, GNUNET_NO if valid
*/
-int GNUNET_DISK_handle_invalid (const struct GNUNET_DISK_FileHandle *h);
+int
+GNUNET_DISK_handle_invalid (const struct GNUNET_DISK_FileHandle *h);
/**
* @return GNUNET_YES if yes, GNUNET_NO if not a file, GNUNET_SYSERR if something
* else (will print an error message in that case, too).
*/
-int GNUNET_DISK_file_test (const char *fil);
+int
+GNUNET_DISK_file_test (const char *fil);
/**
* @param whence specification to which position the offset parameter relates to
* @return the new position on success, GNUNET_SYSERR otherwise
*/
-off_t GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle *h,
- off_t offset, enum GNUNET_DISK_Seek whence);
+off_t
+GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle *h, off_t offset,
+ enum GNUNET_DISK_Seek whence);
/**
* included?
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
-int GNUNET_DISK_file_size (const char *filename, uint64_t * size,
- int includeSymLinks);
+int
+GNUNET_DISK_file_size (const char *filename, uint64_t * size,
+ int includeSymLinks);
/**
* @param ino set to the inode ID
* @return GNUNET_OK on success
*/
-int GNUNET_DISK_file_get_identifiers (const char *filename, uint64_t * dev,
- uint64_t * ino);
+int
+GNUNET_DISK_file_get_identifiers (const char *filename, uint64_t * dev,
+ uint64_t * ino);
/**
* @return NULL on error, otherwise name of fresh
* file on disk in directory for temporary files
*/
-char *GNUNET_DISK_mktemp (const char *t);
+char *
+GNUNET_DISK_mktemp (const char *t);
/**
* call (because of flags)
* @return IO handle on success, NULL on error
*/
-struct GNUNET_DISK_FileHandle *GNUNET_DISK_file_open (const char *fn,
- enum GNUNET_DISK_OpenFlags
- flags,
- enum
- GNUNET_DISK_AccessPermissions
- perm);
+struct GNUNET_DISK_FileHandle *
+GNUNET_DISK_file_open (const char *fn, enum GNUNET_DISK_OpenFlags flags,
+ enum GNUNET_DISK_AccessPermissions perm);
/**
* Creates an interprocess channel
* @param inherit_write 1 to make write handle inheritable, 0 otherwise (NT only)
* @return handle to the new pipe, NULL on error
*/
-struct GNUNET_DISK_PipeHandle *GNUNET_DISK_pipe (int blocking, int inherit_read,
- int inherit_write);
+struct GNUNET_DISK_PipeHandle *
+GNUNET_DISK_pipe (int blocking, int inherit_read, int inherit_write);
/**
* @param p pipe
* @return GNUNET_OK on success, GNUNET_SYSERR otherwise
*/
-int GNUNET_DISK_pipe_close (struct GNUNET_DISK_PipeHandle *p);
+int
+GNUNET_DISK_pipe_close (struct GNUNET_DISK_PipeHandle *p);
/**
* Closes one half of an interprocess channel
* @param end which end of the pipe to close
* @return GNUNET_OK on success, GNUNET_SYSERR otherwise
*/
-int GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p,
- enum GNUNET_DISK_PipeEnd end);
+int
+GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p,
+ enum GNUNET_DISK_PipeEnd end);
/**
* Close an open file.
* @param h file handle
* @return GNUNET_OK on success, GNUNET_SYSERR otherwise
*/
-int GNUNET_DISK_file_close (struct GNUNET_DISK_FileHandle *h);
+int
+GNUNET_DISK_file_close (struct GNUNET_DISK_FileHandle *h);
/**
* @param n end to access
* @return handle for the respective end
*/
-const struct GNUNET_DISK_FileHandle *GNUNET_DISK_pipe_handle (const struct
- GNUNET_DISK_PipeHandle
- *p,
- enum
- GNUNET_DISK_PipeEnd
- n);
+const struct GNUNET_DISK_FileHandle *
+GNUNET_DISK_pipe_handle (const struct GNUNET_DISK_PipeHandle *p,
+ enum GNUNET_DISK_PipeEnd n);
/**
* Read the contents of a binary file into a buffer.
* @param len the maximum number of bytes to read
* @return the number of bytes read on success, GNUNET_SYSERR on failure
*/
-ssize_t GNUNET_DISK_file_read (const struct GNUNET_DISK_FileHandle *h,
- void *result, size_t len);
+ssize_t
+GNUNET_DISK_file_read (const struct GNUNET_DISK_FileHandle *h, void *result,
+ size_t len);
/**
* @param len the maximum number of bytes to read
* @return number of bytes read, GNUNET_SYSERR on failure
*/
-ssize_t GNUNET_DISK_fn_read (const char *fn, void *result, size_t len);
+ssize_t
+GNUNET_DISK_fn_read (const char *fn, void *result, size_t len);
/**
* @param n number of bytes to write
* @return number of bytes written on success, GNUNET_SYSERR on error
*/
-ssize_t GNUNET_DISK_file_write (const struct GNUNET_DISK_FileHandle *h,
- const void *buffer, size_t n);
+ssize_t
+GNUNET_DISK_file_write (const struct GNUNET_DISK_FileHandle *h,
+ const void *buffer, size_t n);
/**
* @param mode file permissions
* @return number of bytes written on success, GNUNET_SYSERR on error
*/
-ssize_t GNUNET_DISK_fn_write (const char *fn, const void *buffer, size_t n,
- enum GNUNET_DISK_AccessPermissions mode);
+ssize_t
+GNUNET_DISK_fn_write (const char *fn, const void *buffer, size_t n,
+ enum GNUNET_DISK_AccessPermissions mode);
/**
* @param dst destination file name
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
-int GNUNET_DISK_file_copy (const char *src, const char *dst);
+int
+GNUNET_DISK_file_copy (const char *src, const char *dst);
/**
* @param callback_cls closure for callback
* @return the number of files found, -1 on error
*/
-int GNUNET_DISK_directory_scan (const char *dirName,
- GNUNET_FileNameCallback callback,
- void *callback_cls);
+int
+GNUNET_DISK_directory_scan (const char *dirName,
+ GNUNET_FileNameCallback callback,
+ void *callback_cls);
/**
* GNUNET_NO if this was the last entry (and iteration is complete),
* GNUNET_SYSERR if "can" was YES
*/
-int GNUNET_DISK_directory_iterator_next (struct GNUNET_DISK_DirectoryIterator
- *iter, int can);
+int
+GNUNET_DISK_directory_iterator_next (struct GNUNET_DISK_DirectoryIterator *iter,
+ int can);
/**
* @param callback the method to call for each file
* @param callback_cls closure for callback
*/
-void GNUNET_DISK_directory_iterator_start (enum GNUNET_SCHEDULER_Priority prio,
- const char *dirName,
- GNUNET_DISK_DirectoryIteratorCallback
- callback, void *callback_cls);
+void
+GNUNET_DISK_directory_iterator_start (enum GNUNET_SCHEDULER_Priority prio,
+ const char *dirName,
+ GNUNET_DISK_DirectoryIteratorCallback
+ callback, void *callback_cls);
/**
* @returns GNUNET_OK on success, GNUNET_SYSERR on failure,
* GNUNET_NO if directory exists but is not writeable
*/
-int GNUNET_DISK_directory_create_for_file (const char *filename);
+int
+GNUNET_DISK_directory_create_for_file (const char *filename);
/**
* @return GNUNET_YES if yes, GNUNET_NO if does not exist, GNUNET_SYSERR
* on any error and if exists but not directory
*/
-int GNUNET_DISK_directory_test (const char *fil);
+int
+GNUNET_DISK_directory_test (const char *fil);
/**
* @param fileName the file to remove
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
-int GNUNET_DISK_directory_remove (const char *fileName);
+int
+GNUNET_DISK_directory_remove (const char *fileName);
/**
* @param dir the directory to create
* @returns GNUNET_SYSERR on failure, GNUNET_OK otherwise
*/
-int GNUNET_DISK_directory_create (const char *dir);
+int
+GNUNET_DISK_directory_create (const char *dir);
/**
* @param excl GNUNET_YES for an exclusive lock
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
-int GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, off_t lockStart,
- off_t lockEnd, int excl);
+int
+GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, off_t lockStart,
+ off_t lockEnd, int excl);
/**
* @param unlockEnd absolute position until where to unlock
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
-int GNUNET_DISK_file_unlock (struct GNUNET_DISK_FileHandle *fh,
- off_t unlockStart, off_t unlockEnd);
+int
+GNUNET_DISK_file_unlock (struct GNUNET_DISK_FileHandle *fh, off_t unlockStart,
+ off_t unlockEnd);
/**
* @brief Removes special characters as ':' from a filename.
* @param fn the filename to canonicalize
*/
-void GNUNET_DISK_filename_canonicalize (char *fn);
+void
+GNUNET_DISK_filename_canonicalize (char *fn);
/**
* @param user new owner of the file
* @return GNUNET_OK on success, GNUNET_SYSERR on failure
*/
-int GNUNET_DISK_file_change_owner (const char *filename, const char *user);
+int
+GNUNET_DISK_file_change_owner (const char *filename, const char *user);
/**
* private directory name.
* @return the constructed filename
*/
-char *GNUNET_DISK_get_home_filename (const struct GNUNET_CONFIGURATION_Handle
- *cfg, const char *serviceName, ...);
+char *
+GNUNET_DISK_get_home_filename (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *serviceName, ...);
/**
* @param len size of the mapping
* @return pointer to the mapped memory region, NULL on failure
*/
-void *GNUNET_DISK_file_map (const struct GNUNET_DISK_FileHandle *h,
- struct GNUNET_DISK_MapHandle **m,
- enum GNUNET_DISK_MapType access, size_t len);
+void *
+GNUNET_DISK_file_map (const struct GNUNET_DISK_FileHandle *h,
+ struct GNUNET_DISK_MapHandle **m,
+ enum GNUNET_DISK_MapType access, size_t len);
/**
* Unmap a file
* @param h mapping handle
* @return GNUNET_OK on success, GNUNET_SYSERR otherwise
*/
-int GNUNET_DISK_file_unmap (struct GNUNET_DISK_MapHandle *h);
+int
+GNUNET_DISK_file_unmap (struct GNUNET_DISK_MapHandle *h);
/**
* Write file changes to disk
* @param h handle to an open file
* @return GNUNET_OK on success, GNUNET_SYSERR otherwise
*/
-int GNUNET_DISK_file_sync (const struct GNUNET_DISK_FileHandle *h);
+int
+GNUNET_DISK_file_sync (const struct GNUNET_DISK_FileHandle *h);
/**
* Creates a named pipe/FIFO and opens it
* @param perm access permissions
* @return pipe handle on success, NULL on error
*/
-struct GNUNET_DISK_FileHandle *GNUNET_DISK_npipe_create (char **fn,
- enum
- GNUNET_DISK_OpenFlags
- flags,
- enum
- GNUNET_DISK_AccessPermissions
- perm);
+struct GNUNET_DISK_FileHandle *
+GNUNET_DISK_npipe_create (char **fn, enum GNUNET_DISK_OpenFlags flags,
+ enum GNUNET_DISK_AccessPermissions perm);
/**
* Opens already existing named pipe/FIFO
* @param perm access permissions
* @return pipe handle on success, NULL on error
*/
-struct GNUNET_DISK_FileHandle *GNUNET_DISK_npipe_open (const char *fn,
- enum
- GNUNET_DISK_OpenFlags
- flags,
- enum
- GNUNET_DISK_AccessPermissions
- perm);
+struct GNUNET_DISK_FileHandle *
+GNUNET_DISK_npipe_open (const char *fn, enum GNUNET_DISK_OpenFlags flags,
+ enum GNUNET_DISK_AccessPermissions perm);
/**
* Closes a named pipe/FIFO
* @param pipe named pipe
* @return GNUNET_OK on success, GNUNET_SYSERR otherwise
*/
-int GNUNET_DISK_npipe_close (struct GNUNET_DISK_FileHandle *pipe);
+int
+GNUNET_DISK_npipe_close (struct GNUNET_DISK_FileHandle *pipe);
#if 0 /* keep Emacsens' auto-indent happy */
{
* @param cont_cls closure for continuation
*
*/
-int GNUNET_DV_send (struct GNUNET_DV_Handle *dv_handle,
- const struct GNUNET_PeerIdentity *target,
- const char *msgbuf, size_t msgbuf_size,
- unsigned int priority, struct GNUNET_TIME_Relative timeout,
- const void *addr, size_t addrlen,
- GNUNET_TRANSPORT_TransmitContinuation cont, void *cont_cls);
+int
+GNUNET_DV_send (struct GNUNET_DV_Handle *dv_handle,
+ const struct GNUNET_PeerIdentity *target, const char *msgbuf,
+ size_t msgbuf_size, unsigned int priority,
+ struct GNUNET_TIME_Relative timeout, const void *addr,
+ size_t addrlen, GNUNET_TRANSPORT_TransmitContinuation cont,
+ void *cont_cls);
* @param proc_cls closure for proc
* @return the fragmentation context
*/
-struct GNUNET_FRAGMENT_Context *GNUNET_FRAGMENT_context_create (struct
- GNUNET_STATISTICS_Handle
- *stats,
- uint16_t mtu,
- struct
- GNUNET_BANDWIDTH_Tracker
- *tracker,
- struct
- GNUNET_TIME_Relative
- delay,
- const struct
- GNUNET_MessageHeader
- *msg,
- GNUNET_FRAGMENT_MessageProcessor
- proc,
- void *proc_cls);
+struct GNUNET_FRAGMENT_Context *
+GNUNET_FRAGMENT_context_create (struct GNUNET_STATISTICS_Handle *stats,
+ uint16_t mtu,
+ struct GNUNET_BANDWIDTH_Tracker *tracker,
+ struct GNUNET_TIME_Relative delay,
+ const struct GNUNET_MessageHeader *msg,
+ GNUNET_FRAGMENT_MessageProcessor proc,
+ void *proc_cls);
/**
*
* @param fc fragmentation context
*/
-void GNUNET_FRAGMENT_context_transmission_done (struct GNUNET_FRAGMENT_Context
- *fc);
+void
+GNUNET_FRAGMENT_context_transmission_done (struct GNUNET_FRAGMENT_Context *fc);
/**
* GNUNET_NO if more messages are pending
* GNUNET_SYSERR if this ack is not valid for this fc
*/
-int GNUNET_FRAGMENT_process_ack (struct GNUNET_FRAGMENT_Context *fc,
- const struct GNUNET_MessageHeader *msg);
+int
+GNUNET_FRAGMENT_process_ack (struct GNUNET_FRAGMENT_Context *fc,
+ const struct GNUNET_MessageHeader *msg);
/**
* @return average delay between transmission and ACK for the
* last message, FOREVER if the message was not fully transmitted
*/
-struct GNUNET_TIME_Relative GNUNET_FRAGMENT_context_destroy (struct
- GNUNET_FRAGMENT_Context
- *fc);
+struct GNUNET_TIME_Relative
+GNUNET_FRAGMENT_context_destroy (struct GNUNET_FRAGMENT_Context *fc);
/**
* back to the other side)
* @return the defragmentation context
*/
-struct GNUNET_DEFRAGMENT_Context *GNUNET_DEFRAGMENT_context_create (struct
- GNUNET_STATISTICS_Handle
- *stats,
- uint16_t
- mtu,
- unsigned int
- num_msgs,
- void *cls,
- GNUNET_FRAGMENT_MessageProcessor
- proc,
- GNUNET_DEFRAGMENT_AckProcessor
- ackp);
+struct GNUNET_DEFRAGMENT_Context *
+GNUNET_DEFRAGMENT_context_create (struct GNUNET_STATISTICS_Handle *stats,
+ uint16_t mtu, unsigned int num_msgs,
+ void *cls,
+ GNUNET_FRAGMENT_MessageProcessor proc,
+ GNUNET_DEFRAGMENT_AckProcessor ackp);
/**
*
* @param dc defragmentation context
*/
-void GNUNET_DEFRAGMENT_context_destroy (struct GNUNET_DEFRAGMENT_Context *dc);
+void
+GNUNET_DEFRAGMENT_context_destroy (struct GNUNET_DEFRAGMENT_Context *dc);
/**
* @param msg the message that was received
* @return GNUNET_OK on success, GNUNET_NO if this was a duplicate, GNUNET_SYSERR on error
*/
-int GNUNET_DEFRAGMENT_process_fragment (struct GNUNET_DEFRAGMENT_Context *dc,
- const struct GNUNET_MessageHeader *msg);
+int
+GNUNET_DEFRAGMENT_process_fragment (struct GNUNET_DEFRAGMENT_Context *dc,
+ const struct GNUNET_MessageHeader *msg);
#if 0 /* keep Emacsens' auto-indent happy */
* @param uri uri to convert to a unique key
* @param key wherer to store the unique key
*/
-void GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri,
- GNUNET_HashCode * key);
+void
+GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri, GNUNET_HashCode * key);
/**
* Convert a URI to a UTF-8 String.
* @param uri uri to convert to a string
* @return the UTF-8 string
*/
-char *GNUNET_FS_uri_to_string (const struct GNUNET_FS_Uri *uri);
+char *
+GNUNET_FS_uri_to_string (const struct GNUNET_FS_Uri *uri);
/**
* Convert keyword URI to a human readable format
* @param uri ksk uri to convert to a string
* @return string with the keywords
*/
-char *GNUNET_FS_uri_ksk_to_string_fancy (const struct GNUNET_FS_Uri *uri);
+char *
+GNUNET_FS_uri_ksk_to_string_fancy (const struct GNUNET_FS_Uri *uri);
/**
* @param keyword keyword to add
* @param is_mandatory is this keyword mandatory?
*/
-void GNUNET_FS_uri_ksk_add_keyword (struct GNUNET_FS_Uri *uri,
- const char *keyword, int is_mandatory);
+void
+GNUNET_FS_uri_ksk_add_keyword (struct GNUNET_FS_Uri *uri, const char *keyword,
+ int is_mandatory);
/**
* @param uri ksk uri to modify
* @param keyword keyword to add
*/
-void GNUNET_FS_uri_ksk_remove_keyword (struct GNUNET_FS_Uri *uri,
- const char *keyword);
+void
+GNUNET_FS_uri_ksk_remove_keyword (struct GNUNET_FS_Uri *uri,
+ const char *keyword);
/**
* @param emsg where to store the parser error message (if any)
* @return NULL on error
*/
-struct GNUNET_FS_Uri *GNUNET_FS_uri_parse (const char *uri, char **emsg);
+struct GNUNET_FS_Uri *
+GNUNET_FS_uri_parse (const char *uri, char **emsg);
/**
* Free URI.
*
* @param uri uri to free
*/
-void GNUNET_FS_uri_destroy (struct GNUNET_FS_Uri *uri);
+void
+GNUNET_FS_uri_destroy (struct GNUNET_FS_Uri *uri);
/**
* @param uri ksk uri to get the number of keywords from
* @return 0 if this is not a keyword URI
*/
-unsigned int GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri
- *uri);
+unsigned int
+GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri *uri);
/**
* @return -1 if this is not a keyword URI, otherwise number of
* keywords iterated over until iterator aborted
*/
-int GNUNET_FS_uri_ksk_get_keywords (const struct GNUNET_FS_Uri *uri,
- GNUNET_FS_KeywordIterator iterator,
- void *iterator_cls);
+int
+GNUNET_FS_uri_ksk_get_keywords (const struct GNUNET_FS_Uri *uri,
+ GNUNET_FS_KeywordIterator iterator,
+ void *iterator_cls);
/**
* @param peer where to store the identify of the peer (presumably) offering the content
* @return GNUNET_SYSERR if this is not a location URI, otherwise GNUNET_OK
*/
-int GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri,
- struct GNUNET_PeerIdentity *peer);
+int
+GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri,
+ struct GNUNET_PeerIdentity *peer);
/**
* @param uri location URI to get the content URI from
* @return NULL if argument is not a location URI
*/
-struct GNUNET_FS_Uri *GNUNET_FS_uri_loc_get_uri (const struct GNUNET_FS_Uri
- *uri);
+struct GNUNET_FS_Uri *
+GNUNET_FS_uri_loc_get_uri (const struct GNUNET_FS_Uri *uri);
/**
* @param uri location URI to get the expiration from
* @return expiration time of the URI
*/
-struct GNUNET_TIME_Absolute GNUNET_FS_uri_loc_get_expiration (const struct
- GNUNET_FS_Uri
- *uri);
+struct GNUNET_TIME_Absolute
+GNUNET_FS_uri_loc_get_expiration (const struct GNUNET_FS_Uri *uri);
/**
* @param expiration_time how long will the content be offered?
* @return the location URI, NULL on error
*/
-struct GNUNET_FS_Uri *GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri
- *baseUri,
- const struct
- GNUNET_CONFIGURATION_Handle
- *cfg,
- struct GNUNET_TIME_Absolute
- expiration_time);
+struct GNUNET_FS_Uri *
+GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri,
+ const struct GNUNET_CONFIGURATION_Handle *cfg,
+ struct GNUNET_TIME_Absolute expiration_time);
/**
* @param uri the URI to canonicalize
* @return canonicalized version of the URI, NULL on error
*/
-struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_canonicalize (const struct GNUNET_FS_Uri
- *uri);
+struct GNUNET_FS_Uri *
+GNUNET_FS_uri_ksk_canonicalize (const struct GNUNET_FS_Uri *uri);
/**
* @param u2 second uri
* @return merged URI, NULL on error
*/
-struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_merge (const struct GNUNET_FS_Uri *u1,
- const struct GNUNET_FS_Uri *u2);
+struct GNUNET_FS_Uri *
+GNUNET_FS_uri_ksk_merge (const struct GNUNET_FS_Uri *u1,
+ const struct GNUNET_FS_Uri *u2);
/**
* @param uri the URI to duplicate
* @return copy of the URI
*/
-struct GNUNET_FS_Uri *GNUNET_FS_uri_dup (const struct GNUNET_FS_Uri *uri);
+struct GNUNET_FS_Uri *
+GNUNET_FS_uri_dup (const struct GNUNET_FS_Uri *uri);
/**
* @return an FS URI for the given keywords, NULL
* if keywords is not legal (i.e. empty).
*/
-struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_create (const char *keywords,
- char **emsg);
+struct GNUNET_FS_Uri *
+GNUNET_FS_uri_ksk_create (const char *keywords, char **emsg);
/**
* @return an FS URI for the given keywords, NULL
* if keywords is not legal (i.e. empty).
*/
-struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_create_from_args (unsigned int argc,
- const char **argv);
+struct GNUNET_FS_Uri *
+GNUNET_FS_uri_ksk_create_from_args (unsigned int argc, const char **argv);
/**
* @param u2 the other URI
* @return GNUNET_YES if the URIs are equal
*/
-int GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1,
- const struct GNUNET_FS_Uri *u2);
+int
+GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1,
+ const struct GNUNET_FS_Uri *u2);
/**
* @param uri the uri to check
* @return GNUNET_YES if this is an SKS uri
*/
-int GNUNET_FS_uri_test_sks (const struct GNUNET_FS_Uri *uri);
+int
+GNUNET_FS_uri_test_sks (const struct GNUNET_FS_Uri *uri);
/**
* @param emsg where to store an error message
* @return an FS URI for the given namespace and identifier
*/
-struct GNUNET_FS_Uri *GNUNET_FS_uri_sks_create (struct GNUNET_FS_Namespace *ns,
- const char *id, char **emsg);
+struct GNUNET_FS_Uri *
+GNUNET_FS_uri_sks_create (struct GNUNET_FS_Namespace *ns, const char *id,
+ char **emsg);
/**
* @param id identifier
* @return an FS URI for the given namespace and identifier
*/
-struct GNUNET_FS_Uri *GNUNET_FS_uri_sks_create_from_nsid (GNUNET_HashCode *
- nsid, const char *id);
+struct GNUNET_FS_Uri *
+GNUNET_FS_uri_sks_create_from_nsid (GNUNET_HashCode * nsid, const char *id);
/**
* @param nsid where to store the ID of the namespace
* @return GNUNET_OK on success
*/
-int GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri,
- GNUNET_HashCode * nsid);
+int
+GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri,
+ GNUNET_HashCode * nsid);
/**
* @param uri the sks uri
* @return NULL on error (not a valid SKS URI)
*/
-char *GNUNET_FS_uri_sks_get_content_id (const struct GNUNET_FS_Uri *uri);
+char *
+GNUNET_FS_uri_sks_get_content_id (const struct GNUNET_FS_Uri *uri);
/**
* @param uri SKS uri to convert
* @return NULL on error (not an SKS URI)
*/
-char *GNUNET_FS_uri_sks_to_string_fancy (struct GNUNET_CONFIGURATION_Handle
- *cfg, const struct GNUNET_FS_Uri *uri);
+char *
+GNUNET_FS_uri_sks_to_string_fancy (struct GNUNET_CONFIGURATION_Handle *cfg,
+ const struct GNUNET_FS_Uri *uri);
/**
* @param uri the uri
* @return GNUNET_YES if this is a KSK uri
*/
-int GNUNET_FS_uri_test_ksk (const struct GNUNET_FS_Uri *uri);
+int
+GNUNET_FS_uri_test_ksk (const struct GNUNET_FS_Uri *uri);
/**
* @param uri the uri to check
* @return GNUNET_YES if this is a CHK uri
*/
-int GNUNET_FS_uri_test_chk (const struct GNUNET_FS_Uri *uri);
+int
+GNUNET_FS_uri_test_chk (const struct GNUNET_FS_Uri *uri);
/**
* @param uri the CHK (or LOC) URI to inspect
* @return size of the file as specified in the CHK URI
*/
-uint64_t GNUNET_FS_uri_chk_get_file_size (const struct GNUNET_FS_Uri *uri);
+uint64_t
+GNUNET_FS_uri_chk_get_file_size (const struct GNUNET_FS_Uri *uri);
/**
* @param uri the uri to check
* @return GNUNET_YES if this is a LOC uri
*/
-int GNUNET_FS_uri_test_loc (const struct GNUNET_FS_Uri *uri);
+int
+GNUNET_FS_uri_test_loc (const struct GNUNET_FS_Uri *uri);
/**
* @param md metadata to use
* @return NULL on error, otherwise a KSK URI
*/
-struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_create_from_meta_data (const struct
- GNUNET_CONTAINER_MetaData
- *md);
+struct GNUNET_FS_Uri *
+GNUNET_FS_uri_ksk_create_from_meta_data (const struct GNUNET_CONTAINER_MetaData
+ *md);
/* ******************** command-line option parsing API *********************** */
* @param value command line argument given
* @return GNUNET_OK on success
*/
-int GNUNET_FS_getopt_set_keywords (struct
- GNUNET_GETOPT_CommandLineProcessorContext
- *ctx, void *scls, const char *option,
- const char *value);
+int
+GNUNET_FS_getopt_set_keywords (struct GNUNET_GETOPT_CommandLineProcessorContext
+ *ctx, void *scls, const char *option,
+ const char *value);
/**
* @param value command line argument given
* @return GNUNET_OK on success
*/
-int GNUNET_FS_getopt_set_metadata (struct
- GNUNET_GETOPT_CommandLineProcessorContext
- *ctx, void *scls, const char *option,
- const char *value);
+int
+GNUNET_FS_getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext
+ *ctx, void *scls, const char *option,
+ const char *value);
/**
* Return the current year (i.e. '2011').
*/
-unsigned int GNUNET_FS_get_current_year (void);
+unsigned int
+GNUNET_FS_get_current_year (void);
/**
* @param year a year (after 1970, please ;-)).
* @return absolute time for January 1st of that year.
*/
-struct GNUNET_TIME_Absolute GNUNET_FS_year_to_time (unsigned int year);
+struct GNUNET_TIME_Absolute
+GNUNET_FS_year_to_time (unsigned int year);
/**
* @param ... list of optional options, terminated with GNUNET_FS_OPTIONS_END
* @return NULL on error
*/
-struct GNUNET_FS_Handle *GNUNET_FS_start (const struct
- GNUNET_CONFIGURATION_Handle *cfg,
- const char *client_name,
- GNUNET_FS_ProgressCallback upcb,
- void *upcb_cls,
- enum GNUNET_FS_Flags flags, ...);
+struct GNUNET_FS_Handle *
+GNUNET_FS_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *client_name, GNUNET_FS_ProgressCallback upcb,
+ void *upcb_cls, enum GNUNET_FS_Flags flags, ...);
/**
*
* @param h handle that was returned from GNUNET_FS_start
*/
-void GNUNET_FS_stop (struct GNUNET_FS_Handle *h);
+void
+GNUNET_FS_stop (struct GNUNET_FS_Handle *h);
/**
* @return GNUNET_SYSERR on error, otherwise the number
* of meta-data items obtained
*/
-int GNUNET_FS_meta_data_extract_from_file (struct GNUNET_CONTAINER_MetaData *md,
- const char *filename,
- struct EXTRACTOR_PluginList
- *extractors);
+int
+GNUNET_FS_meta_data_extract_from_file (struct GNUNET_CONTAINER_MetaData *md,
+ const char *filename,
+ struct EXTRACTOR_PluginList *extractors);
/**
* can be passed to "GNUNET_FS_file_information_recover"
* to read this fi-struct from disk.
*/
-const char *GNUNET_FS_file_information_get_id (struct GNUNET_FS_FileInformation
- *s);
+const char *
+GNUNET_FS_file_information_get_id (struct GNUNET_FS_FileInformation *s);
* @param bo block options
* @return publish structure entry for the file
*/
-struct GNUNET_FS_FileInformation
- *GNUNET_FS_file_information_create_from_file (struct GNUNET_FS_Handle *h,
- void *client_info,
- const char *filename,
- const struct GNUNET_FS_Uri
- *keywords,
- const struct
- GNUNET_CONTAINER_MetaData
- *meta, int do_index,
- const struct
- GNUNET_FS_BlockOptions *bo);
+struct GNUNET_FS_FileInformation *
+GNUNET_FS_file_information_create_from_file (struct GNUNET_FS_Handle *h,
+ void *client_info,
+ const char *filename,
+ const struct GNUNET_FS_Uri
+ *keywords,
+ const struct
+ GNUNET_CONTAINER_MetaData *meta,
+ int do_index,
+ const struct GNUNET_FS_BlockOptions
+ *bo);
/**
* @param bo block options
* @return publish structure entry for the file
*/
-struct GNUNET_FS_FileInformation
- *GNUNET_FS_file_information_create_from_data (struct GNUNET_FS_Handle *h,
- void *client_info,
- uint64_t length, void *data,
- const struct GNUNET_FS_Uri
- *keywords,
- const struct
- GNUNET_CONTAINER_MetaData
- *meta, int do_index,
- const struct
- GNUNET_FS_BlockOptions *bo);
+struct GNUNET_FS_FileInformation *
+GNUNET_FS_file_information_create_from_data (struct GNUNET_FS_Handle *h,
+ void *client_info, uint64_t length,
+ void *data,
+ const struct GNUNET_FS_Uri
+ *keywords,
+ const struct
+ GNUNET_CONTAINER_MetaData *meta,
+ int do_index,
+ const struct GNUNET_FS_BlockOptions
+ *bo);
/**
* @param bo block options
* @return publish structure entry for the file
*/
-struct GNUNET_FS_FileInformation
- *GNUNET_FS_file_information_create_from_reader (struct GNUNET_FS_Handle *h,
- void *client_info,
- uint64_t length,
- GNUNET_FS_DataReader reader,
- void *reader_cls,
- const struct GNUNET_FS_Uri
- *keywords,
- const struct
- GNUNET_CONTAINER_MetaData
- *meta, int do_index,
- const struct
- GNUNET_FS_BlockOptions *bo);
+struct GNUNET_FS_FileInformation *
+GNUNET_FS_file_information_create_from_reader (struct GNUNET_FS_Handle *h,
+ void *client_info,
+ uint64_t length,
+ GNUNET_FS_DataReader reader,
+ void *reader_cls,
+ const struct GNUNET_FS_Uri
+ *keywords,
+ const struct
+ GNUNET_CONTAINER_MetaData *meta,
+ int do_index,
+ const struct
+ GNUNET_FS_BlockOptions *bo);
/**
* @param emsg where to store an error message (on errors)
* @return GNUNET_OK on success
*/
-int GNUNET_FS_directory_scanner_default (void *cls, struct GNUNET_FS_Handle *h,
- const char *dirname, int do_index,
- const struct GNUNET_FS_BlockOptions
- *bo, GNUNET_FS_FileProcessor proc,
- void *proc_cls, char **emsg);
+int
+GNUNET_FS_directory_scanner_default (void *cls, struct GNUNET_FS_Handle *h,
+ const char *dirname, int do_index,
+ const struct GNUNET_FS_BlockOptions *bo,
+ GNUNET_FS_FileProcessor proc,
+ void *proc_cls, char **emsg);
/**
* @param emsg where to store an error message
* @return publish structure entry for the directory, NULL on error
*/
-struct GNUNET_FS_FileInformation
- *GNUNET_FS_file_information_create_from_directory (struct GNUNET_FS_Handle
- *h, void *client_info,
- const char *filename,
- GNUNET_FS_DirectoryScanner
- scanner,
- void *scanner_cls,
- int do_index,
- const struct
- GNUNET_FS_BlockOptions
- *bo, char **emsg);
+struct GNUNET_FS_FileInformation *
+GNUNET_FS_file_information_create_from_directory (struct GNUNET_FS_Handle *h,
+ void *client_info,
+ const char *filename,
+ GNUNET_FS_DirectoryScanner
+ scanner, void *scanner_cls,
+ int do_index,
+ const struct
+ GNUNET_FS_BlockOptions *bo,
+ char **emsg);
/**
* @param bo block options
* @return publish structure entry for the directory , NULL on error
*/
-struct GNUNET_FS_FileInformation
- *GNUNET_FS_file_information_create_empty_directory (struct GNUNET_FS_Handle
- *h, void *client_info,
- const struct
- GNUNET_FS_Uri *keywords,
- const struct
- GNUNET_CONTAINER_MetaData
- *meta,
- const struct
- GNUNET_FS_BlockOptions
- *bo);
+struct GNUNET_FS_FileInformation *
+GNUNET_FS_file_information_create_empty_directory (struct GNUNET_FS_Handle *h,
+ void *client_info,
+ const struct GNUNET_FS_Uri
+ *keywords,
+ const struct
+ GNUNET_CONTAINER_MetaData
+ *meta,
+ const struct
+ GNUNET_FS_BlockOptions *bo);
/**
* @param ent check if this FI represents a directory
* @return GNUNET_YES if so, GNUNET_NO if not
*/
-int GNUNET_FS_file_information_is_directory (const struct
- GNUNET_FS_FileInformation *ent);
+int
+GNUNET_FS_file_information_is_directory (const struct GNUNET_FS_FileInformation
+ *ent);
/**
* must not include "dir" in its structure
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
-int GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir,
- struct GNUNET_FS_FileInformation *ent);
+int
+GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir,
+ struct GNUNET_FS_FileInformation *ent);
/**
* @param proc function to call on each entry
* @param proc_cls closure for proc
*/
-void GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir,
- GNUNET_FS_FileInformationProcessor
- proc, void *proc_cls);
+void
+GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir,
+ GNUNET_FS_FileInformationProcessor proc,
+ void *proc_cls);
/**
* values are ignored
* @param cleaner_cls closure for cleaner
*/
-void GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi,
- GNUNET_FS_FileInformationProcessor
- cleaner, void *cleaner_cls);
+void
+GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi,
+ GNUNET_FS_FileInformationProcessor cleaner,
+ void *cleaner_cls);
/**
* @param options options for the publication
* @return context that can be used to control the publish operation
*/
-struct GNUNET_FS_PublishContext *GNUNET_FS_publish_start (struct
- GNUNET_FS_Handle *h,
- struct
- GNUNET_FS_FileInformation
- *fi,
- struct
- GNUNET_FS_Namespace
- *namespace,
- const char *nid,
- const char *nuid,
- enum
- GNUNET_FS_PublishOptions
- options);
+struct GNUNET_FS_PublishContext *
+GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h,
+ struct GNUNET_FS_FileInformation *fi,
+ struct GNUNET_FS_Namespace *namespace, const char *nid,
+ const char *nuid,
+ enum GNUNET_FS_PublishOptions options);
/**
*
* @param pc context for the publication to stop
*/
-void GNUNET_FS_publish_stop (struct GNUNET_FS_PublishContext *pc);
+void
+GNUNET_FS_publish_stop (struct GNUNET_FS_PublishContext *pc);
/**
* @param cont continuation
* @param cont_cls closure for cont
*/
-void GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h,
- const struct GNUNET_FS_Uri *ksk_uri,
- const struct GNUNET_CONTAINER_MetaData *meta,
- const struct GNUNET_FS_Uri *uri,
- const struct GNUNET_FS_BlockOptions *bo,
- enum GNUNET_FS_PublishOptions options,
- GNUNET_FS_PublishContinuation cont, void *cont_cls);
+void
+GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h,
+ const struct GNUNET_FS_Uri *ksk_uri,
+ const struct GNUNET_CONTAINER_MetaData *meta,
+ const struct GNUNET_FS_Uri *uri,
+ const struct GNUNET_FS_BlockOptions *bo,
+ enum GNUNET_FS_PublishOptions options,
+ GNUNET_FS_PublishContinuation cont, void *cont_cls);
/**
* @param cont continuation
* @param cont_cls closure for cont
*/
-void GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h,
- struct GNUNET_FS_Namespace *namespace,
- const char *identifier, const char *update,
- const struct GNUNET_CONTAINER_MetaData *meta,
- const struct GNUNET_FS_Uri *uri,
- const struct GNUNET_FS_BlockOptions *bo,
- enum GNUNET_FS_PublishOptions options,
- GNUNET_FS_PublishContinuation cont, void *cont_cls);
+void
+GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h,
+ struct GNUNET_FS_Namespace *namespace,
+ const char *identifier, const char *update,
+ const struct GNUNET_CONTAINER_MetaData *meta,
+ const struct GNUNET_FS_Uri *uri,
+ const struct GNUNET_FS_BlockOptions *bo,
+ enum GNUNET_FS_PublishOptions options,
+ GNUNET_FS_PublishContinuation cont, void *cont_cls);
/**
* error) or "PREREQ_DONE" (on success)
* @param cont_cls closure for cont
*/
-void GNUNET_FS_get_indexed_files (struct GNUNET_FS_Handle *h,
- GNUNET_FS_IndexedFileProcessor iterator,
- void *iterator_cls,
- GNUNET_SCHEDULER_Task cont, void *cont_cls);
+void
+GNUNET_FS_get_indexed_files (struct GNUNET_FS_Handle *h,
+ GNUNET_FS_IndexedFileProcessor iterator,
+ void *iterator_cls, GNUNET_SCHEDULER_Task cont,
+ void *cont_cls);
/**
* @param cctx initial value for the client context
* @return NULL on error, otherwise handle
*/
-struct GNUNET_FS_UnindexContext *GNUNET_FS_unindex_start (struct
- GNUNET_FS_Handle *h,
- const char *filename,
- void *cctx);
+struct GNUNET_FS_UnindexContext *
+GNUNET_FS_unindex_start (struct GNUNET_FS_Handle *h, const char *filename,
+ void *cctx);
/**
*
* @param uc handle
*/
-void GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc);
+void
+GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc);
/**
* @param cont continuation
* @param cont_cls closure for cont
*/
-void GNUNET_FS_namespace_advertise (struct GNUNET_FS_Handle *h,
- struct GNUNET_FS_Uri *ksk_uri,
- struct GNUNET_FS_Namespace *namespace,
- const struct GNUNET_CONTAINER_MetaData
- *meta,
- const struct GNUNET_FS_BlockOptions *bo,
- const char *rootEntry,
- GNUNET_FS_PublishContinuation cont,
- void *cont_cls);
+void
+GNUNET_FS_namespace_advertise (struct GNUNET_FS_Handle *h,
+ struct GNUNET_FS_Uri *ksk_uri,
+ struct GNUNET_FS_Namespace *namespace,
+ const struct GNUNET_CONTAINER_MetaData *meta,
+ const struct GNUNET_FS_BlockOptions *bo,
+ const char *rootEntry,
+ GNUNET_FS_PublishContinuation cont,
+ void *cont_cls);
/**
* @param name name to use for the namespace
* @return handle to the namespace, NULL on error
*/
-struct GNUNET_FS_Namespace *GNUNET_FS_namespace_create (struct GNUNET_FS_Handle
- *h, const char *name);
+struct GNUNET_FS_Namespace *
+GNUNET_FS_namespace_create (struct GNUNET_FS_Handle *h, const char *name);
/**
*
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
-int GNUNET_FS_namespace_delete (struct GNUNET_FS_Namespace *namespace,
- int freeze);
+int
+GNUNET_FS_namespace_delete (struct GNUNET_FS_Namespace *namespace, int freeze);
/**
* @param cb function to call on each known namespace
* @param cb_cls closure for cb
*/
-void GNUNET_FS_namespace_list (struct GNUNET_FS_Handle *h,
- GNUNET_FS_NamespaceInfoProcessor cb,
- void *cb_cls);
+void
+GNUNET_FS_namespace_list (struct GNUNET_FS_Handle *h,
+ GNUNET_FS_NamespaceInfoProcessor cb, void *cb_cls);
/**
* @param ip function to call on each updateable identifier
* @param ip_cls closure for ip
*/
-void GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Namespace *namespace,
- const char *next_id,
- GNUNET_FS_IdentifierProcessor ip,
- void *ip_cls);
+void
+GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Namespace *namespace,
+ const char *next_id,
+ GNUNET_FS_IdentifierProcessor ip,
+ void *ip_cls);
/**
* @param cctx initial value for the client context
* @return context that can be used to control the search
*/
-struct GNUNET_FS_SearchContext *GNUNET_FS_search_start (struct GNUNET_FS_Handle
- *h,
- const struct
- GNUNET_FS_Uri *uri,
- uint32_t anonymity,
- enum
- GNUNET_FS_SearchOptions
- options, void *cctx);
+struct GNUNET_FS_SearchContext *
+GNUNET_FS_search_start (struct GNUNET_FS_Handle *h,
+ const struct GNUNET_FS_Uri *uri, uint32_t anonymity,
+ enum GNUNET_FS_SearchOptions options, void *cctx);
/**
*
* @param sc context for the search that should be paused
*/
-void GNUNET_FS_search_pause (struct GNUNET_FS_SearchContext *sc);
+void
+GNUNET_FS_search_pause (struct GNUNET_FS_SearchContext *sc);
/**
*
* @param sc context for the search that should be resumed
*/
-void GNUNET_FS_search_continue (struct GNUNET_FS_SearchContext *sc);
+void
+GNUNET_FS_search_continue (struct GNUNET_FS_SearchContext *sc);
/**
*
* @param sc context for the search that should be stopped
*/
-void GNUNET_FS_search_stop (struct GNUNET_FS_SearchContext *sc);
+void
+GNUNET_FS_search_stop (struct GNUNET_FS_SearchContext *sc);
* for top-level downloads; useful for manually-triggered recursive downloads)
* @return context that can be used to control this download
*/
-struct GNUNET_FS_DownloadContext *GNUNET_FS_download_start (struct
- GNUNET_FS_Handle *h,
- const struct
- GNUNET_FS_Uri *uri,
- const struct
- GNUNET_CONTAINER_MetaData
- *meta,
- const char
- *filename,
- const char
- *tempname,
- uint64_t offset,
- uint64_t length,
- uint32_t anonymity,
- enum
- GNUNET_FS_DownloadOptions
- options, void *cctx,
- struct
- GNUNET_FS_DownloadContext
- *parent);
+struct GNUNET_FS_DownloadContext *
+GNUNET_FS_download_start (struct GNUNET_FS_Handle *h,
+ const struct GNUNET_FS_Uri *uri,
+ const struct GNUNET_CONTAINER_MetaData *meta,
+ const char *filename, const char *tempname,
+ uint64_t offset, uint64_t length, uint32_t anonymity,
+ enum GNUNET_FS_DownloadOptions options, void *cctx,
+ struct GNUNET_FS_DownloadContext *parent);
/**
* @param cctx initial value for the client context for this download
* @return context that can be used to control this download
*/
-struct GNUNET_FS_DownloadContext *GNUNET_FS_download_start_from_search (struct
- GNUNET_FS_Handle
- *h,
- struct
- GNUNET_FS_SearchResult
- *sr,
- const
- char
- *filename,
- const
- char
- *tempname,
- uint64_t
- offset,
- uint64_t
- length,
- uint32_t
- anonymity,
- enum
- GNUNET_FS_DownloadOptions
- options,
- void
- *cctx);
+struct GNUNET_FS_DownloadContext *
+GNUNET_FS_download_start_from_search (struct GNUNET_FS_Handle *h,
+ struct GNUNET_FS_SearchResult *sr,
+ const char *filename,
+ const char *tempname, uint64_t offset,
+ uint64_t length, uint32_t anonymity,
+ enum GNUNET_FS_DownloadOptions options,
+ void *cctx);
/**
* @param dc handle for the download
* @param do_delete delete files of incomplete downloads
*/
-void GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc,
- int do_delete);
+void
+GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, int do_delete);
* @return GNUNET_YES if it is, GNUNET_NO if it is not, GNUNET_SYSERR if
* we have no mime-type information (treat as 'GNUNET_NO')
*/
-int GNUNET_FS_meta_data_test_for_directory (const struct
- GNUNET_CONTAINER_MetaData *md);
+int
+GNUNET_FS_meta_data_test_for_directory (const struct GNUNET_CONTAINER_MetaData
+ *md);
/**
*
* @param md metadata to add mimetype to
*/
-void GNUNET_FS_meta_data_make_directory (struct GNUNET_CONTAINER_MetaData *md);
+void
+GNUNET_FS_meta_data_make_directory (struct GNUNET_CONTAINER_MetaData *md);
/**
* @param md given meta data
* @return NULL if meta data is useless for suggesting a filename
*/
-char *GNUNET_FS_meta_data_suggest_filename (const struct
- GNUNET_CONTAINER_MetaData *md);
+char *
+GNUNET_FS_meta_data_suggest_filename (const struct GNUNET_CONTAINER_MetaData
+ *md);
/**
* GNUNET_NO if this could be part of a directory (but not 100% OK)
* GNUNET_SYSERR if 'data' does not represent a directory
*/
-int GNUNET_FS_directory_list_contents (size_t size, const void *data,
- uint64_t offset,
- GNUNET_FS_DirectoryEntryProcessor dep,
- void *dep_cls);
+int
+GNUNET_FS_directory_list_contents (size_t size, const void *data,
+ uint64_t offset,
+ GNUNET_FS_DirectoryEntryProcessor dep,
+ void *dep_cls);
/**
*
* @param mdir metadata for the directory
*/
-struct GNUNET_FS_DirectoryBuilder *GNUNET_FS_directory_builder_create (const
- struct
- GNUNET_CONTAINER_MetaData
- *mdir);
+struct GNUNET_FS_DirectoryBuilder *
+GNUNET_FS_directory_builder_create (const struct GNUNET_CONTAINER_MetaData
+ *mdir);
/**
* data must point to exactly the number of bytes specified
* by the uri
*/
-void GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld,
- const struct GNUNET_FS_Uri *uri,
- const struct GNUNET_CONTAINER_MetaData
- *md, const void *data);
+void
+GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld,
+ const struct GNUNET_FS_Uri *uri,
+ const struct GNUNET_CONTAINER_MetaData *md,
+ const void *data);
/**
* @param rdata set to the encoded directory
* @return GNUNET_OK on success
*/
-int GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld,
- size_t * rsize, void **rdata);
+int
+GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld,
+ size_t * rsize, void **rdata);
#if 0 /* keep Emacsens' auto-indent happy */
* @return index into argv with first non-option
* argument, or GNUNET_SYSERR on error
*/
-int GNUNET_GETOPT_run (const char *binaryOptions,
- const struct GNUNET_GETOPT_CommandLineOption *allOptions,
- unsigned int argc, char *const *argv);
+int
+GNUNET_GETOPT_run (const char *binaryOptions,
+ const struct GNUNET_GETOPT_CommandLineOption *allOptions,
+ unsigned int argc, char *const *argv);
/**
* @param value actual value of the option as a string.
* @return GNUNET_OK if parsing the value worked
*/
-int GNUNET_GETOPT_set_ulong (struct GNUNET_GETOPT_CommandLineProcessorContext
- *ctx, void *scls, const char *option,
- const char *value);
+int
+GNUNET_GETOPT_set_ulong (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
+ void *scls, const char *option, const char *value);
/**
* @param value actual value of the option as a string.
* @return GNUNET_OK if parsing the value worked
*/
-int GNUNET_GETOPT_set_uint (struct GNUNET_GETOPT_CommandLineProcessorContext
- *ctx, void *scls, const char *option,
- const char *value);
+int
+GNUNET_GETOPT_set_uint (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
+ void *scls, const char *option, const char *value);
/**
* @param value not used (NULL)
* @return GNUNET_OK
*/
-int GNUNET_GETOPT_set_one (struct GNUNET_GETOPT_CommandLineProcessorContext
- *ctx, void *scls, const char *option,
- const char *value);
+int
+GNUNET_GETOPT_set_one (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
+ void *scls, const char *option, const char *value);
/**
* @param value actual value of the option (a string)
* @return GNUNET_OK
*/
-int GNUNET_GETOPT_set_string (struct GNUNET_GETOPT_CommandLineProcessorContext
- *ctx, void *scls, const char *option,
- const char *value);
+int
+GNUNET_GETOPT_set_string (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
+ void *scls, const char *option, const char *value);
/**
* Set an option of type 'unsigned int' from the command line. Each
* @param value not used (NULL)
* @return GNUNET_OK
*/
-int GNUNET_GETOPT_increment_value (struct
- GNUNET_GETOPT_CommandLineProcessorContext
- *ctx, void *scls, const char *option,
- const char *value);
+int
+GNUNET_GETOPT_increment_value (struct GNUNET_GETOPT_CommandLineProcessorContext
+ *ctx, void *scls, const char *option,
+ const char *value);
/* *************** internal prototypes - use macros above! ************* */
* @param value not used (NULL)
* @return GNUNET_SYSERR (do not continue)
*/
-int GNUNET_GETOPT_format_help_ (struct GNUNET_GETOPT_CommandLineProcessorContext
- *ctx, void *scls, const char *option,
- const char *value);
+int
+GNUNET_GETOPT_format_help_ (struct GNUNET_GETOPT_CommandLineProcessorContext
+ *ctx, void *scls, const char *option,
+ const char *value);
/**
* Print out program version (implements --version).
* @param value not used (NULL)
* @return GNUNET_SYSERR (do not continue)
*/
-int GNUNET_GETOPT_print_version_ (struct
- GNUNET_GETOPT_CommandLineProcessorContext
- *ctx, void *scls, const char *option,
- const char *value);
+int
+GNUNET_GETOPT_print_version_ (struct GNUNET_GETOPT_CommandLineProcessorContext
+ *ctx, void *scls, const char *option,
+ const char *value);
#if 0 /* keep Emacsens' auto-indent happy */
{
* @return number of bytes copied, 0 if
* the target buffer was not big enough.
*/
-size_t GNUNET_HELLO_add_address (const char *tname,
- struct GNUNET_TIME_Absolute
- expiration, const void *addr,
- uint16_t addr_len, char *target,
- size_t max);
+size_t
+GNUNET_HELLO_add_address (const char *tname,
+ struct GNUNET_TIME_Absolute expiration,
+ const void *addr, uint16_t addr_len, char *target,
+ size_t max);
/**
*
* @return the hello message
*/
-struct GNUNET_HELLO_Message *GNUNET_HELLO_create (const struct
- GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
- *publicKey,
- GNUNET_HELLO_GenerateAddressListCallback
- addrgen, void *addrgen_cls);
+struct GNUNET_HELLO_Message *
+GNUNET_HELLO_create (const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
+ *publicKey,
+ GNUNET_HELLO_GenerateAddressListCallback addrgen,
+ void *addrgen_cls);
/**
* @param hello to inspect
* @return the size, 0 if HELLO is invalid
*/
-uint16_t GNUNET_HELLO_size (const struct GNUNET_HELLO_Message *hello);
+uint16_t
+GNUNET_HELLO_size (const struct GNUNET_HELLO_Message *hello);
/**
* @param h2 the second HELLO message
* @return the combined hello message
*/
-struct GNUNET_HELLO_Message *GNUNET_HELLO_merge (const struct
- GNUNET_HELLO_Message *h1,
- const struct
- GNUNET_HELLO_Message *h2);
+struct GNUNET_HELLO_Message *
+GNUNET_HELLO_merge (const struct GNUNET_HELLO_Message *h1,
+ const struct GNUNET_HELLO_Message *h2);
/**
* zero if the some addresses with expirations >= now
* do not match at all
*/
-struct GNUNET_TIME_Absolute GNUNET_HELLO_equals (const struct
- GNUNET_HELLO_Message *h1,
- const struct
- GNUNET_HELLO_Message *h2,
- struct GNUNET_TIME_Absolute
- now);
+struct GNUNET_TIME_Absolute
+GNUNET_HELLO_equals (const struct GNUNET_HELLO_Message *h1,
+ const struct GNUNET_HELLO_Message *h2,
+ struct GNUNET_TIME_Absolute now);
/**
* @param it_cls closure for it
* @return the modified HELLO or NULL
*/
-struct GNUNET_HELLO_Message *GNUNET_HELLO_iterate_addresses (const struct
- GNUNET_HELLO_Message
- *msg,
- int
- return_modified,
- GNUNET_HELLO_AddressIterator
- it, void *it_cls);
+struct GNUNET_HELLO_Message *
+GNUNET_HELLO_iterate_addresses (const struct GNUNET_HELLO_Message *msg,
+ int return_modified,
+ GNUNET_HELLO_AddressIterator it, void *it_cls);
/**
* @param it iterator to call on each address
* @param it_cls closure for it
*/
-void GNUNET_HELLO_iterate_new_addresses (const struct GNUNET_HELLO_Message
- *new_hello,
- const struct GNUNET_HELLO_Message
- *old_hello,
- struct GNUNET_TIME_Absolute
- expiration_limit,
- GNUNET_HELLO_AddressIterator it,
- void *it_cls);
+void
+GNUNET_HELLO_iterate_new_addresses (const struct GNUNET_HELLO_Message
+ *new_hello,
+ const struct GNUNET_HELLO_Message
+ *old_hello,
+ struct GNUNET_TIME_Absolute
+ expiration_limit,
+ GNUNET_HELLO_AddressIterator it,
+ void *it_cls);
/**
* @param publicKey where to copy the public key information, can be NULL
* @return GNUNET_SYSERR if the HELLO was malformed
*/
-int GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello,
- struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
- *publicKey);
+int
+GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello,
+ struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
+ *publicKey);
/**
* @param peer where to store the peer's identity
* @return GNUNET_SYSERR if the HELLO was malformed
*/
-int GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello,
- struct GNUNET_PeerIdentity *peer);
+int
+GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello,
+ struct GNUNET_PeerIdentity *peer);
/**
*
* @return header or NULL if the HELLO was malformed
*/
-struct GNUNET_MessageHeader *GNUNET_HELLO_get_header (struct
- GNUNET_HELLO_Message
- *hello);
+struct GNUNET_MessageHeader *
+GNUNET_HELLO_get_header (struct GNUNET_HELLO_Message *hello);
/* ifndef GNUNET_HELLO_LIB_H */
#endif
* frequency, 0-load values will be added to the load
* @return the new load value
*/
-struct GNUNET_LOAD_Value *GNUNET_LOAD_value_init (struct GNUNET_TIME_Relative
- autodecline);
+struct GNUNET_LOAD_Value *
+GNUNET_LOAD_value_init (struct GNUNET_TIME_Relative autodecline);
/**
* @param load load to update
* @param autodecline frequency of load decline
*/
-void GNUNET_LOAD_value_set_decline (struct GNUNET_LOAD_Value *load,
- struct GNUNET_TIME_Relative autodecline);
+void
+GNUNET_LOAD_value_set_decline (struct GNUNET_LOAD_Value *load,
+ struct GNUNET_TIME_Relative autodecline);
/**
* 100 if the latest updates were so large
* that we could not do proper calculations
*/
-double GNUNET_LOAD_get_load (struct GNUNET_LOAD_Value *load);
+double
+GNUNET_LOAD_get_load (struct GNUNET_LOAD_Value *load);
/**
* @param load load handle
* @return zero if update was never called
*/
-double GNUNET_LOAD_get_average (struct GNUNET_LOAD_Value *load);
+double
+GNUNET_LOAD_get_average (struct GNUNET_LOAD_Value *load);
/**
* @param load to update
* @param data latest measurement value (for example, delay)
*/
-void GNUNET_LOAD_update (struct GNUNET_LOAD_Value *load, uint64_t data);
+void
+GNUNET_LOAD_update (struct GNUNET_LOAD_Value *load, uint64_t data);
#if 0 /* keep Emacsens' auto-indent happy */
* @return handle to the mesh service
* NULL on error (in this case, init is never called)
*/
-struct GNUNET_MESH_Handle *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);
+struct GNUNET_MESH_Handle *
+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);
/**
* Get the peer on the other side of this tunnel if it is just one. Return NULL otherwise
* @param tunnel the tunnel
* @return the peer or NULL
*/
-const struct GNUNET_PeerIdentity *GNUNET_MESH_get_peer (const struct
- GNUNET_MESH_Tunnel
- *tunnel);
+const struct GNUNET_PeerIdentity *
+GNUNET_MESH_get_peer (const struct GNUNET_MESH_Tunnel *tunnel);
/**
*
* @param handle connection to mesh to disconnect
*/
-void GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle);
+void
+GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle);
* @param handler_cls closure for handler
* @return NULL on error (handler will not be called), otherwise handle for cancellation
*/
-struct GNUNET_MESH_Tunnel *GNUNET_MESH_peer_request_connect_any (struct
- GNUNET_MESH_Handle
- *h,
- struct
- GNUNET_TIME_Relative
- timeout,
- unsigned int
- num_peers,
- const struct
- GNUNET_PeerIdentity
- *peers,
- GNUNET_MESH_TunnelConnectHandler
- connect_handler,
- GNUNET_MESH_TunnelDisconnectHandler
- disconnect_handler,
- void
- *handler_cls);
+struct GNUNET_MESH_Tunnel *
+GNUNET_MESH_peer_request_connect_any (struct GNUNET_MESH_Handle *h,
+ struct GNUNET_TIME_Relative timeout,
+ unsigned int num_peers,
+ const struct GNUNET_PeerIdentity *peers,
+ GNUNET_MESH_TunnelConnectHandler
+ connect_handler,
+ GNUNET_MESH_TunnelDisconnectHandler
+ disconnect_handler, void *handler_cls);
/**
* @param handler_cls closure for handler
* @return NULL on error (handler will not be called), otherwise handle for cancellation
*/
-struct GNUNET_MESH_Tunnel *GNUNET_MESH_peer_request_connect_all (struct
- GNUNET_MESH_Handle
- *h,
- struct
- GNUNET_TIME_Relative
- timeout,
- unsigned int
- num_peers,
- const struct
- GNUNET_PeerIdentity
- *peers,
- GNUNET_MESH_TunnelConnectHandler
- connect_handler,
- GNUNET_MESH_TunnelDisconnectHandler
- disconnect_handler,
- void
- *handler_cls);
+struct GNUNET_MESH_Tunnel *
+GNUNET_MESH_peer_request_connect_all (struct GNUNET_MESH_Handle *h,
+ struct GNUNET_TIME_Relative timeout,
+ unsigned int num_peers,
+ const struct GNUNET_PeerIdentity *peers,
+ GNUNET_MESH_TunnelConnectHandler
+ connect_handler,
+ GNUNET_MESH_TunnelDisconnectHandler
+ disconnect_handler, void *handler_cls);
/**
* @param timeout how long to try to establish a connection
* @param peer peer to add
*/
-void GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel,
- struct GNUNET_TIME_Relative timeout,
- const struct GNUNET_PeerIdentity
- *peer);
+void
+GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel,
+ struct GNUNET_TIME_Relative timeout,
+ const struct GNUNET_PeerIdentity *peer);
/**
* @param tunnel handle to existing tunnel
* @param peer peer to remove
*/
-void GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel,
- const struct GNUNET_PeerIdentity
- *peer);
+void
+GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel,
+ const struct GNUNET_PeerIdentity *peer);
/**
* @param handler_cls closure for handler
* @return NULL on error (handler will not be called), otherwise handle for cancellation
*/
-struct GNUNET_MESH_Tunnel *GNUNET_MESH_peer_request_connect_by_type (struct
- GNUNET_MESH_Handle
- *h,
- struct
- GNUNET_TIME_Relative
- timeout,
- GNUNET_MESH_ApplicationType
- app_type,
- GNUNET_MESH_TunnelConnectHandler
- connect_handler,
- GNUNET_MESH_TunnelDisconnectHandler
- disconnect_handler,
- void
- *handler_cls);
+struct GNUNET_MESH_Tunnel *
+GNUNET_MESH_peer_request_connect_by_type (struct GNUNET_MESH_Handle *h,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_MESH_ApplicationType app_type,
+ GNUNET_MESH_TunnelConnectHandler
+ connect_handler,
+ GNUNET_MESH_TunnelDisconnectHandler
+ disconnect_handler,
+ void *handler_cls);
/**
*
* @param req request handle that was returned for the original request
*/
-void GNUNET_MESH_peer_request_connect_cancel (struct GNUNET_MESH_Tunnel *req);
+void
+GNUNET_MESH_peer_request_connect_cancel (struct GNUNET_MESH_Tunnel *req);
/**
* NULL if we can not even queue the request (insufficient
* 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,
- uint32_t
- priority,
- struct
- GNUNET_TIME_Relative
- maxdelay,
- const
- struct
- GNUNET_PeerIdentity
- *target,
- size_t
- notify_size,
- GNUNET_CONNECTION_TransmitReadyNotify
- notify,
- void
- *notify_cls);
+struct GNUNET_MESH_TransmitHandle *
+GNUNET_MESH_notify_transmit_ready (struct GNUNET_MESH_Tunnel *tunnel, int cork,
+ uint32_t priority,
+ struct GNUNET_TIME_Relative maxdelay,
+ const struct GNUNET_PeerIdentity *target,
+ size_t notify_size,
+ GNUNET_CONNECTION_TransmitReadyNotify notify,
+ void *notify_cls);
/**
*
* @param th handle that was returned by "notify_transmit_ready".
*/
-void GNUNET_MESH_notify_transmit_ready_cancel (struct GNUNET_MESH_TransmitHandle
- *th);
-
-void GNUNET_MESH_tunnel_set_head (struct GNUNET_MESH_Tunnel *tunnel,
- void *head);
-void GNUNET_MESH_tunnel_set_tail (struct GNUNET_MESH_Tunnel *tunnel,
- void *tail);
-void *GNUNET_MESH_tunnel_get_head (struct GNUNET_MESH_Tunnel *tunnel);
-void *GNUNET_MESH_tunnel_get_tail (struct GNUNET_MESH_Tunnel *tunnel);
-
-void GNUNET_MESH_tunnel_set_data (struct GNUNET_MESH_Tunnel *tunnel,
- void *data);
-void *GNUNET_MESH_tunnel_get_data (struct GNUNET_MESH_Tunnel *tunnel);
+void
+GNUNET_MESH_notify_transmit_ready_cancel (struct GNUNET_MESH_TransmitHandle
+ *th);
+
+void
+GNUNET_MESH_tunnel_set_head (struct GNUNET_MESH_Tunnel *tunnel, void *head);
+void
+GNUNET_MESH_tunnel_set_tail (struct GNUNET_MESH_Tunnel *tunnel, void *tail);
+void *
+GNUNET_MESH_tunnel_get_head (struct GNUNET_MESH_Tunnel *tunnel);
+void *
+GNUNET_MESH_tunnel_get_tail (struct GNUNET_MESH_Tunnel *tunnel);
+
+void
+GNUNET_MESH_tunnel_set_data (struct GNUNET_MESH_Tunnel *tunnel, void *data);
+void *
+GNUNET_MESH_tunnel_get_data (struct GNUNET_MESH_Tunnel *tunnel);
#if 0 /* keep Emacsens' auto-indent happy */
{
* @return handle to the mesh service NULL on error
* (in this case, init is never called)
*/
-struct GNUNET_MESH_Handle *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);
+struct GNUNET_MESH_Handle *
+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);
/**
*
* @param handle connection to mesh to disconnect
*/
-void GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle);
+void
+GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle);
/**
* @param disconnect_handler function to call when peers are disconnected
* @param handler_cls closure for connect/disconnect handlers
*/
-struct GNUNET_MESH_Tunnel *GNUNET_MESH_tunnel_create (struct GNUNET_MESH_Handle
- *h,
- GNUNET_MESH_TunnelConnectHandler
- connect_handler,
- GNUNET_MESH_TunnelDisconnectHandler
- disconnect_handler,
- void *handler_cls);
+struct GNUNET_MESH_Tunnel *
+GNUNET_MESH_tunnel_create (struct GNUNET_MESH_Handle *h,
+ GNUNET_MESH_TunnelConnectHandler connect_handler,
+ GNUNET_MESH_TunnelDisconnectHandler
+ disconnect_handler, void *handler_cls);
/**
* Destroy an existing tunnel.
*
* @param tun tunnel handle
*/
-void GNUNET_MESH_tunnel_destroy (struct GNUNET_MESH_Tunnel *tun);
+void
+GNUNET_MESH_tunnel_destroy (struct GNUNET_MESH_Tunnel *tun);
/**
* @param timeout how long to try to establish a connection
* @param peer peer to add
*/
-void GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel,
- struct GNUNET_TIME_Relative timeout,
- const struct GNUNET_PeerIdentity
- *peer);
+void
+GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel,
+ struct GNUNET_TIME_Relative timeout,
+ const struct GNUNET_PeerIdentity *peer);
/**
* @param tunnel handle to existing tunnel
* @param peer peer to remove
*/
-void GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel,
- const struct GNUNET_PeerIdentity
- *peer);
+void
+GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel,
+ const struct GNUNET_PeerIdentity *peer);
/**
* @param app_type application type that must be supported by the peer
* (MESH should discover peer in proximity handling this type)
*/
-void GNUNET_MESH_peer_request_connect_by_type (struct GNUNET_MESH_Tunnel
- *tunnel,
- struct GNUNET_TIME_Relative
- timeout,
- GNUNET_MESH_ApplicationType
- app_type);
+void
+GNUNET_MESH_peer_request_connect_by_type (struct GNUNET_MESH_Tunnel *tunnel,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_MESH_ApplicationType app_type);
/**
* NULL if we can not even queue the request (insufficient
* 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,
- uint32_t
- priority,
- struct
- GNUNET_TIME_Relative
- maxdelay,
- const
- struct
- GNUNET_PeerIdentity
- *target,
- size_t
- notify_size,
- GNUNET_CONNECTION_TransmitReadyNotify
- notify,
- void
- *notify_cls);
+struct GNUNET_MESH_TransmitHandle *
+GNUNET_MESH_notify_transmit_ready (struct GNUNET_MESH_Tunnel *tunnel, int cork,
+ uint32_t priority,
+ struct GNUNET_TIME_Relative maxdelay,
+ const struct GNUNET_PeerIdentity *target,
+ size_t notify_size,
+ GNUNET_CONNECTION_TransmitReadyNotify notify,
+ void *notify_cls);
/**
*
* @param th handle that was returned by "notify_transmit_ready".
*/
-void GNUNET_MESH_notify_transmit_ready_cancel (struct GNUNET_MESH_TransmitHandle
- *th);
+void
+GNUNET_MESH_notify_transmit_ready_cancel (struct GNUNET_MESH_TransmitHandle
+ *th);
#if 0 /* keep Emacsens' auto-indent happy */
* @param callback_cls closure for callback
* @return NULL on error, otherwise handle that can be used to unregister
*/
-struct GNUNET_NAT_Handle *GNUNET_NAT_register (const struct
- GNUNET_CONFIGURATION_Handle *cfg,
- int is_tcp, uint16_t adv_port,
- unsigned int num_addrs,
- const struct sockaddr **addrs,
- const socklen_t * addrlens,
- GNUNET_NAT_AddressCallback
- address_callback,
- GNUNET_NAT_ReversalCallback
- reversal_callback,
- void *callback_cls);
+struct GNUNET_NAT_Handle *
+GNUNET_NAT_register (const struct GNUNET_CONFIGURATION_Handle *cfg, int is_tcp,
+ uint16_t adv_port, unsigned int num_addrs,
+ const struct sockaddr **addrs, const socklen_t * addrlens,
+ GNUNET_NAT_AddressCallback address_callback,
+ GNUNET_NAT_ReversalCallback reversal_callback,
+ void *callback_cls);
/**
* GNUNET_NO if the address is not plausible,
* GNUNET_SYSERR if the address is malformed
*/
-int GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *h, const void *addr,
- socklen_t addrlen);
+int
+GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *h, const void *addr,
+ socklen_t addrlen);
/**
* @param h handle (used for configuration)
* @param sa the address of the peer (IPv4-only)
*/
-void GNUNET_NAT_run_client (struct GNUNET_NAT_Handle *h,
- const struct sockaddr_in *sa);
+void
+GNUNET_NAT_run_client (struct GNUNET_NAT_Handle *h,
+ const struct sockaddr_in *sa);
*
* @param h the handle to stop
*/
-void GNUNET_NAT_unregister (struct GNUNET_NAT_Handle *h);
+void
+GNUNET_NAT_unregister (struct GNUNET_NAT_Handle *h);
/**
* @param report_cls closure for report
* @return handle to cancel NAT test
*/
-struct GNUNET_NAT_Test *GNUNET_NAT_test_start (const struct
- GNUNET_CONFIGURATION_Handle *cfg,
- int is_tcp, uint16_t bnd_port,
- uint16_t adv_port,
- GNUNET_NAT_TestCallback report,
- void *report_cls);
+struct GNUNET_NAT_Test *
+GNUNET_NAT_test_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ int is_tcp, uint16_t bnd_port, uint16_t adv_port,
+ GNUNET_NAT_TestCallback report, void *report_cls);
/**
*
* @param tst test to stop.
*/
-void GNUNET_NAT_test_stop (struct GNUNET_NAT_Test *tst);
+void
+GNUNET_NAT_test_stop (struct GNUNET_NAT_Test *tst);
/**
* @param cb_cls closure for 'cb'
* @return handle for cancellation (can only be used until 'cb' is called), NULL on error
*/
-struct GNUNET_NAT_ExternalHandle *GNUNET_NAT_mini_get_external_ipv4 (struct
- GNUNET_TIME_Relative
- timeout,
- GNUNET_NAT_IPCallback
- cb,
- void
- *cb_cls);
+struct GNUNET_NAT_ExternalHandle *
+GNUNET_NAT_mini_get_external_ipv4 (struct GNUNET_TIME_Relative timeout,
+ GNUNET_NAT_IPCallback cb, void *cb_cls);
/**
*
* @param eh operation to cancel
*/
-void GNUNET_NAT_mini_get_external_ipv4_cancel (struct GNUNET_NAT_ExternalHandle
- *eh);
+void
+GNUNET_NAT_mini_get_external_ipv4_cancel (struct GNUNET_NAT_ExternalHandle *eh);
/**
* @param ac_cls closure for 'ac'
* @return NULL on error
*/
-struct GNUNET_NAT_MiniHandle *GNUNET_NAT_mini_map_start (uint16_t port,
- int is_tcp,
- GNUNET_NAT_AddressCallback
- ac, void *ac_cls);
+struct GNUNET_NAT_MiniHandle *
+GNUNET_NAT_mini_map_start (uint16_t port, int is_tcp,
+ GNUNET_NAT_AddressCallback ac, void *ac_cls);
/**
*
* @param mini the handle
*/
-void GNUNET_NAT_mini_map_stop (struct GNUNET_NAT_MiniHandle *mini);
+void
+GNUNET_NAT_mini_map_stop (struct GNUNET_NAT_MiniHandle *mini);
#endif
* @param address_len length of address
* @return client socket
*/
-struct GNUNET_NETWORK_Handle *GNUNET_NETWORK_socket_accept (const struct
- GNUNET_NETWORK_Handle
- *desc,
- struct sockaddr
- *address,
- socklen_t *
- address_len);
+struct GNUNET_NETWORK_Handle *
+GNUNET_NETWORK_socket_accept (const struct GNUNET_NETWORK_Handle *desc,
+ struct sockaddr *address,
+ socklen_t * address_len);
/**
* @param fd socket to box
* @return NULL on error (including not supported on target platform)
*/
-struct GNUNET_NETWORK_Handle *GNUNET_NETWORK_socket_box_native (int fd);
+struct GNUNET_NETWORK_Handle *
+GNUNET_NETWORK_socket_box_native (int fd);
/**
* @param address_len length of address
* @return GNUNET_OK on success, GNUNET_SYSERR otherwise
*/
-int GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc,
- const struct sockaddr *address,
- socklen_t address_len);
+int
+GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc,
+ const struct sockaddr *address,
+ socklen_t address_len);
/**
* Close a socket.
* @param desc socket to close
* @return GNUNET_OK on success, GNUNET_SYSERR otherwise
*/
-int GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc);
+int
+GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc);
/**
* @param address_len of address
* @return GNUNET_OK on success, GNUNET_SYSERR otherwise
*/
-int GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc,
- const struct sockaddr *address,
- socklen_t address_len);
+int
+GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc,
+ const struct sockaddr *address,
+ socklen_t address_len);
/**
* @param optlen length of optval
* @return GNUNET_OK on success, GNUNET_SYSERR otherwise
*/
-int GNUNET_NETWORK_socket_getsockopt (const struct GNUNET_NETWORK_Handle *desc,
- int level, int optname, void *optval,
- socklen_t * optlen);
+int
+GNUNET_NETWORK_socket_getsockopt (const struct GNUNET_NETWORK_Handle *desc,
+ int level, int optname, void *optval,
+ socklen_t * optlen);
/**
* @param backlog length of the listen queue
* @return GNUNET_OK on success, GNUNET_SYSERR otherwise
*/
-int GNUNET_NETWORK_socket_listen (const struct GNUNET_NETWORK_Handle *desc,
- int backlog);
+int
+GNUNET_NETWORK_socket_listen (const struct GNUNET_NETWORK_Handle *desc,
+ int backlog);
/**
* How much data is available to be read on this descriptor?
* @param desc socket
*/
-ssize_t GNUNET_NETWORK_socket_recvfrom_amount (const struct
- GNUNET_NETWORK_Handle *desc);
+ssize_t
+GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle
+ *desc);
/**
* to be filled in by recvfrom
* @param addrlen length of the addr
*/
-ssize_t GNUNET_NETWORK_socket_recvfrom (const struct
- GNUNET_NETWORK_Handle
- *desc, void *buffer,
- size_t length,
- struct sockaddr *src_addr,
- socklen_t * addrlen);
+ssize_t
+GNUNET_NETWORK_socket_recvfrom (const struct GNUNET_NETWORK_Handle *desc,
+ void *buffer, size_t length,
+ struct sockaddr *src_addr, socklen_t * addrlen);
/**
* @param length length of buffer
* @return number of bytes read
*/
-ssize_t GNUNET_NETWORK_socket_recv (const struct GNUNET_NETWORK_Handle *desc,
- void *buffer, size_t length);
+ssize_t
+GNUNET_NETWORK_socket_recv (const struct GNUNET_NETWORK_Handle *desc,
+ void *buffer, size_t length);
/**
* @param timeout relative value when to return
* @return number of selected sockets, GNUNET_SYSERR on error
*/
-int GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds,
- struct GNUNET_NETWORK_FDSet *wfds,
- struct GNUNET_NETWORK_FDSet *efds,
- struct GNUNET_TIME_Relative timeout);
+int
+GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds,
+ struct GNUNET_NETWORK_FDSet *wfds,
+ struct GNUNET_NETWORK_FDSet *efds,
+ struct GNUNET_TIME_Relative timeout);
/**
* @param length size of the buffer
* @return number of bytes sent, GNUNET_SYSERR on error
*/
-ssize_t GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle *desc,
- const void *buffer, size_t length);
+ssize_t
+GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle *desc,
+ const void *buffer, size_t length);
/**
* @param dest_len length of address
* @return number of bytes sent, GNUNET_SYSERR on error
*/
-ssize_t GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle *desc,
- const void *message, size_t length,
- const struct sockaddr *dest_addr,
- socklen_t dest_len);
+ssize_t
+GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle *desc,
+ const void *message, size_t length,
+ const struct sockaddr *dest_addr,
+ socklen_t dest_len);
/**
* @param option_len size of option_value
* @return GNUNET_OK on success, GNUNET_SYSERR otherwise
*/
-int GNUNET_NETWORK_socket_setsockopt (struct GNUNET_NETWORK_Handle *fd,
- int level, int option_name,
- const void *option_value,
- socklen_t option_len);
+int
+GNUNET_NETWORK_socket_setsockopt (struct GNUNET_NETWORK_Handle *fd, int level,
+ int option_name, const void *option_value,
+ socklen_t option_len);
/**
* @param how type of shutdown
* @return GNUNET_OK on success, GNUNET_SYSERR otherwise
*/
-int GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc,
- int how);
+int
+GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc, int how);
/**
* @param desc socket
* @return GNUNET_OK on success, GNUNET_SYSERR otherwise
*/
-int GNUNET_NETWORK_socket_disable_corking (struct GNUNET_NETWORK_Handle *desc);
+int
+GNUNET_NETWORK_socket_disable_corking (struct GNUNET_NETWORK_Handle *desc);
/**
* @param protocol network protocol
* @return new socket, NULL on error
*/
-struct GNUNET_NETWORK_Handle *GNUNET_NETWORK_socket_create (int domain,
- int type,
- int protocol);
+struct GNUNET_NETWORK_Handle *
+GNUNET_NETWORK_socket_create (int domain, int type, int protocol);
/**
*
* @param fds fd set to clear
*/
-void GNUNET_NETWORK_fdset_zero (struct GNUNET_NETWORK_FDSet *fds);
+void
+GNUNET_NETWORK_fdset_zero (struct GNUNET_NETWORK_FDSet *fds);
/**
* @param fds fd set
* @param desc socket to add
*/
-void GNUNET_NETWORK_fdset_set (struct GNUNET_NETWORK_FDSet *fds,
- const struct GNUNET_NETWORK_Handle *desc);
+void
+GNUNET_NETWORK_fdset_set (struct GNUNET_NETWORK_FDSet *fds,
+ const struct GNUNET_NETWORK_Handle *desc);
#ifdef __MINGW32__
* @param fds fd set
* @param h the file handle to add
*/
-void GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct
- GNUNET_NETWORK_FDSet
- *fds, HANDLE h);
+void
+GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct GNUNET_NETWORK_FDSet
+ *fds, HANDLE h);
#endif
* @param desc socket
* @return GNUNET_YES if the socket is in the set
*/
-int GNUNET_NETWORK_fdset_isset (const struct GNUNET_NETWORK_FDSet *fds,
- const struct GNUNET_NETWORK_Handle *desc);
+int
+GNUNET_NETWORK_fdset_isset (const struct GNUNET_NETWORK_FDSet *fds,
+ const struct GNUNET_NETWORK_Handle *desc);
/**
* @param dst the fd set to add to
* @param src the fd set to add from
*/
-void GNUNET_NETWORK_fdset_add (struct GNUNET_NETWORK_FDSet *dst,
- const struct GNUNET_NETWORK_FDSet *src);
+void
+GNUNET_NETWORK_fdset_add (struct GNUNET_NETWORK_FDSet *dst,
+ const struct GNUNET_NETWORK_FDSet *src);
/**
* @param to destination
* @param from source
*/
-void GNUNET_NETWORK_fdset_copy (struct GNUNET_NETWORK_FDSet *to,
- const struct GNUNET_NETWORK_FDSet *from);
+void
+GNUNET_NETWORK_fdset_copy (struct GNUNET_NETWORK_FDSet *to,
+ const struct GNUNET_NETWORK_FDSet *from);
/**
* @param desc wrapper to process
* @return POSIX file descriptor
*/
-int GNUNET_NETWORK_get_fd (struct GNUNET_NETWORK_Handle *desc);
+int
+GNUNET_NETWORK_get_fd (struct GNUNET_NETWORK_Handle *desc);
/**
* @param from native source set
* @param nfds the biggest socket number in from + 1
*/
-void GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to,
- const fd_set * from, int nfds);
+void
+GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to,
+ const fd_set * from, int nfds);
/**
* @param to destination
* @param nfd native FD to set
*/
-void GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to, int nfd);
+void
+GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to, int nfd);
/**
* @param nfd native FD to test, -1 for none
* @return GNUNET_YES if to contains nfd
*/
-int GNUNET_NETWORK_fdset_test_native (const struct GNUNET_NETWORK_FDSet *to,
- int nfd);
+int
+GNUNET_NETWORK_fdset_test_native (const struct GNUNET_NETWORK_FDSet *to,
+ int nfd);
/**
* @param fds fd set
* @param h the file handle to add
*/
-void GNUNET_NETWORK_fdset_handle_set (struct GNUNET_NETWORK_FDSet *fds,
- const struct GNUNET_DISK_FileHandle *h);
+void
+GNUNET_NETWORK_fdset_handle_set (struct GNUNET_NETWORK_FDSet *fds,
+ const struct GNUNET_DISK_FileHandle *h);
/**
* @param h file handle
* @return GNUNET_YES if the file handle is part of the set
*/
-int GNUNET_NETWORK_fdset_handle_isset (const struct GNUNET_NETWORK_FDSet *fds,
- const struct GNUNET_DISK_FileHandle *h);
+int
+GNUNET_NETWORK_fdset_handle_isset (const struct GNUNET_NETWORK_FDSet *fds,
+ const struct GNUNET_DISK_FileHandle *h);
/**
* @param fds2 second fd set
* @return GNUNET_YES if they do overlap, GNUNET_NO otherwise
*/
-int GNUNET_NETWORK_fdset_overlap (const struct GNUNET_NETWORK_FDSet *fds1,
- const struct GNUNET_NETWORK_FDSet *fds2);
+int
+GNUNET_NETWORK_fdset_overlap (const struct GNUNET_NETWORK_FDSet *fds1,
+ const struct GNUNET_NETWORK_FDSet *fds2);
/**
* Creates an fd set
* @return a new fd set
*/
-struct GNUNET_NETWORK_FDSet *GNUNET_NETWORK_fdset_create (void);
+struct GNUNET_NETWORK_FDSet *
+GNUNET_NETWORK_fdset_create (void);
/**
* Releases the associated memory of an fd set
* @param fds fd set
*/
-void GNUNET_NETWORK_fdset_destroy (struct GNUNET_NETWORK_FDSet *fds);
+void
+GNUNET_NETWORK_fdset_destroy (struct GNUNET_NETWORK_FDSet *fds);
#if 0 /* keep Emacsens' auto-indent happy */
*
* @return handle to use
*/
-struct GNUNET_NSE_Handle *GNUNET_NSE_connect (const struct
- GNUNET_CONFIGURATION_Handle *cfg,
- GNUNET_NSE_Callback func,
- void *func_cls);
+struct GNUNET_NSE_Handle *
+GNUNET_NSE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ GNUNET_NSE_Callback func, void *func_cls);
/**
* @param h handle to destroy
*
*/
-void GNUNET_NSE_disconnect (struct GNUNET_NSE_Handle *h);
+void
+GNUNET_NSE_disconnect (struct GNUNET_NSE_Handle *h);
#if 0 /* keep Emacsens' auto-indent happy */
* @param dirkind what kind of directory is desired?
* @return a pointer to the dir path (to be freed by the caller)
*/
-char *GNUNET_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind
- dirkind);
+char *
+GNUNET_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind dirkind);
/**
* @param proc the callback function
* @param proc_cls closure for proc
*/
-void GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor
- proc, void *proc_cls);
+void
+GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc,
+ void *proc_cls);
/**
* @brief Get maximum string length returned by gethostname()
*
* @return pointer to the process sturcutre for this process
*/
-struct GNUNET_OS_Process *GNUNET_OS_process_current (void);
+struct GNUNET_OS_Process *
+GNUNET_OS_process_current (void);
/**
* @param sig signal
* @return 0 on success, -1 on error
*/
-int GNUNET_OS_process_kill (struct GNUNET_OS_Process *proc, int sig);
+int
+GNUNET_OS_process_kill (struct GNUNET_OS_Process *proc, int sig);
/**
*
* @param proc pointer to process structure
*/
-void GNUNET_OS_process_close (struct GNUNET_OS_Process *proc);
+void
+GNUNET_OS_process_close (struct GNUNET_OS_Process *proc);
/**
* Get the pid of the process in question
*
* @return the current process id
*/
-pid_t GNUNET_OS_process_get_pid (struct GNUNET_OS_Process *proc);
+pid_t
+GNUNET_OS_process_get_pid (struct GNUNET_OS_Process *proc);
/**
* Set process priority
* @param prio priority value
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
-int GNUNET_OS_set_process_priority (struct GNUNET_OS_Process *proc,
- enum GNUNET_SCHEDULER_Priority prio);
+int
+GNUNET_OS_set_process_priority (struct GNUNET_OS_Process *proc,
+ enum GNUNET_SCHEDULER_Priority prio);
/**
* @param ... NULL-terminated list of arguments to the process
* @return pointer to process structure of the new process, NULL on error
*/
-struct GNUNET_OS_Process *GNUNET_OS_start_process (struct GNUNET_DISK_PipeHandle
- *pipe_stdin,
- struct GNUNET_DISK_PipeHandle
- *pipe_stdout,
- const char *filename, ...);
+struct GNUNET_OS_Process *
+GNUNET_OS_start_process (struct GNUNET_DISK_PipeHandle *pipe_stdin,
+ struct GNUNET_DISK_PipeHandle *pipe_stdout,
+ const char *filename, ...);
/**
* @param va NULL-terminated list of arguments to the process
* @return pointer to process structure of the new process, NULL on error
*/
-struct GNUNET_OS_Process *GNUNET_OS_start_process_va (struct
- GNUNET_DISK_PipeHandle
- *pipe_stdin,
- struct
- GNUNET_DISK_PipeHandle
- *pipe_stdout,
- const char *filename,
- va_list va);
+struct GNUNET_OS_Process *
+GNUNET_OS_start_process_va (struct GNUNET_DISK_PipeHandle *pipe_stdin,
+ struct GNUNET_DISK_PipeHandle *pipe_stdout,
+ const char *filename, va_list va);
/**
* Start a process.
* including the process name as the first argument
* @return pointer to process structure of the new process, NULL on error
*/
-struct GNUNET_OS_Process *GNUNET_OS_start_process_v (const int *lsocks,
- const char *filename,
- char *const argv[]);
+struct GNUNET_OS_Process *
+GNUNET_OS_start_process_v (const int *lsocks, const char *filename,
+ char *const argv[]);
/**
*
* @param cmd handle to the process
*/
-void GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd);
+void
+GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd);
/**
* @param ... arguments to command
* @return NULL on error
*/
-struct GNUNET_OS_CommandHandle *GNUNET_OS_command_run (GNUNET_OS_LineProcessor
- proc, void *proc_cls,
- struct
- GNUNET_TIME_Relative
- timeout,
- const char *binary, ...);
+struct GNUNET_OS_CommandHandle *
+GNUNET_OS_command_run (GNUNET_OS_LineProcessor proc, void *proc_cls,
+ struct GNUNET_TIME_Relative timeout, const char *binary,
+ ...);
/**
* @param code return code/signal number
* @return GNUNET_OK on success, GNUNET_NO if the process is still running, GNUNET_SYSERR otherwise
*/
-int GNUNET_OS_process_status (struct GNUNET_OS_Process *proc,
- enum GNUNET_OS_ProcessStatusType *type,
- unsigned long *code);
+int
+GNUNET_OS_process_status (struct GNUNET_OS_Process *proc,
+ enum GNUNET_OS_ProcessStatusType *type,
+ unsigned long *code);
/**
* @param proc pointer to process structure of the process to wait for
* @return GNUNET_OK on success, GNUNET_SYSERR otherwise
*/
-int GNUNET_OS_process_wait (struct GNUNET_OS_Process *proc);
+int
+GNUNET_OS_process_wait (struct GNUNET_OS_Process *proc);
/**
* Connects this process to its parent via pipe
*/
-void GNUNET_OS_install_parent_control_handler (void *cls,
- const struct
- GNUNET_SCHEDULER_TaskContext
- *tc);
+void
+GNUNET_OS_install_parent_control_handler (void *cls,
+ const struct
+ GNUNET_SCHEDULER_TaskContext *tc);
/**
* GNUNET_NO if not SUID (but binary exists)
* GNUNET_SYSERR on error (no such binary or not executable)
*/
-int GNUNET_OS_check_helper_binary (const char *binary);
+int
+GNUNET_OS_check_helper_binary (const char *binary);
#if 0 /* keep Emacsens' auto-indent happy */
* @param pid identity to find
* @return the interned identity or 0.
*/
-GNUNET_PEER_Id GNUNET_PEER_search (const struct GNUNET_PeerIdentity *pid);
+GNUNET_PEER_Id
+GNUNET_PEER_search (const struct GNUNET_PeerIdentity *pid);
/**
* @param pid identity to intern
* @return the interned identity.
*/
-GNUNET_PEER_Id GNUNET_PEER_intern (const struct GNUNET_PeerIdentity *pid);
+GNUNET_PEER_Id
+GNUNET_PEER_intern (const struct GNUNET_PeerIdentity *pid);
/**
* @param id identity to change the RC of
* @param delta how much to change the RC
*/
-void GNUNET_PEER_change_rc (GNUNET_PEER_Id id, int delta);
+void
+GNUNET_PEER_change_rc (GNUNET_PEER_Id id, int delta);
/**
* @param ids array of PIDs to decrement the RCs of
* @param count size of the ids array
*/
-void GNUNET_PEER_decrement_rcs (const GNUNET_PEER_Id *ids, unsigned int count);
+void
+GNUNET_PEER_decrement_rcs (const GNUNET_PEER_Id *ids, unsigned int count);
/**
* @param id interned PID to convert
* @param pid where to write the normal peer identity
*/
-void GNUNET_PEER_resolve (GNUNET_PEER_Id id, struct GNUNET_PeerIdentity *pid);
+void
+GNUNET_PEER_resolve (GNUNET_PEER_Id id, struct GNUNET_PeerIdentity *pid);
/* ifndef GNUNET_PEER_LIB_H */
* @return NULL on error (configuration related, actual connection
* etablishment may happen asynchronously).
*/
-struct GNUNET_PEERINFO_Handle *GNUNET_PEERINFO_connect (const struct
- GNUNET_CONFIGURATION_Handle
- *cfg);
+struct GNUNET_PEERINFO_Handle *
+GNUNET_PEERINFO_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
*
* @param h handle to disconnect
*/
-void GNUNET_PEERINFO_disconnect (struct GNUNET_PEERINFO_Handle *h);
+void
+GNUNET_PEERINFO_disconnect (struct GNUNET_PEERINFO_Handle *h);
/**
* @param h handle to the peerinfo service
* @param hello the verified (!) HELLO message
*/
-void GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h,
- const struct GNUNET_HELLO_Message *hello);
+void
+GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h,
+ const struct GNUNET_HELLO_Message *hello);
/**
* @return NULL on error (in this case, 'callback' is never called!),
* otherwise an iterator context
*/
-struct GNUNET_PEERINFO_IteratorContext *GNUNET_PEERINFO_iterate (struct
- GNUNET_PEERINFO_Handle
- *h,
- const struct
- GNUNET_PeerIdentity
- *peer,
- struct
- GNUNET_TIME_Relative
- timeout,
- GNUNET_PEERINFO_Processor
- callback,
- void
- *callback_cls);
+struct GNUNET_PEERINFO_IteratorContext *
+GNUNET_PEERINFO_iterate (struct GNUNET_PEERINFO_Handle *h,
+ const struct GNUNET_PeerIdentity *peer,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_PEERINFO_Processor callback,
+ void *callback_cls);
*
* @param ic context of the iterator to cancel
*/
-void GNUNET_PEERINFO_iterate_cancel (struct GNUNET_PEERINFO_IteratorContext
- *ic);
+void
+GNUNET_PEERINFO_iterate_cancel (struct GNUNET_PEERINFO_IteratorContext *ic);
* @param callback_cls closure for callback
* @return NULL on error
*/
-struct GNUNET_PEERINFO_NotifyContext *GNUNET_PEERINFO_notify (const struct
- GNUNET_CONFIGURATION_Handle
- *cfg,
- GNUNET_PEERINFO_Processor
- callback,
- void
- *callback_cls);
+struct GNUNET_PEERINFO_NotifyContext *
+GNUNET_PEERINFO_notify (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ GNUNET_PEERINFO_Processor callback, void *callback_cls);
/**
*
* @param nc context to stop notifying
*/
-void GNUNET_PEERINFO_notify_cancel (struct GNUNET_PEERINFO_NotifyContext *nc);
+void
+GNUNET_PEERINFO_notify_cancel (struct GNUNET_PEERINFO_NotifyContext *nc);
#if 0 /* keep Emacsens' auto-indent happy */
* @param library_name name of the plugin to test if it is installed
* @return GNUNET_YES if the plugin exists, GNUNET_NO if not
*/
-int GNUNET_PLUGIN_test (const char *library_name);
+int
+GNUNET_PLUGIN_test (const char *library_name);
/**
* Setup plugin (runs the "init" callback and returns whatever "init"
* @param arg argument to the plugin initialization function
* @return whatever the initialization function returned, NULL on error
*/
-void *GNUNET_PLUGIN_load (const char *library_name, void *arg);
+void *
+GNUNET_PLUGIN_load (const char *library_name, void *arg);
/**
* @return whatever the shutdown function returned, typically NULL
* or a "char *" representing the error message
*/
-void *GNUNET_PLUGIN_unload (const char *library_name, void *arg);
+void *
+GNUNET_PLUGIN_unload (const char *library_name, void *arg);
#if 0 /* keep Emacsens' auto-indent happy */
* @param task_cls closure for task
* @return GNUNET_SYSERR on error, GNUNET_OK on success
*/
-int GNUNET_PROGRAM_run (int argc, char *const *argv, const char *binaryName,
- const char *binaryHelp,
- const struct GNUNET_GETOPT_CommandLineOption *options,
- GNUNET_PROGRAM_Main task, void *task_cls);
+int
+GNUNET_PROGRAM_run (int argc, char *const *argv, const char *binaryName,
+ const char *binaryHelp,
+ const struct GNUNET_GETOPT_CommandLineOption *options,
+ GNUNET_PROGRAM_Main task, void *task_cls);
* @param delta by how much should the rating be changed?
* @return new rating of the namespace
*/
-int GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg,
- const GNUNET_HashCode * nsid, int delta);
+int
+GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ const GNUNET_HashCode * nsid, int delta);
/**
* Add a pseudonym to the set of known pseudonyms.
* @param id the pseudonym identifier
* @param meta metadata for the pseudonym
*/
-void GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg,
- const GNUNET_HashCode * id,
- const struct GNUNET_CONTAINER_MetaData *meta);
+void
+GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ const GNUNET_HashCode * id,
+ const struct GNUNET_CONTAINER_MetaData *meta);
/**
* @param closure closure for iterator
* @return number of pseudonyms found
*/
-int GNUNET_PSEUDONYM_list_all (const struct GNUNET_CONFIGURATION_Handle *cfg,
- GNUNET_PSEUDONYM_Iterator iterator,
- void *closure);
+int
+GNUNET_PSEUDONYM_list_all (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ GNUNET_PSEUDONYM_Iterator iterator, void *closure);
/**
* Register callback to be invoked whenever we discover
* a new pseudonym.
*/
-int GNUNET_PSEUDONYM_discovery_callback_register (const struct
- GNUNET_CONFIGURATION_Handle
- *cfg,
- GNUNET_PSEUDONYM_Iterator
- iterator, void *closure);
+int
+GNUNET_PSEUDONYM_discovery_callback_register (const struct
+ GNUNET_CONFIGURATION_Handle *cfg,
+ GNUNET_PSEUDONYM_Iterator
+ iterator, void *closure);
/**
* Unregister namespace discovery callback.
*/
-int GNUNET_PSEUDONYM_discovery_callback_unregister (GNUNET_PSEUDONYM_Iterator
- iterator, void *closure);
+int
+GNUNET_PSEUDONYM_discovery_callback_unregister (GNUNET_PSEUDONYM_Iterator
+ iterator, void *closure);
/**
* Return the unique, human readable name for the given pseudonym.
*
* @return NULL on failure (should never happen)
*/
-char *GNUNET_PSEUDONYM_id_to_name (const struct GNUNET_CONFIGURATION_Handle
- *cfg, const GNUNET_HashCode * pseudo);
+char *
+GNUNET_PSEUDONYM_id_to_name (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ const GNUNET_HashCode * pseudo);
/**
* Get the pseudonym ID belonging to the given human readable name.
*
* @return GNUNET_OK on success
*/
-int GNUNET_PSEUDONYM_name_to_id (const struct GNUNET_CONFIGURATION_Handle *cfg,
- const char *hname, GNUNET_HashCode * psid);
+int
+GNUNET_PSEUDONYM_name_to_id (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *hname, GNUNET_HashCode * psid);
#if 0 /* keep Emacsens' auto-indent happy */
*
* @param cfg configuration to use
*/
-void GNUNET_RESOLVER_connect (const struct GNUNET_CONFIGURATION_Handle *c);
+void
+GNUNET_RESOLVER_connect (const struct GNUNET_CONFIGURATION_Handle *c);
/**
* Destroy the connection to the resolver service.
*/
-void GNUNET_RESOLVER_disconnect (void);
+void
+GNUNET_RESOLVER_disconnect (void);
/**
* @param timeout how long to try resolving
* @return handle that can be used to cancel the request, NULL on error
*/
-struct GNUNET_RESOLVER_RequestHandle *GNUNET_RESOLVER_ip_get (const char
- *hostname,
- int domain,
- struct
- GNUNET_TIME_Relative
- timeout,
- GNUNET_RESOLVER_AddressCallback
- callback,
- void
- *callback_cls);
+struct GNUNET_RESOLVER_RequestHandle *
+GNUNET_RESOLVER_ip_get (const char *hostname, int domain,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_RESOLVER_AddressCallback callback,
+ void *callback_cls);
/**
* @param timeout how long to try resolving
* @return handle that can be used to cancel the request, NULL on error
*/
-struct GNUNET_RESOLVER_RequestHandle *GNUNET_RESOLVER_hostname_resolve (int
- domain,
- struct
- GNUNET_TIME_Relative
- timeout,
- GNUNET_RESOLVER_AddressCallback
- callback,
- void
- *cls);
+struct GNUNET_RESOLVER_RequestHandle *
+GNUNET_RESOLVER_hostname_resolve (int domain,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_RESOLVER_AddressCallback callback,
+ void *cls);
/**
*
* @return local hostname, caller must free
*/
-char *GNUNET_RESOLVER_local_fqdn_get (void);
+char *
+GNUNET_RESOLVER_local_fqdn_get (void);
/**
* @param cls closure for callback
* @return handle that can be used to cancel the request, NULL on error
*/
-struct GNUNET_RESOLVER_RequestHandle *GNUNET_RESOLVER_hostname_get (const struct
- sockaddr
- *sa,
- socklen_t
- salen,
- int
- do_resolve,
- struct
- GNUNET_TIME_Relative
- timeout,
- GNUNET_RESOLVER_HostnameCallback
- callback,
- void *cls);
+struct GNUNET_RESOLVER_RequestHandle *
+GNUNET_RESOLVER_hostname_get (const struct sockaddr *sa, socklen_t salen,
+ int do_resolve,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_RESOLVER_HostnameCallback callback,
+ void *cls);
/**
*
* @param rh handle of request to cancel
*/
-void GNUNET_RESOLVER_request_cancel (struct GNUNET_RESOLVER_RequestHandle *rh);
+void
+GNUNET_RESOLVER_request_cancel (struct GNUNET_RESOLVER_RequestHandle *rh);
#if 0 /* keep Emacsens' auto-indent happy */
* @param task task to run first (and immediately)
* @param task_cls closure of task
*/
-void GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_Task task, void *task_cls);
+void
+GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_Task task, void *task_cls);
/**
* priorities and prerequisite tasks). Note that tasks
* scheduled AFTER this call may still be delayed arbitrarily.
*/
-void GNUNET_SCHEDULER_shutdown ();
+void
+GNUNET_SCHEDULER_shutdown ();
/**
* all priority levels
* @return number of tasks pending right now
*/
-unsigned int GNUNET_SCHEDULER_get_load (enum GNUNET_SCHEDULER_Priority p);
+unsigned int
+GNUNET_SCHEDULER_get_load (enum GNUNET_SCHEDULER_Priority p);
/**
*
* * @return reason(s) why the current task is run
*/
-enum GNUNET_SCHEDULER_Reason GNUNET_SCHEDULER_get_reason ();
+enum GNUNET_SCHEDULER_Reason
+GNUNET_SCHEDULER_get_reason ();
/**
* * @param task id of the task to cancel
* @return the closure of the callback of the cancelled task
*/
-void *GNUNET_SCHEDULER_cancel (GNUNET_SCHEDULER_TaskIdentifier task);
+void *
+GNUNET_SCHEDULER_cancel (GNUNET_SCHEDULER_TaskIdentifier task);
/**
* @param task_cls closure of task
* @param reason reason for task invocation
*/
-void GNUNET_SCHEDULER_add_continuation (GNUNET_SCHEDULER_Task task,
- void *task_cls,
- enum GNUNET_SCHEDULER_Reason reason);
+void
+GNUNET_SCHEDULER_add_continuation (GNUNET_SCHEDULER_Task task, void *task_cls,
+ enum GNUNET_SCHEDULER_Reason reason);
/**
* @return unique task identifier for the job
* only valid until "task" is started!
*/
-GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_with_priority (enum
- GNUNET_SCHEDULER_Priority
- prio,
- GNUNET_SCHEDULER_Task
- task,
- void
- *task_cls);
+GNUNET_SCHEDULER_TaskIdentifier
+GNUNET_SCHEDULER_add_with_priority (enum GNUNET_SCHEDULER_Priority prio,
+ GNUNET_SCHEDULER_Task task, void *task_cls);
/**
* @return unique task identifier for the job
* only valid until "task" is started!
*/
-GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_Task
- task, void *task_cls);
+GNUNET_SCHEDULER_TaskIdentifier
+GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_Task task, void *task_cls);
/**
* @return unique task identifier for the job
* only valid until "task" is started!
*/
-GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_now_with_lifeness (int
- lifeness,
- GNUNET_SCHEDULER_Task
- task,
- void
- *task_cls);
+GNUNET_SCHEDULER_TaskIdentifier
+GNUNET_SCHEDULER_add_now_with_lifeness (int lifeness,
+ GNUNET_SCHEDULER_Task task,
+ void *task_cls);
/**
* @return unique task identifier for the job
* only valid until "task" is started!
*/
-GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_delayed (struct
- GNUNET_TIME_Relative
- delay,
- GNUNET_SCHEDULER_Task
- task,
- void *task_cls);
+GNUNET_SCHEDULER_TaskIdentifier
+GNUNET_SCHEDULER_add_delayed (struct GNUNET_TIME_Relative delay,
+ GNUNET_SCHEDULER_Task task, void *task_cls);
/**
* @return unique task identifier for the job
* only valid until "task" is started!
*/
-GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_read_net (struct
- GNUNET_TIME_Relative
- delay,
- struct
- GNUNET_NETWORK_Handle
- *rfd,
- GNUNET_SCHEDULER_Task
- task,
- void *task_cls);
+GNUNET_SCHEDULER_TaskIdentifier
+GNUNET_SCHEDULER_add_read_net (struct GNUNET_TIME_Relative delay,
+ struct GNUNET_NETWORK_Handle *rfd,
+ GNUNET_SCHEDULER_Task task, void *task_cls);
/**
* @return unique task identifier for the job
* only valid until "task" is started!
*/
-GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_write_net (struct
- GNUNET_TIME_Relative
- delay,
- struct
- GNUNET_NETWORK_Handle
- *wfd,
- GNUNET_SCHEDULER_Task
- task,
- void *task_cls);
+GNUNET_SCHEDULER_TaskIdentifier
+GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay,
+ struct GNUNET_NETWORK_Handle *wfd,
+ GNUNET_SCHEDULER_Task task, void *task_cls);
/**
* @return unique task identifier for the job
* only valid until "task" is started!
*/
-GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_read_file (struct
- GNUNET_TIME_Relative
- delay,
- const struct
- GNUNET_DISK_FileHandle
- *rfd,
- GNUNET_SCHEDULER_Task
- task,
- void *task_cls);
+GNUNET_SCHEDULER_TaskIdentifier
+GNUNET_SCHEDULER_add_read_file (struct GNUNET_TIME_Relative delay,
+ const struct GNUNET_DISK_FileHandle *rfd,
+ GNUNET_SCHEDULER_Task task, void *task_cls);
/**
* @return unique task identifier for the job
* only valid until "task" is started!
*/
-GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_write_file (struct
- GNUNET_TIME_Relative
- delay,
- const struct
- GNUNET_DISK_FileHandle
- *wfd,
- GNUNET_SCHEDULER_Task
- task,
- void
- *task_cls);
+GNUNET_SCHEDULER_TaskIdentifier
+GNUNET_SCHEDULER_add_write_file (struct GNUNET_TIME_Relative delay,
+ const struct GNUNET_DISK_FileHandle *wfd,
+ GNUNET_SCHEDULER_Task task, void *task_cls);
/**
* @return unique task identifier for the job
* only valid until "task" is started!
*/
-GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_select (enum
- GNUNET_SCHEDULER_Priority
- prio,
- GNUNET_SCHEDULER_TaskIdentifier
- prerequisite_task,
- struct
- GNUNET_TIME_Relative
- delay,
- const struct
- GNUNET_NETWORK_FDSet
- *rs,
- const struct
- GNUNET_NETWORK_FDSet
- *ws,
- GNUNET_SCHEDULER_Task
- task,
- void *task_cls);
+GNUNET_SCHEDULER_TaskIdentifier
+GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio,
+ GNUNET_SCHEDULER_TaskIdentifier prerequisite_task,
+ struct GNUNET_TIME_Relative delay,
+ const struct GNUNET_NETWORK_FDSet *rs,
+ const struct GNUNET_NETWORK_FDSet *ws,
+ GNUNET_SCHEDULER_Task task, void *task_cls);
/**
* Sets the select function to use in the scheduler (scheduler_select).
* @param new_select new select function to use (NULL to reset to default)
* @param new_select_cls closure for 'new_select'
*/
-void GNUNET_SCHEDULER_set_select (GNUNET_SCHEDULER_select new_select,
- void *new_select_cls);
+void
+GNUNET_SCHEDULER_set_select (GNUNET_SCHEDULER_select new_select,
+ void *new_select_cls);
#if 0 /* keep Emacsens' auto-indent happy */
* @return handle for the new server, NULL on error
* (typically, "port" already in use)
*/
-struct GNUNET_SERVER_Handle
- *GNUNET_SERVER_create_with_sockets (GNUNET_CONNECTION_AccessCheck access,
- void *access_cls,
- struct GNUNET_NETWORK_Handle **lsocks,
- struct GNUNET_TIME_Relative
- idle_timeout, int require_found);
+struct GNUNET_SERVER_Handle *
+GNUNET_SERVER_create_with_sockets (GNUNET_CONNECTION_AccessCheck access,
+ void *access_cls,
+ struct GNUNET_NETWORK_Handle **lsocks,
+ struct GNUNET_TIME_Relative idle_timeout,
+ int require_found);
/**
* Create a new server.
* @return handle for the new server, NULL on error
* (typically, "port" already in use)
*/
-struct GNUNET_SERVER_Handle *GNUNET_SERVER_create (GNUNET_CONNECTION_AccessCheck
- access, void *access_cls,
- struct sockaddr *const
- *serverAddr,
- const socklen_t * socklen,
- struct GNUNET_TIME_Relative
- idle_timeout,
- int require_found);
+struct GNUNET_SERVER_Handle *
+GNUNET_SERVER_create (GNUNET_CONNECTION_AccessCheck access, void *access_cls,
+ struct sockaddr *const *serverAddr,
+ const socklen_t * socklen,
+ struct GNUNET_TIME_Relative idle_timeout,
+ int require_found);
/**
*
* @param s server to destroy
*/
-void GNUNET_SERVER_destroy (struct GNUNET_SERVER_Handle *s);
+void
+GNUNET_SERVER_destroy (struct GNUNET_SERVER_Handle *s);
/**
* the handlers array must exist until removed
* (or server is destroyed).
*/
-void GNUNET_SERVER_add_handlers (struct GNUNET_SERVER_Handle *server,
- const struct GNUNET_SERVER_MessageHandler
- *handlers);
+void
+GNUNET_SERVER_add_handlers (struct GNUNET_SERVER_Handle *server,
+ const struct GNUNET_SERVER_MessageHandler
+ *handlers);
/**
* GNUNET_CONNECTION_notify_transmit_ready_cancel.
* NULL if we are already going to notify someone else (busy)
*/
-struct GNUNET_CONNECTION_TransmitHandle
- *GNUNET_SERVER_notify_transmit_ready (struct GNUNET_SERVER_Client *client,
- size_t size,
- struct GNUNET_TIME_Relative timeout,
- GNUNET_CONNECTION_TransmitReadyNotify
- callback, void *callback_cls);
+struct GNUNET_CONNECTION_TransmitHandle *
+GNUNET_SERVER_notify_transmit_ready (struct GNUNET_SERVER_Client *client,
+ size_t size,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_CONNECTION_TransmitReadyNotify
+ callback, void *callback_cls);
/**
*
* @param client the client to set the persistent flag on
*/
-void GNUNET_SERVER_client_persist_ (struct GNUNET_SERVER_Client *client);
+void
+GNUNET_SERVER_client_persist_ (struct GNUNET_SERVER_Client *client);
/**
* Resume receiving from this client, we are done processing the
* GNUNET_SYSERR to close the connection (signal
* serious error)
*/
-void GNUNET_SERVER_receive_done (struct GNUNET_SERVER_Client *client,
- int success);
+void
+GNUNET_SERVER_receive_done (struct GNUNET_SERVER_Client *client, int success);
/**
* @param client the client to update
* @param timeout new timeout for activities on the socket
*/
-void GNUNET_SERVER_client_set_timeout (struct GNUNET_SERVER_Client *client,
- struct GNUNET_TIME_Relative timeout);
+void
+GNUNET_SERVER_client_set_timeout (struct GNUNET_SERVER_Client *client,
+ struct GNUNET_TIME_Relative timeout);
/**
*
* @param client client for which to disable the warning
*/
-void GNUNET_SERVER_disable_receive_done_warning (struct GNUNET_SERVER_Client
- *client);
+void
+GNUNET_SERVER_disable_receive_done_warning (struct GNUNET_SERVER_Client
+ *client);
/**
* GNUNET_SYSERR if the connection to the
* client should be shut down
*/
-int GNUNET_SERVER_inject (struct GNUNET_SERVER_Handle *server,
- struct GNUNET_SERVER_Client *sender,
- const struct GNUNET_MessageHeader *message);
+int
+GNUNET_SERVER_inject (struct GNUNET_SERVER_Handle *server,
+ struct GNUNET_SERVER_Client *sender,
+ const struct GNUNET_MessageHeader *message);
/**
* @return the client handle (client should call
* "client_drop" on the return value eventually)
*/
-struct GNUNET_SERVER_Client *GNUNET_SERVER_connect_socket (struct
- GNUNET_SERVER_Handle
- *server,
- struct
- GNUNET_CONNECTION_Handle
- *connection);
+struct GNUNET_SERVER_Client *
+GNUNET_SERVER_connect_socket (struct GNUNET_SERVER_Handle *server,
+ struct GNUNET_CONNECTION_Handle *connection);
/**
*
* @param client the client to keep
*/
-void GNUNET_SERVER_client_keep (struct GNUNET_SERVER_Client *client);
+void
+GNUNET_SERVER_client_keep (struct GNUNET_SERVER_Client *client);
/**
*
* @param client the client to drop
*/
-void GNUNET_SERVER_client_drop (struct GNUNET_SERVER_Client *client);
+void
+GNUNET_SERVER_client_drop (struct GNUNET_SERVER_Client *client);
/**
* @param addrlen where to store the length of the address
* @return GNUNET_OK on success
*/
-int GNUNET_SERVER_client_get_address (struct GNUNET_SERVER_Client *client,
- void **addr, size_t * addrlen);
+int
+GNUNET_SERVER_client_get_address (struct GNUNET_SERVER_Client *client,
+ void **addr, size_t * addrlen);
/**
* @param callback function to call on disconnect
* @param callback_cls closure for callback
*/
-void GNUNET_SERVER_disconnect_notify (struct GNUNET_SERVER_Handle *server,
- GNUNET_SERVER_DisconnectCallback callback,
- void *callback_cls);
+void
+GNUNET_SERVER_disconnect_notify (struct GNUNET_SERVER_Handle *server,
+ GNUNET_SERVER_DisconnectCallback callback,
+ void *callback_cls);
/**
* @param callback function to call on disconnect
* @param callback_cls closure for callback
*/
-void GNUNET_SERVER_disconnect_notify_cancel (struct GNUNET_SERVER_Handle
- *server,
- GNUNET_SERVER_DisconnectCallback
- callback, void *callback_cls);
+void
+GNUNET_SERVER_disconnect_notify_cancel (struct GNUNET_SERVER_Handle *server,
+ GNUNET_SERVER_DisconnectCallback
+ callback, void *callback_cls);
/**
*
* @param client the client to disconnect from
*/
-void GNUNET_SERVER_client_disconnect (struct GNUNET_SERVER_Client *client);
+void
+GNUNET_SERVER_client_disconnect (struct GNUNET_SERVER_Client *client);
/**
* @param h server handle
* @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default
*/
-void GNUNET_SERVER_ignore_shutdown (struct GNUNET_SERVER_Handle *h,
- int do_ignore);
+void
+GNUNET_SERVER_ignore_shutdown (struct GNUNET_SERVER_Handle *h, int do_ignore);
* @param client handle to the client
* @return GNUNET_OK on success
*/
-int GNUNET_SERVER_client_disable_corking (struct GNUNET_SERVER_Client *client);
+int
+GNUNET_SERVER_client_disable_corking (struct GNUNET_SERVER_Client *client);
/**
* @param client client to create the context for.
* @return NULL on error
*/
-struct GNUNET_SERVER_TransmitContext
- *GNUNET_SERVER_transmit_context_create (struct GNUNET_SERVER_Client
- *client);
+struct GNUNET_SERVER_TransmitContext *
+GNUNET_SERVER_transmit_context_create (struct GNUNET_SERVER_Client *client);
/**
* @param length length of data
* @param type type of the message
*/
-void GNUNET_SERVER_transmit_context_append_data (struct
- GNUNET_SERVER_TransmitContext
- *tc, const void *data,
- size_t length, uint16_t type);
+void
+GNUNET_SERVER_transmit_context_append_data (struct GNUNET_SERVER_TransmitContext
+ *tc, const void *data,
+ size_t length, uint16_t type);
/**
* @param tc context to use
* @param msg message to append
*/
-void GNUNET_SERVER_transmit_context_append_message (struct
- GNUNET_SERVER_TransmitContext
- *tc,
- const struct
- GNUNET_MessageHeader *msg);
+void
+GNUNET_SERVER_transmit_context_append_message (struct
+ GNUNET_SERVER_TransmitContext
+ *tc,
+ const struct GNUNET_MessageHeader
+ *msg);
/**
* @param tc transmission context to use
* @param timeout when to time out and abort the transmission
*/
-void GNUNET_SERVER_transmit_context_run (struct GNUNET_SERVER_TransmitContext
- *tc,
- struct GNUNET_TIME_Relative timeout);
+void
+GNUNET_SERVER_transmit_context_run (struct GNUNET_SERVER_TransmitContext *tc,
+ struct GNUNET_TIME_Relative timeout);
* if the queue gets longer than this number of messages
* @return handle to the notification context
*/
-struct GNUNET_SERVER_NotificationContext
- *GNUNET_SERVER_notification_context_create (struct GNUNET_SERVER_Handle
- *server,
- unsigned int queue_length);
+struct GNUNET_SERVER_NotificationContext *
+GNUNET_SERVER_notification_context_create (struct GNUNET_SERVER_Handle *server,
+ unsigned int queue_length);
/**
*
* @param nc context to destroy.
*/
-void GNUNET_SERVER_notification_context_destroy (struct
- GNUNET_SERVER_NotificationContext
- *nc);
+void
+GNUNET_SERVER_notification_context_destroy (struct
+ GNUNET_SERVER_NotificationContext
+ *nc);
/**
* @param nc context to modify
* @param client client to add
*/
-void GNUNET_SERVER_notification_context_add (struct
- GNUNET_SERVER_NotificationContext
- *nc,
- struct GNUNET_SERVER_Client
- *client);
+void
+GNUNET_SERVER_notification_context_add (struct GNUNET_SERVER_NotificationContext
+ *nc,
+ struct GNUNET_SERVER_Client *client);
/**
* @param msg message to send
* @param can_drop can this message be dropped due to queue length limitations
*/
-void GNUNET_SERVER_notification_context_unicast (struct
- GNUNET_SERVER_NotificationContext
- *nc,
- struct GNUNET_SERVER_Client
- *client,
- const struct
- GNUNET_MessageHeader *msg,
- int can_drop);
+void
+GNUNET_SERVER_notification_context_unicast (struct
+ GNUNET_SERVER_NotificationContext
+ *nc,
+ struct GNUNET_SERVER_Client *client,
+ const struct GNUNET_MessageHeader
+ *msg, int can_drop);
/**
* @param msg message to send
* @param can_drop can this message be dropped due to queue length limitations
*/
-void GNUNET_SERVER_notification_context_broadcast (struct
- GNUNET_SERVER_NotificationContext
- *nc,
- const struct
- GNUNET_MessageHeader *msg,
- int can_drop);
+void
+GNUNET_SERVER_notification_context_broadcast (struct
+ GNUNET_SERVER_NotificationContext
+ *nc,
+ const struct GNUNET_MessageHeader
+ *msg, int can_drop);
* @param cb_cls closure for cb
* @return handle to tokenizer
*/
-struct GNUNET_SERVER_MessageStreamTokenizer
- *GNUNET_SERVER_mst_create (GNUNET_SERVER_MessageTokenizerCallback cb,
- void *cb_cls);
+struct GNUNET_SERVER_MessageStreamTokenizer *
+GNUNET_SERVER_mst_create (GNUNET_SERVER_MessageTokenizerCallback cb,
+ void *cb_cls);
/**
* GNUNET_NO if one_shot was set and we have another message ready
* GNUNET_SYSERR if the data stream is corrupt
*/
-int GNUNET_SERVER_mst_receive (struct GNUNET_SERVER_MessageStreamTokenizer *mst,
- void *client_identity, const char *buf,
- size_t size, int purge, int one_shot);
+int
+GNUNET_SERVER_mst_receive (struct GNUNET_SERVER_MessageStreamTokenizer *mst,
+ void *client_identity, const char *buf, size_t size,
+ int purge, int one_shot);
/**
*
* @param mst tokenizer to destroy
*/
-void GNUNET_SERVER_mst_destroy (struct GNUNET_SERVER_MessageStreamTokenizer
- *mst);
+void
+GNUNET_SERVER_mst_destroy (struct GNUNET_SERVER_MessageStreamTokenizer *mst);
#if 0 /* keep Emacsens' auto-indent happy */
* zero (in this case, '*addrs' and '*addr_lens' will be
* set to NULL).
*/
-int GNUNET_SERVICE_get_server_addresses (const char *serviceName,
- const struct
- GNUNET_CONFIGURATION_Handle *cfg,
- struct sockaddr ***addrs,
- socklen_t ** addr_lens);
+int
+GNUNET_SERVICE_get_server_addresses (const char *serviceName,
+ const struct GNUNET_CONFIGURATION_Handle
+ *cfg, struct sockaddr ***addrs,
+ socklen_t ** addr_lens);
/**
* @return GNUNET_SYSERR on error, GNUNET_OK
* if we shutdown nicely
*/
-int GNUNET_SERVICE_run (int argc, char *const *argv, const char *serviceName,
- enum GNUNET_SERVICE_Options opt,
- GNUNET_SERVICE_Main task, void *task_cls);
+int
+GNUNET_SERVICE_run (int argc, char *const *argv, const char *serviceName,
+ enum GNUNET_SERVICE_Options opt, GNUNET_SERVICE_Main task,
+ void *task_cls);
struct GNUNET_SERVICE_Context;
* @param cfg configuration to use
* @return NULL on error, service handle
*/
-struct GNUNET_SERVICE_Context *GNUNET_SERVICE_start (const char *serviceName,
- const struct
- GNUNET_CONFIGURATION_Handle
- *cfg);
+struct GNUNET_SERVICE_Context *
+GNUNET_SERVICE_start (const char *serviceName,
+ const struct GNUNET_CONFIGURATION_Handle *cfg);
/**
* @param ctx the service context returned from the start function
* @return handle to the server for this service, NULL if there is none
*/
-struct GNUNET_SERVER_Handle *GNUNET_SERVICE_get_server (struct
- GNUNET_SERVICE_Context
- *ctx);
+struct GNUNET_SERVER_Handle *
+GNUNET_SERVICE_get_server (struct GNUNET_SERVICE_Context *ctx);
/**
*
* @param sctx the service context returned from the start function
*/
-void GNUNET_SERVICE_stop (struct GNUNET_SERVICE_Context *sctx);
+void
+GNUNET_SERVICE_stop (struct GNUNET_SERVICE_Context *sctx);
#if 0 /* keep Emacsens' auto-indent happy */
* @param handler the function to call
* @return context that can be used to restore, NULL on error
*/
-struct GNUNET_SIGNAL_Context *GNUNET_SIGNAL_handler_install (int signal,
- GNUNET_SIGNAL_Handler
- handler);
+struct GNUNET_SIGNAL_Context *
+GNUNET_SIGNAL_handler_install (int signal, GNUNET_SIGNAL_Handler handler);
/**
* Uninstall a previously installed signal hander.
* @param ctx context that was returned when the
* signal handler was installed
*/
-void GNUNET_SIGNAL_handler_uninstall (struct GNUNET_SIGNAL_Context *ctx);
+void
+GNUNET_SIGNAL_handler_uninstall (struct GNUNET_SIGNAL_Context *ctx);
#if 0 /* keep Emacsens' auto-indent happy */
* @param cfg services configuration in use
* @return handle to use
*/
-struct GNUNET_STATISTICS_Handle *GNUNET_STATISTICS_create (const char
- *subsystem,
- const struct
- GNUNET_CONFIGURATION_Handle
- *cfg);
+struct GNUNET_STATISTICS_Handle *
+GNUNET_STATISTICS_create (const char *subsystem,
+ const struct GNUNET_CONFIGURATION_Handle *cfg);
/**
* @param sync_first set to GNUNET_YES if pending SET requests should
* be completed
*/
-void GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h,
- int sync_first);
+void
+GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h, int sync_first);
/**
* @param proc_cls closure for proc
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
-int GNUNET_STATISTICS_watch (struct GNUNET_STATISTICS_Handle *handle,
- const char *subsystem, const char *name,
- GNUNET_STATISTICS_Iterator proc, void *proc_cls);
+int
+GNUNET_STATISTICS_watch (struct GNUNET_STATISTICS_Handle *handle,
+ const char *subsystem, const char *name,
+ GNUNET_STATISTICS_Iterator proc, void *proc_cls);
/**
* @param cls closure for proc and cont
* @return NULL on error
*/
-struct GNUNET_STATISTICS_GetHandle *GNUNET_STATISTICS_get (struct
- GNUNET_STATISTICS_Handle
- *handle,
- const char
- *subsystem,
- const char *name,
- struct
- GNUNET_TIME_Relative
- timeout,
- GNUNET_STATISTICS_Callback
- cont,
- GNUNET_STATISTICS_Iterator
- proc, void *cls);
+struct GNUNET_STATISTICS_GetHandle *
+GNUNET_STATISTICS_get (struct GNUNET_STATISTICS_Handle *handle,
+ const char *subsystem, const char *name,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_STATISTICS_Callback cont,
+ GNUNET_STATISTICS_Iterator proc, void *cls);
/**
*
* @param gh handle of the request to cancel
*/
-void GNUNET_STATISTICS_get_cancel (struct GNUNET_STATISTICS_GetHandle *gh);
+void
+GNUNET_STATISTICS_get_cancel (struct GNUNET_STATISTICS_GetHandle *gh);
/**
* @param value new value to set
* @param make_persistent should the value be kept across restarts?
*/
-void GNUNET_STATISTICS_set (struct GNUNET_STATISTICS_Handle *handle,
- const char *name, uint64_t value,
- int make_persistent);
+void
+GNUNET_STATISTICS_set (struct GNUNET_STATISTICS_Handle *handle,
+ const char *name, uint64_t value, int make_persistent);
/**
* Set statistic value for the peer. Will always use our
* @param delta change in value (added to existing value)
* @param make_persistent should the value be kept across restarts?
*/
-void GNUNET_STATISTICS_update (struct GNUNET_STATISTICS_Handle *handle,
- const char *name, int64_t delta,
- int make_persistent);
+void
+GNUNET_STATISTICS_update (struct GNUNET_STATISTICS_Handle *handle,
+ const char *name, int64_t delta, int make_persistent);
* @param size number of bytes
* @return fancy representation of the size (possibly rounded) for humans
*/
-char *GNUNET_STRINGS_byte_size_fancy (unsigned long long size);
+char *
+GNUNET_STRINGS_byte_size_fancy (unsigned long long size);
/**
* @param charset character set to convert from
* @return the converted string (0-terminated)
*/
-char *GNUNET_STRINGS_to_utf8 (const char *input, size_t len,
- const char *charset);
+char *
+GNUNET_STRINGS_to_utf8 (const char *input, size_t len, const char *charset);
/**
* @return the full file name,
* NULL is returned on error
*/
-char *GNUNET_STRINGS_filename_expand (const char *fil);
+char *
+GNUNET_STRINGS_filename_expand (const char *fil);
/**
* Fill a buffer of the given size with
* @return number of bytes written to the buffer
* (or number of bytes that would have been written)
*/
-size_t GNUNET_STRINGS_buffer_fill (char *buffer, size_t size,
- unsigned int count, ...);
+size_t
+GNUNET_STRINGS_buffer_fill (char *buffer, size_t size, unsigned int count, ...);
/**
* @return offset of the character after the last 0-termination
* in the buffer, or 0 on error.
*/
-unsigned int GNUNET_STRINGS_buffer_tokenize (const char *buffer, size_t size,
- unsigned int count, ...);
+unsigned int
+GNUNET_STRINGS_buffer_tokenize (const char *buffer, size_t size,
+ unsigned int count, ...);
* @param t the absolute time to convert
* @return timestamp in human-readable form
*/
-char *GNUNET_STRINGS_absolute_time_to_string (struct GNUNET_TIME_Absolute t);
+char *
+GNUNET_STRINGS_absolute_time_to_string (struct GNUNET_TIME_Absolute t);
/**
* @param delta time in milli seconds
* @return string in human-readable form
*/
-char *GNUNET_STRINGS_relative_time_to_string (struct GNUNET_TIME_Relative
- delta);
+char *
+GNUNET_STRINGS_relative_time_to_string (struct GNUNET_TIME_Relative delta);
#if 0 /* keep Emacsens' auto-indent happy */
{
* @param cb_cls closure for cb
* @return handle to the daemon (actual start will be completed asynchronously)
*/
-struct GNUNET_TESTING_Daemon *GNUNET_TESTING_daemon_start (const struct
- GNUNET_CONFIGURATION_Handle
- *cfg,
- struct
- GNUNET_TIME_Relative
- timeout, int pretend,
- const char *hostname,
- const char
- *ssh_username,
- uint16_t sshport,
- const char *hostkey,
- GNUNET_TESTING_NotifyHostkeyCreated
- hostkey_callback,
- void *hostkey_cls,
- GNUNET_TESTING_NotifyDaemonRunning
- cb, void *cb_cls);
+struct GNUNET_TESTING_Daemon *
+GNUNET_TESTING_daemon_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ struct GNUNET_TIME_Relative timeout, int pretend,
+ const char *hostname, const char *ssh_username,
+ uint16_t sshport, const char *hostkey,
+ GNUNET_TESTING_NotifyHostkeyCreated
+ hostkey_callback, void *hostkey_cls,
+ GNUNET_TESTING_NotifyDaemonRunning cb,
+ void *cb_cls);
/**
* Continues GNUnet daemon startup when user wanted to be notified
*
* @param daemon the daemon to finish starting
*/
-void GNUNET_TESTING_daemon_continue_startup (struct GNUNET_TESTING_Daemon
- *daemon);
+void
+GNUNET_TESTING_daemon_continue_startup (struct GNUNET_TESTING_Daemon *daemon);
/**
* Check whether the given daemon is running.
* @return GNUNET_YES if the daemon is up, GNUNET_NO if the
* daemon is down, GNUNET_SYSERR on error.
*/
-int GNUNET_TESTING_daemon_running (struct GNUNET_TESTING_Daemon *daemon);
+int
+GNUNET_TESTING_daemon_running (struct GNUNET_TESTING_Daemon *daemon);
/**
* Restart (stop and start) a GNUnet daemon.
* @param cb function called once the daemon is (re)started
* @param cb_cls closure for cb
*/
-void GNUNET_TESTING_daemon_restart (struct GNUNET_TESTING_Daemon *d,
- GNUNET_TESTING_NotifyDaemonRunning cb,
- void *cb_cls);
+void
+GNUNET_TESTING_daemon_restart (struct GNUNET_TESTING_Daemon *d,
+ GNUNET_TESTING_NotifyDaemonRunning cb,
+ void *cb_cls);
/**
* Start a peer that has previously been stopped using the daemon_stop
* @param cb the callback for notification when the peer is running
* @param cb_cls closure for the callback
*/
-void GNUNET_TESTING_daemon_start_stopped (struct GNUNET_TESTING_Daemon *daemon,
- struct GNUNET_TIME_Relative timeout,
- GNUNET_TESTING_NotifyDaemonRunning cb,
- void *cb_cls);
+void
+GNUNET_TESTING_daemon_start_stopped (struct GNUNET_TESTING_Daemon *daemon,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_TESTING_NotifyDaemonRunning cb,
+ void *cb_cls);
/**
* Starts a GNUnet daemon's service.
* @param cb function called once gnunet-arm returns
* @param cb_cls closure for cb
*/
-void GNUNET_TESTING_daemon_start_service (struct GNUNET_TESTING_Daemon *d,
- char *service,
- struct GNUNET_TIME_Relative timeout,
- GNUNET_TESTING_NotifyDaemonRunning cb,
- void *cb_cls);
+void
+GNUNET_TESTING_daemon_start_service (struct GNUNET_TESTING_Daemon *d,
+ char *service,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_TESTING_NotifyDaemonRunning cb,
+ void *cb_cls);
/**
* Starts a GNUnet daemon's service which has been previously turned off.
* @param cb function called once gnunet-arm returns
* @param cb_cls closure for cb
*/
-void GNUNET_TESTING_daemon_start_stopped_service (struct GNUNET_TESTING_Daemon
- *d, char *service,
- struct GNUNET_TIME_Relative
- timeout,
- GNUNET_TESTING_NotifyDaemonRunning
- cb, void *cb_cls);
+void
+GNUNET_TESTING_daemon_start_stopped_service (struct GNUNET_TESTING_Daemon *d,
+ char *service,
+ struct GNUNET_TIME_Relative
+ timeout,
+ GNUNET_TESTING_NotifyDaemonRunning
+ cb, void *cb_cls);
/**
* Get a certain testing daemon handle.
* @param pg handle to the set of running peers
* @param position the number of the peer to return
*/
-struct GNUNET_TESTING_Daemon *GNUNET_TESTING_daemon_get (struct
- GNUNET_TESTING_PeerGroup
- *pg,
- unsigned int position);
+struct GNUNET_TESTING_Daemon *
+GNUNET_TESTING_daemon_get (struct GNUNET_TESTING_PeerGroup *pg,
+ unsigned int position);
/*
* Get a daemon by peer identity, so callers can
*
* @return the daemon on success, or NULL if no such peer identity is found
*/
-struct GNUNET_TESTING_Daemon *GNUNET_TESTING_daemon_get_by_id (struct
- GNUNET_TESTING_PeerGroup
- *pg,
- struct
- GNUNET_PeerIdentity
- *peer_id);
+struct GNUNET_TESTING_Daemon *
+GNUNET_TESTING_daemon_get_by_id (struct GNUNET_TESTING_PeerGroup *pg,
+ struct GNUNET_PeerIdentity *peer_id);
/**
* Stops a GNUnet daemon.
* @param allow_restart GNUNET_YES to restart peer later (using this API)
* GNUNET_NO to kill off and clean up for good
*/
-void GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d,
- struct GNUNET_TIME_Relative timeout,
- GNUNET_TESTING_NotifyCompletion cb,
- void *cb_cls, int delete_files,
- int allow_restart);
+void
+GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_TESTING_NotifyCompletion cb, void *cb_cls,
+ int delete_files, int allow_restart);
/**
* @param cb function called once the configuration was changed
* @param cb_cls closure for cb
*/
-void GNUNET_TESTING_daemon_reconfigure (struct GNUNET_TESTING_Daemon *d,
- struct GNUNET_CONFIGURATION_Handle *cfg,
- GNUNET_TESTING_NotifyCompletion cb,
- void *cb_cls);
+void
+GNUNET_TESTING_daemon_reconfigure (struct GNUNET_TESTING_Daemon *d,
+ struct GNUNET_CONFIGURATION_Handle *cfg,
+ GNUNET_TESTING_NotifyCompletion cb,
+ void *cb_cls);
/**
* Stops a single service of a GNUnet daemon. Used like daemon_stop,
* @param cb function called once the service was stopped
* @param cb_cls closure for cb
*/
-void GNUNET_TESTING_daemon_stop_service (struct GNUNET_TESTING_Daemon *d,
- char *service,
- struct GNUNET_TIME_Relative timeout,
- GNUNET_TESTING_NotifyCompletion cb,
- void *cb_cls);
+void
+GNUNET_TESTING_daemon_stop_service (struct GNUNET_TESTING_Daemon *d,
+ char *service,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_TESTING_NotifyCompletion cb,
+ void *cb_cls);
/**
* Read a testing hosts file based on a configuration.
*
* @return DLL of hosts on success, NULL on failure
*/
-struct GNUNET_TESTING_Host *GNUNET_TESTING_hosts_load (const struct
- GNUNET_CONFIGURATION_Handle
- *cfg);
+struct GNUNET_TESTING_Host *
+GNUNET_TESTING_hosts_load (const struct GNUNET_CONFIGURATION_Handle *cfg);
/**
*
* @return NULL on error, otherwise handle to control peer group
*/
-struct GNUNET_TESTING_PeerGroup *GNUNET_TESTING_daemons_start (const struct
- GNUNET_CONFIGURATION_Handle
- *cfg,
- unsigned int
- total,
- unsigned int
- max_concurrent_connections,
- unsigned int
- max_concurrent_ssh,
- struct
- GNUNET_TIME_Relative
- timeout,
- GNUNET_TESTING_NotifyHostkeyCreated
- hostkey_callback,
- void
- *hostkey_cls,
- GNUNET_TESTING_NotifyDaemonRunning
- cb, void *cb_cls,
- GNUNET_TESTING_NotifyConnection
- connect_callback,
- void
- *connect_callback_cls,
- const struct
- GNUNET_TESTING_Host
- *hostnames);
+struct GNUNET_TESTING_PeerGroup *
+GNUNET_TESTING_daemons_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ unsigned int total,
+ unsigned int max_concurrent_connections,
+ unsigned int max_concurrent_ssh,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_TESTING_NotifyHostkeyCreated
+ hostkey_callback, void *hostkey_cls,
+ GNUNET_TESTING_NotifyDaemonRunning cb,
+ void *cb_cls,
+ GNUNET_TESTING_NotifyConnection connect_callback,
+ void *connect_callback_cls,
+ const struct GNUNET_TESTING_Host *hostnames);
/**
* Function which continues a peer group starting up
*
* @param pg the peer group to continue starting
*/
-void GNUNET_TESTING_daemons_continue_startup (struct GNUNET_TESTING_PeerGroup
- *pg);
+void
+GNUNET_TESTING_daemons_continue_startup (struct GNUNET_TESTING_PeerGroup *pg);
/**
* @param cb function to call at the end
* @param cb_cls closure for cb
*/
-void GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1,
- struct GNUNET_TESTING_Daemon *d2,
- struct GNUNET_TIME_Relative timeout,
- unsigned int max_connect_attempts,
- int send_hello,
- GNUNET_TESTING_NotifyConnection cb,
- void *cb_cls);
+void
+GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1,
+ struct GNUNET_TESTING_Daemon *d2,
+ struct GNUNET_TIME_Relative timeout,
+ unsigned int max_connect_attempts,
+ int send_hello,
+ GNUNET_TESTING_NotifyConnection cb,
+ void *cb_cls);
/**
* @param callback function to call on completion (or failure)
* @param callback_cls closure for the callback function
*/
-void GNUNET_TESTING_daemons_restart (struct GNUNET_TESTING_PeerGroup *pg,
- GNUNET_TESTING_NotifyCompletion callback,
- void *callback_cls);
+void
+GNUNET_TESTING_daemons_restart (struct GNUNET_TESTING_PeerGroup *pg,
+ GNUNET_TESTING_NotifyCompletion callback,
+ void *callback_cls);
/**
* @param cb callback to notify upon success or failure
* @param cb_cls closure for cb
*/
-void GNUNET_TESTING_daemons_stop (struct GNUNET_TESTING_PeerGroup *pg,
- struct GNUNET_TIME_Relative timeout,
- GNUNET_TESTING_NotifyCompletion cb,
- void *cb_cls);
+void
+GNUNET_TESTING_daemons_stop (struct GNUNET_TESTING_PeerGroup *pg,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_TESTING_NotifyCompletion cb, void *cb_cls);
/**
*
* @return the number of currently running peers in the peer group
*/
-unsigned int GNUNET_TESTING_daemons_running (struct GNUNET_TESTING_PeerGroup
- *pg);
+unsigned int
+GNUNET_TESTING_daemons_running (struct GNUNET_TESTING_PeerGroup *pg);
/**
* Simulate churn by stopping some peers (and possibly
* @param cb function to call at the end
* @param cb_cls closure for cb
*/
-void GNUNET_TESTING_daemons_churn (struct GNUNET_TESTING_PeerGroup *pg,
- char *service, unsigned int voff,
- unsigned int von,
- struct GNUNET_TIME_Relative timeout,
- GNUNET_TESTING_NotifyCompletion cb,
- void *cb_cls);
+void
+GNUNET_TESTING_daemons_churn (struct GNUNET_TESTING_PeerGroup *pg,
+ char *service, unsigned int voff,
+ unsigned int von,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_TESTING_NotifyCompletion cb, void *cb_cls);
/*
* Start a given service for each of the peers in the peer group.
*
* @param cb_cls closure for cb
*
*/
-void GNUNET_TESTING_daemons_start_service (struct GNUNET_TESTING_PeerGroup *pg,
- char *service,
- struct GNUNET_TIME_Relative timeout,
- GNUNET_TESTING_NotifyCompletion cb,
- void *cb_cls);
+void
+GNUNET_TESTING_daemons_start_service (struct GNUNET_TESTING_PeerGroup *pg,
+ char *service,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_TESTING_NotifyCompletion cb,
+ void *cb_cls);
/**
* Callback function to process statistic values.
* @param proc processing function for each statistic retrieved
* @param cls closure to pass to proc
*/
-void GNUNET_TESTING_get_statistics (struct GNUNET_TESTING_PeerGroup *pg,
- GNUNET_STATISTICS_Callback cont,
- GNUNET_TESTING_STATISTICS_Iterator proc,
- void *cls);
+void
+GNUNET_TESTING_get_statistics (struct GNUNET_TESTING_PeerGroup *pg,
+ GNUNET_STATISTICS_Callback cont,
+ GNUNET_TESTING_STATISTICS_Iterator proc,
+ void *cls);
/**
* Topologies supported for testbeds.
* @return GNUNET_YES if topology string matched a
* known topology, GNUNET_NO if not
*/
-int GNUNET_TESTING_topology_get (enum GNUNET_TESTING_Topology *topology,
- const char *topology_string);
+int
+GNUNET_TESTING_topology_get (enum GNUNET_TESTING_Topology *topology,
+ const char *topology_string);
/**
* Get connect topology option from string input.
* @return GNUNET_YES if topology string matched a
* known topology, GNUNET_NO if not
*/
-int GNUNET_TESTING_topology_option_get (enum GNUNET_TESTING_TopologyOption
- *topology_option,
- const char *topology_string);
+int
+GNUNET_TESTING_topology_option_get (enum GNUNET_TESTING_TopologyOption
+ *topology_option,
+ const char *topology_string);
/**
* @return the maximum number of connections were all allowed peers
* connected to each other
*/
-unsigned int GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup
- *pg,
- enum GNUNET_TESTING_Topology
- topology,
- enum GNUNET_TESTING_Topology
- restrict_topology,
- const char *restrict_transports);
+unsigned int
+GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup *pg,
+ enum GNUNET_TESTING_Topology topology,
+ enum GNUNET_TESTING_Topology restrict_topology,
+ const char *restrict_transports);
/**
* Iterate over all (running) peers in the peer group, retrieve
* @param cb callback for topology information
* @param cls closure for callback
*/
-void GNUNET_TESTING_get_topology (struct GNUNET_TESTING_PeerGroup *pg,
- GNUNET_TESTING_NotifyTopology cb, void *cls);
+void
+GNUNET_TESTING_get_topology (struct GNUNET_TESTING_PeerGroup *pg,
+ GNUNET_TESTING_NotifyTopology cb, void *cls);
/**
* Stop the connection process temporarily.
*
* @param pg the peer group to stop connecting
*/
-void GNUNET_TESTING_stop_connections (struct GNUNET_TESTING_PeerGroup *pg);
+void
+GNUNET_TESTING_stop_connections (struct GNUNET_TESTING_PeerGroup *pg);
/**
* Resume the connection process.
*
* @param pg the peer group to resume connecting
*/
-void GNUNET_TESTING_resume_connections (struct GNUNET_TESTING_PeerGroup *pg);
+void
+GNUNET_TESTING_resume_connections (struct GNUNET_TESTING_PeerGroup *pg);
/**
* There are many ways to connect peers that are supported by this function.
*
* @return the number of connections that will be attempted, GNUNET_SYSERR on error
*/
-int GNUNET_TESTING_connect_topology (struct GNUNET_TESTING_PeerGroup *pg,
- enum GNUNET_TESTING_Topology topology,
- enum GNUNET_TESTING_TopologyOption options,
- double option_modifier,
- struct GNUNET_TIME_Relative
- connect_timeout,
- unsigned int connect_attempts,
- GNUNET_TESTING_NotifyCompletion
- notify_callback, void *notify_cls);
+int
+GNUNET_TESTING_connect_topology (struct GNUNET_TESTING_PeerGroup *pg,
+ enum GNUNET_TESTING_Topology topology,
+ enum GNUNET_TESTING_TopologyOption options,
+ double option_modifier,
+ struct GNUNET_TIME_Relative connect_timeout,
+ unsigned int connect_attempts,
+ GNUNET_TESTING_NotifyCompletion
+ notify_callback, void *notify_cls);
/**
* Start or stop an individual peer from the given group.
* @param cb function to call at the end
* @param cb_cls closure for cb
*/
-void GNUNET_TESTING_daemons_vary (struct GNUNET_TESTING_PeerGroup *pg,
- unsigned int offset, int desired_status,
- struct GNUNET_TIME_Relative timeout,
- GNUNET_TESTING_NotifyCompletion cb,
- void *cb_cls);
+void
+GNUNET_TESTING_daemons_vary (struct GNUNET_TESTING_PeerGroup *pg,
+ unsigned int offset, int desired_status,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_TESTING_NotifyCompletion cb, void *cb_cls);
/**
* Start a peer group with a given number of peers. Notify
*
* @return NULL on error, otherwise handle to control peer group
*/
-struct GNUNET_TESTING_PeerGroup *GNUNET_TESTING_peergroup_start (const struct
- GNUNET_CONFIGURATION_Handle
- *cfg,
- unsigned int
- total,
- struct
- GNUNET_TIME_Relative
- timeout,
- GNUNET_TESTING_NotifyConnection
- connect_cb,
- GNUNET_TESTING_NotifyCompletion
- peergroup_cb,
- void
- *peergroup_cls,
- const struct
- GNUNET_TESTING_Host
- *hostnames);
+struct GNUNET_TESTING_PeerGroup *
+GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ unsigned int total,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_TESTING_NotifyConnection connect_cb,
+ GNUNET_TESTING_NotifyCompletion peergroup_cb,
+ void *peergroup_cls,
+ const struct GNUNET_TESTING_Host *hostnames);
/**
* Print current topology to a graphviz readable file.
* @param notify_cb_cls closure for notify_cb
*
*/
-void GNUNET_TESTING_peergroup_topology_to_file (struct GNUNET_TESTING_PeerGroup
- *pg,
- const char *output_filename,
- GNUNET_TESTING_NotifyCompletion
- notify_cb, void *notify_cb_cls);
+void
+GNUNET_TESTING_peergroup_topology_to_file (struct GNUNET_TESTING_PeerGroup *pg,
+ const char *output_filename,
+ GNUNET_TESTING_NotifyCompletion
+ notify_cb, void *notify_cb_cls);
#if 0 /* keep Emacsens' auto-indent happy */
/**
* Return relative time of 0ms.
*/
-struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_zero (void);
+struct GNUNET_TIME_Relative
+GNUNET_TIME_relative_get_zero (void);
/**
* Return absolute time of 0ms.
*/
-struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get_zero (void);
+struct GNUNET_TIME_Absolute
+GNUNET_TIME_absolute_get_zero (void);
/**
* Return relative time of 1ms.
*/
-struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_unit (void);
+struct GNUNET_TIME_Relative
+GNUNET_TIME_relative_get_unit (void);
/**
* Return "forever".
*/
-struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_forever (void);
+struct GNUNET_TIME_Relative
+GNUNET_TIME_relative_get_forever (void);
/**
* Return "forever".
*/
-struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get_forever (void);
+struct GNUNET_TIME_Absolute
+GNUNET_TIME_absolute_get_forever (void);
/**
* Get the current time.
*
* @return the current time
*/
-struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get (void);
+struct GNUNET_TIME_Absolute
+GNUNET_TIME_absolute_get (void);
/**
* Convert relative time to an absolute time in the
* @param rel relative time to convert
* @return timestamp that is "rel" in the future, or FOREVER if rel==FOREVER (or if we would overflow)
*/
-struct GNUNET_TIME_Absolute GNUNET_TIME_relative_to_absolute (struct
- GNUNET_TIME_Relative
- rel);
+struct GNUNET_TIME_Absolute
+GNUNET_TIME_relative_to_absolute (struct GNUNET_TIME_Relative rel);
/**
* Return the minimum of two relative time values.
* @param t2 other timestamp
* @return timestamp that is smaller
*/
-struct GNUNET_TIME_Relative GNUNET_TIME_relative_min (struct
- GNUNET_TIME_Relative t1,
- struct
- GNUNET_TIME_Relative t2);
+struct GNUNET_TIME_Relative
+GNUNET_TIME_relative_min (struct GNUNET_TIME_Relative t1,
+ struct GNUNET_TIME_Relative t2);
/**
* @param t2 other timestamp
* @return timestamp that is larger
*/
-struct GNUNET_TIME_Relative GNUNET_TIME_relative_max (struct
- GNUNET_TIME_Relative t1,
- struct
- GNUNET_TIME_Relative t2);
+struct GNUNET_TIME_Relative
+GNUNET_TIME_relative_max (struct GNUNET_TIME_Relative t1,
+ struct GNUNET_TIME_Relative t2);
/**
* Return the minimum of two absolute time values.
* @param t2 other timestamp
* @return timestamp that is smaller
*/
-struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_min (struct
- GNUNET_TIME_Absolute t1,
- struct
- GNUNET_TIME_Absolute t2);
+struct GNUNET_TIME_Absolute
+GNUNET_TIME_absolute_min (struct GNUNET_TIME_Absolute t1,
+ struct GNUNET_TIME_Absolute t2);
/**
* Return the maximum of two absolute time values.
* @param t2 other timestamp
* @return timestamp that is smaller
*/
-struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_max (struct
- GNUNET_TIME_Absolute t1,
- struct
- GNUNET_TIME_Absolute t2);
+struct GNUNET_TIME_Absolute
+GNUNET_TIME_absolute_max (struct GNUNET_TIME_Absolute t1,
+ struct GNUNET_TIME_Absolute t2);
/**
* Given a timestamp in the future, how much time
* @param future some absolute time, typically in the future
* @return future - now, or 0 if now >= future, or FOREVER if future==FOREVER.
*/
-struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_remaining (struct
- GNUNET_TIME_Absolute
- future);
+struct GNUNET_TIME_Relative
+GNUNET_TIME_absolute_get_remaining (struct GNUNET_TIME_Absolute future);
/**
* @return remaining duration for the operation,
* assuming it continues at the same speed
*/
-struct GNUNET_TIME_Relative GNUNET_TIME_calculate_eta (struct
- GNUNET_TIME_Absolute
- start, uint64_t finished,
- uint64_t total);
+struct GNUNET_TIME_Relative
+GNUNET_TIME_calculate_eta (struct GNUNET_TIME_Absolute start, uint64_t finished,
+ uint64_t total);
/**
* @param end some absolute time (typically larger or equal to start)
* @return 0 if start >= end; FOREVER if end==FOREVER; otherwise end - start
*/
-struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_difference (struct
- GNUNET_TIME_Absolute
- start,
- struct
- GNUNET_TIME_Absolute
- end);
+struct GNUNET_TIME_Relative
+GNUNET_TIME_absolute_get_difference (struct GNUNET_TIME_Absolute start,
+ struct GNUNET_TIME_Absolute end);
/**
* Get the duration of an operation as the
* @param whence some absolute time, typically in the past
* @return aborts if hence==FOREVER, 0 if hence > now, otherwise now-hence.
*/
-struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_duration (struct
- GNUNET_TIME_Absolute
- whence);
+struct GNUNET_TIME_Relative
+GNUNET_TIME_absolute_get_duration (struct GNUNET_TIME_Absolute whence);
/**
* @param duration some relative time to add
* @return FOREVER if either argument is FOREVER or on overflow; start+duration otherwise
*/
-struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_add (struct
- GNUNET_TIME_Absolute
- start,
- struct
- GNUNET_TIME_Relative
- duration);
+struct GNUNET_TIME_Absolute
+GNUNET_TIME_absolute_add (struct GNUNET_TIME_Absolute start,
+ struct GNUNET_TIME_Relative duration);
/**
* @param duration some relative time to subtract
* @return ZERO if start <= duration, or FOREVER if start time is FOREVER; start-duration otherwise
*/
-struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_subtract (struct
- GNUNET_TIME_Absolute
- start,
- struct
- GNUNET_TIME_Relative
- duration);
+struct GNUNET_TIME_Absolute
+GNUNET_TIME_absolute_subtract (struct GNUNET_TIME_Absolute start,
+ struct GNUNET_TIME_Relative duration);
/**
* Multiply relative time by a given factor.
* @param factor integer to multiply with
* @return FOREVER if rel=FOREVER or on overflow; otherwise rel*factor
*/
-struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply (struct
- GNUNET_TIME_Relative
- rel,
- unsigned int factor);
+struct GNUNET_TIME_Relative
+GNUNET_TIME_relative_multiply (struct GNUNET_TIME_Relative rel,
+ unsigned int factor);
/**
* Divide relative time by a given factor.
* @param factor integer to divide by
* @return FOREVER if rel=FOREVER or factor==0; otherwise rel/factor
*/
-struct GNUNET_TIME_Relative GNUNET_TIME_relative_divide (struct
- GNUNET_TIME_Relative
- rel,
- unsigned int factor);
+struct GNUNET_TIME_Relative
+GNUNET_TIME_relative_divide (struct GNUNET_TIME_Relative rel,
+ unsigned int factor);
/**
* Add relative times together.
* @param a2 some other relative time
* @return FOREVER if either argument is FOREVER or on overflow; a1+a2 otherwise
*/
-struct GNUNET_TIME_Relative GNUNET_TIME_relative_add (struct
- GNUNET_TIME_Relative a1,
- struct
- GNUNET_TIME_Relative a2);
+struct GNUNET_TIME_Relative
+GNUNET_TIME_relative_add (struct GNUNET_TIME_Relative a1,
+ struct GNUNET_TIME_Relative a2);
/**
* Subtract relative timestamp from the other.
* @param a2 second timestamp
* @return ZERO if a2>=a1 (including both FOREVER), FOREVER if a1 is FOREVER, a1-a2 otherwise
*/
-struct GNUNET_TIME_Relative GNUNET_TIME_relative_subtract (struct
- GNUNET_TIME_Relative
- a1,
- struct
- GNUNET_TIME_Relative
- a2);
+struct GNUNET_TIME_Relative
+GNUNET_TIME_relative_subtract (struct GNUNET_TIME_Relative a1,
+ struct GNUNET_TIME_Relative a2);
/**
* @param a time to convert
* @return converted time value
*/
-struct GNUNET_TIME_RelativeNBO GNUNET_TIME_relative_hton (struct
- GNUNET_TIME_Relative
- a);
+struct GNUNET_TIME_RelativeNBO
+GNUNET_TIME_relative_hton (struct GNUNET_TIME_Relative a);
/**
* Convert relative time from network byte order.
* @param a time to convert
* @return converted time value
*/
-struct GNUNET_TIME_Relative GNUNET_TIME_relative_ntoh (struct
- GNUNET_TIME_RelativeNBO
- a);
+struct GNUNET_TIME_Relative
+GNUNET_TIME_relative_ntoh (struct GNUNET_TIME_RelativeNBO a);
/**
* Convert relative time to network byte order.
* @param a time to convert
* @return converted time value
*/
-struct GNUNET_TIME_AbsoluteNBO GNUNET_TIME_absolute_hton (struct
- GNUNET_TIME_Absolute
- a);
+struct GNUNET_TIME_AbsoluteNBO
+GNUNET_TIME_absolute_hton (struct GNUNET_TIME_Absolute a);
/**
* Convert relative time from network byte order.
* @param a time to convert
* @return converted time value
*/
-struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_ntoh (struct
- GNUNET_TIME_AbsoluteNBO
- a);
+struct GNUNET_TIME_Absolute
+GNUNET_TIME_absolute_ntoh (struct GNUNET_TIME_AbsoluteNBO a);
/**
* Convert a relative time to a string.
*
* @return string form of the time (as milliseconds)
*/
-const char *GNUNET_TIME_relative_to_string (struct GNUNET_TIME_Relative time);
+const char *
+GNUNET_TIME_relative_to_string (struct GNUNET_TIME_Relative time);
/**
* Set the timestamp offset for this instance.
*
* @param offset the offset to skew the locale time by
*/
-void GNUNET_TIME_set_offset (long long offset);
+void
+GNUNET_TIME_set_offset (long long offset);
#if 0 /* keep Emacsens' auto-indent happy */
{
* @param nd function to call on disconnect events
* @return NULL on error
*/
-struct GNUNET_TRANSPORT_Handle *GNUNET_TRANSPORT_connect (const struct
- GNUNET_CONFIGURATION_Handle
- *cfg,
- const struct
- GNUNET_PeerIdentity
- *self, void *cls,
- GNUNET_TRANSPORT_ReceiveCallback
- rec,
- GNUNET_TRANSPORT_NotifyConnect
- nc,
- GNUNET_TRANSPORT_NotifyDisconnect
- nd);
+struct GNUNET_TRANSPORT_Handle *
+GNUNET_TRANSPORT_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ const struct GNUNET_PeerIdentity *self, void *cls,
+ GNUNET_TRANSPORT_ReceiveCallback rec,
+ GNUNET_TRANSPORT_NotifyConnect nc,
+ GNUNET_TRANSPORT_NotifyDisconnect nd);
/**
*
* @param handle handle returned from connect
*/
-void GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle);
+void
+GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle);
/**
* @param handle connection to transport service
* @param target who we should try to connect to
*/
-void GNUNET_TRANSPORT_try_connect (struct GNUNET_TRANSPORT_Handle *handle,
- const struct GNUNET_PeerIdentity *target);
+void
+GNUNET_TRANSPORT_try_connect (struct GNUNET_TRANSPORT_Handle *handle,
+ const struct GNUNET_PeerIdentity *target);
/**
* @param quota_in incoming bandwidth quota
* @param quota_out outgoing bandwidth quota
*/
-void GNUNET_TRANSPORT_set_quota (struct GNUNET_TRANSPORT_Handle *handle,
- const struct GNUNET_PeerIdentity *target,
- struct GNUNET_BANDWIDTH_Value32NBO quota_in,
- struct GNUNET_BANDWIDTH_Value32NBO quota_out);
+void
+GNUNET_TRANSPORT_set_quota (struct GNUNET_TRANSPORT_Handle *handle,
+ const struct GNUNET_PeerIdentity *target,
+ struct GNUNET_BANDWIDTH_Value32NBO quota_in,
+ struct GNUNET_BANDWIDTH_Value32NBO quota_out);
/**
* non-NULL if the notify callback was queued (can be used to cancel
* using GNUNET_TRANSPORT_notify_transmit_ready_cancel)
*/
-struct GNUNET_TRANSPORT_TransmitHandle
- *GNUNET_TRANSPORT_notify_transmit_ready (struct GNUNET_TRANSPORT_Handle
- *handle,
- const struct GNUNET_PeerIdentity
- *target, size_t size,
- uint32_t priority,
- struct GNUNET_TIME_Relative
- timeout,
- GNUNET_CONNECTION_TransmitReadyNotify
- notify, void *notify_cls);
+struct GNUNET_TRANSPORT_TransmitHandle *
+GNUNET_TRANSPORT_notify_transmit_ready (struct GNUNET_TRANSPORT_Handle *handle,
+ const struct GNUNET_PeerIdentity
+ *target, size_t size, uint32_t priority,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_CONNECTION_TransmitReadyNotify
+ notify, void *notify_cls);
/**
*
* @param th handle of the transmission notification request to cancel
*/
-void GNUNET_TRANSPORT_notify_transmit_ready_cancel (struct
- GNUNET_TRANSPORT_TransmitHandle
- *th);
+void
+GNUNET_TRANSPORT_notify_transmit_ready_cancel (struct
+ GNUNET_TRANSPORT_TransmitHandle
+ *th);
* @param rec function to call with the HELLO
* @param rec_cls closure for rec
*/
-void GNUNET_TRANSPORT_get_hello (struct GNUNET_TRANSPORT_Handle *handle,
- GNUNET_TRANSPORT_HelloUpdateCallback rec,
- void *rec_cls);
+void
+GNUNET_TRANSPORT_get_hello (struct GNUNET_TRANSPORT_Handle *handle,
+ GNUNET_TRANSPORT_HelloUpdateCallback rec,
+ void *rec_cls);
/**
* @param rec function previously registered to be called with the HELLOs
* @param rec_cls closure for rec
*/
-void GNUNET_TRANSPORT_get_hello_cancel (struct GNUNET_TRANSPORT_Handle *handle,
- GNUNET_TRANSPORT_HelloUpdateCallback
- rec, void *rec_cls);
+void
+GNUNET_TRANSPORT_get_hello_cancel (struct GNUNET_TRANSPORT_Handle *handle,
+ GNUNET_TRANSPORT_HelloUpdateCallback rec,
+ void *rec_cls);
/**
* @param cls closure for continuation
*
*/
-void GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle,
- const struct GNUNET_MessageHeader *hello,
- GNUNET_SCHEDULER_Task cont, void *cls);
+void
+GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle,
+ const struct GNUNET_MessageHeader *hello,
+ GNUNET_SCHEDULER_Task cont, void *cls);
/**
* @param aluc function to call with the results
* @param aluc_cls closure for aluc
*/
-void GNUNET_TRANSPORT_address_lookup (const struct GNUNET_CONFIGURATION_Handle
- *cfg, const char *address,
- size_t addressLen, int numeric,
- const char *nameTrans,
- struct GNUNET_TIME_Relative timeout,
- GNUNET_TRANSPORT_AddressLookUpCallback
- aluc, void *aluc_cls);
+void
+GNUNET_TRANSPORT_address_lookup (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *address, size_t addressLen,
+ int numeric, const char *nameTrans,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_TRANSPORT_AddressLookUpCallback aluc,
+ void *aluc_cls);
/**
* @param peer_address_callback function to call with the results
* @param peer_address_callback_cls closure for peer_address_callback
*/
-void GNUNET_TRANSPORT_peer_address_lookup (const struct
- GNUNET_CONFIGURATION_Handle *cfg,
- const struct GNUNET_PeerIdentity
- *peer,
- struct GNUNET_TIME_Relative timeout,
- GNUNET_TRANSPORT_AddressLookUpCallback
- peer_address_callback,
- void *peer_address_callback_cls);
+void
+GNUNET_TRANSPORT_peer_address_lookup (const struct GNUNET_CONFIGURATION_Handle
+ *cfg,
+ const struct GNUNET_PeerIdentity *peer,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_TRANSPORT_AddressLookUpCallback
+ peer_address_callback,
+ void *peer_address_callback_cls);
/**
* @param peer_address_callback function to call with the results
* @param peer_address_callback_cls closure for peer_address_callback
*/
-void GNUNET_TRANSPORT_address_iterate (const struct GNUNET_CONFIGURATION_Handle
- *cfg,
- struct GNUNET_TIME_Relative timeout,
- GNUNET_TRANSPORT_AddressLookUpCallback
- peer_address_callback,
- void *peer_address_callback_cls);
+void
+GNUNET_TRANSPORT_address_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_TRANSPORT_AddressLookUpCallback
+ peer_address_callback,
+ void *peer_address_callback_cls);
/**
* @param cb_cls closure for cb
* @return NULL on error, otherwise handle for cancellation
*/
-struct GNUNET_TRANSPORT_Blacklist *GNUNET_TRANSPORT_blacklist (const struct
- GNUNET_CONFIGURATION_Handle
- *cfg,
- GNUNET_TRANSPORT_BlacklistCallback
- cb,
- void *cb_cls);
+struct GNUNET_TRANSPORT_Blacklist *
+GNUNET_TRANSPORT_blacklist (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ GNUNET_TRANSPORT_BlacklistCallback cb,
+ void *cb_cls);
/**
*
* @param br handle of the request that is to be cancelled
*/
-void GNUNET_TRANSPORT_blacklist_cancel (struct GNUNET_TRANSPORT_Blacklist *br);
+void
+GNUNET_TRANSPORT_blacklist_cancel (struct GNUNET_TRANSPORT_Blacklist *br);
* function will be called with NULL on error
* @param cls closure for callback
*/
-int GNUNET_UPNP_get_ip (struct GNUNET_CONFIGURATION_Handle *cfg, int domain,
- int type, int protocol, uint16_t port,
- struct GNUNET_TIME_Relative timeout,
- GNUNET_RESOLVER_AddressCallback callback, void *cls);
+int
+GNUNET_UPNP_get_ip (struct GNUNET_CONFIGURATION_Handle *cfg, int domain,
+ int type, int protocol, uint16_t port,
+ struct GNUNET_TIME_Relative timeout,
+ GNUNET_RESOLVER_AddressCallback callback, void *cls);
#if 0 /* keep Emacsens' auto-indent happy */
#if !HAVE_ATOLL
-long long atoll (const char *nptr);
+long long
+atoll (const char *nptr);
#endif
#if ENABLE_NLS
}
-static void churn_peers (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+churn_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
*
* @param h handle to NAT
*/
-static void start_gnunet_nat_server (struct GNUNET_NAT_Handle *h);
+static void
+start_gnunet_nat_server (struct GNUNET_NAT_Handle *h);
/**
* @param cls the NAT handle
* @param tc scheduler context
*/
-static void resolve_dns (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+resolve_dns (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
* @param cls the NAT handle
* @param tc scheduler context
*/
-static void resolve_hostname (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+resolve_hostname (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
* @param cls the 'struct GNUNET_NAT_MiniHandle'
* @param tc scheduler context
*/
-static void do_refresh (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+do_refresh (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
* @param cls the 'struct GNUNET_NAT_MiniHandle'
* @param line line of output, NULL at the end
*/
-static void process_map_output (void *cls, const char *line);
+static void
+process_map_output (void *cls, const char *line);
/**
return; /* skip */
if (1 !=
sscanf (line,
- (mini->
- is_tcp) ? "%*u TCP %u->%*s:%*u %*s" :
+ (mini->is_tcp) ? "%*u TCP %u->%*s:%*u %*s" :
"%*u UDP %u->%*s:%*u %*s", &nport))
return; /* skip */
mini->found = GNUNET_YES;
}
-static void churn_peers (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+churn_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
* @param cls the 'struct NSEPeerEntry'
* @param tc scheduler context
*/
-static void transmit_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+transmit_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"In round %llu, sending to `%s' estimate with %u bits\n",
(unsigned long long)
- GNUNET_TIME_absolute_ntoh (size_estimate_messages[idx].timestamp).
- abs_value, GNUNET_i2s (&peer_entry->id),
+ GNUNET_TIME_absolute_ntoh (size_estimate_messages[idx].
+ timestamp).abs_value,
+ GNUNET_i2s (&peer_entry->id),
(unsigned int) ntohl (size_estimate_messages[idx].matching_bits));
#endif
if (ntohl (size_estimate_messages[idx].hop_count) == 0)
incoming_flood->proof_of_work))
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Proof of work invalid: %llu!\n"),
- (unsigned long long) GNUNET_ntohll (incoming_flood->
- proof_of_work));
+ (unsigned long long)
+ GNUNET_ntohll (incoming_flood->proof_of_work));
GNUNET_break_op (0);
return GNUNET_NO;
}
GNUNET_snprintf (pred, sizeof (pred), "%s", GNUNET_i2s (peer));
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Flood at %llu from `%s' via `%s' at `%s' with bits %u\n",
- (unsigned long long) GNUNET_TIME_absolute_ntoh (incoming_flood->
- timestamp).
- abs_value, origin, pred, GNUNET_i2s (&my_identity),
+ (unsigned long long)
+ GNUNET_TIME_absolute_ntoh (incoming_flood->timestamp).abs_value,
+ origin, pred, GNUNET_i2s (&my_identity),
(unsigned int) matching_bits);
}
#endif
* @param cls the handle to the transport service
* @param tc scheduler context
*/
-static void reconnect (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
*
* @param h handle to the service
*/
-static void trigger_transmit (struct GNUNET_PEERINFO_Handle *h);
+static void
+trigger_transmit (struct GNUNET_PEERINFO_Handle *h);
/**
*
* @param h handle to the service
*/
-static void reconnect (struct GNUNET_PEERINFO_Handle *h);
+static void
+reconnect (struct GNUNET_PEERINFO_Handle *h);
/**
* Task scheduled to re-try connecting to the peerinfo service.
*
* @param nc our context
*/
-static void request_notifications (struct GNUNET_PEERINFO_NotifyContext *nc);
+static void
+request_notifications (struct GNUNET_PEERINFO_NotifyContext *nc);
/**
*
* @param nc our context
*/
-static void receive_notifications (struct GNUNET_PEERINFO_NotifyContext *nc);
+static void
+receive_notifications (struct GNUNET_PEERINFO_NotifyContext *nc);
/**
/**
* Schedule the next action to be performed.
*/
-static void schedule_action (struct GNUNET_STATISTICS_Handle *h);
+static void
+schedule_action (struct GNUNET_STATISTICS_Handle *h);
/**
* Try to (re)connect to the statistics service.
*
* @return GNUNET_YES on success, GNUNET_NO on failure.
*/
-static int try_connect (struct GNUNET_STATISTICS_Handle *ret);
+static int
+try_connect (struct GNUNET_STATISTICS_Handle *ret);
static void
"Processing VALUE done, now reading more\n");
#endif
GNUNET_CLIENT_receive (h->client, &receive_stats, h,
- GNUNET_TIME_absolute_get_remaining (h->current->
- timeout));
+ GNUNET_TIME_absolute_get_remaining (h->
+ current->timeout));
h->backoff = GNUNET_TIME_UNIT_MILLISECONDS;
return;
}
#endif
handle->receiving = GNUNET_YES;
GNUNET_CLIENT_receive (handle->client, &receive_stats, handle,
- GNUNET_TIME_absolute_get_remaining (handle->current->
- timeout));
+ GNUNET_TIME_absolute_get_remaining (handle->
+ current->timeout));
}
return msize;
}
* Run the next phase of starting daemons, connecting them and
* stopping them again.
*/
-static void run_phase ();
+static void
+run_phase ();
static void
end2_cb (void *cls, const char *emsg)
#endif
}
-static void start_fsm (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
#if WAIT_FOR_HELLO
/**
d->server = NULL;
if (GNUNET_YES == d->dead)
GNUNET_TESTING_daemon_stop (d,
- GNUNET_TIME_absolute_get_remaining (d->
- max_timeout),
- d->dead_cb, d->dead_cb_cls, GNUNET_YES,
- GNUNET_NO);
+ GNUNET_TIME_absolute_get_remaining
+ (d->max_timeout), d->dead_cb, d->dead_cb_cls,
+ GNUNET_YES, GNUNET_NO);
else if (NULL != d->cb)
d->cb (d->cb_cls, NULL, d->cfg, d,
_("Failed to connect to core service\n"));
{
if (GNUNET_YES == d->dead)
GNUNET_TESTING_daemon_stop (d,
- GNUNET_TIME_absolute_get_remaining (d->
- max_timeout),
- d->dead_cb, d->dead_cb_cls, GNUNET_YES,
- GNUNET_NO);
+ GNUNET_TIME_absolute_get_remaining
+ (d->max_timeout), d->dead_cb, d->dead_cb_cls,
+ GNUNET_YES, GNUNET_NO);
else if (NULL != d->cb)
d->cb (d->cb_cls, &d->id, d->cfg, d,
_("Failed to connect to transport service!\n"));
if (NULL != cb)
cb (d->cb_cls, NULL, d->cfg, d,
(NULL ==
- d->
- hostname) ?
+ d->hostname) ?
_("Failed to create pipe for `gnunet-peerinfo' process.\n") :
_("Failed to create pipe for `ssh' process.\n"));
return;
if (NULL != cb)
cb (d->cb_cls, NULL, d->cfg, d,
(NULL ==
- d->
- hostname) ? _("Failed to start `gnunet-peerinfo' process.\n") :
- _("Failed to start `ssh' process.\n"));
+ d->hostname) ? _("Failed to start `gnunet-peerinfo' process.\n")
+ : _("Failed to start `ssh' process.\n"));
GNUNET_DISK_pipe_close (d->pipe_stdout);
return;
}
d->task =
GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_absolute_get_remaining
(d->max_timeout),
- GNUNET_DISK_pipe_handle (d->
- pipe_stdout,
- GNUNET_DISK_PIPE_END_READ),
+ GNUNET_DISK_pipe_handle
+ (d->pipe_stdout,
+ GNUNET_DISK_PIPE_END_READ),
&start_fsm, d);
}
else /* Already have a hostkey! */
d->task =
GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_absolute_get_remaining
(d->max_timeout),
- GNUNET_DISK_pipe_handle (d->
- pipe_stdout,
- GNUNET_DISK_PIPE_END_READ),
+ GNUNET_DISK_pipe_handle
+ (d->pipe_stdout,
+ GNUNET_DISK_PIPE_END_READ),
&start_fsm, d);
return;
}
if (NULL != cb)
cb (d->cb_cls, NULL, d->cfg, d,
(NULL ==
- d->
- hostname) ? _("Failed to start `gnunet-arm' process.\n") :
+ d->hostname) ? _("Failed to start `gnunet-arm' process.\n") :
_("Failed to start `ssh' process.\n"));
return;
}
if (NULL != cb)
cb (d->cb_cls, NULL, d->cfg, d,
(NULL ==
- d->
- hostname) ? _("`gnunet-arm' does not seem to terminate.\n") :
+ d->hostname) ? _("`gnunet-arm' does not seem to terminate.\n") :
_("`ssh' does not seem to terminate.\n"));
GNUNET_CONFIGURATION_destroy (d->cfg);
GNUNET_free (d->cfgfile);
{
if (GNUNET_YES == d->dead)
GNUNET_TESTING_daemon_stop (d,
- GNUNET_TIME_absolute_get_remaining (d->
- max_timeout),
- d->dead_cb, d->dead_cb_cls, GNUNET_YES,
- GNUNET_NO);
+ GNUNET_TIME_absolute_get_remaining
+ (d->max_timeout), d->dead_cb,
+ d->dead_cb_cls, GNUNET_YES, GNUNET_NO);
else if (NULL != d->cb)
d->cb (d->cb_cls, &d->id, d->cfg, d,
_("Failed to connect to transport service!\n"));
if (NULL != cb)
cb (d->cb_cls, NULL, d->cfg, d,
(NULL ==
- d->
- hostname) ? _("`gnunet-arm' does not seem to terminate.\n") :
+ d->hostname) ? _("`gnunet-arm' does not seem to terminate.\n") :
_("`ssh' does not seem to terminate.\n"));
return;
}
if (NULL != cb)
cb (d->cb_cls, NULL, d->cfg, d,
(NULL ==
- d->
- hostname) ?
+ d->hostname) ?
_
("`gnunet-arm' terminated with non-zero exit status (or timed out)!\n")
: _("`ssh' does not seem to terminate.\n"));
/** Forward declaration **/
-static void reattempt_daemons_connect (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext
- *tc);
+static void
+reattempt_daemons_connect (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
}
#else
if (GNUNET_YES ==
- GNUNET_CONTAINER_multihashmap_contains (pg->peers[first].
- blacklisted_peers, &hash_second))
+ GNUNET_CONTAINER_multihashmap_contains (pg->
+ peers[first].blacklisted_peers,
+ &hash_second))
{
- GNUNET_CONTAINER_multihashmap_remove_all (pg->peers[first].
- blacklisted_peers, &hash_second);
+ GNUNET_CONTAINER_multihashmap_remove_all (pg->
+ peers[first].blacklisted_peers,
+ &hash_second);
}
if (GNUNET_YES ==
- GNUNET_CONTAINER_multihashmap_contains (pg->peers[second].
- blacklisted_peers, &hash_first))
+ GNUNET_CONTAINER_multihashmap_contains (pg->
+ peers[second].blacklisted_peers,
+ &hash_first))
{
- GNUNET_CONTAINER_multihashmap_remove_all (pg->peers[second].
- blacklisted_peers, &hash_first);
+ GNUNET_CONTAINER_multihashmap_remove_all (pg->
+ peers[second].blacklisted_peers,
+ &hash_first);
}
#endif
conn_iter = pg->peers[pg_iter].allowed_peers_head;
while (conn_iter != NULL)
{
- GNUNET_CRYPTO_hash_to_enc (&pg->peers[conn_iter->index].daemon->id.
- hashPubKey, &peer_enc);
+ GNUNET_CRYPTO_hash_to_enc (&pg->peers[conn_iter->index].daemon->
+ id.hashPubKey, &peer_enc);
fprintf (temp_friend_handle, "%s\n", (char *) &peer_enc);
conn_iter = conn_iter->next;
}
conn_iter = pg->peers[pg_iter].blacklisted_peers_head;
while (conn_iter != NULL)
{
- GNUNET_CRYPTO_hash_to_enc (&pg->peers[conn_iter->index].daemon->id.
- hashPubKey, &peer_enc);
+ GNUNET_CRYPTO_hash_to_enc (&pg->peers[conn_iter->index].daemon->
+ id.hashPubKey, &peer_enc);
fprintf (temp_file_handle, "%s:%s\n", pos, (char *) &peer_enc);
conn_iter = conn_iter->next;
}
#else
blacklist_ctx.transport = pos;
- (void) GNUNET_CONTAINER_multihashmap_iterate (pg->peers[pg_iter].
- blacklisted_peers,
+ (void) GNUNET_CONTAINER_multihashmap_iterate (pg->
+ peers
+ [pg_iter].blacklisted_peers,
&blacklist_file_iterator,
&blacklist_ctx);
#endif
}
/* Forward Declaration */
-static void schedule_connect (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+schedule_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
* Choose a random peer's next connection to create, and
#if USE_SEND_HELLOS
/* Forward declaration */
-static void schedule_send_hellos (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext
- *tc);
+static void
+schedule_send_hellos (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
* Close connections and free the hello context.
conn = send_hello_context->peer->connect_peers_head;
while (conn != NULL)
{
- GNUNET_CORE_peer_request_connect (send_hello_context->peer->daemon->
- server,
- &send_hello_context->pg->peers[conn->
- index].
- daemon->id, NULL, NULL);
+ GNUNET_CORE_peer_request_connect (send_hello_context->peer->
+ daemon->server,
+ &send_hello_context->pg->
+ peers[conn->index].daemon->id, NULL,
+ NULL);
conn = conn->next;
}
send_hello_context->core_connect_task =
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_divide
- (send_hello_context->pg->ct_ctx.
- connect_timeout,
- send_hello_context->pg->ct_ctx.
- connect_attempts),
+ (send_hello_context->pg->
+ ct_ctx.connect_timeout,
+ send_hello_context->pg->
+ ct_ctx.connect_attempts),
&send_core_connect_requests,
send_hello_context);
}
send_hello_context->core_connect_task =
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_divide
- (send_hello_context->pg->ct_ctx.
- connect_timeout,
- send_hello_context->pg->ct_ctx.
- connect_attempts),
+ (send_hello_context->pg->
+ ct_ctx.connect_timeout,
+ send_hello_context->pg->
+ ct_ctx.connect_attempts),
&send_core_connect_requests,
send_hello_context);
}
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
_("Offering Hello of peer %s to peer %s\n"),
send_hello_context->peer->daemon->shortname,
- pg->peers[send_hello_context->peer_pos->index].daemon->
- shortname);
+ pg->peers[send_hello_context->peer_pos->index].
+ daemon->shortname);
#endif
GNUNET_TRANSPORT_offer_hello (send_hello_context->peer->daemon->th,
- (const struct GNUNET_MessageHeader *) pg->
- peers[send_hello_context->peer_pos->index].
- daemon->hello, &hello_sent_callback,
- send_hello_context);
+ (const struct GNUNET_MessageHeader *)
+ pg->peers[send_hello_context->peer_pos->
+ index].daemon->hello,
+ &hello_sent_callback, send_hello_context);
send_hello_context->peer_pos = send_hello_context->peer_pos->next;
GNUNET_assert (send_hello_context->peer->daemon->th != NULL);
}
second_cfg, first_cfg, second_daemon, first_daemon,
emsg);
- GNUNET_CONTAINER_DLL_remove (pg->peers[connect_ctx->second_index].
- connect_peers_head,
- pg->peers[connect_ctx->second_index].
- connect_peers_tail, connection);
+ GNUNET_CONTAINER_DLL_remove (pg->
+ peers[connect_ctx->
+ second_index].connect_peers_head,
+ pg->peers[connect_ctx->
+ second_index].connect_peers_tail,
+ connection);
GNUNET_free (connection);
}
#endif
pg->outstanding_connects++;
pg->total_connects_scheduled++;
- GNUNET_TESTING_daemons_connect (pg->peers[connect_context->first_index].
- daemon,
- pg->peers[connect_context->second_index].
- daemon,
+ GNUNET_TESTING_daemons_connect (pg->
+ peers[connect_context->first_index].daemon,
+ pg->peers[connect_context->
+ second_index].daemon,
connect_context->ct_ctx->connect_timeout,
connect_context->ct_ctx->connect_attempts,
#if USE_SEND_HELLOS
if (random_number < random_ctx->percentage)
{
GNUNET_assert (GNUNET_OK ==
- GNUNET_CONTAINER_multihashmap_put (random_ctx->first->
- connect_peers_working_set,
+ GNUNET_CONTAINER_multihashmap_put (random_ctx->
+ first->connect_peers_working_set,
key, value,
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
}
hash_from_uid (random_ctx->first_uid, &first_hash);
GNUNET_assert (random_ctx->pg->total > second_pos);
GNUNET_assert (GNUNET_YES ==
- GNUNET_CONTAINER_multihashmap_remove (random_ctx->pg->
- peers[second_pos].
- connect_peers,
+ GNUNET_CONTAINER_multihashmap_remove (random_ctx->
+ pg->peers
+ [second_pos].connect_peers,
&first_hash,
- random_ctx->first->
- daemon));
+ random_ctx->
+ first->daemon));
return GNUNET_YES;
}
if (min_ctx->pg_array[i] == min_ctx->current)
{
GNUNET_assert (GNUNET_OK ==
- GNUNET_CONTAINER_multihashmap_put (min_ctx->first->
- connect_peers_working_set,
+ GNUNET_CONTAINER_multihashmap_put (min_ctx->
+ first->connect_peers_working_set,
key, value,
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
uid_from_hash (key, &second_pos);
hash_from_uid (min_ctx->first_uid, &first_hash);
GNUNET_assert (min_ctx->pg->total > second_pos);
GNUNET_assert (GNUNET_OK ==
- GNUNET_CONTAINER_multihashmap_put (min_ctx->pg->
- peers[second_pos].
- connect_peers_working_set,
+ GNUNET_CONTAINER_multihashmap_put (min_ctx->
+ pg->peers
+ [second_pos].connect_peers_working_set,
&first_hash,
- min_ctx->
- first->daemon,
+ min_ctx->first->
+ daemon,
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
/* Now we have added this particular connection, remove it from the second peer's map so it's not double counted */
GNUNET_assert (GNUNET_YES ==
- GNUNET_CONTAINER_multihashmap_remove (min_ctx->pg->
- peers[second_pos].
- connect_peers,
+ GNUNET_CONTAINER_multihashmap_remove (min_ctx->
+ pg->peers
+ [second_pos].connect_peers,
&first_hash,
- min_ctx->first->
- daemon));
+ min_ctx->
+ first->daemon));
}
}
min_ctx->current++;
if (dfs_ctx->current == dfs_ctx->chosen)
{
GNUNET_assert (GNUNET_OK ==
- GNUNET_CONTAINER_multihashmap_put (dfs_ctx->first->
- connect_peers_working_set,
+ GNUNET_CONTAINER_multihashmap_put (dfs_ctx->
+ first->connect_peers_working_set,
key, value,
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
uid_from_hash (key, &dfs_ctx->second_uid);
hash_from_uid (dfs_ctx->first_uid, &first_hash);
GNUNET_assert (GNUNET_OK ==
- GNUNET_CONTAINER_multihashmap_put (dfs_ctx->pg->
- peers
- [dfs_ctx->second_uid].
- connect_peers_working_set,
+ GNUNET_CONTAINER_multihashmap_put (dfs_ctx->
+ pg->peers[dfs_ctx->
+ second_uid].connect_peers_working_set,
&first_hash,
dfs_ctx->first->daemon,
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
GNUNET_assert (GNUNET_YES ==
- GNUNET_CONTAINER_multihashmap_remove (dfs_ctx->pg->
- peers[dfs_ctx->
- second_uid].
- connect_peers,
+ GNUNET_CONTAINER_multihashmap_remove (dfs_ctx->
+ pg->peers
+ [dfs_ctx->second_uid].connect_peers,
&first_hash,
- dfs_ctx->first->
- daemon));
+ dfs_ctx->
+ first->daemon));
/* Can't remove second from first yet because we are currently iterating, hence the return value in the DFSContext! */
return GNUNET_NO; /* We have found our peer, don't iterate more */
}
}
#else
count +=
- GNUNET_CONTAINER_multihashmap_size (pg->peers[pg_iter].
- connect_peers_working_set);
+ GNUNET_CONTAINER_multihashmap_size (pg->
+ peers
+ [pg_iter].connect_peers_working_set);
#endif
}
minimum_ctx.first_uid = pg_iter;
minimum_ctx.pg_array =
GNUNET_CRYPTO_random_permute (GNUNET_CRYPTO_QUALITY_WEAK,
- GNUNET_CONTAINER_multihashmap_size (pg->
- peers
- [pg_iter].
- connect_peers));
+ GNUNET_CONTAINER_multihashmap_size
+ (pg->peers[pg_iter].connect_peers));
minimum_ctx.first = &pg->peers[pg_iter];
minimum_ctx.pg = pg;
minimum_ctx.num_to_add = num;
&closest_ctx->curr_peer->daemon->id.hashPubKey) >
closest_ctx->closest_dist)) &&
(GNUNET_YES !=
- GNUNET_CONTAINER_multihashmap_contains (closest_ctx->curr_peer->
- connect_peers, key)))
+ GNUNET_CONTAINER_multihashmap_contains (closest_ctx->
+ curr_peer->connect_peers, key)))
{
closest_ctx->closest_dist =
GNUNET_CRYPTO_hash_matching_bits (&daemon->id.hashPubKey,
- &closest_ctx->curr_peer->daemon->id.
- hashPubKey);
+ &closest_ctx->curr_peer->daemon->
+ id.hashPubKey);
closest_ctx->closest = daemon;
uid_from_hash (key, &closest_ctx->closest_num);
}
for (pg_iter = 0; pg_iter < pg->total; pg_iter++)
{
temp_count =
- count_connections (pg->peers[pg_iter].
- connect_peers_working_set_head);
+ count_connections (pg->
+ peers[pg_iter].connect_peers_working_set_head);
if (temp_count < least_connections)
{
starting_peer = pg_iter;
{
starting_peer = pg_iter;
least_connections =
- GNUNET_CONTAINER_multihashmap_size (pg->peers[pg_iter].
- connect_peers_working_set);
+ GNUNET_CONTAINER_multihashmap_size (pg->
+ peers
+ [pg_iter].connect_peers_working_set);
}
}
}
/* Choose a random peer from the chosen peers set of connections to add */
dfs_ctx.chosen =
GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK,
- GNUNET_CONTAINER_multihashmap_size (pg->
- peers
- [starting_peer].
- connect_peers));
+ GNUNET_CONTAINER_multihashmap_size (pg->peers
+ [starting_peer].connect_peers));
dfs_ctx.first_uid = starting_peer;
dfs_ctx.first = &pg->peers[starting_peer];
dfs_ctx.pg = pg;
dfs_ctx.current = 0;
- GNUNET_CONTAINER_multihashmap_iterate (pg->peers[starting_peer].
- connect_peers, &dfs_connect_iterator,
- &dfs_ctx);
+ GNUNET_CONTAINER_multihashmap_iterate (pg->
+ peers[starting_peer].connect_peers,
+ &dfs_connect_iterator, &dfs_ctx);
/* Remove the second from the first, since we will be continuing the search and may encounter the first peer again! */
hash_from_uid (dfs_ctx.second_uid, &second_hash);
GNUNET_assert (GNUNET_YES ==
- GNUNET_CONTAINER_multihashmap_remove (pg->
- peers[starting_peer].
- connect_peers,
+ GNUNET_CONTAINER_multihashmap_remove (pg->peers
+ [starting_peer].connect_peers,
&second_hash,
- pg->peers[dfs_ctx.
- second_uid].
- daemon));
+ pg->
+ peers
+ [dfs_ctx.second_uid].daemon));
starting_peer = dfs_ctx.second_uid;
}
{
if (startup_ctx->churn_ctx->service != NULL)
GNUNET_TESTING_daemon_start_stopped_service (peer_restart_ctx->daemon,
- startup_ctx->churn_ctx->
- service,
+ startup_ctx->
+ churn_ctx->service,
startup_ctx->timeout,
&churn_start_callback,
startup_ctx);
for (i = 0; i < pg->total; i++)
{
if (pg->peers[i].internal_context.hostkey_callback != NULL)
- pg->peers[i].internal_context.hostkey_callback (pg->
- peers[i].internal_context.
- hostkey_cls,
+ pg->peers[i].internal_context.hostkey_callback (pg->peers[i].
+ internal_context.hostkey_cls,
&pg->peers[i].daemon->id,
pg->peers[i].daemon,
NULL);
/* Get duration in seconds */
duration =
GNUNET_TIME_absolute_get_difference (connect_last_time,
- GNUNET_TIME_absolute_get ()).
- rel_value / 1000;
+ GNUNET_TIME_absolute_get
+ ()).rel_value / 1000;
total_duration =
GNUNET_TIME_absolute_get_difference (connect_start_time,
- GNUNET_TIME_absolute_get ()).
- rel_value / 1000;
+ GNUNET_TIME_absolute_get
+ ()).rel_value / 1000;
failed_conns_per_sec_recent = (double) new_failed_connections / duration;
failed_conns_per_sec_total = (double) failed_connections / total_duration;
#if TIMING
total_duration =
GNUNET_TIME_absolute_get_difference (connect_start_time,
- GNUNET_TIME_absolute_get ()).
- rel_value / 1000;
+ GNUNET_TIME_absolute_get
+ ()).rel_value / 1000;
failed_conns_per_sec_total = (double) failed_connections / total_duration;
conns_per_sec_total = (double) total_connections / total_duration;
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
pg_start_ctx->expected_connections =
GNUNET_TESTING_connect_topology (pg_start_ctx->pg,
pg_start_ctx->connect_topology,
- pg_start_ctx->
- connect_topology_option,
- pg_start_ctx->
- connect_topology_option_modifier,
+ pg_start_ctx->connect_topology_option,
+ pg_start_ctx->connect_topology_option_modifier,
DEFAULT_CONNECT_TIMEOUT,
pg_start_ctx->connect_attempts, NULL,
NULL);
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_number (cfg, "testing",
"max_outstanding_connections",
- &pg_start_ctx->
- max_concurrent_connections))
+ &pg_start_ctx->max_concurrent_connections))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n",
"testing", "max_outstanding_connections");
"connect_topology_option",
&temp_str)) &&
(GNUNET_NO ==
- GNUNET_TESTING_topology_option_get (&pg_start_ctx->
- connect_topology_option, temp_str)))
+ GNUNET_TESTING_topology_option_get
+ (&pg_start_ctx->connect_topology_option, temp_str)))
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Invalid connect topology option `%s' given for section %s option %s\n",
if (GNUNET_YES !=
GNUNET_CONFIGURATION_get_value_string (cfg, "testing",
"blacklist_transports",
- &pg_start_ctx->
- restrict_transports))
+ &pg_start_ctx->restrict_transports))
pg_start_ctx->restrict_transports = NULL;
pg_start_ctx->restrict_topology = GNUNET_TESTING_TOPOLOGY_NONE;
* @param cls 'struct Peer' to greylist
* @param tc scheduler context
*/
-static void remove_from_greylist (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext
- *tc);
+static void
+remove_from_greylist (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
* @param buf where the callee should write the message
* @return number of bytes written to buf
*/
-static size_t hello_advertising_ready (void *cls, size_t size, void *buf);
+static size_t
+hello_advertising_ready (void *cls, size_t size, void *buf);
/**
}
if ((!pos->is_connected) && (!pos->is_friend) &&
(0 ==
- GNUNET_TIME_absolute_get_remaining (pos->greylisted_until).
- rel_value))
+ GNUNET_TIME_absolute_get_remaining (pos->
+ greylisted_until).rel_value))
free_peer (NULL, &pos->pid.hashPubKey, pos);
}
return;
{
memcpy (&enc, &data[pos], sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded));
if (!isspace
- ((unsigned char) enc.
- encoding[sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1]))
+ ((unsigned char)
+ enc.encoding[sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1]))
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
_
ret =
GST_neighbours_calculate_receive_delay (peer,
(message ==
- NULL) ? 0 : ntohs (message->
- size),
+ NULL) ? 0 :
+ ntohs (message->size),
&do_forward);
if (do_forward == GNUNET_YES)
GST_clients_broadcast (message, GNUNET_YES);
* disconnected or must we ask all plugins to
* disconnect?
*/
-static void disconnect_neighbour (struct NeighbourMapEntry *n, int check);
+static void
+disconnect_neighbour (struct NeighbourMapEntry *n, int check);
/**
* Check the ready list for the given neighbour and if a plugin is
*
* @param nexi target peer for which to transmit
*/
-static void try_transmission_to_peer (struct NeighbourMapEntry *n);
+static void
+try_transmission_to_peer (struct NeighbourMapEntry *n);
-struct ForeignAddressList *get_preferred_ats_address (struct NeighbourMapEntry
- *n);
+struct ForeignAddressList *
+get_preferred_ats_address (struct NeighbourMapEntry *n);
/**
* Find an entry in the neighbour list for a particular peer.
#endif
memcpy (&enc, &data[pos], sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded));
if (!isspace
- ((unsigned char) enc.
- encoding[sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1]))
+ ((unsigned char)
+ enc.encoding[sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1]))
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
_
*
* @param fal address to set to 'connected'
*/
-static void mark_address_connected (struct ForeignAddressList *fal);
+static void
+mark_address_connected (struct ForeignAddressList *fal);
/* Have an inbound connection to this peer which is valid; our id is lower, ignore outbound connection! */
if ((inbound != NULL) && (0 != fal->addrlen) &&
(1 ==
- GNUNET_CRYPTO_hash_xorcmp (&inbound->ready_list->neighbour->
- id.hashPubKey, &my_identity.hashPubKey,
+ GNUNET_CRYPTO_hash_xorcmp (&inbound->ready_list->neighbour->id.
+ hashPubKey, &my_identity.hashPubKey,
&null_hash)))
{
#if DEBUG_INBOUND
}
else if ((outbound != NULL) && (0 == fal->addrlen) &&
((-1 ==
- GNUNET_CRYPTO_hash_xorcmp (&outbound->ready_list->neighbour->id.
- hashPubKey, &my_identity.hashPubKey,
+ GNUNET_CRYPTO_hash_xorcmp (&outbound->ready_list->neighbour->
+ id.hashPubKey, &my_identity.hashPubKey,
&null_hash))))
{
#if DEBUG_INBOUND
if (((best_address == NULL) || (addresses->connected == GNUNET_YES) ||
(best_address->connected == GNUNET_NO)) &&
(addresses->in_transmit == GNUNET_NO) && ((best_address == NULL) ||
- (addresses->latency.
- rel_value <
- best_address->latency.
- rel_value)))
+ (addresses->
+ latency.rel_value <
+ best_address->
+ latency.rel_value)))
best_address = addresses;
/* FIXME: also give lower-latency addresses that are not
* connected a chance some times... */
*
* @param fal address to PING
*/
-static void schedule_next_ping (struct ForeignAddressList *fal);
+static void
+schedule_next_ping (struct ForeignAddressList *fal);
/**
* @param cls the 'struct BlacklistCheck*'
* @param tc unused
*/
-static void do_blacklist_check (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+do_blacklist_check (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
* Transmit blacklist query to the client.
"Some validation of address `%s' via `%s' for peer `%4s' already in progress.\n",
(peer_address->addr != NULL) ? a2s (tp->short_name,
peer_address->addr,
- peer_address->
- addrlen) : "<inbound>",
- tp->short_name, GNUNET_i2s (&neighbour->id));
+ peer_address->addrlen) :
+ "<inbound>", tp->short_name, GNUNET_i2s (&neighbour->id));
#endif
schedule_next_ping (peer_address);
return;
GNUNET_NO);
fal->latency = GNUNET_TIME_absolute_get_duration (ve->send_time);
update_addr_value (fal,
- GNUNET_TIME_absolute_get_duration (ve->send_time).
- rel_value, GNUNET_TRANSPORT_ATS_QUALITY_NET_DELAY);
+ GNUNET_TIME_absolute_get_duration (ve->
+ send_time).rel_value,
+ GNUNET_TRANSPORT_ATS_QUALITY_NET_DELAY);
schedule_next_ping (fal);
if (n->latency.rel_value == GNUNET_TIME_UNIT_FOREVER_REL.rel_value)
chvc = chvc_head;
while (NULL != chvc)
{
- if (GNUNET_HELLO_equals (hello, chvc->hello, GNUNET_TIME_absolute_get ()).
- abs_value > 0)
+ if (GNUNET_HELLO_equals
+ (hello, chvc->hello, GNUNET_TIME_absolute_get ()).abs_value > 0)
{
#if DEBUG_TRANSPORT_HELLO > 2
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
memcpy (&pong[1], plugin->short_name, slen);
if ((sender_address != NULL) && (sender_address_len > 0))
memcpy (&((char *) &pong[1])[slen], sender_address, sender_address_len);
- if (GNUNET_TIME_absolute_get_remaining (session_header->pong_sig_expires).
- rel_value < PONG_SIGNATURE_LIFETIME.rel_value / 4)
+ if (GNUNET_TIME_absolute_get_remaining
+ (session_header->pong_sig_expires).rel_value <
+ PONG_SIGNATURE_LIFETIME.rel_value / 4)
{
/* create / update cached sig */
#if DEBUG_TRANSPORT
#if DEBUG_TRANSPORT
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Throttling read (%llu bytes excess at %u b/s), waiting %llu ms before reading more.\n",
- (unsigned long long) n->in_tracker.
- consumption_since_last_update__,
+ (unsigned long long) n->
+ in_tracker.consumption_since_last_update__,
(unsigned int) n->in_tracker.available_bytes_per_s__,
(unsigned long long) ret.rel_value);
#endif
* Dummy functions for CFLAGS
*/
-static void _dummy2 ();
+static void
+_dummy2 ();
static void
_dummy ()
{
/*
* ATS functions
*/
-struct ATS_Handle *ats_init (double D, double U, double R, int v_b_min,
- int v_n_min, int max_iterations,
- struct GNUNET_TIME_Relative max_duration,
- GNUNET_TRANSPORT_ATS_AddressNotification
- address_not,
- GNUNET_TRANSPORT_ATS_ResultCallback res_cb);
+struct ATS_Handle *
+ats_init (double D, double U, double R, int v_b_min, int v_n_min,
+ int max_iterations, struct GNUNET_TIME_Relative max_duration,
+ GNUNET_TRANSPORT_ATS_AddressNotification address_not,
+ GNUNET_TRANSPORT_ATS_ResultCallback res_cb);
-void ats_shutdown (struct ATS_Handle *ats);
+void
+ats_shutdown (struct ATS_Handle *ats);
-void ats_delete_problem (struct ATS_Handle *ats);
+void
+ats_delete_problem (struct ATS_Handle *ats);
-int ats_create_problem (struct ATS_Handle *ats, struct ATS_internals *stat,
- struct ATS_peer *peers, int c_p,
- struct ATS_mechanism *mechanisms, int c_m);
+int
+ats_create_problem (struct ATS_Handle *ats, struct ATS_internals *stat,
+ struct ATS_peer *peers, int c_p,
+ struct ATS_mechanism *mechanisms, int c_m);
-void ats_modify_problem_state (struct ATS_Handle *ats,
- enum ATS_problem_state s);
+void
+ats_modify_problem_state (struct ATS_Handle *ats, enum ATS_problem_state s);
-void ats_calculate_bandwidth_distribution (struct ATS_Handle *ats);
+void
+ats_calculate_bandwidth_distribution (struct ATS_Handle *ats);
-void ats_solve_problem (struct ATS_Handle *ats, unsigned int max_it,
- unsigned int max_dur, unsigned int c_peers,
- unsigned int c_mechs, struct ATS_internals *stat);
+void
+ats_solve_problem (struct ATS_Handle *ats, unsigned int max_it,
+ unsigned int max_dur, unsigned int c_peers,
+ unsigned int c_mechs, struct ATS_internals *stat);
-int ats_evaluate_results (int result, int solution, char *problem);
+int
+ats_evaluate_results (int result, int solution, char *problem);
-void ats_update_problem_qm (struct ATS_Handle *ats);
+void
+ats_update_problem_qm (struct ATS_Handle *ats);
-void ats_update_problem_cr (struct ATS_Handle *ats);
+void
+ats_update_problem_cr (struct ATS_Handle *ats);
-void ats_set_logging_options (struct ATS_Handle *ats,
- struct GNUNET_STATISTICS_Handle *stats,
- const struct GNUNET_CONFIGURATION_Handle *cfg);
+void
+ats_set_logging_options (struct ATS_Handle *ats,
+ struct GNUNET_STATISTICS_Handle *stats,
+ const struct GNUNET_CONFIGURATION_Handle *cfg);
#endif
/* end of file gnunet-service-transport_ats.h */
* @param cls the 'struct BlacklistCheck*'
* @param tc unused
*/
-static void do_blacklist_check (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+do_blacklist_check (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
#endif
memcpy (&enc, &data[pos], sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded));
if (!isspace
- ((unsigned char) enc.
- encoding[sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1]))
+ ((unsigned char)
+ enc.encoding[sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1]))
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
_
*
* @param server server used to accept clients from
*/
-void GST_blacklist_start (struct GNUNET_SERVER_Handle *server);
+void
+GST_blacklist_start (struct GNUNET_SERVER_Handle *server);
/**
* Stop blacklist subsystem.
*/
-void GST_blacklist_stop (void);
+void
+GST_blacklist_stop (void);
/**
* @param client the client
* @param message the blacklist-init message that was sent
*/
-void GST_blacklist_handle_init (void *cls, struct GNUNET_SERVER_Client *client,
- const struct GNUNET_MessageHeader *message);
+void
+GST_blacklist_handle_init (void *cls, struct GNUNET_SERVER_Client *client,
+ const struct GNUNET_MessageHeader *message);
/**
* A blacklisting client has sent us reply. Process it.
* @param client the client
* @param message the blacklist-init message that was sent
*/
-void GST_blacklist_handle_reply (void *cls, struct GNUNET_SERVER_Client *client,
- const struct GNUNET_MessageHeader *message);
+void
+GST_blacklist_handle_reply (void *cls, struct GNUNET_SERVER_Client *client,
+ const struct GNUNET_MessageHeader *message);
/**
* Add the given peer to the blacklist (for the given transport).
* @param peer peer to blacklist
* @param transport_name transport to blacklist for this peer, NULL for all
*/
-void GST_blacklist_add_peer (const struct GNUNET_PeerIdentity *peer,
- const char *transport_name);
+void
+GST_blacklist_add_peer (const struct GNUNET_PeerIdentity *peer,
+ const char *transport_name);
/**
* @return handle to the blacklist check, NULL if the decision
* was made instantly and 'cont' was already called
*/
-struct GST_BlacklistCheck *GST_blacklist_test_allowed (const struct
- GNUNET_PeerIdentity
- *peer,
- const char
- *transport_name,
- GST_BlacklistTestContinuation
- cont, void *cont_cls);
+struct GST_BlacklistCheck *
+GST_blacklist_test_allowed (const struct GNUNET_PeerIdentity *peer,
+ const char *transport_name,
+ GST_BlacklistTestContinuation cont, void *cont_cls);
/**
*
* @param bc check to cancel
*/
-void GST_blacklist_test_cancel (struct GST_BlacklistCheck *bc);
+void
+GST_blacklist_test_cancel (struct GST_BlacklistCheck *bc);
#endif
/* end of file gnunet-service-transport_blacklist.h */
*
* @param server server used to accept clients from.
*/
-void GST_clients_start (struct GNUNET_SERVER_Handle *server);
+void
+GST_clients_start (struct GNUNET_SERVER_Handle *server);
/**
* Stop processing clients.
*/
-void GST_clients_stop (void);
+void
+GST_clients_stop (void);
/**
* @param msg message to broadcast
* @param may_drop GNUNET_YES if the message can be dropped
*/
-void GST_clients_broadcast (const struct GNUNET_MessageHeader *msg,
- int may_drop);
+void
+GST_clients_broadcast (const struct GNUNET_MessageHeader *msg, int may_drop);
/**
* @param msg message to transmit
* @param may_drop GNUNET_YES if the message can be dropped
*/
-void GST_clients_unicast (struct GNUNET_SERVER_Client *client,
- const struct GNUNET_MessageHeader *msg, int may_drop);
+void
+GST_clients_unicast (struct GNUNET_SERVER_Client *client,
+ const struct GNUNET_MessageHeader *msg, int may_drop);
* @param cb function to call whenever our HELLO changes
* @param cb_cls closure for cb
*/
-void GST_hello_start (GST_HelloCallback cb, void *cb_cls);
+void
+GST_hello_start (GST_HelloCallback cb, void *cb_cls);
/**
* Shutdown the HELLO module.
*/
-void GST_hello_stop (void);
+void
+GST_hello_stop (void);
/**
*
* @return our HELLO message
*/
-const struct GNUNET_MessageHeader *GST_hello_get (void);
+const struct GNUNET_MessageHeader *
+GST_hello_get (void);
/**
* @param plugin_address address in a plugin-specific format
* @param plugin_address_len number of bytes in plugin_address
*/
-void GST_hello_modify_addresses (int addremove, const char *plugin_name,
- const void *plugin_address,
- size_t plugin_address_len);
+void
+GST_hello_modify_addresses (int addremove, const char *plugin_name,
+ const void *plugin_address,
+ size_t plugin_address_len);
/**
* @return GNUNET_YES if this is one of our addresses,
* GNUNET_NO if not
*/
-int GST_hello_test_address (const char *plugin_name, const void *plugin_address,
- size_t plugin_address_len,
- struct GNUNET_CRYPTO_RsaSignature **sig,
- struct GNUNET_TIME_Absolute **sig_expiration);
+int
+GST_hello_test_address (const char *plugin_name, const void *plugin_address,
+ size_t plugin_address_len,
+ struct GNUNET_CRYPTO_RsaSignature **sig,
+ struct GNUNET_TIME_Absolute **sig_expiration);
#endif
* @param cls the 'struct NeighbourMapEntry'
* @param tc scheduler context
*/
-static void transmission_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+transmission_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
#if DEBUG_TRANSPORT
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Throttling read (%llu bytes excess at %u b/s), waiting %llu ms before reading more.\n",
- (unsigned long long) n->in_tracker.
- consumption_since_last_update__,
+ (unsigned long long) n->
+ in_tracker.consumption_since_last_update__,
(unsigned int) n->in_tracker.available_bytes_per_s__,
(unsigned long long) ret.rel_value);
#endif
* @param connect_cb function to call if we connect to a peer
* @param disconnect_cb function to call if we disconnect from a peer
*/
-void GST_neighbours_start (void *cls, GNUNET_TRANSPORT_NotifyConnect connect_cb,
- GNUNET_TRANSPORT_NotifyDisconnect disconnect_cb);
+void
+GST_neighbours_start (void *cls, GNUNET_TRANSPORT_NotifyConnect connect_cb,
+ GNUNET_TRANSPORT_NotifyDisconnect disconnect_cb);
/**
* Cleanup the neighbours subsystem.
*/
-void GST_neighbours_stop (void);
+void
+GST_neighbours_stop (void);
/**
*
* @param target peer to try to connect to
*/
-void GST_neighbours_try_connect (const struct GNUNET_PeerIdentity *target);
+void
+GST_neighbours_try_connect (const struct GNUNET_PeerIdentity *target);
/**
* @param target peer to test
* @return GNUNET_YES if we are connected, GNUNET_NO if not
*/
-int GST_neighbours_test_connected (const struct GNUNET_PeerIdentity *target);
+int
+GST_neighbours_test_connected (const struct GNUNET_PeerIdentity *target);
/**
* @param cont function to call when done
* @param cont_cls closure for 'cont'
*/
-void GST_neighbours_send (const struct GNUNET_PeerIdentity *target,
- const void *msg, size_t msg_size,
- struct GNUNET_TIME_Relative timeout,
- GST_NeighbourSendContinuation cont, void *cont_cls);
+void
+GST_neighbours_send (const struct GNUNET_PeerIdentity *target, const void *msg,
+ size_t msg_size, struct GNUNET_TIME_Relative timeout,
+ GST_NeighbourSendContinuation cont, void *cont_cls);
/**
* GNUNET_NO if the neighbour is not connected or violates the quota
* @return how long to wait before reading more from this sender
*/
-struct GNUNET_TIME_Relative GST_neighbours_calculate_receive_delay (const struct
- GNUNET_PeerIdentity
- *sender,
- ssize_t
- size,
- int
- *do_forward);
+struct GNUNET_TIME_Relative
+GST_neighbours_calculate_receive_delay (const struct GNUNET_PeerIdentity
+ *sender, ssize_t size, int *do_forward);
/**
*
* @param neighbour neighbour to keep alive
*/
-void GST_neighbours_keepalive (const struct GNUNET_PeerIdentity *neighbour);
+void
+GST_neighbours_keepalive (const struct GNUNET_PeerIdentity *neighbour);
/**
* @param neighbour identity of peer to change qutoa for
* @param quota new quota
*/
-void GST_neighbours_set_incoming_quota (const struct GNUNET_PeerIdentity
- *neighbour,
- struct GNUNET_BANDWIDTH_Value32NBO
- quota);
+void
+GST_neighbours_set_incoming_quota (const struct GNUNET_PeerIdentity *neighbour,
+ struct GNUNET_BANDWIDTH_Value32NBO quota);
/**
*
* @param target peer to disconnect from
*/
-void GST_neighbours_force_disconnect (const struct GNUNET_PeerIdentity *target);
+void
+GST_neighbours_force_disconnect (const struct GNUNET_PeerIdentity *target);
/**
* @param cb function to call
* @param cb_cls closure for cb
*/
-void GST_neighbours_iterate (GST_NeighbourIterator cb, void *cb_cls);
+void
+GST_neighbours_iterate (GST_NeighbourIterator cb, void *cb_cls);
/**
* @param peer identity of the peer where the session died
* @param session session that is gone
*/
-void GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer,
- struct Session *session);
+void
+GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer,
+ struct Session *session);
/**
* @param ats performance data
* @param ats_count number of entries in ats (excluding 0-termination)
*/
-void GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer,
- const char *plugin_name,
- const void *address, size_t address_len,
- struct Session *session,
- const struct
- GNUNET_TRANSPORT_ATS_Information *ats,
- uint32_t ats_count);
+void
+GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer,
+ const char *plugin_name, const void *address,
+ size_t address_len, struct Session *session,
+ const struct GNUNET_TRANSPORT_ATS_Information
+ *ats, uint32_t ats_count);
#endif
* @param address_cb function to call when our public addresses changed
* @param session_end_cb function to call when a session was terminated
*/
-void GST_plugins_load (GNUNET_TRANSPORT_PluginReceiveCallback recv_cb,
- GNUNET_TRANSPORT_AddressNotification address_cb,
- GNUNET_TRANSPORT_SessionEnd session_end_cb);
+void
+GST_plugins_load (GNUNET_TRANSPORT_PluginReceiveCallback recv_cb,
+ GNUNET_TRANSPORT_AddressNotification address_cb,
+ GNUNET_TRANSPORT_SessionEnd session_end_cb);
/**
* Unload all plugins
*/
-void GST_plugins_unload (void);
+void
+GST_plugins_unload (void);
/**
* @param name name of the plugin
* @return the plugin's API, NULL if the plugin is not loaded
*/
-struct GNUNET_TRANSPORT_PluginFunctions *GST_plugins_find (const char *name);
+struct GNUNET_TRANSPORT_PluginFunctions *
+GST_plugins_find (const char *name);
/**
* @param addrlen number of bytes in 'addr'
* @return statically allocated (!) human-readable address
*/
-const char *GST_plugins_a2s (const char *name, const void *addr,
- size_t addrlen);
+const char *
+GST_plugins_a2s (const char *name, const void *addr, size_t addrlen);
#endif
/**
* Start the validation subsystem.
*/
-void GST_validation_start (void);
+void
+GST_validation_start (void);
/**
* Stop the validation subsystem.
*/
-void GST_validation_stop (void);
+void
+GST_validation_stop (void);
/**
* if we did not initiate the connection
* @param sender_address_len number of bytes in sender_address
*/
-void GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender,
- const struct GNUNET_MessageHeader *hdr,
- const char *plugin_name,
- struct Session *session,
- const void *sender_address,
- size_t sender_address_len);
+void
+GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender,
+ const struct GNUNET_MessageHeader *hdr,
+ const char *plugin_name, struct Session *session,
+ const void *sender_address,
+ size_t sender_address_len);
/**
* @param sender peer sending the PONG
* @param hdr the PONG
*/
-void GST_validation_handle_pong (const struct GNUNET_PeerIdentity *sender,
- const struct GNUNET_MessageHeader *hdr);
+void
+GST_validation_handle_pong (const struct GNUNET_PeerIdentity *sender,
+ const struct GNUNET_MessageHeader *hdr);
/**
*
* @param hello the HELLO we received
*/
-void GST_validation_handle_hello (const struct GNUNET_MessageHeader *hello);
+void
+GST_validation_handle_hello (const struct GNUNET_MessageHeader *hello);
/**
* @param cb_cls closure for 'cb'
* @return context to cancel, NULL if 'snapshot_only' is GNUNET_YES
*/
-void GST_validation_get_addresses (const struct GNUNET_PeerIdentity *target,
- GST_ValidationAddressCallback cb,
- void *cb_cls);
+void
+GST_validation_get_addresses (const struct GNUNET_PeerIdentity *target,
+ GST_ValidationAddressCallback cb, void *cb_cls);
#endif
};
// FIXME: inline?
-int getChannelFromFrequency (int frequency);
+int
+getChannelFromFrequency (int frequency);
// FIXME: make nice...
static unsigned long
* @param addrlen length of the address
* @return string representing the same address
*/
-static const char *http_plugin_address_to_string (void *cls, const void *addr,
- size_t addrlen);
+static const char *
+http_plugin_address_to_string (void *cls, const void *addr, size_t addrlen);
/**
* Call MHD to process pending ipv4 requests and then go back
* and schedule the next run.
*/
-static void http_server_daemon_v4_run (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext
- *tc);
+static void
+http_server_daemon_v4_run (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
* Call MHD to process pending ipv6 requests and then go back
* and schedule the next run.
*/
-static void http_server_daemon_v6_run (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext
- *tc);
+static void
+http_server_daemon_v6_run (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
* Function setting up curl handle and selecting message to send
* @param ps session
* @return GNUNET_SYSERR on failure, GNUNET_NO if connecting, GNUNET_YES if ok
*/
-static int send_check_connections (struct Plugin *plugin, struct Session *ps);
+static int
+send_check_connections (struct Plugin *plugin, struct Session *ps);
/**
* Function setting up file descriptors and scheduling task to run
* @param plugin plugin as closure
* @return GNUNET_SYSERR for hard failure, GNUNET_OK for ok
*/
-static int curl_schedule (struct Plugin *plugin);
+static int
+curl_schedule (struct Plugin *plugin);
/**
* Task scheduled to reset the inbound quota delay for a specific peer
"Connection %X: Forwarding message to transport service, type %u and size %u from `%s' (`%s')\n",
ps, ntohs (message->type), ntohs (message->size),
GNUNET_i2s (&(pc->identity)), http_plugin_address_to_string (NULL,
- ps->
- addr,
- ps->
- addrlen));
+ ps->addr,
+ ps->addrlen));
#endif
struct GNUNET_TRANSPORT_ATS_Information distance[2];
GNUNET_CONFIGURATION_get_value_string (env->cfg,
component_name,
"BINDTO4",
- &plugin->
- bind_hostname));
+ &plugin->bind_hostname));
plugin->bind4_address = GNUNET_malloc (sizeof (struct sockaddr_in));
plugin->bind4_address->sin_family = AF_INET;
plugin->bind4_address->sin_port = htons (port);
MHD_OPTION_SOCK_ADDR,
tmp,
MHD_OPTION_CONNECTION_LIMIT,
- (unsigned int) plugin->
- max_connect_per_transport,
+ (unsigned int)
+ plugin->max_connect_per_transport,
#if BUILD_HTTPS
MHD_OPTION_HTTPS_PRIORITIES,
plugin->crypto_init,
(struct sockaddr_in *)
plugin->bind4_address,
MHD_OPTION_CONNECTION_LIMIT,
- (unsigned int) plugin->
- max_connect_per_transport,
+ (unsigned int)
+ plugin->max_connect_per_transport,
#if BUILD_HTTPS
MHD_OPTION_HTTPS_PRIORITIES,
plugin->crypto_init,
maddr = (const EmailAddress *) &hello[1];
if ((ntohs (hello->header.size) !=
sizeof (GNUNET_MessageHello) + ntohs (hello->senderAddressSize)) ||
- (maddr->
- senderAddress[ntohs (hello->senderAddressSize) - 1 -
- FILTER_STRING_SIZE] != '\0'))
+ (maddr->senderAddress
+ [ntohs (hello->senderAddressSize) - 1 - FILTER_STRING_SIZE] != '\0'))
{
GNUNET_GE_BREAK (ectx, 0);
return GNUNET_SYSERR; /* obviously invalid */
*
* @param session for which session should we do this
*/
-static void process_pending_messages (struct Session *session);
+static void
+process_pending_messages (struct Session *session);
/**
(session->connect_addr !=
NULL) ? tcp_address_to_string (session->plugin,
session->connect_addr,
- session->
- connect_alen) : "*");
+ session->connect_alen) :
+ "*");
#endif
/* remove from session list */
prev = NULL;
session =
GNUNET_CONTAINER_multihashmap_get (plugin->nat_wait_conns,
- &tcp_nat_probe->clientIdentity.
- hashPubKey);
+ &tcp_nat_probe->
+ clientIdentity.hashPubKey);
if (session == NULL)
{
#if DEBUG_TCP_NAT
(session->connect_addr !=
NULL) ? tcp_address_to_string (session->plugin,
session->connect_addr,
- session->
- connect_alen) : "*");
+ session->connect_alen) :
+ "*");
#endif
GNUNET_STATISTICS_update (session->plugin->env->stats,
gettext_noop
tcp_probe_ctx);
tcp_probe_ctx->transmit_handle =
GNUNET_CONNECTION_notify_transmit_ready (sock,
- ntohs (tcp_probe_ctx->message.
- header.size),
+ ntohs (tcp_probe_ctx->
+ message.header.size),
GNUNET_TIME_UNIT_FOREVER_REL,
¬ify_send_probe,
tcp_probe_ctx);
return;
GNUNET_assert (GNUNET_OK ==
GNUNET_CONTAINER_multihashmap_remove (plugin->sessions,
- &udp->sender.
- hashPubKey,
+ &udp->
+ sender.hashPubKey,
peer_session));
plugin->last_expected_delay =
GNUNET_FRAGMENT_context_destroy (peer_session->frag);
&fragment_msg_proc, &ack_proc);
rc->hnode =
GNUNET_CONTAINER_heap_insert (plugin->defrags, rc,
- (GNUNET_CONTAINER_HeapCostType) now.
- abs_value);
+ (GNUNET_CONTAINER_HeapCostType)
+ now.abs_value);
}
#if DEBUG_UDP
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
{
/* keep this 'rc' from expiring */
GNUNET_CONTAINER_heap_update_cost (plugin->defrags, rc->hnode,
- (GNUNET_CONTAINER_HeapCostType) now.
- abs_value);
+ (GNUNET_CONTAINER_HeapCostType)
+ now.abs_value);
}
if (GNUNET_CONTAINER_heap_get_size (plugin->defrags) >
UDP_MAX_SENDER_ADDRESSES_WITH_DEFRAG)
}
/* Forward Declaration */
-static ssize_t unix_real_send (void *cls,
- struct RetrySendContext *incoming_retry_context,
- struct GNUNET_NETWORK_Handle *send_handle,
- const struct GNUNET_PeerIdentity *target,
- const char *msgbuf, size_t msgbuf_size,
- unsigned int priority,
- struct GNUNET_TIME_Relative timeout,
- const void *addr, size_t addrlen,
- GNUNET_TRANSPORT_TransmitContinuation cont,
- void *cont_cls);
+static ssize_t
+unix_real_send (void *cls, struct RetrySendContext *incoming_retry_context,
+ struct GNUNET_NETWORK_Handle *send_handle,
+ const struct GNUNET_PeerIdentity *target, const char *msgbuf,
+ size_t msgbuf_size, unsigned int priority,
+ struct GNUNET_TIME_Relative timeout, const void *addr,
+ size_t addrlen, GNUNET_TRANSPORT_TransmitContinuation cont,
+ void *cont_cls);
/**
* Retry sending a message.
struct Radiotap_Send *radioHeader;
};
-static void do_transmit (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
-static void free_session (struct Plugin *plugin, struct Sessionqueue *queue,
- int do_free_macendpoint);
-static struct MacEndpoint *create_macendpoint (struct Plugin *plugin,
- const struct MacAddress *addr);
+static void
+do_transmit (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+free_session (struct Plugin *plugin, struct Sessionqueue *queue,
+ int do_free_macendpoint);
+static struct MacEndpoint *
+create_macendpoint (struct Plugin *plugin, const struct MacAddress *addr);
/**
* Generates a nice hexdump of a memory area.
newmsg = session->pending_message_head;
GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, PLUGIN_LOG_NAME,
"wlan_plugin_send: a pending message is already in the queue for this client\n remaining time to send this message is %u, queued fragment messages for this mac connection %u\n",
- GNUNET_TIME_absolute_get_remaining (newmsg->timeout).
- rel_value, session->mac->fragment_messages_out_count);
+ GNUNET_TIME_absolute_get_remaining (newmsg->
+ timeout).rel_value,
+ session->mac->fragment_messages_out_count);
}
newmsg = GNUNET_malloc (sizeof (struct PendingMessage));
GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, PLUGIN_LOG_NAME,
"Calling plugin->env->receive for session %p; %s; size: %u\n",
session, wlan_plugin_address_to_string (NULL,
- session->mac->addr.
- mac, 6),
+ session->mac->
+ addr.mac, 6),
htons (hdr->size));
#endif
GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, PLUGIN_LOG_NAME,
"Func wlan_data_helper got GNUNET_MESSAGE_TYPE_WLAN_ADVERTISEMENT size: %u; %s\n",
ntohs (hdr->size), wlan_plugin_address_to_string (NULL,
- session_light->
- addr.mac,
- 6));
+ session_light->addr.
+ mac, 6));
#endif
if (session_light->macendpoint == NULL)
GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, PLUGIN_LOG_NAME,
"Macendpoint does not exist for this GNUNET_MESSAGE_TYPE_FRAGMENT_ACK size: %u; %s\n",
ntohs (hdr->size), wlan_plugin_address_to_string (NULL,
- session_light->
- addr.
- mac,
+ session_light->addr.mac,
6));
#endif
return;
return;
}
if (GNUNET_TIME_absolute_get_remaining
- (GNUNET_TIME_absolute_add (endpoint->last_activity, MACENDPOINT_TIMEOUT)).
- rel_value == 0)
+ (GNUNET_TIME_absolute_add
+ (endpoint->last_activity, MACENDPOINT_TIMEOUT)).rel_value == 0)
{
free_macendpoint (endpoint->plugin, endpoint);
}
}
-static void run_connection_tests (int phase, void *cls);
+static void
+run_connection_tests (int phase, void *cls);
/**
* Recieves messages from plugin, in real world transport
}
-static size_t send_prepare (struct HTTP_Transfer *result);
+static size_t
+send_prepare (struct HTTP_Transfer *result);
static void
}
-static void run_connection_tests (int phase, void *cls);
+static void
+run_connection_tests (int phase, void *cls);
/**
* Recieves messages from plugin, in real world transport
return size * nmemb;
}
-static size_t send_prepare (struct HTTP_Transfer *result);
+static size_t
+send_prepare (struct HTTP_Transfer *result);
}
-static void measure (unsigned long long quota_p1, unsigned long long quota_p2);
+static void
+measure (unsigned long long quota_p1, unsigned long long quota_p2);
static void
measurement_counter (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
#endif
-static void peers_connect ();
+static void
+peers_connect ();
static void
end ()
msgs_recv++;
}
-static void peers_disconnect (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+peers_disconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
static size_t
notify_ready (void *cls, size_t size, void *buf)
int p2_c;
};
-static void exchange_hello_last (void *cb_cls,
- const struct GNUNET_MessageHeader *message);
-static void exchange_hello (void *cb_cls,
- const struct GNUNET_MessageHeader *message);
+static void
+exchange_hello_last (void *cb_cls, const struct GNUNET_MessageHeader *message);
+static void
+exchange_hello (void *cb_cls, const struct GNUNET_MessageHeader *message);
static void
notify_connect_internal (void *cls, const struct GNUNET_PeerIdentity *peer,
* if NULL passed the PeerContext * will be used!
* @return the peer context
*/
-struct PeerContext *GNUNET_TRANSPORT_TESTING_start_peer (const char *cfgname,
- GNUNET_TRANSPORT_ReceiveCallback
- rec,
- GNUNET_TRANSPORT_NotifyConnect
- nc,
- GNUNET_TRANSPORT_NotifyDisconnect
- nd, void *cb_cls);
+struct PeerContext *
+GNUNET_TRANSPORT_TESTING_start_peer (const char *cfgname,
+ GNUNET_TRANSPORT_ReceiveCallback rec,
+ GNUNET_TRANSPORT_NotifyConnect nc,
+ GNUNET_TRANSPORT_NotifyDisconnect nd,
+ void *cb_cls);
/**
* @param p the peer
*/
-void GNUNET_TRANSPORT_TESTING_stop_peer (struct PeerContext *pc);
+void
+GNUNET_TRANSPORT_TESTING_stop_peer (struct PeerContext *pc);
/**
* @param cb the callback to call
* @param cb_cls callback cls
*/
-void GNUNET_TRANSPORT_TESTING_connect_peers (struct PeerContext *p1,
- struct PeerContext *p2,
- GNUNET_TRANSPORT_TESTING_connect_cb
- cb, void *cls);
+void
+GNUNET_TRANSPORT_TESTING_connect_peers (struct PeerContext *p1,
+ struct PeerContext *p2,
+ GNUNET_TRANSPORT_TESTING_connect_cb cb,
+ void *cls);
/* end of transport_testing.h */
*
* @param h transport service to schedule a transmission for
*/
-static void schedule_transmission (struct GNUNET_TRANSPORT_Handle *h);
+static void
+schedule_transmission (struct GNUNET_TRANSPORT_Handle *h);
/**
*
* @param h transport service to reconnect
*/
-static void disconnect_and_schedule_reconnect (struct GNUNET_TRANSPORT_Handle
- *h);
+static void
+disconnect_and_schedule_reconnect (struct GNUNET_TRANSPORT_Handle *h);
/**
th = n->th;
if (th->notify_size + sizeof (struct OutboundMessage) > size)
break; /* does not fit */
- if (GNUNET_BANDWIDTH_tracker_get_delay (&n->out_tracker, th->notify_size).
- rel_value > 0)
+ if (GNUNET_BANDWIDTH_tracker_get_delay
+ (&n->out_tracker, th->notify_size).rel_value > 0)
break; /* too early */
GNUNET_assert (n == GNUNET_CONTAINER_heap_remove_root (h->ready_heap));
n->hn = NULL;
*
* @param br overall handle
*/
-static void reconnect (struct GNUNET_TRANSPORT_Blacklist *br);
+static void
+reconnect (struct GNUNET_TRANSPORT_Blacklist *br);
/**
*
* @param br our overall context
*/
-static void reply (struct GNUNET_TRANSPORT_Blacklist *br);
+static void
+reply (struct GNUNET_TRANSPORT_Blacklist *br);
/**
-/*\r
- * Compatibility header\r
- *\r
- * Copyright (C) 2009 Thomas d'Otreppe\r
- *\r
- * This program is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
- */ \r
- \r
-#ifndef _AIRCRACK_NG_BYTEORDER_H_\r
-#define _AIRCRACK_NG_BYTEORDER_H_\r
- \r
-#define ___my_swab16(x) \\r
+/*
+ * Compatibility header
+ *
+ * Copyright (C) 2009 Thomas d'Otreppe
+ *
+ * This program 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 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _AIRCRACK_NG_BYTEORDER_H_
+#define _AIRCRACK_NG_BYTEORDER_H_
+
+#define ___my_swab16(x) \
((u_int16_t)
(\\r(((u_int16_t) (x) & (u_int16_t) 0x00ffU) << 8) |
- \\r(((u_int16_t) (x) & (u_int16_t) 0xff00U) >> 8))) \r
-#define ___my_swab32(x) \\r
+ \\r(((u_int16_t) (x) & (u_int16_t) 0xff00U) >> 8)))
+#define ___my_swab32(x) \
((u_int32_t)
(\\r(((u_int32_t) (x) & (u_int32_t) 0x000000ffUL) << 24) |
\\r(((u_int32_t) (x) & (u_int32_t) 0x0000ff00UL) << 8) |
\\r(((u_int32_t) (x) & (u_int32_t) 0x00ff0000UL) >> 8) |
- \\r(((u_int32_t) (x) & (u_int32_t) 0xff000000UL) >> 24))) \r
-#define ___my_swab64(x) \\r
+ \\r(((u_int32_t) (x) & (u_int32_t) 0xff000000UL) >> 24)))
+#define ___my_swab64(x) \
((u_int64_t)
(\\r(u_int64_t)
(((u_int64_t) (x) & (u_int64_t) 0x00000000000000ffULL) << 56) |
0x0000ff0000000000ULL) >> 24) |
\\r(u_int64_t) (((u_int64_t) (x) & (u_int64_t) 0x00ff000000000000ULL) >>
40) | \\r(u_int64_t) (((u_int64_t) (x) & (u_int64_t)
- 0xff00000000000000ULL) >> 56))) \r \r \r
- /*\r
- * Linux\r
- */ \r
-#if defined(linux) || defined(Linux) || defined(__linux__) || defined(__linux) || defined(__gnu_linux__)\r
-#include <endian.h>\r
-#include <unistd.h>\r
-#include <stdint.h>\r
- \r
-#ifndef __int8_t_defined\r
+ 0xff00000000000000ULL) >> 56))) \r \r
+ /*
+ * Linux
+ */
+#if defined(linux) || defined(Linux) || defined(__linux__) || defined(__linux) || defined(__gnu_linux__)
+#include <endian.h>
+#include <unistd.h>
+#include <stdint.h>
+
+#ifndef __int8_t_defined
typedef uint64_t u_int64_t;
\rtypedef uint32_t u_int32_t;
\rtypedef uint16_t u_int16_t;
\rtypedef uint8_t u_int8_t;
-\r
-#endif /* \r */
- \r
-#ifndef htole16\r
-#if __BYTE_ORDER == __LITTLE_ENDIAN\r
-#define htobe16(x) ___my_swab16 (x)\r
-#define htole16(x) (x)\r
-#define be16toh(x) ___my_swab16 (x)\r
-#define le16toh(x) (x)\r
- \r
-#define htobe32(x) ___my_swab32 (x)\r
-#define htole32(x) (x)\r
-#define be32toh(x) ___my_swab32 (x)\r
-#define le32toh(x) (x)\r
- \r
-#define htobe64(x) ___my_swab64 (x)\r
-#define htole64(x) (x)\r
-#define be64toh(x) ___my_swab64 (x)\r
-#define le64toh(x) (x)\r
+
+#endif /* \r */
+
+#ifndef htole16
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define htobe16(x) ___my_swab16 (x)
+#define htole16(x) (x)
+#define be16toh(x) ___my_swab16 (x)
+#define le16toh(x) (x)
+
+#define htobe32(x) ___my_swab32 (x)
+#define htole32(x) (x)
+#define be32toh(x) ___my_swab32 (x)
+#define le32toh(x) (x)
+
+#define htobe64(x) ___my_swab64 (x)
+#define htole64(x) (x)
+#define be64toh(x) ___my_swab64 (x)
+#define le64toh(x) (x)
#else /* \r */
-#define htobe16(x) (x)\r
-#define htole16(x) ___my_swab16 (x)\r
-#define be16toh(x) (x)\r
-#define le16toh(x) ___my_swab16 (x)\r
- \r
-#define htobe32(x) (x)\r
-#define htole32(x) ___my_swab32 (x)\r
-#define be32toh(x) (x)\r
-#define le32toh(x) ___my_swab32 (x)\r
- \r
-#define htobe64(x) (x)\r
-#define htole64(x) ___my_swab64 (x)\r
-#define be64toh(x) (x)\r
-#define le64toh(x) ___my_swab64 (x)\r
-#endif /* \r */
-#endif /* \r */
- \r \r \r
-#endif /* \r */
- \r
- /*\r
- * Cygwin\r
- */ \r
-#if defined(__CYGWIN32__)\r
-#include <asm/byteorder.h>\r
-#include <unistd.h>\r
- \r
-#define __be64_to_cpu(x) ___my_swab64(x)\r
-#define __be32_to_cpu(x) ___my_swab32(x)\r
-#define __be16_to_cpu(x) ___my_swab16(x)\r
-#define __cpu_to_be64(x) ___my_swab64(x)\r
-#define __cpu_to_be32(x) ___my_swab32(x)\r
-#define __cpu_to_be16(x) ___my_swab16(x)\r
-#define __le64_to_cpu(x) (x)\r
-#define __le32_to_cpu(x) (x)\r
-#define __le16_to_cpu(x) (x)\r
-#define __cpu_to_le64(x) (x)\r
-#define __cpu_to_le32(x) (x)\r
-#define __cpu_to_le16(x) (x)\r
- \r
-#define AIRCRACK_NG_BYTE_ORDER_DEFINED\r
- \r
-#endif /* \r */
- \r
- /*\r
- * Windows (DDK)\r
- */ \r
-#if defined(__WIN__)\r
- \r
-#include <io.h>\r
- \r
-#define __be64_to_cpu(x) ___my_swab64(x)\r
-#define __be32_to_cpu(x) ___my_swab32(x)\r
-#define __be16_to_cpu(x) ___my_swab16(x)\r
-#define __cpu_to_be64(x) ___my_swab64(x)\r
-#define __cpu_to_be32(x) ___my_swab32(x)\r
-#define __cpu_to_be16(x) ___my_swab16(x)\r
-#define __le64_to_cpu(x) (x)\r
-#define __le32_to_cpu(x) (x)\r
-#define __le16_to_cpu(x) (x)\r
-#define __cpu_to_le64(x) (x)\r
-#define __cpu_to_le32(x) (x)\r
-#define __cpu_to_le16(x) (x)\r
- \r
-#define AIRCRACK_NG_BYTE_ORDER_DEFINED\r
- \r
-#endif /* \r */
- \r
- /*\r
- * MAC (Darwin)\r
- */ \r
-#if defined(__APPLE_CC__)\r
-#if defined(__x86_64__) && defined(__APPLE__)\r
- \r
-#include <libkern/OSByteOrder.h>\r
- \r
-#define __swab64(x) (unsigned long long) OSSwapInt64((uint64_t)x)\r
-#define __swab32(x) (unsigned long) OSSwapInt32((uint32_t)x)\r
-#define __swab16(x) (unsigned short) OSSwapInt16((uint16_t)x)\r
-#define __be64_to_cpu(x) (unsigned long long) OSSwapBigToHostInt64((uint64_t)x)\r
-#define __be32_to_cpu(x) (unsigned long) OSSwapBigToHostInt32((uint32_t)x)\r
-#define __be16_to_cpu(x) (unsigned short) OSSwapBigToHostInt16((uint16_t)x)\r
-#define __le64_to_cpu(x) (unsigned long long) OSSwapLittleToHostInt64((uint64_t)x)\r
-#define __le32_to_cpu(x) (unsigned long) OSSwapLittleToHostInt32((uint32_t)x)\r
-#define __le16_to_cpu(x) (unsigned short) OSSwapLittleToHostInt16((uint16_t)x)\r
-#define __cpu_to_be64(x) (unsigned long long) OSSwapHostToBigInt64((uint64_t)x)\r
-#define __cpu_to_be32(x) (unsigned long) OSSwapHostToBigInt32((uint32_t)x)\r
-#define __cpu_to_be16(x) (unsigned short) OSSwapHostToBigInt16((uint16_t)x)\r
-#define __cpu_to_le64(x) (unsigned long long) OSSwapHostToLittleInt64((uint64_t)x)\r
-#define __cpu_to_le32(x) (unsigned long) OSSwapHostToLittleInt32((uint32_t)x)\r
-#define __cpu_to_le16(x) (unsigned short) OSSwapHostToLittleInt16((uint16_t)x)\r
- \r
+#define htobe16(x) (x)
+#define htole16(x) ___my_swab16 (x)
+#define be16toh(x) (x)
+#define le16toh(x) ___my_swab16 (x)
+
+#define htobe32(x) (x)
+#define htole32(x) ___my_swab32 (x)
+#define be32toh(x) (x)
+#define le32toh(x) ___my_swab32 (x)
+
+#define htobe64(x) (x)
+#define htole64(x) ___my_swab64 (x)
+#define be64toh(x) (x)
+#define le64toh(x) ___my_swab64 (x)
+#endif /* \r */
+#endif /* \r */
+ \r \r
+#endif /* \r */
+
+ /*
+ * Cygwin
+ */
+#if defined(__CYGWIN32__)
+#include <asm/byteorder.h>
+#include <unistd.h>
+
+#define __be64_to_cpu(x) ___my_swab64(x)
+#define __be32_to_cpu(x) ___my_swab32(x)
+#define __be16_to_cpu(x) ___my_swab16(x)
+#define __cpu_to_be64(x) ___my_swab64(x)
+#define __cpu_to_be32(x) ___my_swab32(x)
+#define __cpu_to_be16(x) ___my_swab16(x)
+#define __le64_to_cpu(x) (x)
+#define __le32_to_cpu(x) (x)
+#define __le16_to_cpu(x) (x)
+#define __cpu_to_le64(x) (x)
+#define __cpu_to_le32(x) (x)
+#define __cpu_to_le16(x) (x)
+
+#define AIRCRACK_NG_BYTE_ORDER_DEFINED
+
+#endif /* \r */
+
+ /*
+ * Windows (DDK)
+ */
+#if defined(__WIN__)
+
+#include <io.h>
+
+#define __be64_to_cpu(x) ___my_swab64(x)
+#define __be32_to_cpu(x) ___my_swab32(x)
+#define __be16_to_cpu(x) ___my_swab16(x)
+#define __cpu_to_be64(x) ___my_swab64(x)
+#define __cpu_to_be32(x) ___my_swab32(x)
+#define __cpu_to_be16(x) ___my_swab16(x)
+#define __le64_to_cpu(x) (x)
+#define __le32_to_cpu(x) (x)
+#define __le16_to_cpu(x) (x)
+#define __cpu_to_le64(x) (x)
+#define __cpu_to_le32(x) (x)
+#define __cpu_to_le16(x) (x)
+
+#define AIRCRACK_NG_BYTE_ORDER_DEFINED
+
+#endif /* \r */
+
+ /*
+ * MAC (Darwin)
+ */
+#if defined(__APPLE_CC__)
+#if defined(__x86_64__) && defined(__APPLE__)
+
+#include <libkern/OSByteOrder.h>
+
+#define __swab64(x) (unsigned long long) OSSwapInt64((uint64_t)x)
+#define __swab32(x) (unsigned long) OSSwapInt32((uint32_t)x)
+#define __swab16(x) (unsigned short) OSSwapInt16((uint16_t)x)
+#define __be64_to_cpu(x) (unsigned long long) OSSwapBigToHostInt64((uint64_t)x)
+#define __be32_to_cpu(x) (unsigned long) OSSwapBigToHostInt32((uint32_t)x)
+#define __be16_to_cpu(x) (unsigned short) OSSwapBigToHostInt16((uint16_t)x)
+#define __le64_to_cpu(x) (unsigned long long) OSSwapLittleToHostInt64((uint64_t)x)
+#define __le32_to_cpu(x) (unsigned long) OSSwapLittleToHostInt32((uint32_t)x)
+#define __le16_to_cpu(x) (unsigned short) OSSwapLittleToHostInt16((uint16_t)x)
+#define __cpu_to_be64(x) (unsigned long long) OSSwapHostToBigInt64((uint64_t)x)
+#define __cpu_to_be32(x) (unsigned long) OSSwapHostToBigInt32((uint32_t)x)
+#define __cpu_to_be16(x) (unsigned short) OSSwapHostToBigInt16((uint16_t)x)
+#define __cpu_to_le64(x) (unsigned long long) OSSwapHostToLittleInt64((uint64_t)x)
+#define __cpu_to_le32(x) (unsigned long) OSSwapHostToLittleInt32((uint32_t)x)
+#define __cpu_to_le16(x) (unsigned short) OSSwapHostToLittleInt16((uint16_t)x)
+
#else /* \r */
- \r
-#include <architecture/byte_order.h>\r
- \r
-#define __swab64(x) NXSwapLongLong(x)\r
-#define __swab32(x) NXSwapLong(x)\r
-#define __swab16(x) NXSwapShort(x)\r
-#define __be64_to_cpu(x) NXSwapBigLongLongToHost(x)\r
-#define __be32_to_cpu(x) NXSwapBigLongToHost(x)\r
-#define __be16_to_cpu(x) NXSwapBigShortToHost(x)\r
-#define __le64_to_cpu(x) NXSwapLittleLongLongToHost(x)\r
-#define __le32_to_cpu(x) NXSwapLittleLongToHost(x)\r
-#define __le16_to_cpu(x) NXSwapLittleShortToHost(x)\r
-#define __cpu_to_be64(x) NXSwapHostLongLongToBig(x)\r
-#define __cpu_to_be32(x) NXSwapHostLongToBig(x)\r
-#define __cpu_to_be16(x) NXSwapHostShortToBig(x)\r
-#define __cpu_to_le64(x) NXSwapHostLongLongToLittle(x)\r
-#define __cpu_to_le32(x) NXSwapHostLongToLittle(x)\r
-#define __cpu_to_le16(x) NXSwapHostShortToLittle(x)\r
- \r
-#endif /* \r */
- \r
-#define __LITTLE_ENDIAN 1234\r
-#define __BIG_ENDIAN 4321\r
-#define __PDP_ENDIAN 3412\r
-#define __BYTE_ORDER __BIG_ENDIAN\r
- \r
-#define AIRCRACK_NG_BYTE_ORDER_DEFINED\r
- \r
-#endif /* \r */
- \r
- /*\r
- * Solaris\r
- * -------\r
- */ \r
-#if defined(__sparc__) && defined(__sun__)\r
-#include <sys/byteorder.h>\r
-#include <sys/types.h>\r
-#include <unistd.h>\r
- \r
-#define __be64_to_cpu(x) (x)\r
-#define __be32_to_cpu(x) (x)\r
-#define __be16_to_cpu(x) (x)\r
-#define __cpu_to_be64(x) (x)\r
-#define __cpu_to_be32(x) (x)\r
-#define __cpu_to_be16(x) (x)\r
-#define __le64_to_cpu(x) ___my_swab64(x)\r
-#define __le32_to_cpu(x) ___my_swab32(x)\r
-#define __le16_to_cpu(x) ___my_swab16(x)\r
-#define __cpu_to_le64(x) ___my_swab64(x)\r
-#define __cpu_to_le32(x) ___my_swab32(x)\r
-#define __cpu_to_le16(x) ___my_swab16(x)\r
+
+#include <architecture/byte_order.h>
+
+#define __swab64(x) NXSwapLongLong(x)
+#define __swab32(x) NXSwapLong(x)
+#define __swab16(x) NXSwapShort(x)
+#define __be64_to_cpu(x) NXSwapBigLongLongToHost(x)
+#define __be32_to_cpu(x) NXSwapBigLongToHost(x)
+#define __be16_to_cpu(x) NXSwapBigShortToHost(x)
+#define __le64_to_cpu(x) NXSwapLittleLongLongToHost(x)
+#define __le32_to_cpu(x) NXSwapLittleLongToHost(x)
+#define __le16_to_cpu(x) NXSwapLittleShortToHost(x)
+#define __cpu_to_be64(x) NXSwapHostLongLongToBig(x)
+#define __cpu_to_be32(x) NXSwapHostLongToBig(x)
+#define __cpu_to_be16(x) NXSwapHostShortToBig(x)
+#define __cpu_to_le64(x) NXSwapHostLongLongToLittle(x)
+#define __cpu_to_le32(x) NXSwapHostLongToLittle(x)
+#define __cpu_to_le16(x) NXSwapHostShortToLittle(x)
+
+#endif /* \r */
+
+#define __LITTLE_ENDIAN 1234
+#define __BIG_ENDIAN 4321
+#define __PDP_ENDIAN 3412
+#define __BYTE_ORDER __BIG_ENDIAN
+
+#define AIRCRACK_NG_BYTE_ORDER_DEFINED
+
+#endif /* \r */
+
+ /*
+ * Solaris
+ * -------
+ */
+#if defined(__sparc__) && defined(__sun__)
+#include <sys/byteorder.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#define __be64_to_cpu(x) (x)
+#define __be32_to_cpu(x) (x)
+#define __be16_to_cpu(x) (x)
+#define __cpu_to_be64(x) (x)
+#define __cpu_to_be32(x) (x)
+#define __cpu_to_be16(x) (x)
+#define __le64_to_cpu(x) ___my_swab64(x)
+#define __le32_to_cpu(x) ___my_swab32(x)
+#define __le16_to_cpu(x) ___my_swab16(x)
+#define __cpu_to_le64(x) ___my_swab64(x)
+#define __cpu_to_le32(x) ___my_swab32(x)
+#define __cpu_to_le16(x) ___my_swab16(x)
\rtypedef uint64_t u_int64_t;
\rtypedef uint32_t u_int32_t;
\rtypedef uint16_t u_int16_t;
\rtypedef uint8_t u_int8_t;
-\r \r
-#define AIRCRACK_NG_BYTE_ORDER_DEFINED\r
- \r
-#endif /* \r */
- \r
- /*\r
- * Custom stuff\r
- */ \r
-#if defined(__MACH__) && !defined(__APPLE_CC__)\r
-#include <libkern/OSByteOrder.h>\r
-#define __cpu_to_be64(x) = OSSwapHostToBigInt64(x)\r
-#define __cpu_to_be32(x) = OSSwapHostToBigInt32(x)\r
- \r
-#define AIRCRACK_NG_BYTE_ORDER_DEFINED\r
- \r
-#endif /* \r */
- \r \r
- // FreeBSD\r
-#ifdef __FreeBSD__\r
-#include <machine/endian.h>\r
-#endif /* \r */
- \r
- // XXX: Is there anything to include on OpenBSD/NetBSD/DragonFlyBSD/...?\r
- \r \r
- // XXX: Mac: Check http://www.opensource.apple.com/source/CF/CF-476.18/CFByteOrder.h\r
- // http://developer.apple.com/DOCUMENTATION/CoreFoundation/Reference/CFByteOrderUtils/Reference/reference.html\r
- // Write to apple to ask what should be used.\r
- \r
-#if defined(LITTLE_ENDIAN)\r
-#define AIRCRACK_NG_LITTLE_ENDIAN LITTLE_ENDIAN\r
-#elif defined(__LITTLE_ENDIAN)\r
-#define AIRCRACK_NG_LITTLE_ENDIAN __LITTLE_ENDIAN\r
-#elif defined(_LITTLE_ENDIAN)\r
-#define AIRCRACK_NG_LITTLE_ENDIAN _LITTLE_ENDIAN\r
-#endif /* \r */
- \r
-#if defined(BIG_ENDIAN)\r
-#define AIRCRACK_NG_BIG_ENDIAN BIG_ENDIAN\r
-#elif defined(__BIG_ENDIAN)\r
-#define AIRCRACK_NG_BIG_ENDIAN __BIG_ENDIAN\r
-#elif defined(_BIG_ENDIAN)\r
-#define AIRCRACK_NG_BIG_ENDIAN _BIG_ENDIAN\r
-#endif /* \r */
- \r
-#if !defined(AIRCRACK_NG_LITTLE_ENDIAN) && !defined(AIRCRACK_NG_BIG_ENDIAN)\r
-#error Impossible to determine endianness (Little or Big endian), please contact the author.\r
-#endif /* \r */
- \r
-#if defined(BYTE_ORDER)\r
-#if (BYTE_ORDER == AIRCRACK_NG_LITTLE_ENDIAN)\r
-#define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_LITTLE_ENDIAN\r
-#elif (BYTE_ORDER == AIRCRACK_NG_BIG_ENDIAN)\r
-#define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_BIG_ENDIAN\r
-#endif /* \r */
-#elif defined(__BYTE_ORDER)\r
-#if (__BYTE_ORDER == AIRCRACK_NG_LITTLE_ENDIAN)\r
-#define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_LITTLE_ENDIAN\r
-#elif (__BYTE_ORDER == AIRCRACK_NG_BIG_ENDIAN)\r
-#define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_BIG_ENDIAN\r
-#endif /* \r */
-#elif defined(_BYTE_ORDER)\r
-#if (_BYTE_ORDER == AIRCRACK_NG_LITTLE_ENDIAN)\r
-#define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_LITTLE_ENDIAN\r
-#elif (_BYTE_ORDER == AIRCRACK_NG_BIG_ENDIAN)\r
-#define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_BIG_ENDIAN\r
-#endif /* \r */
-#endif /* \r */
- \r
-#ifndef AIRCRACK_NG_BYTE_ORDER\r
-#error Impossible to determine endianness (Little or Big endian), please contact the author.\r
-#endif /* \r */
- \r
-#if (AIRCRACK_NG_BYTE_ORDER == AIRCRACK_NG_LITTLE_ENDIAN)\r
- \r
-#ifndef AIRCRACK_NG_BYTE_ORDER_DEFINED\r
-#define __be64_to_cpu(x) ___my_swab64(x)\r
-#define __be32_to_cpu(x) ___my_swab32(x)\r
-#define __be16_to_cpu(x) ___my_swab16(x)\r
-#define __cpu_to_be64(x) ___my_swab64(x)\r
-#define __cpu_to_be32(x) ___my_swab32(x)\r
-#define __cpu_to_be16(x) ___my_swab16(x)\r
-#define __le64_to_cpu(x) (x)\r
-#define __le32_to_cpu(x) (x)\r
-#define __le16_to_cpu(x) (x)\r
-#define __cpu_to_le64(x) (x)\r
-#define __cpu_to_le32(x) (x)\r
-#define __cpu_to_le16(x) (x)\r
-#endif /* \r */
- \r
-#ifndef htobe16\r
-#define htobe16 ___my_swab16\r
-#endif /* \r */
-#ifndef htobe32\r
-#define htobe32 ___my_swab32\r
-#endif /* \r */
-#ifndef betoh16\r
-#define betoh16 ___my_swab16\r
-#endif /* \r */
-#ifndef betoh32\r
-#define betoh32 ___my_swab32\r
-#endif /* \r */
- \r
-#ifndef htole16\r
-#define htole16(x) (x)\r
-#endif /* \r */
-#ifndef htole32\r
-#define htole32(x) (x)\r
-#endif /* \r */
-#ifndef letoh16\r
-#define letoh16(x) (x)\r
-#endif /* \r */
-#ifndef letoh32\r
-#define letoh32(x) (x)\r
-#endif /* \r */
- \r
-#endif /* \r */
- \r
-#if (AIRCRACK_NG_BYTE_ORDER == AIRCRACK_NG_BIG_ENDIAN)\r
- \r
-#ifndef AIRCRACK_NG_BYTE_ORDER_DEFINED\r
-#define __be64_to_cpu(x) (x)\r
-#define __be32_to_cpu(x) (x)\r
-#define __be16_to_cpu(x) (x)\r
-#define __cpu_to_be64(x) (x)\r
-#define __cpu_to_be32(x) (x)\r
-#define __cpu_to_be16(x) (x)\r
-#define __le64_to_cpu(x) ___my_swab64(x)\r
-#define __le32_to_cpu(x) ___my_swab32(x)\r
-#define __le16_to_cpu(x) ___my_swab16(x)\r
-#define __cpu_to_le64(x) ___my_swab64(x)\r
-#define __cpu_to_le32(x) ___my_swab32(x)\r
-#define __cpu_to_le16(x) ___my_swab16(x)\r
-#endif /* \r */
- \r
-#ifndef htobe16\r
-#define htobe16(x) (x)\r
-#endif /* \r */
-#ifndef htobe32\r
-#define htobe32(x) (x)\r
-#endif /* \r */
-#ifndef betoh16\r
-#define betoh16(x) (x)\r
-#endif /* \r */
-#ifndef betoh32\r
-#define betoh32(x) (x)\r
-#endif /* \r */
- \r
-#ifndef htole16\r
-#define htole16 ___my_swab16\r
-#endif /* \r */
-#ifndef htole32\r
-#define htole32 ___my_swab32\r
-#endif /* \r */
-#ifndef letoh16\r
-#define letoh16 ___my_swab16\r
-#endif /* \r */
-#ifndef letoh32\r
-#define letoh32 ___my_swab32\r
-#endif /* \r */
- \r
-#endif /* \r */
- \r
- // Common defines\r
-#define cpu_to_le64 __cpu_to_le64\r
-#define le64_to_cpu __le64_to_cpu\r
-#define cpu_to_le32 __cpu_to_le32\r
-#define le32_to_cpu __le32_to_cpu\r
-#define cpu_to_le16 __cpu_to_le16\r
-#define le16_to_cpu __le16_to_cpu\r
-#define cpu_to_be64 __cpu_to_be64\r
-#define be64_to_cpu __be64_to_cpu\r
-#define cpu_to_be32 __cpu_to_be32\r
-#define be32_to_cpu __be32_to_cpu\r
-#define cpu_to_be16 __cpu_to_be16\r
-#define be16_to_cpu __be16_to_cpu\r
- \r
-#ifndef le16toh\r
-#define le16toh le16_to_cpu\r
-#endif /* \r */
-#ifndef be16toh\r
-#define be16toh be16_to_cpu\r
-#endif /* \r */
-#ifndef le32toh\r
-#define le32toh le32_to_cpu\r
-#endif /* \r */
-#ifndef be32toh\r
-#define be32toh be32_to_cpu\r
+\r
+#define AIRCRACK_NG_BYTE_ORDER_DEFINED
+
+#endif /* \r */
+
+ /*
+ * Custom stuff
+ */
+#if defined(__MACH__) && !defined(__APPLE_CC__)
+#include <libkern/OSByteOrder.h>
+#define __cpu_to_be64(x) = OSSwapHostToBigInt64(x)
+#define __cpu_to_be32(x) = OSSwapHostToBigInt32(x)
+
+#define AIRCRACK_NG_BYTE_ORDER_DEFINED
+
+#endif /* \r */
+ \r
+ // FreeBSD
+#ifdef __FreeBSD__
+#include <machine/endian.h>
+#endif /* \r */
+
+ // XXX: Is there anything to include on OpenBSD/NetBSD/DragonFlyBSD/...?
+ \r
+ // XXX: Mac: Check http://www.opensource.apple.com/source/CF/CF-476.18/CFByteOrder.h
+ // http://developer.apple.com/DOCUMENTATION/CoreFoundation/Reference/CFByteOrderUtils/Reference/reference.html
+ // Write to apple to ask what should be used.
+
+#if defined(LITTLE_ENDIAN)
+#define AIRCRACK_NG_LITTLE_ENDIAN LITTLE_ENDIAN
+#elif defined(__LITTLE_ENDIAN)
+#define AIRCRACK_NG_LITTLE_ENDIAN __LITTLE_ENDIAN
+#elif defined(_LITTLE_ENDIAN)
+#define AIRCRACK_NG_LITTLE_ENDIAN _LITTLE_ENDIAN
+#endif /* \r */
+
+#if defined(BIG_ENDIAN)
+#define AIRCRACK_NG_BIG_ENDIAN BIG_ENDIAN
+#elif defined(__BIG_ENDIAN)
+#define AIRCRACK_NG_BIG_ENDIAN __BIG_ENDIAN
+#elif defined(_BIG_ENDIAN)
+#define AIRCRACK_NG_BIG_ENDIAN _BIG_ENDIAN
+#endif /* \r */
+
+#if !defined(AIRCRACK_NG_LITTLE_ENDIAN) && !defined(AIRCRACK_NG_BIG_ENDIAN)
+#error Impossible to determine endianness (Little or Big endian), please contact the author.
+#endif /* \r */
+
+#if defined(BYTE_ORDER)
+#if (BYTE_ORDER == AIRCRACK_NG_LITTLE_ENDIAN)
+#define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_LITTLE_ENDIAN
+#elif (BYTE_ORDER == AIRCRACK_NG_BIG_ENDIAN)
+#define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_BIG_ENDIAN
+#endif /* \r */
+#elif defined(__BYTE_ORDER)
+#if (__BYTE_ORDER == AIRCRACK_NG_LITTLE_ENDIAN)
+#define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_LITTLE_ENDIAN
+#elif (__BYTE_ORDER == AIRCRACK_NG_BIG_ENDIAN)
+#define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_BIG_ENDIAN
+#endif /* \r */
+#elif defined(_BYTE_ORDER)
+#if (_BYTE_ORDER == AIRCRACK_NG_LITTLE_ENDIAN)
+#define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_LITTLE_ENDIAN
+#elif (_BYTE_ORDER == AIRCRACK_NG_BIG_ENDIAN)
+#define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_BIG_ENDIAN
+#endif /* \r */
+#endif /* \r */
+
+#ifndef AIRCRACK_NG_BYTE_ORDER
+#error Impossible to determine endianness (Little or Big endian), please contact the author.
+#endif /* \r */
+
+#if (AIRCRACK_NG_BYTE_ORDER == AIRCRACK_NG_LITTLE_ENDIAN)
+
+#ifndef AIRCRACK_NG_BYTE_ORDER_DEFINED
+#define __be64_to_cpu(x) ___my_swab64(x)
+#define __be32_to_cpu(x) ___my_swab32(x)
+#define __be16_to_cpu(x) ___my_swab16(x)
+#define __cpu_to_be64(x) ___my_swab64(x)
+#define __cpu_to_be32(x) ___my_swab32(x)
+#define __cpu_to_be16(x) ___my_swab16(x)
+#define __le64_to_cpu(x) (x)
+#define __le32_to_cpu(x) (x)
+#define __le16_to_cpu(x) (x)
+#define __cpu_to_le64(x) (x)
+#define __cpu_to_le32(x) (x)
+#define __cpu_to_le16(x) (x)
+#endif /* \r */
+
+#ifndef htobe16
+#define htobe16 ___my_swab16
+#endif /* \r */
+#ifndef htobe32
+#define htobe32 ___my_swab32
+#endif /* \r */
+#ifndef betoh16
+#define betoh16 ___my_swab16
+#endif /* \r */
+#ifndef betoh32
+#define betoh32 ___my_swab32
+#endif /* \r */
+
+#ifndef htole16
+#define htole16(x) (x)
+#endif /* \r */
+#ifndef htole32
+#define htole32(x) (x)
+#endif /* \r */
+#ifndef letoh16
+#define letoh16(x) (x)
+#endif /* \r */
+#ifndef letoh32
+#define letoh32(x) (x)
+#endif /* \r */
+
+#endif /* \r */
+
+#if (AIRCRACK_NG_BYTE_ORDER == AIRCRACK_NG_BIG_ENDIAN)
+
+#ifndef AIRCRACK_NG_BYTE_ORDER_DEFINED
+#define __be64_to_cpu(x) (x)
+#define __be32_to_cpu(x) (x)
+#define __be16_to_cpu(x) (x)
+#define __cpu_to_be64(x) (x)
+#define __cpu_to_be32(x) (x)
+#define __cpu_to_be16(x) (x)
+#define __le64_to_cpu(x) ___my_swab64(x)
+#define __le32_to_cpu(x) ___my_swab32(x)
+#define __le16_to_cpu(x) ___my_swab16(x)
+#define __cpu_to_le64(x) ___my_swab64(x)
+#define __cpu_to_le32(x) ___my_swab32(x)
+#define __cpu_to_le16(x) ___my_swab16(x)
+#endif /* \r */
+
+#ifndef htobe16
+#define htobe16(x) (x)
+#endif /* \r */
+#ifndef htobe32
+#define htobe32(x) (x)
+#endif /* \r */
+#ifndef betoh16
+#define betoh16(x) (x)
+#endif /* \r */
+#ifndef betoh32
+#define betoh32(x) (x)
+#endif /* \r */
+
+#ifndef htole16
+#define htole16 ___my_swab16
+#endif /* \r */
+#ifndef htole32
+#define htole32 ___my_swab32
+#endif /* \r */
+#ifndef letoh16
+#define letoh16 ___my_swab16
+#endif /* \r */
+#ifndef letoh32
+#define letoh32 ___my_swab32
+#endif /* \r */
+
+#endif /* \r */
+
+ // Common defines
+#define cpu_to_le64 __cpu_to_le64
+#define le64_to_cpu __le64_to_cpu
+#define cpu_to_le32 __cpu_to_le32
+#define le32_to_cpu __le32_to_cpu
+#define cpu_to_le16 __cpu_to_le16
+#define le16_to_cpu __le16_to_cpu
+#define cpu_to_be64 __cpu_to_be64
+#define be64_to_cpu __be64_to_cpu
+#define cpu_to_be32 __cpu_to_be32
+#define be32_to_cpu __be32_to_cpu
+#define cpu_to_be16 __cpu_to_be16
+#define be16_to_cpu __be16_to_cpu
+
+#ifndef le16toh
+#define le16toh le16_to_cpu
+#endif /* \r */
+#ifndef be16toh
+#define be16toh be16_to_cpu
+#endif /* \r */
+#ifndef le32toh
+#define le32toh le32_to_cpu
+#endif /* \r */
+#ifndef be32toh
+#define be32toh be32_to_cpu
#endif /* \r */
- \r \r
-#ifndef htons\r
-#define htons be16_to_cpu\r
+ \r
+#ifndef htons
+#define htons be16_to_cpu
#endif /* \r */
-#ifndef htonl\r
-#define htonl cpu_to_be16\r
-#endif /* \r */
-#ifndef ntohs\r
-#define ntohs cpu_to_be16\r
-#endif /* \r */
-#ifndef ntohl\r
-#define ntohl cpu_to_be32\r
-#endif /* \r */
- \r
+#ifndef htonl
+#define htonl cpu_to_be16
+#endif /* \r */
+#ifndef ntohs
+#define ntohs cpu_to_be16
+#endif /* \r */
+#ifndef ntohl
+#define ntohl cpu_to_be32
+#endif /* \r */
+
#endif /* \r */
#ifndef HELPER_COMMON_H_
#define HELPER_COMMON_H_
-int getFrequencyFromChannel (int channel);
-int getChannelFromFrequency (int frequency);
-int send_mac_to_plugin (char *buffer, uint8_t * mac);
+int
+getFrequencyFromChannel (int channel);
+int
+getChannelFromFrequency (int frequency);
+int
+send_mac_to_plugin (char *buffer, uint8_t * mac);
#endif /* HELPER_COMMON_H_ */
//static void file_in_send(void *cls, void *client, const struct GNUNET_MessageHeader *hdr);
-int testmode (int argc, char *argv[]);
+int
+testmode (int argc, char *argv[]);
#endif /* LOOPBACK_HELPER_H_ */
*/
if ((((void *) iterator->arg) -
- ((void *) iterator->
- rtheader)) & ((rt_sizes[iterator->arg_index] >> 4) - 1))
+ ((void *) iterator->rtheader)) & ((rt_sizes[iterator->arg_index] >> 4)
+ - 1))
iterator->arg_index +=
(rt_sizes[iterator->arg_index] >> 4) -
((((void *) iterator->arg) -
- ((void *) iterator->
- rtheader)) & ((rt_sizes[iterator->arg_index] >> 4) - 1));
+ ((void *) iterator->rtheader)) & ((rt_sizes[iterator->arg_index] >>
+ 4) - 1));
/*
* this is what we will return to user, but we need to
u32 bitmap_shifter;
};
-int ieee80211_radiotap_iterator_init (struct ieee80211_radiotap_iterator
- *iterator,
- struct ieee80211_radiotap_header
- *radiotap_header, int max_length);
+int
+ieee80211_radiotap_iterator_init (struct ieee80211_radiotap_iterator *iterator,
+ struct ieee80211_radiotap_header
+ *radiotap_header, int max_length);
-int ieee80211_radiotap_iterator_next (struct ieee80211_radiotap_iterator
- *iterator);
+int
+ieee80211_radiotap_iterator_next (struct ieee80211_radiotap_iterator *iterator);
{
if ((conn->received_pos >= sizeof (struct GNUNET_MessageHeader)) &&
(conn->received_pos >=
- ntohs (((const struct GNUNET_MessageHeader *) conn->
- received_buf)->size)))
+ ntohs (((const struct GNUNET_MessageHeader *) conn->received_buf)->
+ size)))
conn->msg_complete = GNUNET_YES;
}
msg->type = htons (GNUNET_MESSAGE_TYPE_TEST);
msg->size = htons (sizeof (struct GNUNET_MessageHeader));
GNUNET_CLIENT_receive (conn, &confirm_handler, conn,
- GNUNET_TIME_absolute_get_remaining (conn->
- test_deadline));
+ GNUNET_TIME_absolute_get_remaining
+ (conn->test_deadline));
return sizeof (struct GNUNET_MessageHeader);
}
* @param buf where to write them
* @return number of bytes written to buf
*/
-static size_t client_notify (void *cls, size_t size, void *buf);
+static size_t
+client_notify (void *cls, size_t size, void *buf);
/**
* @param cls our connection handle
* @param tc task context describing why we are here
*/
-static void receive_again (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+receive_again (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
* @param cls our connection handle
* @param tc task context describing why we are here
*/
-static void transmit_ready (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+transmit_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
if (h->nth.notify_ready != NULL)
delay =
GNUNET_TIME_relative_min (delay,
- GNUNET_TIME_absolute_get_remaining (h->nth.
- transmit_timeout));
+ GNUNET_TIME_absolute_get_remaining (h->
+ nth.transmit_timeout));
if (h->receiver != NULL)
delay =
GNUNET_TIME_relative_min (delay,
- GNUNET_TIME_absolute_get_remaining (h->
- receive_timeout));
+ GNUNET_TIME_absolute_get_remaining
+ (h->receive_timeout));
ap->task =
GNUNET_SCHEDULER_add_write_net (delay, ap->sock,
&connect_probe_continuation, ap);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Receive from `%s' encounters error: time out by %llums... (%p)\n",
GNUNET_a2s (sh->addr, sh->addrlen),
- GNUNET_TIME_absolute_get_duration (sh->
- receive_timeout).rel_value,
- sh);
+ GNUNET_TIME_absolute_get_duration (sh->receive_timeout).
+ rel_value, sh);
#endif
signal_timeout (sh);
return;
GNUNET_assert (node->parent == NULL);
while ((heap->order == GNUNET_CONTAINER_HEAP_ORDER_MAX) ? (pos->cost >=
- node->
- cost) : (pos->
- cost <=
- node->
- cost))
+ node->cost)
+ : (pos->cost <= node->cost))
{
/* node is descendent of pos */
pos->tree_size += (1 + node->tree_size);
else
mime_type = &mdata[left];
GNUNET_CONTAINER_meta_data_insert (md, plugin_name,
- (enum EXTRACTOR_MetaType) ntohl (ent.
- type),
- format, mime_type, meta_data, dlen);
+ (enum EXTRACTOR_MetaType)
+ ntohl (ent.type), format, mime_type,
+ meta_data, dlen);
}
GNUNET_free_non_null (data);
return md;
size = GNUNET_CRYPTO_RSA_KEY_LENGTH - GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH;
GNUNET_assert (0 ==
gcry_mpi_print (GCRYMPI_FMT_USG,
- &pub->
- key[GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH],
- size, &size, skey[1]));
+ &pub->key
+ [GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH], size,
+ &size, skey[1]));
adjust (&pub->key[GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH], size,
GNUNET_CRYPTO_RSA_KEY_LENGTH -
GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH);
* @param dst_len length of dst
* @return GNUNET_OK on success, GNUNET_SYSERR otherwise
*/
-int GNUNET_DISK_internal_file_handle_ (const struct GNUNET_DISK_FileHandle *fh,
- void *dst, size_t dst_len);
+int
+GNUNET_DISK_internal_file_handle_ (const struct GNUNET_DISK_FileHandle *fh,
+ void *dst, size_t dst_len);
#endif /* GNUNET_DISK_H_ */
/* Avoid depending on library functions or files
whose names are inconsistent. */
-char *getenv ();
+char *
+getenv ();
static char *
my_index (str, chr)
#if !defined (__STDC__) || !__STDC__
/* gcc with -traditional declares the built-in strlen to return int,
and has done so at least since version 2.4.5. -- rms. */
-extern int strlen (const char *);
+extern int
+strlen (const char *);
#endif /* not __STDC__ */
#endif /* __GNUC__ */
the new indices of the non-options in ARGV after they are moved. */
#if defined (__STDC__) && __STDC__
-static void exchange (char **);
+static void
+exchange (char **);
#endif
static void
/* Initialize the internal data when the first call is made. */
#if defined (__STDC__) && __STDC__
-static const char *_getopt_initialize (int, char *const *, const char *);
+static const char *
+_getopt_initialize (int, char *const *, const char *);
#endif
static const char *
_getopt_initialize (argc, argv, optstring)
pTable->table[dwIfIdx].dwPhysAddrLen);
snprintf (szEntry, 1000, "%s (%s - %I64u)",
- pszIfName ? pszIfName : (char *) pTable->table[dwIfIdx].
- bDescr, inet_ntop (AF_INET, &dwIP, dst, INET_ADDRSTRLEN),
+ pszIfName ? pszIfName : (char *) pTable->
+ table[dwIfIdx].bDescr, inet_ntop (AF_INET, &dwIP, dst,
+ INET_ADDRSTRLEN),
*((unsigned long long *) bPhysAddr));
szEntry[1000] = 0;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' invoked because of %d\n",
__FUNCTION__, tc->reason);
#endif
- if (tc->
- reason & (GNUNET_SCHEDULER_REASON_SHUTDOWN |
- GNUNET_SCHEDULER_REASON_TIMEOUT |
- GNUNET_SCHEDULER_REASON_PREREQ_DONE))
+ if (tc->reason &
+ (GNUNET_SCHEDULER_REASON_SHUTDOWN | GNUNET_SCHEDULER_REASON_TIMEOUT |
+ GNUNET_SCHEDULER_REASON_PREREQ_DONE))
{
GNUNET_DISK_npipe_close (control_pipe);
}
{
GNUNET_break (GNUNET_OK ==
GNUNET_CONTAINER_multihashmap_remove (map,
- &table[id].id.
- hashPubKey,
+ &table[id].
+ id.hashPubKey,
(void *) (long) id));
table[id].pid = free_list_start;
free_list_start = id;
{
GNUNET_break (GNUNET_OK ==
GNUNET_CONTAINER_multihashmap_remove (map,
- &table[id].id.
- hashPubKey,
+ &table[id].
+ id.hashPubKey,
(void *) (long) id));
table[id].pid = free_list_start;
free_list_start = id;
start = GNUNET_TIME_absolute_get ();
perfHash ();
printf ("Hash perf took %llu ms\n",
- (unsigned long long) GNUNET_TIME_absolute_get_duration (start).
- rel_value);
+ (unsigned long long)
+ GNUNET_TIME_absolute_get_duration (start).rel_value);
GAUGER ("UTIL", "Cryptographic hashing",
1024 * 64 * 1024 / (1 +
- GNUNET_TIME_absolute_get_duration (start).
- rel_value), "kb/s");
+ GNUNET_TIME_absolute_get_duration
+ (start).rel_value), "kb/s");
return 0;
}
/**
* Adjust exponential back-off and reconnect to the service.
*/
-static void reconnect ();
+static void
+reconnect ();
/**
*
* @param h handle to the resolver
*/
-static void process_requests ();
+static void
+process_requests ();
/**
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Task %llu took %llums to be scheduled\n", pos->id,
- (unsigned long long) GNUNET_TIME_absolute_get_duration (pos->
- start_time).
- rel_value);
+ (unsigned long long)
+ GNUNET_TIME_absolute_get_duration
+ (pos->start_time).rel_value);
}
#endif
tc.reason = pos->reason;
_
("Processing code for message of type %u did not call GNUNET_SERVER_receive_done after %llums\n"),
(unsigned int) client->warn_type,
- (unsigned long long) GNUNET_TIME_absolute_get_duration (client->
- warn_start).
- rel_value);
+ (unsigned long long)
+ GNUNET_TIME_absolute_get_duration
+ (client->warn_start).rel_value);
}
* @param addrlen length of addr
* @param errCode code indicating errors receiving, 0 for success
*/
-static void process_incoming (void *cls, const void *buf, size_t available,
- const struct sockaddr *addr, socklen_t addrlen,
- int errCode);
+static void
+process_incoming (void *cls, const void *buf, size_t available,
+ const struct sockaddr *addr, socklen_t addrlen, int errCode);
/**
if (client->th == NULL)
client->th =
GNUNET_SERVER_notify_transmit_ready (client->client,
- ntohs (client->pending_head->msg->
- size),
+ ntohs (client->pending_head->
+ msg->size),
GNUNET_TIME_UNIT_FOREVER_REL,
&transmit_message, client);
}
}
}
printf ("%d RSA encrypt/decrypt operations %llums (%d failures)\n", ITER,
- (unsigned long long) GNUNET_TIME_absolute_get_duration (start).
- rel_value, ok);
+ (unsigned long long)
+ GNUNET_TIME_absolute_get_duration (start).rel_value, ok);
if (ok == 0)
return GNUNET_OK;
else
}
}
printf ("%d RSA sign/verify operations %llums\n", ITER,
- (unsigned long long) GNUNET_TIME_absolute_get_duration (start).
- rel_value);
+ (unsigned long long)
+ GNUNET_TIME_absolute_get_duration (start).rel_value);
return ok;
}
}
}
printf ("%d RSA encrypt/decrypt operations %llums (%d failures)\n", ITER,
- (unsigned long long) GNUNET_TIME_absolute_get_duration (start).
- rel_value, ok);
+ (unsigned long long)
+ GNUNET_TIME_absolute_get_duration (start).rel_value, ok);
GNUNET_CRYPTO_rsa_key_free (hostkey);
if (ok == 0)
return GNUNET_OK;
}
}
printf ("%d RSA encrypt operations %llu ms (%d failures)\n", ITER,
- (unsigned long long) GNUNET_TIME_absolute_get_duration (start).
- rel_value, ok);
+ (unsigned long long)
+ GNUNET_TIME_absolute_get_duration (start).rel_value, ok);
GNUNET_CRYPTO_rsa_key_free (hostkey);
if (ok != 0)
return GNUNET_SYSERR;
}
}
printf ("%d RSA encrypt/decrypt SK operations %llums (%d failures)\n", ITER,
- (unsigned long long) GNUNET_TIME_absolute_get_duration (start).
- rel_value, ok);
+ (unsigned long long)
+ GNUNET_TIME_absolute_get_duration (start).rel_value, ok);
GNUNET_CRYPTO_rsa_key_free (hostkey);
if (ok != 0)
return GNUNET_SYSERR;
}
}
printf ("%d RSA sign/verify operations %llums\n", ITER,
- (unsigned long long) GNUNET_TIME_absolute_get_duration (start).
- rel_value);
+ (unsigned long long)
+ GNUNET_TIME_absolute_get_duration (start).rel_value);
GNUNET_CRYPTO_rsa_key_free (hostkey);
return ok;
}
}
}
printf ("%d RSA sign operations %llu ms\n", ITER,
- (unsigned long long) GNUNET_TIME_absolute_get_duration (start).
- rel_value);
+ (unsigned long long)
+ GNUNET_TIME_absolute_get_duration (start).rel_value);
GNUNET_CRYPTO_rsa_key_free (hostkey);
return ok;
}
inet_ntop (addr->sa_family,
(addr->sa_family ==
- AF_INET) ? (void *) &((struct sockaddr_in *) addr)->
- sin_addr : (void *) &((struct sockaddr_in6 *) addr)->sin6_addr,
- buf, sizeof (buf));
+ AF_INET) ? (void *) &((struct sockaddr_in *) addr)->sin_addr
+ : (void *) &((struct sockaddr_in6 *) addr)->sin6_addr, buf,
+ sizeof (buf));
if ((0 == strcmp ("::1", buf)) || (0 == strcmp ("127.0.0.1", buf)))
*ok = 0;
return GNUNET_OK;
GNUNET_assert (GNUNET_TIME_absolute_get_difference (future, now).rel_value ==
0);
- GNUNET_assert (GNUNET_TIME_absolute_get_difference (zero, forever).
- rel_value == forever.abs_value);
+ GNUNET_assert (GNUNET_TIME_absolute_get_difference (zero, forever).rel_value
+ == forever.abs_value);
past.abs_value = now.abs_value - 1000000;
rel = GNUNET_TIME_absolute_get_duration (future);
GNUNET_assert (forever.abs_value ==
GNUNET_TIME_absolute_subtract (forever,
- GNUNET_TIME_UNIT_MINUTES).
- abs_value);
+ GNUNET_TIME_UNIT_MINUTES).abs_value);
/*check absolute subtract */
now.abs_value = 50000;
rel.rel_value = 100000;
* Callback called by notify_transmit_ready; sends dns-queries or rehijack-messages
* to the service-dns
*/
-size_t send_query (void *cls, size_t size, void *buf);
+size_t
+send_query (void *cls, size_t size, void *buf);
/**
* Connect to the service-dns
*/
-void connect_to_service_dns (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+void
+connect_to_service_dns (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
* This receives packets from the service-dns and schedules process_answer to
* handle it
*/
-void dns_answer_handler (void *cls, const struct GNUNET_MessageHeader *msg);
+void
+dns_answer_handler (void *cls, const struct GNUNET_MessageHeader *msg);
/**
* The connection to the service-dns
}
else if (0x06 == pkt->ip_hdr.proto &&
- (me->desc.
- service_type & htonl (GNUNET_DNS_SERVICE_TYPE_TCP)) &&
- (port_in_ports (me->desc.ports, pkt_tcp->tcp_hdr.dpt)))
+ (me->
+ desc.service_type & htonl (GNUNET_DNS_SERVICE_TYPE_TCP))
+ && (port_in_ports (me->desc.ports, pkt_tcp->tcp_hdr.dpt)))
{
hdr->type = ntohs (GNUNET_MESSAGE_TYPE_VPN_SERVICE_TCP);
/**
* Start the helper-process
*/
-void start_helper_and_schedule (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+void
+start_helper_and_schedule (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
* Restart the helper-process
*/
-void restart_helper (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tskctx);
+void
+restart_helper (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tskctx);
/**
* Read from the helper-process
*/
-void helper_read (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tsdkctx);
+void
+helper_read (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tsdkctx);
/**
* Send an dns-answer-packet to the helper
*/
-void helper_write (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tsdkctx);
+void
+helper_write (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tsdkctx);
/**
* Receive packets from the helper-process
*/
-void message_token (void *cls, void *client,
- const struct GNUNET_MessageHeader *message);
+void
+message_token (void *cls, void *client,
+ const struct GNUNET_MessageHeader *message);
-void write_to_helper (void *buf, size_t len);
+void
+write_to_helper (void *buf, size_t len);
-void schedule_helper_write (struct GNUNET_TIME_Relative, void *cls);
+void
+schedule_helper_write (struct GNUNET_TIME_Relative, void *cls);
#endif /* end of include guard: GNUNET-DAEMON-VPN-HELPER_H */
GNUNET_assert (me != NULL);
if (ntohs (message->type) == GNUNET_MESSAGE_TYPE_VPN_SERVICE_UDP_BACK)
{
- GNUNET_assert (me->
- desc.service_type & htonl (GNUNET_DNS_SERVICE_TYPE_UDP));
+ GNUNET_assert (me->desc.
+ service_type & htonl (GNUNET_DNS_SERVICE_TYPE_UDP));
if (!port_in_ports (me->desc.ports, pkt6->udp_hdr.spt) &&
!testBit (me->additional_ports, ntohs (pkt6->udp_hdr.spt)))
{
GNUNET_assert (me != NULL);
if (ntohs (message->type) == GNUNET_MESSAGE_TYPE_VPN_SERVICE_UDP_BACK)
- GNUNET_assert (me->
- desc.service_type & htonl (GNUNET_DNS_SERVICE_TYPE_TCP));
+ GNUNET_assert (me->desc.
+ service_type & htonl (GNUNET_DNS_SERVICE_TYPE_TCP));
pkt6->tcp_hdr.crc = 0;
uint32_t sum = 0;
* At the moment this means "inventing" and IPv6-Address for .gnunet-services and
* doing nothing for "real" services.
*/
-void process_answer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
+void
+process_answer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
-void send_icmp6_response (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
-void send_icmp4_response (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+void
+send_icmp6_response (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
+void
+send_icmp4_response (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
-size_t send_udp_service (void *cls, size_t size,
- void *buf);
+size_t
+send_udp_service (void *cls, size_t size, void *buf);
-GNUNET_HashCode *address6_mapping_exists (unsigned char addr[]);
-GNUNET_HashCode *address4_mapping_exists (uint32_t addr);
+GNUNET_HashCode *
+address6_mapping_exists (unsigned char addr[]);
+GNUNET_HashCode *
+address4_mapping_exists (uint32_t addr);
-unsigned int port_in_ports (uint64_t ports, uint16_t port);
+unsigned int
+port_in_ports (uint64_t ports, uint16_t port);
-void send_pkt_to_peer (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_TRANSPORT_ATS_Information *atsi);
+void
+send_pkt_to_peer (void *cls, const struct GNUNET_PeerIdentity *peer,
+ const struct GNUNET_TRANSPORT_ATS_Information *atsi);
/**
* The configuration to use
* @param bitArray memory area to set the bit in
* @param bitIdx which bit to set
*/
-void setBit (char *bitArray, unsigned int bitIdx);
+void
+setBit (char *bitArray, unsigned int bitIdx);
/**
* Clears a bit from bitArray.
* @param bitArray memory area to set the bit in
* @param bitIdx which bit to unset
*/
-void clearBit (char *bitArray, unsigned int bitIdx);
+void
+clearBit (char *bitArray, unsigned int bitIdx);
/**
* Checks if a bit is active in the bitArray
* @param bitIdx which bit to test
* @return GNUNET_YES if the bit is set, GNUNET_NO if not.
*/
-int testBit (char *bitArray, unsigned int bitIdx);
+int
+testBit (char *bitArray, unsigned int bitIdx);
struct remote_addr
{
#include "platform.h"
#include "gnunet-vpn-packet.h"
-struct dns_pkt_parsed *parse_dns_packet (struct dns_pkt *pkt);
+struct dns_pkt_parsed *
+parse_dns_packet (struct dns_pkt *pkt);
-void free_parsed_dns_packet (struct dns_pkt_parsed *ppkt);
+void
+free_parsed_dns_packet (struct dns_pkt_parsed *ppkt);
#endif
*
* @return A pointer to the new Handle, NULL on error
*/
-struct GNUNET_VPN_HELPER_Handle *start_helper (const char *ifname,
- const char *ipv6addr,
- const char *ipv6prefix,
- const char *ipv4addr,
- const char *ipv4mask,
- const char *process_name,
- GNUNET_SCHEDULER_Task
- restart_task,
- GNUNET_SERVER_MessageTokenizerCallback
- cb, void *cb_cls);
+struct GNUNET_VPN_HELPER_Handle *
+start_helper (const char *ifname, const char *ipv6addr, const char *ipv6prefix,
+ const char *ipv4addr, const char *ipv4mask,
+ const char *process_name, GNUNET_SCHEDULER_Task restart_task,
+ GNUNET_SERVER_MessageTokenizerCallback cb, void *cb_cls);
/**
* @brief Kills the helper, closes the pipe and free()s the handle
*/
-void cleanup_helper (struct GNUNET_VPN_HELPER_Handle *);
+void
+cleanup_helper (struct GNUNET_VPN_HELPER_Handle *);
#endif /* end of include guard: GNUNET_HELPER_VPN_API_H */
GNUNET_SERVER_receive_done (client, GNUNET_OK);
}
-static void read_response (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+read_response (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
static int
open_port ()
#include <platform.h>
-uint32_t calculate_checksum_update (uint32_t sum, uint16_t * hdr, short len);
+uint32_t
+calculate_checksum_update (uint32_t sum, uint16_t * hdr, short len);
-uint16_t calculate_checksum_end (uint32_t sum);
+uint16_t
+calculate_checksum_end (uint32_t sum);
/**
* Calculate the checksum of an IPv4-Header
*/
-uint16_t calculate_ip_checksum (uint16_t * hdr, short len);
+uint16_t
+calculate_ip_checksum (uint16_t * hdr, short len);
#endif /* end of include guard: GNUNET-VPN-CHECKSUM_H */