gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r25109 - gnunet/src/include


From: gnunet
Subject: [GNUnet-SVN] r25109 - gnunet/src/include
Date: Thu, 22 Nov 2012 19:02:46 +0100

Author: bartpolot
Date: 2012-11-22 19:02:45 +0100 (Thu, 22 Nov 2012)
New Revision: 25109

Modified:
   gnunet/src/include/gnunet_mesh_service.h
   gnunet/src/include/gnunet_protocols.h
Log:
- API additions for monitor tunnel

Modified: gnunet/src/include/gnunet_mesh_service.h
===================================================================
--- gnunet/src/include/gnunet_mesh_service.h    2012-11-22 18:02:19 UTC (rev 
25108)
+++ gnunet/src/include/gnunet_mesh_service.h    2012-11-22 18:02:45 UTC (rev 
25109)
@@ -437,28 +437,78 @@
  * @param npeers Number of peers in peers.
  */
 typedef void (*GNUNET_MESH_MonitorCB) (void *cls,
-                                       const struct GNUNET_PeerIdentity 
*initiator,
+                                       const struct GNUNET_PeerIdentity *owner,
                                        unsigned int tunnel_number,
                                        const struct GNUNET_PeerIdentity *peers,
                                        unsigned int npeers);
 
 
 /**
+ * Method called to retrieve information about each tunnel the mesh peer
+ * is aware of.
+ *
+ * @param cls Closure.
+ * @param initiator Peer that started the tunnel (owner).
+ * @param tunnel_number Tunnel number.
+ * @param peers Array of peers that form the tunnel, including transit nodes.
+ *              The identities come in pairs, representing a peer
+ *              and his predecessor in the tree. The root does not
+ *              appear in the array.
+ * @param npeers Number of peers in peers (size is 2 x npeers!).
+ */
+typedef void (*GNUNET_MESH_MonitorTunnelCB) (
+                      void *cls,
+                      const struct GNUNET_PeerIdentity *owner,
+                      unsigned int tunnel_number,
+                      const struct GNUNET_PeerIdentity *peers,
+                      unsigned int npeers);
+
+
+/**
  * Request information about the running mesh peer.
+ * The callback will be called for every tunnel known to the service,
+ * listing all peers that blong to the tunnel (active only).
  *
+ * If called again on the same handle, it will overwrite the previous
+ * callback and cls. To retrieve the cls, monitor_cancel must be
+ * called first.
+ *
+ * WARNING: unstable API, likely to change in the future!
+ *
  * @param h Handle to the mesh peer.
  * @param callback Function to call with the requested data.
- * @param monitor_cls Closure for @c callback.
+ * @param callback_cls Closure for @c callback.
  */
 void
 GNUNET_MESH_monitor (struct GNUNET_MESH_Handle *h,
                      GNUNET_MESH_MonitorCB callback,
-                     void *monitor_cls);
+                     void *callback_cls);
 
 
 /**
+ * Request information about a specific tunnel of the running mesh peer.
+ *
+ * WARNING: unstable API, likely to change in the future!
+ *
+ * @param h Handle to the mesh peer.
+ * @param initiator ID of the owner of the tunnel.
+ * @param tunnel_number Tunnel number.
+ * @param callback Function to call with the requested data.
+ * @param callback_cls Closure for @c callback.
+ */
+void
+GNUNET_MESH_monitor_tunnel (struct GNUNET_MESH_Handle *h,
+                            struct GNUNET_PeerIdentity *initiator,
+                            unsigned int tunnel_number,
+                            GNUNET_MESH_MonitorTunnelCB callback,
+                            void *callback_cls);
+
+
+/**
  * Cancel a monitor request. The monitor callback will not be called.
  *
+ * WARNING: unstable API, likely to change in the future!
+ *
  * @param h Mesh handle.
  *
  * @return Closure given to GNUNET_MESH_monitor, if any.

Modified: gnunet/src/include/gnunet_protocols.h
===================================================================
--- gnunet/src/include/gnunet_protocols.h       2012-11-22 18:02:19 UTC (rev 
25108)
+++ gnunet/src/include/gnunet_protocols.h       2012-11-22 18:02:45 UTC (rev 
25109)
@@ -886,6 +886,11 @@
 #define GNUNET_MESSAGE_TYPE_MESH_LOCAL_MONITOR          287
 
 /**
+ * Local monitoring of service of a specific tunnel.
+ */
+#define GNUNET_MESSAGE_TYPE_MESH_LOCAL_MONITOR_TUNNEL   288
+
+/**
  * 640kb should be enough for everybody
  */
 #define GNUNET_MESSAGE_TYPE_MESH_RESERVE_END            299




reply via email to

[Prev in Thread] Current Thread [Next in Thread]