mis-named functions (this means that SOMEONE doesn't have exhaustive testcases)
[oweals/gnunet.git] / src / block / plugin_block_dht.c
index 8312a69b53d789cdf4c60807ca1ca6b217541316..56f99a7650128f898454df9761c20f0fce213aac 100644 (file)
@@ -42,7 +42,7 @@
  * @param query original query (hash)
  * @param bf pointer to bloom filter associated with query; possibly updated (!)
  * @param bf_mutator mutation value for bf
- * @param xquery extrended query data (can be NULL, depending on type)
+ * @param xquery extended query data (can be NULL, depending on type)
  * @param xquery_size number of bytes in xquery
  * @param reply_block response to validate
  * @param reply_block_size number of bytes in reply block
@@ -59,14 +59,18 @@ block_plugin_dht_evaluate (void *cls,
                           const void *reply_block,
                           size_t reply_block_size)
 {
-  if (type != GNUNET_BLOCK_TYPE_DHT_HELLO)  
+  switch (type)
+  {
+  case GNUNET_BLOCK_TYPE_DHT_HELLO:
+    if (xquery_size != 0)
+      return GNUNET_BLOCK_EVALUATION_REQUEST_INVALID;
+    if (reply_block_size == 0)
+      return GNUNET_BLOCK_EVALUATION_REQUEST_VALID;
+    GNUNET_break (NULL == *bf);
+      return GNUNET_BLOCK_EVALUATION_OK_LAST;
+  default:
     return GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED;
-  if (xquery_size != 0)
-    return GNUNET_BLOCK_EVALUATION_REQUEST_INVALID;
-  if (reply_block_size == 0)
-    return GNUNET_BLOCK_EVALUATION_REQUEST_VALID;
-  GNUNET_break (NULL == *bf);
-  return GNUNET_BLOCK_EVALUATION_OK_LAST;
+  }
 }
 
 
@@ -131,7 +135,7 @@ block_plugin_dht_get_key (void *cls,
  * Entry point for the plugin.
  */
 void *
-gnunet_plugin_block_dht_init (void *cls)
+libgnunet_plugin_block_dht_init (void *cls)
 {
   static enum GNUNET_BLOCK_Type types[] = 
     {
@@ -152,7 +156,7 @@ gnunet_plugin_block_dht_init (void *cls)
  * Exit point from the plugin.
  */
 void *
-gnunet_plugin_block_dht_done (void *cls)
+libgnunet_plugin_block_dht_done (void *cls)
 {
   struct GNUNET_TRANSPORT_PluginFunctions *api = cls;