aboutsummaryrefslogtreecommitdiff
path: root/src/set/gnunet-service-set_intersection.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-11-24 13:57:17 +0000
committerChristian Grothoff <christian@grothoff.org>2014-11-24 13:57:17 +0000
commit82f034f771b4fd8e18c61487f4bd239e0e200408 (patch)
tree29d37b77fee94a49359a462bd5adbdb460733a69 /src/set/gnunet-service-set_intersection.c
parent3fb00702b5ebd54301d5827774fbebcd11d206c9 (diff)
downloadgnunet-82f034f771b4fd8e18c61487f4bd239e0e200408.tar.gz
gnunet-82f034f771b4fd8e18c61487f4bd239e0e200408.zip
fixing collect_generation_garbage() complexity, doxygen, etc.
Diffstat (limited to 'src/set/gnunet-service-set_intersection.c')
-rw-r--r--src/set/gnunet-service-set_intersection.c59
1 files changed, 32 insertions, 27 deletions
diff --git a/src/set/gnunet-service-set_intersection.c b/src/set/gnunet-service-set_intersection.c
index 27110077e..20fe8682b 100644
--- a/src/set/gnunet-service-set_intersection.c
+++ b/src/set/gnunet-service-set_intersection.c
@@ -17,7 +17,6 @@
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20
21/** 20/**
22 * @file set/gnunet-service-set_intersection.c 21 * @file set/gnunet-service-set_intersection.c
23 * @brief two-peer set intersection 22 * @brief two-peer set intersection
@@ -86,30 +85,24 @@ struct OperationState
86 struct GNUNET_CONTAINER_BloomFilter *local_bf; 85 struct GNUNET_CONTAINER_BloomFilter *local_bf;
87 86
88 /** 87 /**
89 * for multipart msgs we have to store the bloomfilter-data until we fully sent it. 88 * Iterator for sending elements on the key to element mapping to the client.
90 */
91 char * bf_data;
92
93 /**
94 * size of the bloomfilter
95 */ 89 */
96 uint32_t bf_data_size; 90 struct GNUNET_CONTAINER_MultiHashMapIterator *full_result_iter;
97 91
98 /** 92 /**
99 * size of the bloomfilter 93 * Evaluate operations are held in a linked list.
100 */ 94 */
101 uint32_t bf_bits_per_element; 95 struct OperationState *next;
102 96
103 /** 97 /**
104 * Current state of the operation. 98 * Evaluate operations are held in a linked list.
105 */ 99 */
106 enum IntersectionOperationPhase phase; 100 struct OperationState *prev;
107 101
108 /** 102 /**
109 * Generation in which the operation handle 103 * for multipart msgs we have to store the bloomfilter-data until we fully sent it.
110 * was created.
111 */ 104 */
112 unsigned int generation_created; 105 char *bf_data;
113 106
114 /** 107 /**
115 * Maps element-id-hashes to 'elements in our set'. 108 * Maps element-id-hashes to 'elements in our set'.
@@ -117,26 +110,30 @@ struct OperationState
117 struct GNUNET_CONTAINER_MultiHashMap *my_elements; 110 struct GNUNET_CONTAINER_MultiHashMap *my_elements;
118 111
119 /** 112 /**
120 * Current element count contained within contained_elements 113 * Current element count contained within @e my_elements
121 */ 114 */
122 uint32_t my_element_count; 115 uint32_t my_element_count;
123 116
124 /** 117 /**
125 * Iterator for sending elements on the key to element mapping to the client. 118 * size of the bloomfilter in @e bf_data.
126 */ 119 */
127 struct GNUNET_CONTAINER_MultiHashMapIterator *full_result_iter; 120 uint32_t bf_data_size;
128 121
129 /** 122 /**
130 * Evaluate operations are held in 123 * size of the bloomfilter
131 * a linked list.
132 */ 124 */
133 struct OperationState *next; 125 uint32_t bf_bits_per_element;
134 126
135 /** 127 /**
136 * Evaluate operations are held in 128 * Current state of the operation.
137 * a linked list. 129 */
138 */ 130 enum IntersectionOperationPhase phase;
139 struct OperationState *prev; 131
132 /**
133 * Generation in which the operation handle
134 * was created.
135 */
136 unsigned int generation_created;
140 137
141 /** 138 /**
142 * Did we send the client that we are done? 139 * Did we send the client that we are done?
@@ -237,6 +234,7 @@ iterator_initialization_by_alice (void *cls,
237 return GNUNET_YES; 234 return GNUNET_YES;
238} 235}
239 236
237
240/** 238/**
241 * fills the contained-elements hashmap with all relevant 239 * fills the contained-elements hashmap with all relevant
242 * elements and adds their mutated hashes to our local bloomfilter 240 * elements and adds their mutated hashes to our local bloomfilter
@@ -1093,9 +1091,16 @@ intersection_op_cancel (struct Operation *op)
1093 }*/ 1091 }*/
1094 GNUNET_free (op->state); 1092 GNUNET_free (op->state);
1095 op->state = NULL; 1093 op->state = NULL;
1096 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "destroying intersection op done\n"); 1094 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1095 "destroying intersection op done\n");
1097} 1096}
1098 1097
1098
1099/**
1100 * Get the table with implementing functions for set intersection.
1101 *
1102 * @return the operation specific VTable
1103 */
1099const struct SetVT * 1104const struct SetVT *
1100_GSS_intersection_vt () 1105_GSS_intersection_vt ()
1101{ 1106{