GNUnet  0.10.x
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  */
36 #ifndef GNUNET_PEERINFO_SERVICE_H
37 #define GNUNET_PEERINFO_SERVICE_H
38 
39 #include "gnunet_common.h"
41 #include "gnunet_crypto_lib.h"
42 #include "gnunet_hello_lib.h"
43 
44 #ifdef __cplusplus
45 extern "C"
46 {
47 #if 0 /* keep Emacsens' auto-indent happy */
48 }
49 #endif
50 #endif
51 
52 
57 
58 
68 
69 
79 void
81 
82 
101 struct GNUNET_MQ_Envelope *
103  const struct GNUNET_HELLO_Message *hello,
105  void *cont_cls);
106 
107 
117 typedef void
119  const struct GNUNET_PeerIdentity *peer,
120  const struct GNUNET_HELLO_Message *hello,
121  const char *err_msg);
122 
123 
128 
129 
150  const struct GNUNET_PeerIdentity *peer,
152  void *callback_cls);
153 
154 
160 void
162 
163 
168 
169 
189  void *callback_cls);
190 
191 
197 void
199 
200 
201 #if 0 /* keep Emacsens' auto-indent happy */
202 {
203 #endif
204 #ifdef __cplusplus
205 }
206 #endif
207 
208 #endif
209  /* end of group */
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.
Handle to the peerinfo service.
Definition: peerinfo_api.c:83
A HELLO message is used to exchange information about transports with other peers.
struct GNUNET_PEERINFO_Handle * GNUNET_PEERINFO_connect(const struct GNUNET_CONFIGURATION_Handle *cfg)
Connect to the peerinfo service.
Definition: peerinfo_api.c:128
Context for the info handler.
void GNUNET_PEERINFO_notify_cancel(struct GNUNET_PEERINFO_NotifyContext *nc)
Stop notifying about changes.
static int include_friend_only
Option &#39;-f&#39;.
void * callback_cls
Closure for callback.
Context for an iteration request.
Definition: peerinfo_api.c:37
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:94
void(* GNUNET_SCHEDULER_TaskCallback)(void *cls)
Signature of the main function of a task.
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_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:486
cryptographic primitives for GNUnet
void GNUNET_PEERINFO_iterate_cancel(struct GNUNET_PEERINFO_IteratorContext *ic)
Cancel an iteration over peer information.
Definition: peerinfo_api.c:519
void * callback_cls
Closure for callback.
Definition: peerinfo_api.c:61
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:552
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:104
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.
static struct GNUNET_PEERINFO_NotifyContext * nc
Iterator context.
The identity of the host (wraps the signing key of the peer).
configuration data
Definition: configuration.c:83
GNUNET_PEERINFO_Processor callback
Function to call with the results.
Definition: peerinfo_api.c:56
void GNUNET_PEERINFO_disconnect(struct GNUNET_PEERINFO_Handle *h)
Disconnect from the peerinfo service.
Definition: peerinfo_api.c:154
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
GNUNET_PEERINFO_Processor callback
Function to call with information.