* FIXME this is called once per address. Merge instead of replacing?
*/
static void
-process_hello (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_HELLO_Message *hello, const char *err_msg)
+process_hello (void *cls,
+ const struct GNUNET_PeerIdentity *peer,
+ const struct GNUNET_HELLO_Message *hello,
+ const char *err_msg)
{
struct GNUNET_TIME_Absolute ex;
struct GNUNET_HELLO_Message *hm;
- if (hello == NULL)
+ if (NULL == hello)
return;
ex = GNUNET_HELLO_get_last_expiration (hello);
if (0 == GNUNET_TIME_absolute_get_remaining (ex).rel_value_us)
void
GDS_HELLO_init ()
{
- pnc = GNUNET_PEERINFO_notify (GDS_cfg, GNUNET_NO, &process_hello, NULL);
- peer_to_hello = GNUNET_CONTAINER_multipeermap_create (256, GNUNET_NO);
+ pnc = GNUNET_PEERINFO_notify (GDS_cfg,
+ GNUNET_NO,
+ &process_hello,
+ NULL);
+ peer_to_hello = GNUNET_CONTAINER_multipeermap_create (256,
+ GNUNET_NO);
}
}
if (NULL != peer_to_hello)
{
- GNUNET_CONTAINER_multipeermap_iterate (peer_to_hello, &free_hello, NULL);
+ GNUNET_CONTAINER_multipeermap_iterate (peer_to_hello,
+ &free_hello,
+ NULL);
GNUNET_CONTAINER_multipeermap_destroy (peer_to_hello);
}
}
* #GNUNET_SYSERR if the result is malformed or type unsupported
*/
static int
-process (void *cls, const struct GNUNET_HashCode * key, void *value)
+process (void *cls,
+ const struct GNUNET_HashCode *key,
+ void *value)
{
struct ProcessContext *pc = cls;
struct RecentRequest *rr = value;
struct GNUNET_HashCode hc;
const struct GNUNET_HashCode *eval_key;
- if ((rr->type != GNUNET_BLOCK_TYPE_ANY) && (rr->type != pc->type))
+ if ( (rr->type != GNUNET_BLOCK_TYPE_ANY) &&
+ (rr->type != pc->type) )
return GNUNET_OK; /* type missmatch */
if (0 != (rr->options & GNUNET_DHT_RO_RECORD_ROUTE))
* we fake it by changing the key to the actual PID ... */
GNUNET_BLOCK_get_key (GDS_block_context,
GNUNET_BLOCK_TYPE_DHT_HELLO,
- pc->data, pc->data_size,
+ pc->data,
+ pc->data_size,
&hc);
eval_key = &hc;
}
{
eval_key = key;
}
- eval =
- GNUNET_BLOCK_evaluate (GDS_block_context,
+ eval
+ = GNUNET_BLOCK_evaluate (GDS_block_context,
pc->type,
GNUNET_BLOCK_EO_NONE,
eval_key,
pc.data_size = 0;
pc.data = ""; /* something not null */
}
- GNUNET_CONTAINER_multihashmap_get_multiple (recent_map, key, &process, &pc);
+ GNUNET_CONTAINER_multihashmap_get_multiple (recent_map,
+ key,
+ &process,
+ &pc);
}
* @param cls the new 'struct RecentRequest' (to discard upon successful combination)
* @param key the query
* @param value the existing 'struct RecentRequest' (to update upon successful combination)
- * @return GNUNET_OK (continue to iterate),
- * GNUNET_SYSERR if the request was successfully combined
+ * @return #GNUNET_OK (continue to iterate),
+ * #GNUNET_SYSERR if the request was successfully combined
*/
static int
-try_combine_recent (void *cls, const struct GNUNET_HashCode * key, void *value)
+try_combine_recent (void *cls,
+ const struct GNUNET_HashCode *key,
+ void *value)
{
struct RecentRequest *in = cls;
struct RecentRequest *rr = value;
GDS_ROUTING_add (const struct GNUNET_PeerIdentity *sender,
enum GNUNET_BLOCK_Type type,
enum GNUNET_DHT_RouteOption options,
- const struct GNUNET_HashCode * key, const void *xquery,
+ const struct GNUNET_HashCode *key,
+ const void *xquery,
size_t xquery_size,
const struct GNUNET_CONTAINER_BloomFilter *reply_bf,
uint32_t reply_bf_mutator)
recent_req->xquery_size = xquery_size;
recent_req->reply_bf_mutator = reply_bf_mutator;
if (GNUNET_SYSERR ==
- GNUNET_CONTAINER_multihashmap_get_multiple (recent_map, key,
- &try_combine_recent, recent_req))
+ GNUNET_CONTAINER_multihashmap_get_multiple (recent_map,
+ key,
+ &try_combine_recent,
+ recent_req))
{
GNUNET_STATISTICS_update (GDS_stats,
gettext_noop