- mark old API calls used for previous VPN implementation as deprecated
[oweals/gnunet.git] / src / include / gnunet_helper_lib.h
index 7115748fc7be9af9df3d2bf1edf573b425e50cae..9c1bc21e2841925927bb038f01b9e761b3660837 100644 (file)
@@ -74,6 +74,12 @@ typedef void (*GNUNET_HELPER_Continuation)(void *cls,
                                           int result);
 
 
+/**
+ * Handle to cancel 'send'
+ */
+struct GNUNET_HELPER_SendHandle;
+
+
 /**
  * Send an message to the helper.
  *
@@ -82,10 +88,11 @@ typedef void (*GNUNET_HELPER_Continuation)(void *cls,
  * @param can_drop can the message be dropped if there is already one in the queue?
  * @param cont continuation to run once the message is out
  * @param cont_cls closure for 'cont'
- * @return GNUNET_YES if the message will be sent
- *         GNUNET_NO if the message was dropped
+ * @return NULL if the message was dropped, 
+ *         otherwise handle to cancel *cont* (actual transmission may
+ *         not be abortable)
  */
-int
+struct GNUNET_HELPER_SendHandle *
 GNUNET_HELPER_send (struct GNUNET_HELPER_Handle *h, 
                    const struct GNUNET_MessageHeader *msg,
                    int can_drop,
@@ -93,4 +100,14 @@ GNUNET_HELPER_send (struct GNUNET_HELPER_Handle *h,
                    void *cont_cls);
 
 
+/**
+ * Cancel a 'send' operation.  If possible, transmitting the
+ * message is also aborted, but at least 'cont' won't be
+ * called.
+ *
+ * @param sh operation to cancel
+ */
+void
+GNUNET_HELPER_send_cancel (struct GNUNET_HELPER_SendHandle *sh);
+
 #endif /* end of include guard: GNUNET_HELPER_LIB_H */