diff options
author | t3sserakt <t3ss@posteo.de> | 2020-09-08 13:33:25 +0200 |
---|---|---|
committer | t3sserakt <t3ss@posteo.de> | 2020-09-08 13:33:25 +0200 |
commit | 9e012a7a5c3991d224018b2d390b09d8e32c57ae (patch) | |
tree | d0dafee8f74b2ee71b61782642e96dad76edbf99 /src/transport/transport-testing2.h | |
parent | 2c797708b38729effe82328484d67a2be02412ed (diff) | |
download | gnunet-9e012a7a5c3991d224018b2d390b09d8e32c57ae.tar.gz gnunet-9e012a7a5c3991d224018b2d390b09d8e32c57ae.zip |
- fixed socket clean up; added sync between start of service and communicator
Diffstat (limited to 'src/transport/transport-testing2.h')
-rw-r--r-- | src/transport/transport-testing2.h | 144 |
1 files changed, 137 insertions, 7 deletions
diff --git a/src/transport/transport-testing2.h b/src/transport/transport-testing2.h index b77125e82..04f75fc88 100644 --- a/src/transport/transport-testing2.h +++ b/src/transport/transport-testing2.h | |||
@@ -29,13 +29,6 @@ | |||
29 | #include "gnunet_ats_transport_service.h" | 29 | #include "gnunet_ats_transport_service.h" |
30 | #include "transport.h" | 30 | #include "transport.h" |
31 | 31 | ||
32 | |||
33 | /** | ||
34 | * @brief Handle to a transport communicator | ||
35 | */ | ||
36 | struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle; | ||
37 | |||
38 | |||
39 | /** | 32 | /** |
40 | * @brief Queue of a communicator and some context | 33 | * @brief Queue of a communicator and some context |
41 | */ | 34 | */ |
@@ -151,6 +144,143 @@ typedef void | |||
151 | const char*payload, | 144 | const char*payload, |
152 | size_t payload_len); | 145 | size_t payload_len); |
153 | 146 | ||
147 | /** | ||
148 | * @brief Handle to a transport communicator | ||
149 | */ | ||
150 | struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle | ||
151 | { | ||
152 | /** | ||
153 | * Clients | ||
154 | */ | ||
155 | struct MyClient *client_head; | ||
156 | struct MyClient *client_tail; | ||
157 | |||
158 | /** | ||
159 | * @brief Handle to the client | ||
160 | */ | ||
161 | struct GNUNET_MQ_Handle *c_mq; | ||
162 | |||
163 | /** | ||
164 | * @brief Handle to the configuration | ||
165 | */ | ||
166 | struct GNUNET_CONFIGURATION_Handle *cfg; | ||
167 | |||
168 | /** | ||
169 | * @brief File name of configuration file | ||
170 | */ | ||
171 | char *cfg_filename; | ||
172 | |||
173 | struct GNUNET_PeerIdentity peer_id; | ||
174 | |||
175 | /** | ||
176 | * @brief Handle to the transport service | ||
177 | */ | ||
178 | struct GNUNET_SERVICE_Handle *tsh; | ||
179 | |||
180 | /** | ||
181 | * @brief Task that will be run on shutdown to stop and clean transport | ||
182 | * service | ||
183 | */ | ||
184 | struct GNUNET_SCHEDULER_Task *ts_shutdown_task; | ||
185 | |||
186 | |||
187 | /** | ||
188 | * @brief Process of the communicator | ||
189 | */ | ||
190 | struct GNUNET_OS_Process *c_proc; | ||
191 | |||
192 | /** | ||
193 | * NAT process | ||
194 | */ | ||
195 | struct GNUNET_OS_Process *nat_proc; | ||
196 | |||
197 | /** | ||
198 | * resolver service process | ||
199 | */ | ||
200 | struct GNUNET_OS_Process *resolver_proc; | ||
201 | |||
202 | /** | ||
203 | * peerstore service process | ||
204 | */ | ||
205 | struct GNUNET_OS_Process *ps_proc; | ||
206 | |||
207 | /** | ||
208 | * @brief Task that will be run on shutdown to stop and clean communicator | ||
209 | */ | ||
210 | struct GNUNET_SCHEDULER_Task *c_shutdown_task; | ||
211 | |||
212 | /** | ||
213 | * @brief Characteristics of the communicator | ||
214 | */ | ||
215 | enum GNUNET_TRANSPORT_CommunicatorCharacteristics c_characteristics; | ||
216 | |||
217 | /** | ||
218 | * @brief Specifies supported addresses | ||
219 | */ | ||
220 | char *c_addr_prefix; | ||
221 | |||
222 | /** | ||
223 | * @brief Specifies supported addresses | ||
224 | */ | ||
225 | char *c_address; | ||
226 | |||
227 | /** | ||
228 | * @brief Head of the DLL of queues associated with this communicator | ||
229 | */ | ||
230 | struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue *queue_head; | ||
231 | |||
232 | /** | ||
233 | * @brief Tail of the DLL of queues associated with this communicator | ||
234 | */ | ||
235 | struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue *queue_tail; | ||
236 | |||
237 | /* Callbacks + Closures */ | ||
238 | /** | ||
239 | * @brief Callback called when a new communicator connects | ||
240 | */ | ||
241 | GNUNET_TRANSPORT_TESTING_CommunicatorAvailableCallback | ||
242 | communicator_available_cb; | ||
243 | |||
244 | /** | ||
245 | * @brief Callback called when a new communicator connects | ||
246 | */ | ||
247 | GNUNET_TRANSPORT_TESTING_AddAddressCallback add_address_cb; | ||
248 | |||
249 | /** | ||
250 | * @brief Callback called when a new communicator connects | ||
251 | */ | ||
252 | GNUNET_TRANSPORT_TESTING_QueueCreateReplyCallback queue_create_reply_cb; | ||
253 | |||
254 | /** | ||
255 | * @brief Callback called when a new communicator connects | ||
256 | */ | ||
257 | GNUNET_TRANSPORT_TESTING_AddQueueCallback add_queue_cb; | ||
258 | |||
259 | /** | ||
260 | * @brief Callback called when a new communicator connects | ||
261 | */ | ||
262 | GNUNET_TRANSPORT_TESTING_IncomingMessageCallback incoming_msg_cb; | ||
263 | |||
264 | /** | ||
265 | * @brief Backchannel callback | ||
266 | */ | ||
267 | GNUNET_TRANSPORT_TESTING_BackchannelCallback bc_cb; | ||
268 | |||
269 | /** | ||
270 | * Our service handle | ||
271 | */ | ||
272 | struct GNUNET_SERVICE_Handle *sh; | ||
273 | |||
274 | /** | ||
275 | * @brief Closure to the callback | ||
276 | */ | ||
277 | void *cb_cls; | ||
278 | |||
279 | /** | ||
280 | * Backchannel supported | ||
281 | */ | ||
282 | int bc_enabled; | ||
283 | }; | ||
154 | 284 | ||
155 | /** | 285 | /** |
156 | * @brief Start communicator part of transport service and communicator | 286 | * @brief Start communicator part of transport service and communicator |