#include "platform.h"
#include "gnunet_hello_lib.h"
-#include "plugin_block.h"
+#include "gnunet_block_plugin.h"
#define DEBUG_DHT GNUNET_NO
* @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
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;
+ }
}
"block-dht",
_("Block not of type %u\n"),
GNUNET_BLOCK_TYPE_DHT_HELLO);
- return GNUNET_SYSERR;
+ return GNUNET_NO;
}
msg = block;
if (block_size != ntohs (msg->size))
"block-dht",
_("Size mismatch for block\n"),
GNUNET_BLOCK_TYPE_DHT_HELLO);
- return GNUNET_SYSERR;
+ return GNUNET_NO;
}
hello = block;
pid = (struct GNUNET_PeerIdentity*) key;
"block-dht",
_("Block of type %u is malformed\n"),
GNUNET_BLOCK_TYPE_DHT_HELLO);
- return GNUNET_SYSERR;
+ return GNUNET_NO;
}
return GNUNET_OK;
}
* 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[] =
{
* 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;