GNUnet 0.27.0
 
Loading...
Searching...
No Matches
gnunet-service-transport.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2010-2011, 2026 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
26#ifndef GNUNET_SERVICE_TRANSPORT_H
27#define GNUNET_SERVICE_TRANSPORT_H
28
29#include "gnunet_util_lib.h"
31#include "gnunet_ats_service.h"
32#include "gnunet_transport_service.h"
33
34#define VERBOSE_VALIDATION GNUNET_YES
35
40
44extern const struct GNUNET_CONFIGURATION_Handle *GST_cfg;
45
49extern struct GNUNET_PEERINFO_Handle *GST_peerinfo;
50
54extern struct GNUNET_ATS_SchedulingHandle *GST_ats;
55
59extern struct GNUNET_ATS_ConnectivityHandle *GST_ats_connect;
60
65
66
74typedef void
76 const struct
78 const struct
79 GNUNET_HELLO_Address *address,
80 enum GNUNET_TRANSPORT_PeerState
81 state,
83 state_timeout,
85 bandwidth_in,
87 bandwidth_out);
88
89
101typedef void
103 const struct GNUNET_PeerIdentity *peer,
104 const struct GNUNET_HELLO_Address *address,
105 struct GNUNET_ATS_Session *session,
106 int result);
107
108
115void
117 const char *transport_name);
118
119
123struct GST_BlacklistCheck;
124
125
138struct GST_BlacklistCheck *
140 const char *transport_name,
142 void *cont_cls,
143 const struct GNUNET_HELLO_Address *address,
144 struct GNUNET_ATS_Session *session);
145
146
153void
154GST_blacklist_abort_matching (const struct GNUNET_HELLO_Address *address,
155 struct GNUNET_ATS_Session *session);
156
162void
163GST_blacklist_test_cancel (struct GST_BlacklistCheck *bc);
164
165
181 const struct GNUNET_HELLO_Address *address,
182 struct GNUNET_ATS_Session *session,
183 const struct GNUNET_MessageHeader *message);
184
191void
193 int may_drop);
194
195
204void
206 const struct
207 GNUNET_HELLO_Address *address,
208 enum GNUNET_TRANSPORT_PeerState state,
210 state_timeout);
211
212
219void
221
222
223#endif
224/* end of file gnunet-service-transport_plugins.h */
struct GNUNET_MessageHeader * msg
Definition 005.c:2
static char * address
GNS address for this phone.
static int state
The current state of the parser.
static int result
Global testing status.
struct GNUNET_TIME_Relative GST_receive_callback(void *cls, const struct GNUNET_HELLO_Address *address, struct GNUNET_ATS_Session *session, const struct GNUNET_MessageHeader *message)
Function called by the transport for each received message.
void GST_blacklist_test_cancel(struct GST_BlacklistCheck *bc)
Cancel a blacklist check.
void GST_blacklist_abort_matching(const struct GNUNET_HELLO_Address *address, struct GNUNET_ATS_Session *session)
Abort blacklist if address and session match.
void(* GST_BlacklistTestContinuation)(void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_HELLO_Address *address, struct GNUNET_ATS_Session *session, int result)
Continuation called from a blacklist test.
struct GNUNET_ATS_ConnectivityHandle * GST_ats_connect
ATS connectivity handle.
void GST_blacklist_add_peer(const struct GNUNET_PeerIdentity *peer, const char *transport_name)
Add the given peer to the blacklist (for the given transport).
struct GNUNET_ATS_SchedulingHandle * GST_ats
ATS handle.
struct GNUNET_NT_InterfaceScanner * GST_is
Interface scanner determines our LAN address range(s).
void(* GNUNET_TRANSPORT_NeighbourChangeCallback)(void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_HELLO_Address *address, enum GNUNET_TRANSPORT_PeerState state, struct GNUNET_TIME_Absolute state_timeout, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
Function to call when a peer's address has changed.
struct GST_BlacklistCheck * GST_blacklist_test_allowed(const struct GNUNET_PeerIdentity *peer, const char *transport_name, GST_BlacklistTestContinuation cont, void *cont_cls, const struct GNUNET_HELLO_Address *address, struct GNUNET_ATS_Session *session)
Test if a peer/transport combination is blacklisted.
const struct GNUNET_CONFIGURATION_Handle * GST_cfg
Configuration handle.
void GST_clients_broadcast(const struct GNUNET_MessageHeader *msg, int may_drop)
Broadcast the given message to all of our clients.
struct GNUNET_PEERINFO_Handle * GST_peerinfo
Handle to peerinfo service.
struct GNUNET_STATISTICS_Handle * GST_stats
Statistics handle.
void GST_clients_broadcast_disconnect(const struct GNUNET_PeerIdentity *peer)
Notify all clients about a disconnect, and cancel pending SEND_OK messages for this peer.
void GST_clients_broadcast_peer_notification(const struct GNUNET_PeerIdentity *peer, const struct GNUNET_HELLO_Address *address, enum GNUNET_TRANSPORT_PeerState state, struct GNUNET_TIME_Absolute state_timeout)
Broadcast the new active address to all clients monitoring the peer.
API to create, modify and access statistics.
32-bit bandwidth used for network exchange by GNUnet, in bytes per second.
Header for all communications.
Handle to the interface scanner.
Definition nt.c:104
The identity of the host (wraps the signing key of the peer).
Handle for the service.
Time for absolute times used by GNUnet, in microseconds.
Time for relative time used by GNUnet, in microseconds.