aboutsummaryrefslogtreecommitdiff
path: root/src/mesh/gnunet-service-mesh_tunnel.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesh/gnunet-service-mesh_tunnel.h')
-rw-r--r--src/mesh/gnunet-service-mesh_tunnel.h86
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);
153void 153void
154GMT_add_connection (struct MeshTunnel3 *t, struct MeshConnection *c); 154GMT_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
164GMT_remove_connection (struct MeshTunnel3 *t, struct MeshConnection *c); 163GMT_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 */
171void
172GMT_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 */
180void
181GMT_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 */
191struct MeshChannel *
192GMT_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);
227unsigned int 256unsigned int
228GMT_get_buffer (struct MeshTunnel3 *t, int fwd); 257GMT_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 */
266const struct GNUNET_PeerIdentity *
267GMT_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 */
276MESH_ChannelNumber
277GMT_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 */
288void
289GMT_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 */
301int
302GMT_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 */
311const char *
312GMT_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