GNUnet debian-0.24.3-28-g4f2a77692
 
Loading...
Searching...
No Matches
gnunet_core_underlay.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2009-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_SERVICE_H
37#define GNUNET_CORE_UNDERLAY_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 "gnunet_util_lib.h"
49
53#define GNUNET_CORE_UNDERLAY_VERSION 0x00000000
54
55
59struct GNUNET_CORE_UNDERLAY_Handle;
60
61
72typedef void *(*GNUNET_CORE_UNDERLAY_NotifyConnect) (
73 void *cls,
74 uint32_t num_addresses;
75 const char *addresses[static num_addresses],
76 struct GNUNET_MQ_Handle *mq);
77
78
90 void *cls,
91 void *handler_cls);
92
93
106 void *cls,
107 struct GNUNET_HashCode network_location_hash,
108 struct uint64_t network_generation_id);
109
110
125struct GNUNET_CORE_UNDERLAY_Handle *
128 void *cls,
132
133
139void
140GNUNET_CORE_UNDERLAY_disconnect (struct GNUNET_CORE_UNDERLAY_Handle *handle);
141
142
163void
164GNUNET_CORE_UNDERLAY_receive_continue (struct GNUNET_CORE_UNDERLAY_Handle *ch,
165 struct GNUNET_MQ_Handle *mq);
166
167
180void
181GNUNET_CORE_UNDERLAY_connect_to_peer (struct GNUNET_CORE_UNDERLAY_Handle *ch,
182 const char *peer_address
185
186
187#if 0 /* keep Emacsens' auto-indent happy */
188{
189#endif
190#ifdef __cplusplus
191}
192#endif
193
194/* ifndef GNUNET_CORE_UNDERLAY_SERVICE_H */
195#endif
196
/* end of group */
198
/* end of group addition */
200
201/* end of gnunet_core_underlay_service.h */
struct GNUNET_MQ_MessageHandlers handlers[]
Definition 003.c:1
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition gnunet-arm.c:108
static struct GNUNET_CADET_Channel * ch
Channel handle.
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
API of the transport service towards the communicator processes.
void *(* GNUNET_CORE_UNDERLAY_NotifyConnect)(void *cls, uint32_t num_addresses;const char *addresses[static num_addresses], struct GNUNET_MQ_Handle *mq)
Function called to notify core underlay users that another peer connected to us.
void GNUNET_CORE_UNDERLAY_disconnect(struct GNUNET_CORE_UNDERLAY_Handle *handle)
Disconnect from the core underlay service.
void(* GNUNET_CORE_UNDERLAY_NotifyDisconnect)(void *cls, void *handler_cls)
Function called to notify core underlay users that another peer disconnected from us.
void(* GNUNET_CORE_UNDERLAY_NotifyAddressChange)(void *cls, struct GNUNET_HashCode network_location_hash, struct uint64_t network_generation_id)
Function called to notify core of the now available addresses.
struct GNUNET_CORE_UNDERLAY_Handle * GNUNET_CORE_UNDERLAY_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_MQ_MessageHandler *handlers, void *cls, GNUNET_CORE_UNDERLAY_NotifyConnect nc, GNUNET_CORE_UNDERLAY_NotifyDisconnect nd, GNUNET_CORE_UNDERLAY_NotifyAddressChange na)
Connect to the core underlay service.
GNUNET_MQ_PriorityPreferences
Per envelope preferences and priorities.
static struct GNUNET_MQ_Handle * mq
Our connection to the resolver service, created on-demand, but then persists until error or shutdown.
32-bit bandwidth used for network exchange by GNUnet, in bytes per second.
A 512-bit hashcode.
Handle to a message queue.
Definition mq.c:87
Message handler for a specific message type.