-remove trailing whitespace
[oweals/gnunet.git] / src / include / gnunet_mesh_service.h
index 6819af655fbaec8201397eeabe0abf8cc026d811..a5ebcb1ce159695d987151712ff1b0b4496d1d72 100644 (file)
@@ -19,7 +19,7 @@
 */
 
 /**
- * @file include/gnunet_mesh_service_enc.h
+ * @file include/gnunet_mesh_service.h
  * @brief mesh service; establish channels to distant peers
  * @author Christian Grothoff
  */
@@ -59,8 +59,13 @@ struct GNUNET_MESH_Channel;
  * Channel options.
  * Second line indicates filed in the MeshChannelInfo union carrying the answer.
  */
-enum MeshOption
+enum GNUNET_MESH_ChannelOption
 {
+  /**
+   * Default options: unreliable, default buffering, not out of order.
+   */
+  GNUNET_MESH_OPTION_DEFAULT    = 0x0,
+
   /**
    * Disable buffering on intermediate nodes (for minimum latency).
    * Yes/No.
@@ -81,6 +86,7 @@ enum MeshOption
 
   /**
    * Who is the peer at the other end of the channel.
+   * Only for use in @c GNUNET_MESH_channel_get_info
    * struct GNUNET_PeerIdentity *peer
    */
   GNUNET_MESH_OPTION_PEER       = 0x8
@@ -138,14 +144,17 @@ struct GNUNET_MESH_MessageHandler
  * Method called whenever another peer has added us to a channel
  * 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_channel_destroy
- * causes te channel to be ignored and no further notifications are sent about
- * the same channel.
+ * subscribed to in #GNUNET_MESH_connect.
+ *
+ * A call to #GNUNET_MESH_channel_destroy causes te channel to be ignored. In
+ * this case the handler MUST return NULL.
  *
  * @param cls closure
  * @param channel new handle to the channel
  * @param initiator peer that started the channel
  * @param port Port this channel is for.
+ * @param options MeshOption flag field, with all active option bits set to 1.
+ *
  * @return initial channel context for the channel
  *         (can be NULL -- that's not an error)
  */
@@ -156,7 +165,9 @@ typedef void *(GNUNET_MESH_InboundChannelNotificationHandler) (void *cls,
                                                                const struct
                                                                GNUNET_PeerIdentity
                                                                * initiator,
-                                                               uint32_t port);
+                                                               uint32_t port,
+                                                               enum GNUNET_MESH_ChannelOption
+                                                               options);
 
 
 /**
@@ -229,8 +240,8 @@ GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle);
  * @param channel_ctx client's channel context to associate with the channel
  * @param peer peer identity the channel should go to
  * @param port Port number.
- * @param nobuffer Flag for disabling buffering on relay nodes.
- * @param reliable Flag for end-to-end reliability.
+ * @param options MeshOption flag field, with all desired option bits set to 1.
+ *
  * @return handle to the channel
  */
 struct GNUNET_MESH_Channel *
@@ -238,8 +249,7 @@ GNUNET_MESH_channel_create (struct GNUNET_MESH_Handle *h,
                             void *channel_ctx,
                             const struct GNUNET_PeerIdentity *peer,
                             uint32_t port,
-                            int nobuffer,
-                            int reliable);
+                            enum GNUNET_MESH_ChannelOption options);
 
 
 /**
@@ -269,7 +279,7 @@ union GNUNET_MESH_ChannelInfo
   /**
    * Peer on the other side of the channel
    */
-  const struct GNUNET_PeerIdentity *peer;
+  const struct GNUNET_PeerIdentity peer;
 };
 
 
@@ -283,7 +293,7 @@ union GNUNET_MESH_ChannelInfo
  */
 const union GNUNET_MESH_ChannelInfo *
 GNUNET_MESH_channel_get_info (struct GNUNET_MESH_Channel *channel,
-                              enum MeshOption option, ...);
+                              enum GNUNET_MESH_ChannelOption option, ...);
 
 
 /**