GNUnet 0.22.2
gnunet_nse_service.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet
3 Copyright (C) 2011 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20
21#ifndef GNUNET_NSE_SERVICE_H_
22#define GNUNET_NSE_SERVICE_H_
23
45#ifdef __cplusplus
46extern "C"
47{
48#if 0 /* keep Emacsens' auto-indent happy */
49}
50#endif
51#endif
52
53
54#include "gnunet_util_lib.h"
55
59#define GNUNET_NSE_VERSION 0x00000000
60
65
74typedef void
75(*GNUNET_NSE_Callback) (void *cls,
77 double logestimate,
78 double std_dev);
79
80
88#define GNUNET_NSE_log_estimate_to_n(loge) pow (2.0, (loge))
89
90
99struct GNUNET_NSE_Handle *
102 void *func_cls);
103
104
110void
112
113
114#if 0 /* keep Emacsens' auto-indent happy */
115{
116#endif
117#ifdef __cplusplus
118}
119#endif
120 /* end of group nse */
122 /* end of group addition */
124
125#endif /* GNUNET_NSE_SERVICE_H_ */
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:98
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:108
static uint64_t timestamp(void)
Get current timestamp.
void GNUNET_NSE_disconnect(struct GNUNET_NSE_Handle *h)
Disconnect from network size estimation service.
Definition: nse_api.c:192
void(* GNUNET_NSE_Callback)(void *cls, struct GNUNET_TIME_Absolute timestamp, double logestimate, double std_dev)
Callback to call when network size estimate is updated.
struct GNUNET_NSE_Handle * GNUNET_NSE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_NSE_Callback func, void *func_cls)
Connect to the network size estimation service.
Definition: nse_api.c:164
Handle for talking with the NSE service.
Definition: nse_api.c:40
Time for absolute times used by GNUnet, in microseconds.