diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-11-28 20:52:20 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-11-28 20:52:20 +0000 |
commit | f4c9c6514494547973b8962f22fce8266afd4992 (patch) | |
tree | 2211f91a0e80f143cb066ca365c6ddcbb02759cf /src/set/gnunet-service-set_protocol.h | |
parent | 264c9b7f668d0429eaae01075c742ae6ad6f49ee (diff) | |
download | gnunet-f4c9c6514494547973b8962f22fce8266afd4992.tar.gz gnunet-f4c9c6514494547973b8962f22fce8266afd4992.zip |
-fixing misc issues and bugs, including better termination logic for intersection and salt handling
Diffstat (limited to 'src/set/gnunet-service-set_protocol.h')
-rw-r--r-- | src/set/gnunet-service-set_protocol.h | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/src/set/gnunet-service-set_protocol.h b/src/set/gnunet-service-set_protocol.h index f21259804..1f14c06b0 100644 --- a/src/set/gnunet-service-set_protocol.h +++ b/src/set/gnunet-service-set_protocol.h | |||
@@ -17,9 +17,9 @@ | |||
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 | * @author Florian Dold | 21 | * @author Florian Dold |
22 | * @author Christian Grothoff | ||
23 | * @file set/gnunet-service-set_protocol.h | 23 | * @file set/gnunet-service-set_protocol.h |
24 | * @brief Peer-to-Peer messages for gnunet set | 24 | * @brief Peer-to-Peer messages for gnunet set |
25 | */ | 25 | */ |
@@ -45,11 +45,6 @@ struct OperationRequestMessage | |||
45 | uint32_t operation GNUNET_PACKED; | 45 | uint32_t operation GNUNET_PACKED; |
46 | 46 | ||
47 | /** | 47 | /** |
48 | * Salt to use for this operation. | ||
49 | */ | ||
50 | uint32_t salt GNUNET_PACKED; | ||
51 | |||
52 | /** | ||
53 | * For Intersection: my element count | 48 | * For Intersection: my element count |
54 | */ | 49 | */ |
55 | uint32_t element_count GNUNET_PACKED; | 50 | uint32_t element_count GNUNET_PACKED; |
@@ -126,27 +121,28 @@ struct BFMessage | |||
126 | struct GNUNET_MessageHeader header; | 121 | struct GNUNET_MessageHeader header; |
127 | 122 | ||
128 | /** | 123 | /** |
129 | * mutator used with this bloomfilter. | 124 | * Number of elements the sender still has in the set. |
130 | */ | 125 | */ |
131 | uint32_t sender_element_count GNUNET_PACKED; | 126 | uint32_t sender_element_count GNUNET_PACKED; |
132 | 127 | ||
133 | /** | 128 | /** |
134 | * mutator used with this bloomfilter. | 129 | * XOR of all hashes over all elements remaining in the set. |
130 | * Used to determine termination. | ||
135 | */ | 131 | */ |
136 | uint32_t sender_mutator GNUNET_PACKED; | 132 | struct GNUNET_HashCode element_xor_hash; |
137 | 133 | ||
138 | /** | 134 | /** |
139 | * Length of the bloomfilter data | 135 | * Mutator used with this bloomfilter. |
140 | */ | 136 | */ |
141 | uint32_t bloomfilter_total_length GNUNET_PACKED; | 137 | uint32_t sender_mutator GNUNET_PACKED; |
142 | 138 | ||
143 | /** | 139 | /** |
144 | * Length of the appended bloomfilter data block | 140 | * Total length of the bloomfilter data. |
145 | */ | 141 | */ |
146 | uint32_t bloomfilter_length GNUNET_PACKED; | 142 | uint32_t bloomfilter_total_length GNUNET_PACKED; |
147 | 143 | ||
148 | /** | 144 | /** |
149 | * Length of the bloomfilter data | 145 | * Number of bits (k-value) used in encoding the bloomfilter. |
150 | */ | 146 | */ |
151 | uint32_t bits_per_element GNUNET_PACKED; | 147 | uint32_t bits_per_element GNUNET_PACKED; |
152 | 148 | ||
@@ -156,26 +152,28 @@ struct BFMessage | |||
156 | }; | 152 | }; |
157 | 153 | ||
158 | 154 | ||
159 | struct BFPart | 155 | /** |
156 | * Last message, send to confirm the final set. Contains the element | ||
157 | * count as it is possible that the peer determined that we were done | ||
158 | * by getting the empty set, which in that case also needs to be | ||
159 | * communicated. | ||
160 | */ | ||
161 | struct IntersectionDoneMessage | ||
160 | { | 162 | { |
161 | /** | 163 | /** |
162 | * Type: #GNUNET_MESSAGE_TYPE_SET_INTERSECTION_P2P_BF | 164 | * Type: #GNUNET_MESSAGE_TYPE_SET_INTERSECTION_P2P_DONE |
163 | */ | 165 | */ |
164 | struct GNUNET_MessageHeader header; | 166 | struct GNUNET_MessageHeader header; |
165 | 167 | ||
166 | /** | 168 | /** |
167 | * Length of the appended bloomfilter data block | 169 | * Final number of elements in intersection. |
168 | */ | 170 | */ |
169 | uint32_t chunk_length GNUNET_PACKED; | 171 | uint32_t final_element_count GNUNET_PACKED; |
170 | 172 | ||
171 | /** | 173 | /** |
172 | * offset in the bloolfilter data block, if multipart message | 174 | * XOR of all hashes over all elements remaining in the set. |
173 | */ | ||
174 | uint32_t chunk_offset GNUNET_PACKED; | ||
175 | |||
176 | /** | ||
177 | * rest: the sender's bloomfilter | ||
178 | */ | 175 | */ |
176 | struct GNUNET_HashCode element_xor_hash; | ||
179 | }; | 177 | }; |
180 | 178 | ||
181 | GNUNET_NETWORK_STRUCT_END | 179 | GNUNET_NETWORK_STRUCT_END |