diff options
Diffstat (limited to 'src/mesh/gnunet-service-mesh_tunnel.h')
-rw-r--r-- | src/mesh/gnunet-service-mesh_tunnel.h | 86 |
1 files changed, 85 insertions, 1 deletions
diff --git a/src/mesh/gnunet-service-mesh_tunnel.h b/src/mesh/gnunet-service-mesh_tunnel.h index 49e4ce4b2..242d2c318 100644 --- a/src/mesh/gnunet-service-mesh_tunnel.h +++ b/src/mesh/gnunet-service-mesh_tunnel.h | |||
@@ -153,7 +153,6 @@ GMT_change_state (struct MeshTunnel3* t, enum MeshTunnelState state); | |||
153 | void | 153 | void |
154 | GMT_add_connection (struct MeshTunnel3 *t, struct MeshConnection *c); | 154 | GMT_add_connection (struct MeshTunnel3 *t, struct MeshConnection *c); |
155 | 155 | ||
156 | |||
157 | /** | 156 | /** |
158 | * Remove a connection from a tunnel. | 157 | * Remove a connection from a tunnel. |
159 | * | 158 | * |
@@ -164,6 +163,36 @@ void | |||
164 | GMT_remove_connection (struct MeshTunnel3 *t, struct MeshConnection *c); | 163 | GMT_remove_connection (struct MeshTunnel3 *t, struct MeshConnection *c); |
165 | 164 | ||
166 | /** | 165 | /** |
166 | * Add a channel to a tunnel. | ||
167 | * | ||
168 | * @param t Tunnel. | ||
169 | * @param ch Channel. | ||
170 | */ | ||
171 | void | ||
172 | GMT_add_channel (struct MeshTunnel3 *t, struct MeshChannel *ch); | ||
173 | |||
174 | /** | ||
175 | * Remove a channel from a tunnel. | ||
176 | * | ||
177 | * @param t Tunnel. | ||
178 | * @param ch Channel. | ||
179 | */ | ||
180 | void | ||
181 | GMT_remove_channel (struct MeshTunnel3 *t, struct MeshChannel *ch); | ||
182 | |||
183 | /** | ||
184 | * Search for a channel by global ID. | ||
185 | * | ||
186 | * @param t Tunnel containing the channel. | ||
187 | * @param chid Public channel number. | ||
188 | * | ||
189 | * @return channel handler, NULL if doesn't exist | ||
190 | */ | ||
191 | struct MeshChannel * | ||
192 | GMT_get_channel (struct MeshTunnel3 *t, MESH_ChannelNumber chid); | ||
193 | |||
194 | |||
195 | /** | ||
167 | * Cache a message to be sent once tunnel is online. | 196 | * Cache a message to be sent once tunnel is online. |
168 | * | 197 | * |
169 | * @param t Tunnel to hold the message. | 198 | * @param t Tunnel to hold the message. |
@@ -227,6 +256,61 @@ GMT_get_state (struct MeshTunnel3 *t); | |||
227 | unsigned int | 256 | unsigned int |
228 | GMT_get_buffer (struct MeshTunnel3 *t, int fwd); | 257 | GMT_get_buffer (struct MeshTunnel3 *t, int fwd); |
229 | 258 | ||
259 | /** | ||
260 | * Get the tunnel's destination. | ||
261 | * | ||
262 | * @param t Tunnel. | ||
263 | * | ||
264 | * @return ID of the destination peer. | ||
265 | */ | ||
266 | const struct GNUNET_PeerIdentity * | ||
267 | GMT_get_destination (struct MeshTunnel3 *t); | ||
268 | |||
269 | /** | ||
270 | * Get the tunnel's next free Channel ID. | ||
271 | * | ||
272 | * @param t Tunnel. | ||
273 | * | ||
274 | * @return ID of a channel free to use. | ||
275 | */ | ||
276 | MESH_ChannelNumber | ||
277 | GMT_get_next_chid (struct MeshTunnel3 *t); | ||
278 | |||
279 | /** | ||
280 | * Sends an already built message on a tunnel, encrypting it and | ||
281 | * choosing the best connection. | ||
282 | * | ||
283 | * @param message Message to send. Function modifies it. | ||
284 | * @param t Tunnel on which this message is transmitted. | ||
285 | * @param ch Channel on which this message is transmitted. | ||
286 | * @param fwd Is this a fwd message? | ||
287 | */ | ||
288 | void | ||
289 | GMT_send_prebuilt_message (const struct GNUNET_MessageHeader *message, | ||
290 | struct MeshTunnel3 *t, | ||
291 | struct MeshChannel *ch, | ||
292 | int fwd); | ||
293 | |||
294 | /** | ||
295 | * Is the tunnel directed towards the local peer? | ||
296 | * | ||
297 | * @param t Tunnel. | ||
298 | * | ||
299 | * @return GNUNET_YES if it is loopback. | ||
300 | */ | ||
301 | int | ||
302 | GMT_is_loopback (const struct MeshTunnel3 *t); | ||
303 | |||
304 | /** | ||
305 | * Get the static string for the peer this tunnel is directed. | ||
306 | * | ||
307 | * @param t Tunnel. | ||
308 | * | ||
309 | * @return Static string the destination peer's ID. | ||
310 | */ | ||
311 | const char * | ||
312 | GMT_2s (const struct MeshTunnel3 *t); | ||
313 | |||
230 | #if 0 /* keep Emacsens' auto-indent happy */ | 314 | #if 0 /* keep Emacsens' auto-indent happy */ |
231 | { | 315 | { |
232 | #endif | 316 | #endif |