diff options
Diffstat (limited to 'src/set/gnunet-service-set.h')
-rw-r--r-- | src/set/gnunet-service-set.h | 95 |
1 files changed, 13 insertions, 82 deletions
diff --git a/src/set/gnunet-service-set.h b/src/set/gnunet-service-set.h index 685fc47a4..2d0d6595d 100644 --- a/src/set/gnunet-service-set.h +++ b/src/set/gnunet-service-set.h | |||
@@ -86,83 +86,7 @@ struct Set | |||
86 | union { | 86 | union { |
87 | struct IntersectionState *i; | 87 | struct IntersectionState *i; |
88 | struct UnionState *u; | 88 | struct UnionState *u; |
89 | } extra; | 89 | } state; |
90 | }; | ||
91 | |||
92 | |||
93 | /** | ||
94 | * State for an evaluate operation for a set that | ||
95 | * supports set union. | ||
96 | */ | ||
97 | struct UnionEvaluateOperation; | ||
98 | |||
99 | |||
100 | /* FIXME: cfuchs */ | ||
101 | struct IntersectionEvaluateOperation | ||
102 | { | ||
103 | /* FIXME: cfuchs */ | ||
104 | }; | ||
105 | |||
106 | |||
107 | /** | ||
108 | * State of evaluation a set operation with | ||
109 | * another peer | ||
110 | */ | ||
111 | struct EvaluateOperation | ||
112 | { | ||
113 | /** | ||
114 | * Local set the operation is evaluated on | ||
115 | */ | ||
116 | struct Set *set; | ||
117 | |||
118 | /** | ||
119 | * Peer with the remote set | ||
120 | */ | ||
121 | struct GNUNET_PeerIdentity peer; | ||
122 | |||
123 | /** | ||
124 | * Application-specific identifier | ||
125 | */ | ||
126 | struct GNUNET_HashCode app_id; | ||
127 | |||
128 | /** | ||
129 | * Context message, given to us | ||
130 | * by the client, may be NULL. | ||
131 | */ | ||
132 | struct GNUNET_MessageHeader *context_msg; | ||
133 | |||
134 | /** | ||
135 | * Stream socket connected to the other peer | ||
136 | */ | ||
137 | struct GNUNET_STREAM_Socket *socket; | ||
138 | |||
139 | /** | ||
140 | * Message queue for the peer on the other | ||
141 | * end | ||
142 | */ | ||
143 | struct GNUNET_MQ_MessageQueue *mq; | ||
144 | |||
145 | /** | ||
146 | * Type of this operation | ||
147 | */ | ||
148 | enum GNUNET_SET_OperationType operation; | ||
149 | |||
150 | /** | ||
151 | * GNUNET_YES if we started the operation, | ||
152 | * GNUNET_NO if the other peer started it. | ||
153 | */ | ||
154 | int is_outgoing; | ||
155 | |||
156 | /** | ||
157 | * Request id, so we can use one client handle | ||
158 | * for multiple operations | ||
159 | */ | ||
160 | uint32_t request_id; | ||
161 | |||
162 | union { | ||
163 | struct UnionEvaluateOperation *u; | ||
164 | struct IntersectionEvaluateOperation *i; | ||
165 | } extra; | ||
166 | }; | 90 | }; |
167 | 91 | ||
168 | 92 | ||
@@ -246,6 +170,12 @@ struct Incoming | |||
246 | struct GNUNET_MessageHeader *context_msg; | 170 | struct GNUNET_MessageHeader *context_msg; |
247 | 171 | ||
248 | /** | 172 | /** |
173 | * Salt the peer has requested to use for the | ||
174 | * operation | ||
175 | */ | ||
176 | uint16_t salt; | ||
177 | |||
178 | /** | ||
249 | * Operation the other peer wants to do | 179 | * Operation the other peer wants to do |
250 | */ | 180 | */ |
251 | enum GNUNET_SET_OperationType operation; | 181 | enum GNUNET_SET_OperationType operation; |
@@ -271,23 +201,24 @@ extern const struct GNUNET_CONFIGURATION_Handle *configuration; | |||
271 | * @param client the client to disconnect | 201 | * @param client the client to disconnect |
272 | */ | 202 | */ |
273 | void | 203 | void |
274 | client_disconnect (struct GNUNET_SERVER_Client *client); | 204 | _GSS_client_disconnect (struct GNUNET_SERVER_Client *client); |
275 | 205 | ||
276 | 206 | ||
277 | struct Set * | 207 | struct Set * |
278 | union_set_create (void); | 208 | _GSS_union_set_create (void); |
279 | 209 | ||
280 | 210 | ||
281 | void | 211 | void |
282 | union_evaluate (struct EvaluateOperation *eo); | 212 | _GSS_union_evaluate (struct EvaluateMessage *m, struct Set *set); |
283 | 213 | ||
284 | 214 | ||
285 | void | 215 | void |
286 | union_add (struct Set *set, struct ElementMessage *m); | 216 | _GSS_union_add (struct ElementMessage *m, struct Set *set); |
287 | 217 | ||
288 | 218 | ||
289 | void | 219 | void |
290 | union_accept (struct EvaluateOperation *eo, struct Incoming *incoming); | 220 | _GSS_union_accept (struct AcceptMessage *m, struct Set *set, |
221 | struct Incoming *incoming); | ||
291 | 222 | ||
292 | 223 | ||
293 | #endif | 224 | #endif |