-fixes
[oweals/gnunet.git] / src / include / gnunet_mesh_service.h
index c235bdd4228bc1d1b9d172b30b51b62f9a2521d4..b9f0e49c6ce387f027385ec1c80fabd1f60a1ad8 100644 (file)
@@ -107,6 +107,10 @@ struct GNUNET_MESH_MessageHandler
 /**
  * Method called whenever another peer has added us to a tunnel
  * the other peer initiated.
+ * Only called (once) upon reception of data with a message type which was
+ * subscribed to in GNUNET_MESH_connect. A call to GNUNET_MESH_tunnel_destroy
+ * causes te tunnel to be ignored and no further notifications are sent about
+ * the same tunnel.
  *
  * @param cls closure
  * @param tunnel new handle to the tunnel
@@ -154,9 +158,6 @@ typedef uint32_t GNUNET_MESH_ApplicationType;
  * Connect to the mesh service.
  *
  * @param cfg configuration to use
- * @param queue_size size of the data message queue, shared among all tunnels
- *                   (each tunnel is guaranteed to accept at least one message,
- *                    no matter what is the status of other tunnels)
  * @param cls closure for the various callbacks that follow
  *            (including handlers in the handlers array)
  * @param new_tunnel function called when an *inbound* tunnel is created
@@ -172,8 +173,7 @@ typedef uint32_t GNUNET_MESH_ApplicationType;
  *         (in this case, init is never called)
  */
 struct GNUNET_MESH_Handle *
-GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
-                     unsigned int queue_size, void *cls,
+GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, void *cls,
                      GNUNET_MESH_InboundTunnelNotificationHandler new_tunnel,
                      GNUNET_MESH_TunnelEndHandler cleaner,
                      const struct GNUNET_MESH_MessageHandler *handlers,
@@ -227,16 +227,24 @@ typedef void (*GNUNET_MESH_PeerConnectHandler) (void *cls,
  * Announce to ther peer the availability of services described by the regex,
  * in order to be reachable to other peers via connect_by_string.
  * 
- * Note that the first 8 characters are considered to be part of a prefix,
- * (for instance 'gnunet://'). If you put a variable part in there (*, +. ()),
- * all matching strings will be stored in the DHT.
+ * Note that the first GNUNET_REGEX_INITIAL_BYTES characters are considered
+ * to be part of a prefix, (for instance 'gnunet://').
+ * If you put a variable part in there (*, +. ()), all matching strings
+ * will be stored in the DHT.
  *
- * @param h handle to mesh.
- * @param regex string with the regular expression describing local services.
+ * @param h Handle to mesh.
+ * @param regex String with the regular expression describing local services.
+ * @param compression_characters How many characters can be assigned to one
+ *                               edge of the graph. The bigger the variability
+ *                               of the data, the smaller this parameter should
+ *                               be (down to 1).
+ *                               For maximum compression, use strlen (regex)
+ *                               or 0 (special value). Use with care!
  */
 void
 GNUNET_MESH_announce_regex (struct GNUNET_MESH_Handle *h,
-                            const char *regex);
+                            const char *regex,
+                            unsigned int compression_characters);
 
 
 /**
@@ -381,10 +389,11 @@ struct GNUNET_MESH_TransmitHandle;
 /**
  * Ask the mesh to call "notify" once it is ready to transmit the
  * given number of bytes to the specified tunnel or target.
+ * Only one call can be active at any time, to issue another request,
+ * wait for the callback or cancel the current request.
  *
  * @param tunnel tunnel to use for transmission
  * @param cork is corking allowed for this transmission?
- * @param priority how important is the message?
  * @param maxdelay how long can the message wait?
  * @param target destination for the message
  *               NULL for multicast to all tunnel targets
@@ -400,7 +409,6 @@ struct GNUNET_MESH_TransmitHandle;
  */
 struct GNUNET_MESH_TransmitHandle *
 GNUNET_MESH_notify_transmit_ready (struct GNUNET_MESH_Tunnel *tunnel, int cork,
-                                   uint32_t priority,
                                    struct GNUNET_TIME_Relative maxdelay,
                                    const struct GNUNET_PeerIdentity *target,
                                    size_t notify_size,