aboutsummaryrefslogtreecommitdiff
path: root/src/transport/transport-testing2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/transport-testing2.c')
-rw-r--r--src/transport/transport-testing2.c144
1 files changed, 5 insertions, 139 deletions
diff --git a/src/transport/transport-testing2.c b/src/transport/transport-testing2.c
index e194b0159..98cfd5e29 100644
--- a/src/transport/transport-testing2.c
+++ b/src/transport/transport-testing2.c
@@ -59,145 +59,6 @@ struct MyClient
59}; 59};
60 60
61/** 61/**
62 * @brief Handle to a transport communicator
63 */
64struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle
65{
66 /**
67 * Clients
68 */
69 struct MyClient *client_head;
70 struct MyClient *client_tail;
71
72 /**
73 * @brief Handle to the client
74 */
75 struct GNUNET_MQ_Handle *c_mq;
76
77 /**
78 * @brief Handle to the configuration
79 */
80 struct GNUNET_CONFIGURATION_Handle *cfg;
81
82 /**
83 * @brief File name of configuration file
84 */
85 char *cfg_filename;
86
87 struct GNUNET_PeerIdentity peer_id;
88
89 /**
90 * @brief Handle to the transport service
91 */
92 struct GNUNET_SERVICE_Handle *tsh;
93
94 /**
95 * @brief Task that will be run on shutdown to stop and clean transport
96 * service
97 */
98 struct GNUNET_SCHEDULER_Task *ts_shutdown_task;
99
100
101 /**
102 * @brief Process of the communicator
103 */
104 struct GNUNET_OS_Process *c_proc;
105
106 /**
107 * NAT process
108 */
109 struct GNUNET_OS_Process *nat_proc;
110
111 /**
112 * resolver service process
113 */
114 struct GNUNET_OS_Process *resolver_proc;
115
116 /**
117 * peerstore service process
118 */
119 struct GNUNET_OS_Process *ps_proc;
120
121 /**
122 * @brief Task that will be run on shutdown to stop and clean communicator
123 */
124 struct GNUNET_SCHEDULER_Task *c_shutdown_task;
125
126 /**
127 * @brief Characteristics of the communicator
128 */
129 enum GNUNET_TRANSPORT_CommunicatorCharacteristics c_characteristics;
130
131 /**
132 * @brief Specifies supported addresses
133 */
134 char *c_addr_prefix;
135
136 /**
137 * @brief Specifies supported addresses
138 */
139 char *c_address;
140
141 /**
142 * @brief Head of the DLL of queues associated with this communicator
143 */
144 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue *queue_head;
145
146 /**
147 * @brief Tail of the DLL of queues associated with this communicator
148 */
149 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue *queue_tail;
150
151 /* Callbacks + Closures */
152 /**
153 * @brief Callback called when a new communicator connects
154 */
155 GNUNET_TRANSPORT_TESTING_CommunicatorAvailableCallback
156 communicator_available_cb;
157
158 /**
159 * @brief Callback called when a new communicator connects
160 */
161 GNUNET_TRANSPORT_TESTING_AddAddressCallback add_address_cb;
162
163 /**
164 * @brief Callback called when a new communicator connects
165 */
166 GNUNET_TRANSPORT_TESTING_QueueCreateReplyCallback queue_create_reply_cb;
167
168 /**
169 * @brief Callback called when a new communicator connects
170 */
171 GNUNET_TRANSPORT_TESTING_AddQueueCallback add_queue_cb;
172
173 /**
174 * @brief Callback called when a new communicator connects
175 */
176 GNUNET_TRANSPORT_TESTING_IncomingMessageCallback incoming_msg_cb;
177
178 /**
179 * @brief Backchannel callback
180 */
181 GNUNET_TRANSPORT_TESTING_BackchannelCallback bc_cb;
182
183 /**
184 * Our service handle
185 */
186 struct GNUNET_SERVICE_Handle *sh;
187
188 /**
189 * @brief Closure to the callback
190 */
191 void *cb_cls;
192
193 /**
194 * Backchannel supported
195 */
196 int bc_enabled;
197};
198
199
200/**
201 * @brief Queue of a communicator and some context 62 * @brief Queue of a communicator and some context
202 */ 63 */
203struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue 64struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue
@@ -707,6 +568,9 @@ shutdown_service (void *cls)
707{ 568{
708 struct GNUNET_SERVICE_Handle *h = cls; 569 struct GNUNET_SERVICE_Handle *h = cls;
709 570
571 LOG (GNUNET_ERROR_TYPE_DEBUG,
572 "Shutting down service!\n");
573
710 GNUNET_SERVICE_stop (h); 574 GNUNET_SERVICE_stop (h);
711} 575}
712 576
@@ -1202,6 +1066,8 @@ GNUNET_TRANSPORT_TESTING_transport_communicator_open_queue (
1202 memcpy (&msg[1], address, alen); 1066 memcpy (&msg[1], address, alen);
1203 if (NULL != tc_h->c_mq) 1067 if (NULL != tc_h->c_mq)
1204 { 1068 {
1069 LOG (GNUNET_ERROR_TYPE_DEBUG,
1070 "Sending queue create immediately\n");
1205 GNUNET_MQ_send (tc_h->c_mq, env); 1071 GNUNET_MQ_send (tc_h->c_mq, env);
1206 } 1072 }
1207 else 1073 else