aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_mesh_service_new.h
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2011-04-08 01:01:18 +0000
committerBart Polot <bart@net.in.tum.de>2011-04-08 01:01:18 +0000
commit612f0fee557bddd00245a67726aa3c978c07f5c8 (patch)
treeda50edf44731623afa03ff3ff976bb4603a91458 /src/include/gnunet_mesh_service_new.h
parente3a9e2740e43c7c4d2432685b8aff243db7c4098 (diff)
downloadgnunet-612f0fee557bddd00245a67726aa3c978c07f5c8.tar.gz
gnunet-612f0fee557bddd00245a67726aa3c978c07f5c8.zip
Work in progress
Diffstat (limited to 'src/include/gnunet_mesh_service_new.h')
-rw-r--r--src/include/gnunet_mesh_service_new.h47
1 files changed, 27 insertions, 20 deletions
diff --git a/src/include/gnunet_mesh_service_new.h b/src/include/gnunet_mesh_service_new.h
index 4dd738327..3a0aa9507 100644
--- a/src/include/gnunet_mesh_service_new.h
+++ b/src/include/gnunet_mesh_service_new.h
@@ -73,7 +73,8 @@ typedef int
73 void **tunnel_ctx, 73 void **tunnel_ctx,
74 const struct GNUNET_PeerIdentity *sender, 74 const struct GNUNET_PeerIdentity *sender,
75 const struct GNUNET_MessageHeader *message, 75 const struct GNUNET_MessageHeader *message,
76 const struct GNUNET_TRANSPORT_ATS_Information *atsi); 76 const struct GNUNET_TRANSPORT_ATS_Information
77 *atsi);
77 78
78 79
79/** 80/**
@@ -108,10 +109,12 @@ struct GNUNET_MESH_MessageHandler
108 * 109 *
109 * @param cls closure (set from GNUNET_MESH_connect) 110 * @param cls closure (set from GNUNET_MESH_connect)
110 * @param tunnel connection to the other end (henceforth invalid) 111 * @param tunnel connection to the other end (henceforth invalid)
111 * @param tunnel_ctx place where local state associated with the tunnel is stored 112 * @param tunnel_ctx place where local state associated
113 * with the tunnel is stored
112 */ 114 */
113typedef void (GNUNET_MESH_TunnelEndHandler)(void *cls, 115typedef void (GNUNET_MESH_TunnelEndHandler)(void *cls,
114 const struct GNUNET_MESH_Tunnel *tunnel, 116 const struct GNUNET_MESH_Tunnel
117 *tunnel,
115 void **tunnel_ctx); 118 void **tunnel_ctx);
116 119
117 120
@@ -125,14 +128,15 @@ typedef uint32_t GNUNET_MESH_ApplicationType;
125 * Connect to the mesh service. 128 * Connect to the mesh service.
126 * 129 *
127 * @param cfg configuration to use 130 * @param cfg configuration to use
128 * @param cls closure for the various callbacks that follow (including handlers in the handlers array) 131 * @param cls closure for the various callbacks that follow
132 * (including handlers in the handlers array)
129 * @param cleaner function called when an *inbound* tunnel is destroyed 133 * @param cleaner function called when an *inbound* tunnel is destroyed
130 * @param handlers callbacks for messages we care about, NULL-terminated 134 * @param handlers callbacks for messages we care about, NULL-terminated
131 * note that the mesh is allowed to drop notifications about inbound 135 * note that the mesh is allowed to drop notifications about
132 * messages if the client does not process them fast enough (for this 136 * inbound messages if the client does not process them fast
133 * notification type, a bounded queue is used) 137 * enough (for this notification type, a bounded queue is used)
134 * @return handle to the mesh service 138 * @return handle to the mesh service NULL on error
135 * NULL on error (in this case, init is never called) 139 * (in this case, init is never called)
136 */ 140 */
137struct GNUNET_MESH_Handle * 141struct GNUNET_MESH_Handle *
138GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, 142GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
@@ -157,7 +161,7 @@ void GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle);
157 * @param peer peer identity the tunnel stopped working with 161 * @param peer peer identity the tunnel stopped working with
158 */ 162 */
159typedef void (*GNUNET_MESH_TunnelDisconnectHandler) (void *cls, 163typedef void (*GNUNET_MESH_TunnelDisconnectHandler) (void *cls,
160 const struct GNUNET_PeerIdentity *peer); 164 const struct GNUNET_PeerIdentity *peer);
161 165
162 166
163/** 167/**
@@ -168,14 +172,14 @@ typedef void (*GNUNET_MESH_TunnelDisconnectHandler) (void *cls,
168 * @param atsi performance data for the connection 172 * @param atsi performance data for the connection
169 */ 173 */
170typedef void (*GNUNET_MESH_TunnelConnectHandler) (void *cls, 174typedef void (*GNUNET_MESH_TunnelConnectHandler) (void *cls,
171 const struct GNUNET_PeerIdentity *peer, 175 const struct GNUNET_PeerIdentity *peer,
172 const struct GNUNET_TRANSPORT_ATS_Information *atsi); 176 const struct GNUNET_TRANSPORT_ATS_Information *atsi);
173 177
174 178
175 179
176/** 180/**
177 * Create a new tunnel (we're initiator and will be allowed to add/remove peers and 181 * Create a new tunnel (we're initiator and will be allowed to add/remove peers
178 * to broadcast). 182 * and to broadcast).
179 * 183 *
180 * @param h mesh handle 184 * @param h mesh handle
181 * @param connect_handler function to call when peers are actually connected 185 * @param connect_handler function to call when peers are actually connected
@@ -184,9 +188,11 @@ typedef void (*GNUNET_MESH_TunnelConnectHandler) (void *cls,
184 */ 188 */
185struct GNUNET_MESH_Tunnel * 189struct GNUNET_MESH_Tunnel *
186GNUNET_MESH_tunnel_create (struct GNUNET_MESH_Handle *h, 190GNUNET_MESH_tunnel_create (struct GNUNET_MESH_Handle *h,
187 GNUNET_MESH_TunnelConnectHandler connect_handler, 191 GNUNET_MESH_TunnelConnectHandler
188 GNUNET_MESH_TunnelDisconnectHandler disconnect_handler, 192 connect_handler,
189 void *handler_cls); 193 GNUNET_MESH_TunnelDisconnectHandler
194 disconnect_handler,
195 void *handler_cls);
190 196
191/** 197/**
192 * Destroy an existing tunnel. 198 * Destroy an existing tunnel.
@@ -229,8 +235,8 @@ GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel,
229 * 235 *
230 * @param tunnel handle to existing tunnel 236 * @param tunnel handle to existing tunnel
231 * @param timeout how long to try to establish a connection 237 * @param timeout how long to try to establish a connection
232 * @param app_type application type that must be supported by the peer (MESH should 238 * @param app_type application type that must be supported by the peer
233 * discover peer in proximity handling this type) 239 * (MESH should discover peer in proximity handling this type)
234 */ 240 */
235void 241void
236GNUNET_MESH_peer_request_connect_by_type (struct GNUNET_MESH_Tunnel *tunnel, 242GNUNET_MESH_peer_request_connect_by_type (struct GNUNET_MESH_Tunnel *tunnel,
@@ -254,7 +260,8 @@ struct GNUNET_MESH_TransmitHandle;
254 * @param cork is corking allowed for this transmission? 260 * @param cork is corking allowed for this transmission?
255 * @param priority how important is the message? 261 * @param priority how important is the message?
256 * @param maxdelay how long can the message wait? 262 * @param maxdelay how long can the message wait?
257 * @param target destination for the message, NULL for multicast to all tunnel targets 263 * @param target destination for the message
264 * NULL for multicast to all tunnel targets
258 * @param notify_size how many bytes of buffer space does notify want? 265 * @param notify_size how many bytes of buffer space does notify want?
259 * @param notify function to call when buffer space is available; 266 * @param notify function to call when buffer space is available;
260 * will be called with NULL on timeout or if the overall queue 267 * will be called with NULL on timeout or if the overall queue