2 This file is part of GNUnet.
3 (C) 2013 Christian Grothoff (and other contributing authors)
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
22 * @file mesh/gnunet-service-mesh_local.h
23 * @brief mesh service; dealing with local clients
26 * All functions in this file should use the prefix GML (Gnunet Mesh Local)
29 #ifndef GNUNET_SERVICE_MESH_LOCAL_H
30 #define GNUNET_SERVICE_MESH_LOCAL_H
35 #if 0 /* keep Emacsens' auto-indent happy */
40 #include "gnunet_util_lib.h"
41 #include "gnunet-service-mesh_channel.h"
44 * Struct containing information about a client of the service
48 /******************************************************************************/
49 /******************************** API ***********************************/
50 /******************************************************************************/
53 * Initialize server subsystem.
55 * @param handle Server handle.
58 GML_init (struct GNUNET_SERVER_Handle *handle);
61 * Install server (service) handlers and start listening to clients.
73 * Check if client has registered with the service and has not disconnected
75 * @param client the client to check
77 * @return non-NULL if client exists in the global DLL
80 GML_client_get (struct GNUNET_SERVER_Client *client);
83 * Deletes a tunnel from a client (either owner or destination).
85 * @param c Client whose tunnel to delete.
86 * @param ch Channel which should be deleted.
89 GML_client_delete_channel (struct MeshClient *c, struct MeshChannel *ch);
92 * Build a local ACK message and send it to a local client, if needed.
94 * If the client was already allowed to send data, do nothing.
96 * @param ch Channel on which to send the ACK.
97 * @param c Client to whom send the ACK.
98 * @param fwd Set to GNUNET_YES for FWD ACK (dest->root)
101 GML_send_ack (struct MeshChannel *ch, int fwd);
104 * Notify the appropriate client that a new incoming channel was created.
106 * @param ch Channel that was created.
109 GML_send_channel_create (struct MeshClient *c,
110 uint32_t id, uint32_t port, uint32_t opt,
111 struct GNUNET_PeerIdentity *peer);
114 * Notify a client that a channel is no longer valid.
117 * @param id ID of the channel that is destroyed.
120 GML_send_channel_destroy (struct MeshClient *c, uint32_t id);
123 * Modify the mesh message TID from global to local and send to client.
125 * @param ch Channel on which to send the message.
126 * @param msg Message to modify and send.
127 * @param c Client to send to.
128 * @param tid Tunnel ID to use (c can be both owner and client).
131 GML_send_data (struct MeshChannel *ch,
132 const struct GNUNET_MESH_Data *msg,
133 struct MeshClient *c, MESH_ChannelNumber id);
136 #if 0 /* keep Emacsens' auto-indent happy */
143 /* ifndef GNUNET_MESH_SERVICE_LOCAL_H */
145 /* end of gnunet-mesh-service_LOCAL.h */