aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/block/block.c1
-rw-r--r--src/block/plugin_block_template.c2
-rw-r--r--src/block/plugin_block_test.c2
-rw-r--r--src/consensus/plugin_block_consensus.c21
-rw-r--r--src/dht/plugin_block_dht.c2
-rw-r--r--src/dns/plugin_block_dns.c2
-rw-r--r--src/fs/plugin_block_fs.c2
-rw-r--r--src/gns/plugin_block_gns.c2
-rw-r--r--src/include/gnunet_block_plugin.h2
-rw-r--r--src/regex/plugin_block_regex.c2
-rw-r--r--src/set/Makefile.am16
11 files changed, 51 insertions, 3 deletions
diff --git a/src/block/block.c b/src/block/block.c
index 23caacd38..d6e61acf6 100644
--- a/src/block/block.c
+++ b/src/block/block.c
@@ -351,6 +351,7 @@ GNUNET_BLOCK_evaluate (struct GNUNET_BLOCK_Context *ctx,
351 if (NULL == plugin) 351 if (NULL == plugin)
352 return GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED; 352 return GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED;
353 return plugin->evaluate (plugin->cls, 353 return plugin->evaluate (plugin->cls,
354 ctx,
354 type, 355 type,
355 group, 356 group,
356 eo, 357 eo,
diff --git a/src/block/plugin_block_template.c b/src/block/plugin_block_template.c
index b714b6858..2edca17ec 100644
--- a/src/block/plugin_block_template.c
+++ b/src/block/plugin_block_template.c
@@ -95,6 +95,7 @@ block_plugin_template_create_group (void *cls,
95 * request evaluation, simply pass "NULL" for the reply_block. 95 * request evaluation, simply pass "NULL" for the reply_block.
96 * 96 *
97 * @param cls closure 97 * @param cls closure
98 * @param ctx context
98 * @param type block type 99 * @param type block type
99 * @param group block group to use 100 * @param group block group to use
100 * @param eo control flags 101 * @param eo control flags
@@ -107,6 +108,7 @@ block_plugin_template_create_group (void *cls,
107 */ 108 */
108static enum GNUNET_BLOCK_EvaluationResult 109static enum GNUNET_BLOCK_EvaluationResult
109block_plugin_template_evaluate (void *cls, 110block_plugin_template_evaluate (void *cls,
111 struct GNUNET_BLOCK_Context *ctx,
110 enum GNUNET_BLOCK_Type type, 112 enum GNUNET_BLOCK_Type type,
111 struct GNUNET_BLOCK_Group *group, 113 struct GNUNET_BLOCK_Group *group,
112 enum GNUNET_BLOCK_EvaluationOptions eo, 114 enum GNUNET_BLOCK_EvaluationOptions eo,
diff --git a/src/block/plugin_block_test.c b/src/block/plugin_block_test.c
index b9f71cacb..e359acd7f 100644
--- a/src/block/plugin_block_test.c
+++ b/src/block/plugin_block_test.c
@@ -93,6 +93,7 @@ block_plugin_test_create_group (void *cls,
93 * request evaluation, simply pass "NULL" for the reply_block. 93 * request evaluation, simply pass "NULL" for the reply_block.
94 * 94 *
95 * @param cls closure 95 * @param cls closure
96 * @param ctx block context
96 * @param type block type 97 * @param type block type
97 * @param group group to check against 98 * @param group group to check against
98 * @param eo control flags 99 * @param eo control flags
@@ -105,6 +106,7 @@ block_plugin_test_create_group (void *cls,
105 */ 106 */
106static enum GNUNET_BLOCK_EvaluationResult 107static enum GNUNET_BLOCK_EvaluationResult
107block_plugin_test_evaluate (void *cls, 108block_plugin_test_evaluate (void *cls,
109 struct GNUNET_BLOCK_Context *ctx,
108 enum GNUNET_BLOCK_Type type, 110 enum GNUNET_BLOCK_Type type,
109 struct GNUNET_BLOCK_Group *group, 111 struct GNUNET_BLOCK_Group *group,
110 enum GNUNET_BLOCK_EvaluationOptions eo, 112 enum GNUNET_BLOCK_EvaluationOptions eo,
diff --git a/src/consensus/plugin_block_consensus.c b/src/consensus/plugin_block_consensus.c
index 39e348b18..3ad335760 100644
--- a/src/consensus/plugin_block_consensus.c
+++ b/src/consensus/plugin_block_consensus.c
@@ -35,6 +35,7 @@
35 * request evaluation, simply pass "NULL" for the reply_block. 35 * request evaluation, simply pass "NULL" for the reply_block.
36 * 36 *
37 * @param cls closure 37 * @param cls closure
38 * @param ctx context
38 * @param type block type 39 * @param type block type
39 * @param group block group to use 40 * @param group block group to use
40 * @param eo control flags 41 * @param eo control flags
@@ -47,6 +48,7 @@
47 */ 48 */
48static enum GNUNET_BLOCK_EvaluationResult 49static enum GNUNET_BLOCK_EvaluationResult
49block_plugin_consensus_evaluate (void *cls, 50block_plugin_consensus_evaluate (void *cls,
51 struct GNUNET_BLOCK_Context *ctx,
50 enum GNUNET_BLOCK_Type type, 52 enum GNUNET_BLOCK_Type type,
51 struct GNUNET_BLOCK_Group *group, 53 struct GNUNET_BLOCK_Group *group,
52 enum GNUNET_BLOCK_EvaluationOptions eo, 54 enum GNUNET_BLOCK_EvaluationOptions eo,
@@ -57,10 +59,23 @@ block_plugin_consensus_evaluate (void *cls,
57 size_t reply_block_size) 59 size_t reply_block_size)
58{ 60{
59 if (reply_block_size < sizeof (struct ConsensusElement)) 61 if (reply_block_size < sizeof (struct ConsensusElement))
60 {
61 return GNUNET_BLOCK_EVALUATION_RESULT_INVALID; 62 return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
62 } 63
63 return GNUNET_BLOCK_EVALUATION_OK_MORE; 64 const struct ConsensusElement *ce = reply_block;
65
66 if ( (GNUNET_YES == ce->is_contested_marker) ||
67 (0 == ce->payload_type ) )
68 return GNUNET_BLOCK_EVALUATION_OK_MORE;
69
70 return GNUNET_BLOCK_evaluate (ctx,
71 type,
72 group,
73 eo,
74 query,
75 xquery,
76 xquery_size,
77 &ce[1],
78 reply_block_size - sizeof (struct ConsensusElement));
64} 79}
65 80
66 81
diff --git a/src/dht/plugin_block_dht.c b/src/dht/plugin_block_dht.c
index 74498746c..96349ae9d 100644
--- a/src/dht/plugin_block_dht.c
+++ b/src/dht/plugin_block_dht.c
@@ -92,6 +92,7 @@ block_plugin_dht_create_group (void *cls,
92 * request evaluation, simply pass "NULL" for the @a reply_block. 92 * request evaluation, simply pass "NULL" for the @a reply_block.
93 * 93 *
94 * @param cls closure 94 * @param cls closure
95 * @param ctx context
95 * @param type block type 96 * @param type block type
96 * @param group block group to check against 97 * @param group block group to check against
97 * @param eo control flags 98 * @param eo control flags
@@ -104,6 +105,7 @@ block_plugin_dht_create_group (void *cls,
104 */ 105 */
105static enum GNUNET_BLOCK_EvaluationResult 106static enum GNUNET_BLOCK_EvaluationResult
106block_plugin_dht_evaluate (void *cls, 107block_plugin_dht_evaluate (void *cls,
108 struct GNUNET_BLOCK_Context *ctx,
107 enum GNUNET_BLOCK_Type type, 109 enum GNUNET_BLOCK_Type type,
108 struct GNUNET_BLOCK_Group *group, 110 struct GNUNET_BLOCK_Group *group,
109 enum GNUNET_BLOCK_EvaluationOptions eo, 111 enum GNUNET_BLOCK_EvaluationOptions eo,
diff --git a/src/dns/plugin_block_dns.c b/src/dns/plugin_block_dns.c
index fe416e450..ca6ea84c4 100644
--- a/src/dns/plugin_block_dns.c
+++ b/src/dns/plugin_block_dns.c
@@ -93,6 +93,7 @@ block_plugin_dns_create_group (void *cls,
93 * request evaluation, simply pass "NULL" for the reply_block. 93 * request evaluation, simply pass "NULL" for the reply_block.
94 * 94 *
95 * @param cls closure 95 * @param cls closure
96 * @param ctx block context
96 * @param type block type 97 * @param type block type
97 * @param bg group to evaluate against 98 * @param bg group to evaluate against
98 * @param eo control flags 99 * @param eo control flags
@@ -105,6 +106,7 @@ block_plugin_dns_create_group (void *cls,
105 */ 106 */
106static enum GNUNET_BLOCK_EvaluationResult 107static enum GNUNET_BLOCK_EvaluationResult
107block_plugin_dns_evaluate (void *cls, 108block_plugin_dns_evaluate (void *cls,
109 struct GNUNET_BLOCK_Context *ctx,
108 enum GNUNET_BLOCK_Type type, 110 enum GNUNET_BLOCK_Type type,
109 struct GNUNET_BLOCK_Group *bg, 111 struct GNUNET_BLOCK_Group *bg,
110 enum GNUNET_BLOCK_EvaluationOptions eo, 112 enum GNUNET_BLOCK_EvaluationOptions eo,
diff --git a/src/fs/plugin_block_fs.c b/src/fs/plugin_block_fs.c
index b6749b418..c5e63c9e2 100644
--- a/src/fs/plugin_block_fs.c
+++ b/src/fs/plugin_block_fs.c
@@ -109,6 +109,7 @@ block_plugin_fs_create_group (void *cls,
109 * be done with the #GNUNET_BLOCK_get_key() function. 109 * be done with the #GNUNET_BLOCK_get_key() function.
110 * 110 *
111 * @param cls closure 111 * @param cls closure
112 * @param ctx block context
112 * @param type block type 113 * @param type block type
113 * @param bg group to use for evaluation 114 * @param bg group to use for evaluation
114 * @param eo control flags 115 * @param eo control flags
@@ -121,6 +122,7 @@ block_plugin_fs_create_group (void *cls,
121 */ 122 */
122static enum GNUNET_BLOCK_EvaluationResult 123static enum GNUNET_BLOCK_EvaluationResult
123block_plugin_fs_evaluate (void *cls, 124block_plugin_fs_evaluate (void *cls,
125 struct GNUNET_BLOCK_Context *ctx,
124 enum GNUNET_BLOCK_Type type, 126 enum GNUNET_BLOCK_Type type,
125 struct GNUNET_BLOCK_Group *bg, 127 struct GNUNET_BLOCK_Group *bg,
126 enum GNUNET_BLOCK_EvaluationOptions eo, 128 enum GNUNET_BLOCK_EvaluationOptions eo,
diff --git a/src/gns/plugin_block_gns.c b/src/gns/plugin_block_gns.c
index 2ef48f094..558ded6f4 100644
--- a/src/gns/plugin_block_gns.c
+++ b/src/gns/plugin_block_gns.c
@@ -98,6 +98,7 @@ block_plugin_gns_create_group (void *cls,
98 * be done with the "get_key" function. 98 * be done with the "get_key" function.
99 * 99 *
100 * @param cls closure 100 * @param cls closure
101 * @param ctx block context
101 * @param type block type 102 * @param type block type
102 * @param bg block group to use for evaluation 103 * @param bg block group to use for evaluation
103 * @param eo control flags 104 * @param eo control flags
@@ -110,6 +111,7 @@ block_plugin_gns_create_group (void *cls,
110 */ 111 */
111static enum GNUNET_BLOCK_EvaluationResult 112static enum GNUNET_BLOCK_EvaluationResult
112block_plugin_gns_evaluate (void *cls, 113block_plugin_gns_evaluate (void *cls,
114 struct GNUNET_BLOCK_Context *ctx,
113 enum GNUNET_BLOCK_Type type, 115 enum GNUNET_BLOCK_Type type,
114 struct GNUNET_BLOCK_Group *bg, 116 struct GNUNET_BLOCK_Group *bg,
115 enum GNUNET_BLOCK_EvaluationOptions eo, 117 enum GNUNET_BLOCK_EvaluationOptions eo,
diff --git a/src/include/gnunet_block_plugin.h b/src/include/gnunet_block_plugin.h
index 171b6cfc0..3eb031573 100644
--- a/src/include/gnunet_block_plugin.h
+++ b/src/include/gnunet_block_plugin.h
@@ -171,6 +171,7 @@ typedef struct GNUNET_BLOCK_Group *
171 * be done with the "get_key" function. 171 * be done with the "get_key" function.
172 * 172 *
173 * @param cls closure 173 * @param cls closure
174 * @param ctx block context
174 * @param type block type 175 * @param type block type
175 * @param group which block group to use for evaluation 176 * @param group which block group to use for evaluation
176 * @param eo evaluation options to control evaluation 177 * @param eo evaluation options to control evaluation
@@ -183,6 +184,7 @@ typedef struct GNUNET_BLOCK_Group *
183 */ 184 */
184typedef enum GNUNET_BLOCK_EvaluationResult 185typedef enum GNUNET_BLOCK_EvaluationResult
185(*GNUNET_BLOCK_EvaluationFunction) (void *cls, 186(*GNUNET_BLOCK_EvaluationFunction) (void *cls,
187 struct GNUNET_BLOCK_Context *ctx,
186 enum GNUNET_BLOCK_Type type, 188 enum GNUNET_BLOCK_Type type,
187 struct GNUNET_BLOCK_Group *group, 189 struct GNUNET_BLOCK_Group *group,
188 enum GNUNET_BLOCK_EvaluationOptions eo, 190 enum GNUNET_BLOCK_EvaluationOptions eo,
diff --git a/src/regex/plugin_block_regex.c b/src/regex/plugin_block_regex.c
index a345dfedb..0b3ef703e 100644
--- a/src/regex/plugin_block_regex.c
+++ b/src/regex/plugin_block_regex.c
@@ -269,6 +269,7 @@ evaluate_block_regex_accept (void *cls,
269 * be done with the #GNUNET_BLOCK_get_key() function. 269 * be done with the #GNUNET_BLOCK_get_key() function.
270 * 270 *
271 * @param cls closure 271 * @param cls closure
272 * @param ctx block context
272 * @param type block type 273 * @param type block type
273 * @param bg group to evaluate against 274 * @param bg group to evaluate against
274 * @param eo control flags 275 * @param eo control flags
@@ -281,6 +282,7 @@ evaluate_block_regex_accept (void *cls,
281 */ 282 */
282static enum GNUNET_BLOCK_EvaluationResult 283static enum GNUNET_BLOCK_EvaluationResult
283block_plugin_regex_evaluate (void *cls, 284block_plugin_regex_evaluate (void *cls,
285 struct GNUNET_BLOCK_Context *ctx,
284 enum GNUNET_BLOCK_Type type, 286 enum GNUNET_BLOCK_Type type,
285 struct GNUNET_BLOCK_Group *bg, 287 struct GNUNET_BLOCK_Group *bg,
286 enum GNUNET_BLOCK_EvaluationOptions eo, 288 enum GNUNET_BLOCK_EvaluationOptions eo,
diff --git a/src/set/Makefile.am b/src/set/Makefile.am
index 10f7ddc5d..cfe95bc1a 100644
--- a/src/set/Makefile.am
+++ b/src/set/Makefile.am
@@ -5,6 +5,8 @@ pkgcfgdir= $(pkgdatadir)/config.d/
5 5
6libexecdir= $(pkglibdir)/libexec/ 6libexecdir= $(pkglibdir)/libexec/
7 7
8plugindir = $(libdir)/gnunet
9
8pkgcfg_DATA = \ 10pkgcfg_DATA = \
9 set.conf 11 set.conf
10 12
@@ -112,5 +114,19 @@ test_set_union_copy_LDADD = \
112 $(top_builddir)/src/testing/libgnunettesting.la \ 114 $(top_builddir)/src/testing/libgnunettesting.la \
113 libgnunetset.la 115 libgnunetset.la
114 116
117plugin_LTLIBRARIES = \
118 libgnunet_plugin_block_set_test.la
119
120libgnunet_plugin_block_set_test_la_SOURCES = \
121 plugin_block_set_test.c
122libgnunet_plugin_block_set_test_la_LIBADD = \
123 $(top_builddir)/src/block/libgnunetblock.la \
124 $(top_builddir)/src/block/libgnunetblockgroup.la \
125 $(top_builddir)/src/util/libgnunetutil.la \
126 $(LTLIBINTL)
127libgnunet_plugin_block_set_test_la_LDFLAGS = \
128 $(GN_PLUGIN_LDFLAGS)
129
130
115EXTRA_DIST = \ 131EXTRA_DIST = \
116 test_set.conf 132 test_set.conf