diff options
Diffstat (limited to 'src/include/gnunet_block_plugin.h')
-rw-r--r-- | src/include/gnunet_block_plugin.h | 53 |
1 files changed, 22 insertions, 31 deletions
diff --git a/src/include/gnunet_block_plugin.h b/src/include/gnunet_block_plugin.h index ac549fec7..aadfdb5a4 100644 --- a/src/include/gnunet_block_plugin.h +++ b/src/include/gnunet_block_plugin.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | (C) 2010 Christian Grothoff (and other contributing authors) | 3 | (C) 2010,2013 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -23,18 +23,19 @@ | |||
23 | * @brief API for block plugins. Each block plugin must conform to | 23 | * @brief API for block plugins. Each block plugin must conform to |
24 | * the API specified by this header. | 24 | * the API specified by this header. |
25 | * @author Christian Grothoff | 25 | * @author Christian Grothoff |
26 | * @defgroup block API to be implemented by applications storing data in the DHT | ||
27 | * @{ | ||
26 | */ | 28 | */ |
27 | #ifndef PLUGIN_BLOCK_H | 29 | #ifndef PLUGIN_BLOCK_H |
28 | #define PLUGIN_BLOCK_H | 30 | #define PLUGIN_BLOCK_H |
29 | 31 | ||
30 | #include "gnunet_util_lib.h" | 32 | #include "gnunet_util_lib.h" |
31 | #include "gnunet_container_lib.h" | ||
32 | #include "gnunet_block_lib.h" | 33 | #include "gnunet_block_lib.h" |
33 | 34 | ||
34 | 35 | ||
35 | /** | 36 | /** |
36 | * Function called to validate a reply or a request. For | 37 | * Function called to validate a reply or a request. For |
37 | * request evaluation, simply pass "NULL" for the reply_block. | 38 | * request evaluation, simply pass "NULL" for the @a reply_block. |
38 | * Note that it is assumed that the reply has already been | 39 | * Note that it is assumed that the reply has already been |
39 | * matched to the key (and signatures checked) as it would | 40 | * matched to the key (and signatures checked) as it would |
40 | * be done with the "get_key" function. | 41 | * be done with the "get_key" function. |
@@ -43,34 +44,23 @@ | |||
43 | * @param type block type | 44 | * @param type block type |
44 | * @param query original query (hash) | 45 | * @param query original query (hash) |
45 | * @param bf pointer to bloom filter associated with query; possibly updated (!) | 46 | * @param bf pointer to bloom filter associated with query; possibly updated (!) |
46 | * @param bf_mutator mutation value for bf | 47 | * @param bf_mutator mutation value for @a bf |
47 | * @param xquery extrended query data (can be NULL, depending on type) | 48 | * @param xquery extrended query data (can be NULL, depending on type) |
48 | * @param xquery_size number of bytes in xquery | 49 | * @param xquery_size number of bytes in @a xquery |
49 | * @param reply_block response to validate | 50 | * @param reply_block response to validate |
50 | * @param reply_block_size number of bytes in reply block | 51 | * @param reply_block_size number of bytes in @a reply_block |
51 | * @return characterization of result | 52 | * @return characterization of result |
52 | */ | 53 | */ |
53 | typedef enum | 54 | typedef enum GNUNET_BLOCK_EvaluationResult |
54 | GNUNET_BLOCK_EvaluationResult (*GNUNET_BLOCK_EvaluationFunction) (void *cls, | 55 | (*GNUNET_BLOCK_EvaluationFunction) (void *cls, |
55 | enum | 56 | enum GNUNET_BLOCK_Type type, |
56 | GNUNET_BLOCK_Type | 57 | const struct GNUNET_HashCode *query, |
57 | type, | 58 | struct GNUNET_CONTAINER_BloomFilter **bf, |
58 | const | 59 | int32_t bf_mutator, |
59 | struct GNUNET_HashCode | 60 | const void *xquery, |
60 | * query, | 61 | size_t xquery_size, |
61 | struct | 62 | const void *reply_block, |
62 | GNUNET_CONTAINER_BloomFilter | 63 | size_t reply_block_size); |
63 | ** bf, | ||
64 | int32_t | ||
65 | bf_mutator, | ||
66 | const void | ||
67 | *xquery, | ||
68 | size_t | ||
69 | xquery_size, | ||
70 | const void | ||
71 | *reply_block, | ||
72 | size_t | ||
73 | reply_block_size); | ||
74 | 64 | ||
75 | 65 | ||
76 | /** | 66 | /** |
@@ -79,11 +69,11 @@ typedef enum | |||
79 | * @param cls closure | 69 | * @param cls closure |
80 | * @param type block type | 70 | * @param type block type |
81 | * @param block block to get the key for | 71 | * @param block block to get the key for |
82 | * @param block_size number of bytes in block | 72 | * @param block_size number of bytes in @a block |
83 | * @param key set to the key (query) for the given block | 73 | * @param key set to the key (query) for the given block |
84 | * @return GNUNET_YES on success, | 74 | * @return #GNUNET_YES on success, |
85 | * GNUNET_NO if the block is malformed | 75 | * #GNUNET_NO if the block is malformed |
86 | * GNUNET_SYSERR if type not supported | 76 | * #GNUNET_SYSERR if type not supported |
87 | * (or if extracting a key from a block of this type does not work) | 77 | * (or if extracting a key from a block of this type does not work) |
88 | */ | 78 | */ |
89 | typedef int (*GNUNET_BLOCK_GetKeyFunction) (void *cls, | 79 | typedef int (*GNUNET_BLOCK_GetKeyFunction) (void *cls, |
@@ -124,5 +114,6 @@ struct GNUNET_BLOCK_PluginFunctions | |||
124 | 114 | ||
125 | }; | 115 | }; |
126 | 116 | ||
117 | /** @} */ /* end of group block */ | ||
127 | 118 | ||
128 | #endif | 119 | #endif |