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/>.
+
+ SPDX-License-Identifier: AGPL3.0-or-later
*/
/**
#ifndef RPS_SAMPLER_H
#define RPS_SAMPLER_H
#include <inttypes.h>
+#include "rps-sampler_common.h"
/**
struct RPS_SamplerRequestHandle;
-/**
- * Callback that is called from _get_n_rand_peers() when the PeerIDs are ready.
- *
- * @param cls the closure given alongside this function.
- * @param ids the PeerIDs that were returned
- * to be freed
- */
- typedef void
-(*RPS_sampler_n_rand_peers_ready_cb) (const struct GNUNET_PeerIdentity *ids,
- uint32_t num_peers,
- void *cls);
-
-
/**
* Get the size of the sampler.
*
*/
struct RPS_Sampler *
RPS_sampler_init (size_t init_size,
- struct GNUNET_TIME_Relative max_round_interval);
-
-
-/**
- * Initialise a modified tuple of sampler elements.
- *
- * @param init_size the size the sampler is initialised with
- * @param max_round_interval maximum time a round takes
- * @return a handle to a sampler that consists of sampler elements.
- */
-struct RPS_Sampler *
-RPS_sampler_mod_init (size_t init_size,
- struct GNUNET_TIME_Relative max_round_interval);
+ struct GNUNET_TIME_Relative max_round_interval);
/**
*
* Used to get rid of a PeerID.
*
+ * FIXME: This should also consider currently pending requests
+ * (Pending requests already collect peerids. As long as not all
+ * requested IDs have been collected, they are kept.
+ * Ideally, the @p id should be removed from all pending requests. This
+ * seems quite complicated.)
+ *
* @param sampler the sampler to reinitialise a sampler in.
* @param id the id of the samplers to update.
*/