GNUnet  0.17.5
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
46 extern "C"
47 {
48 #if 0 /* keep Emacsens' auto-indent happy */
49 }
50 #endif
51 #endif
52 
53 #include "gnunet_util_lib.h"
54 
58 #define GNUNET_NSE_VERSION 0x00000000
59 
63 struct GNUNET_NSE_Handle;
64 
73 typedef void
74 (*GNUNET_NSE_Callback) (void *cls,
75  struct GNUNET_TIME_Absolute timestamp,
76  double logestimate,
77  double std_dev);
78 
79 
87 #define GNUNET_NSE_log_estimate_to_n(loge) pow (2.0, (loge))
88 
89 
98 struct GNUNET_NSE_Handle *
100  GNUNET_NSE_Callback func,
101  void *func_cls);
102 
103 
109 void
111 
112 
113 #if 0 /* keep Emacsens' auto-indent happy */
114 {
115 #endif
116 #ifdef __cplusplus
117 }
118 #endif
119  /* end of group nse */
121  /* end of group addition */
123 
124 #endif /* GNUNET_NSE_SERVICE_H_ */
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
void GNUNET_NSE_disconnect(struct GNUNET_NSE_Handle *h)
Disconnect from network size estimation service.
Definition: nse_api.c:193
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:165
Handle for talking with the NSE service.
Definition: nse_api.c:41
Time for absolute times used by GNUnet, in microseconds.