RECLAIM/OIDC: code cleanup
[oweals/gnunet.git] / src / include / gnunet_consensus_service.h
index 3b08b2dee634f37b6270c10d7749357bddb22cab..19736f241b8c023f0c97be9e08a4a97db37ab31a 100644 (file)
@@ -1,27 +1,32 @@
 /*
       This file is part of GNUnet
-      (C) 2012 Christian Grothoff (and other contributing authors)
+      Copyright (C) 2012 GNUnet e.V.
 
-      GNUnet is free software; you can redistribute it and/or modify
-      it under the terms of the GNU General Public License as published
-      by the Free Software Foundation; either version 3, or (at your
-      option) any later version.
+      GNUnet is free software: you can redistribute it and/or modify it
+      under the terms of the GNU Affero General Public License as published
+      by the Free Software Foundation, either version 3 of the License,
+      or (at your option) any later version.
 
       GNUnet is distributed in the hope that it will be useful, but
       WITHOUT ANY WARRANTY; without even the implied warranty of
       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-      General Public License for more details.
+      Affero General Public License for more details.
+     
+      You should have received a copy of the GNU Affero General Public License
+      along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-      You should have received a copy of the GNU General Public License
-      along with GNUnet; see the file COPYING.  If not, write to the
-      Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-      Boston, MA 02111-1307, USA.
+     SPDX-License-Identifier: AGPL3.0-or-later
  */
 
 /**
- * @file include/gnunet_consensus_service.h
- * @brief multi-peer set reconciliation
  * @author Florian Dold
+ *
+ * @file
+ * Multi-peer set reconciliation
+ *
+ * @defgroup consensus  Consensus service
+ * Multi-peer set reconciliation
+ * @{
  */
 
 #ifndef GNUNET_CONSENSUS_SERVICE_H
@@ -35,7 +40,6 @@ extern "C"
 #endif
 #endif
 
-#include "platform.h"
 #include "gnunet_common.h"
 #include "gnunet_time_lib.h"
 #include "gnunet_configuration_lib.h"
@@ -43,7 +47,15 @@ extern "C"
 
 
 /**
- * Called when a new element was received from another peer, or an error occured.
+ * Elements inserted into the consensus set by the client
+ * may not be larger than this constant, since types in
+ * the upper range are used by CONSENSUS internally.
+ */
+#define GNUNET_CONSENSUS_ELEMENT_TYPE_USER_MAX 0xFFF0
+
+
+/**
+ * Called when a new element was received from another peer, or an error occurred.
  * May deliver duplicate values.
  * Elements given to a consensus operation by the local peer are NOT given
  * to this callback.
@@ -72,6 +84,9 @@ struct GNUNET_CONSENSUS_Handle;
  *              Inclusion of the local peer is optional.
  * @param session_id session identifier
  *                   Allows a group of peers to have more than consensus session.
+ * @param start start time of the consensus, conclude should be called before
+ *              the start time.
+ * @param deadline time when the consensus should have concluded
  * @param new_element_cb callback, called when a new element is added to the set by
  *                    another peer. Also called when an error occurs.
  * @param new_element_cls closure for new_element
@@ -82,6 +97,8 @@ GNUNET_CONSENSUS_create (const struct GNUNET_CONFIGURATION_Handle *cfg,
                          unsigned int num_peers,
                          const struct GNUNET_PeerIdentity *peers,
                          const struct GNUNET_HashCode *session_id,
+                         struct GNUNET_TIME_Absolute start,
+                         struct GNUNET_TIME_Absolute deadline,
                          GNUNET_CONSENSUS_ElementCallback new_element_cb,
                          void *new_element_cls);
 
@@ -135,14 +152,11 @@ typedef void (*GNUNET_CONSENSUS_ConcludeCallback) (void *cls);
  * try to conclude the consensus within a given time window.
  *
  * @param consensus consensus session
- * @param deadline deadline after which the conculde callback
- *                 whill be called
  * @param conclude called when the conclusion was successful
  * @param conclude_cls closure for the conclude callback
  */
 void
 GNUNET_CONSENSUS_conclude (struct GNUNET_CONSENSUS_Handle *consensus,
-                           struct GNUNET_TIME_Absolute deadline,
                            GNUNET_CONSENSUS_ConcludeCallback conclude,
                            void *conclude_cls);
 
@@ -165,3 +179,5 @@ GNUNET_CONSENSUS_destroy (struct GNUNET_CONSENSUS_Handle *consensus);
 #endif
 
 #endif
+
+/** @} */  /* end of group */