GNUnet debian-0.24.3-23-g589b01d60
gnunet_core_underlay_dummy.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2023 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_CORE_UNDERLAY_DUMMY_SERVICE_H
37#define GNUNET_CORE_UNDERLAY_DUMMY_SERVICE_H
38
39#ifdef __cplusplus
40extern "C" {
41#if 0 /* keep Emacsens' auto-indent happy */
42}
43#endif
44#endif
45
46
47#include <sys/socket.h>
48#include <stdint.h>
49#include "gnunet_util_lib.h"
50#include "gnunet_testing_lib.h"
51
52// FIXME use gnunet_core_underlay.h for most types!
53
57#define GNUNET_CORE_UNDERLAY_DUMMY_VERSION 0x00000000
58
59
64
65
79typedef void *(*GNUNET_CORE_UNDERLAY_DUMMY_NotifyConnect) (
80 void *cls,
81 uint32_t num_addresses,
82 const char *addresses[static num_addresses],
83 struct GNUNET_MQ_Handle *mq,
84 const struct GNUNET_PeerIdentity *peer_id);
85
86
98 void *cls,
99 void *handler_cls);
100
101
111 void *cls,
112 uint32_t num_addresses,
113 const char *addresses[static num_addresses]);
114
115
133 void *cls,
137
138
144void
147
148
169void
170GNUNET_CORE_UNDERLAY_DUMMY_receive_continue (
172 struct GNUNET_MQ_Handle *mq);
173
174
188void
189GNUNET_CORE_UNDERLAY_DUMMY_connect_to_peer (
191 const char *peer_address,
194
198void
199GNUNET_CORE_UNDERLAY_DUMMY_change_address (
201
202
208#define GNUNET_CORE_SIMPLE_DUMMY_UNDERLAY_TRAITS(op, prefix) \
209 op (prefix, connect, const void)
210
211GNUNET_CORE_SIMPLE_DUMMY_UNDERLAY_TRAITS (
213
214
215#if 0 /* keep Emacsens' auto-indent happy */
216{
217#endif
218#ifdef __cplusplus
219}
220#endif
221
222/* ifndef GNUNET_CORE_UNDERLAY_DUMMY_SERVICE_H */
223#endif
224 /* end of group */
226 /* end of group addition */
228
229/* end of gnunet_core_underlay_dummy.h */
struct GNUNET_MQ_MessageHandlers handlers[]
Definition: 003.c:1
struct GNUNET_MQ_Handle * mq
Definition: 003.c:5
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 char * peer_id
Option –peer.
Definition: gnunet-cadet.c:42
static struct GNUNET_CADET_Channel * ch
Channel handle.
Definition: gnunet-cadet.c:117
static struct GNUNET_NotificationContext * nc
Notification context for broadcasting to monitors.
static struct GNUNET_VPN_Handle * handle
Handle to vpn service.
Definition: gnunet-vpn.c:35
#define GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT(prefix, name, type)
Create headers for a trait with name name for statically allocated data of type type.
void GNUNET_CORE_UNDERLAY_DUMMY_disconnect(struct GNUNET_CORE_UNDERLAY_DUMMY_Handle *handle)
Disconnect from the core underlay dummy service.
void * cls
Closure for handlers given by the client - connection-independant (notify_connect,...
struct GNUNET_CORE_UNDERLAY_DUMMY_Handle * GNUNET_CORE_UNDERLAY_DUMMY_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_MQ_MessageHandler *handlers, void *cls, GNUNET_CORE_UNDERLAY_DUMMY_NotifyConnect nc, GNUNET_CORE_UNDERLAY_DUMMY_NotifyDisconnect nd, GNUNET_CORE_UNDERLAY_DUMMY_NotifyAddressChange na)
Connect to the core underlay dummy service.
void(* GNUNET_CORE_UNDERLAY_DUMMY_NotifyAddressChange)(void *cls, uint32_t num_addresses, const char *addresses[static num_addresses])
Function called to notify core of the now available addresses.
void *(* GNUNET_CORE_UNDERLAY_DUMMY_NotifyConnect)(void *cls, uint32_t num_addresses, const char *addresses[static num_addresses], struct GNUNET_MQ_Handle *mq, const struct GNUNET_PeerIdentity *peer_id)
Function called to notify core underlay dummy users that another peer connected to us.
void(* GNUNET_CORE_UNDERLAY_DUMMY_NotifyDisconnect)(void *cls, void *handler_cls)
Function called to notify core underlay dummy users that another peer disconnected from us.
GNUNET_MQ_PriorityPreferences
Per envelope preferences and priorities.
32-bit bandwidth used for network exchange by GNUnet, in bytes per second.
Handle to a message queue.
Definition: mq.c:87
Message handler for a specific message type.
The identity of the host (wraps the signing key of the peer).