GNUnet  0.17.6
gnunet_peerinfo_service.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet
3  Copyright (C) 2009, 2010 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  */
39 #ifndef GNUNET_PEERINFO_SERVICE_H
40 #define GNUNET_PEERINFO_SERVICE_H
41 
42 #include "gnunet_common.h"
44 #include "gnunet_crypto_lib.h"
45 #include "gnunet_hello_lib.h"
46 
47 #ifdef __cplusplus
48 extern "C"
49 {
50 #if 0 /* keep Emacsens' auto-indent happy */
51 }
52 #endif
53 #endif
54 
55 
60 
61 
71 
72 
82 void
84 
85 
104 struct GNUNET_MQ_Envelope *
106  const struct GNUNET_HELLO_Message *hello,
108  void *cont_cls);
109 
110 
120 typedef void
121 (*GNUNET_PEERINFO_Processor) (void *cls,
122  const struct GNUNET_PeerIdentity *peer,
123  const struct GNUNET_HELLO_Message *hello,
124  const char *err_msg);
125 
126 
131 
132 
153  const struct GNUNET_PeerIdentity *peer,
155  void *callback_cls);
156 
157 
163 void
165 
166 
171 
172 
192  void *callback_cls);
193 
194 
200 void
202 
203 
204 #if 0 /* keep Emacsens' auto-indent happy */
205 {
206 #endif
207 #ifdef __cplusplus
208 }
209 #endif
210 
211 #endif
212  /* end of group */
214  /* end of group addition */
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
static int include_friend_only
Option '-f'.
static struct GNUNET_PEERINFO_NotifyContext * nc
Iterator context.
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
Configuration API.
cryptographic primitives for GNUnet
Helper library for handling HELLOs.
void(* GNUNET_PEERINFO_Processor)(void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_HELLO_Message *hello, const char *err_msg)
Type of an iterator over the hosts.
struct GNUNET_MQ_Envelope * GNUNET_PEERINFO_add_peer(struct GNUNET_PEERINFO_Handle *h, const struct GNUNET_HELLO_Message *hello, GNUNET_SCHEDULER_TaskCallback cont, void *cont_cls)
Add a host to the persistent list.
Definition: peerinfo_api.c:553
struct GNUNET_PEERINFO_NotifyContext * GNUNET_PEERINFO_notify(const struct GNUNET_CONFIGURATION_Handle *cfg, int include_friend_only, GNUNET_PEERINFO_Processor callback, void *callback_cls)
Call a method whenever our known information about peers changes.
struct GNUNET_PEERINFO_Handle * GNUNET_PEERINFO_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the peerinfo service.
Definition: peerinfo_api.c:130
void GNUNET_PEERINFO_notify_cancel(struct GNUNET_PEERINFO_NotifyContext *nc)
Stop notifying about changes.
struct GNUNET_PEERINFO_IteratorContext * GNUNET_PEERINFO_iterate(struct GNUNET_PEERINFO_Handle *h, int include_friend_only, const struct GNUNET_PeerIdentity *peer, GNUNET_PEERINFO_Processor callback, void *callback_cls)
Call a method for each known matching host.
Definition: peerinfo_api.c:487
void GNUNET_PEERINFO_iterate_cancel(struct GNUNET_PEERINFO_IteratorContext *ic)
Cancel an iteration over peer information.
Definition: peerinfo_api.c:520
void GNUNET_PEERINFO_disconnect(struct GNUNET_PEERINFO_Handle *h)
Disconnect from the peerinfo service.
Definition: peerinfo_api.c:156
void(* GNUNET_SCHEDULER_TaskCallback)(void *cls)
Signature of the main function of a task.
A HELLO message is used to exchange information about transports with other peers.
Handle to the peerinfo service.
Definition: peerinfo_api.c:85
Context for an iteration request.
Definition: peerinfo_api.c:38
void * callback_cls
Closure for callback.
Definition: peerinfo_api.c:62
GNUNET_PEERINFO_Processor callback
Function to call with the results.
Definition: peerinfo_api.c:57
Context for the info handler.
void * callback_cls
Closure for callback.
GNUNET_PEERINFO_Processor callback
Function to call with information.
The identity of the host (wraps the signing key of the peer).
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.