GNUnet 0.22.2
gnunet-service-transport.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2010,2011 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
50
54extern struct GNUNET_PEERINFO_Handle *GST_peerinfo;
55
60
64extern struct GNUNET_ATS_SchedulingHandle *GST_ats;
65
69extern struct GNUNET_ATS_ConnectivityHandle *GST_ats_connect;
70
75
76
84typedef void
86 const struct
88 const struct
89 GNUNET_HELLO_Address *address,
90 enum GNUNET_TRANSPORT_PeerState
91 state,
93 state_timeout,
95 bandwidth_in,
97 bandwidth_out);
98
99
111typedef void
113 const struct GNUNET_PeerIdentity *peer,
114 const struct GNUNET_HELLO_Address *address,
115 struct GNUNET_ATS_Session *session,
116 int result);
117
118
125void
127 const char *transport_name);
128
129
133struct GST_BlacklistCheck;
134
135
148struct GST_BlacklistCheck *
150 const char *transport_name,
152 void *cont_cls,
153 const struct GNUNET_HELLO_Address *address,
154 struct GNUNET_ATS_Session *session);
155
156
163void
164GST_blacklist_abort_matching (const struct GNUNET_HELLO_Address *address,
165 struct GNUNET_ATS_Session *session);
166
172void
173GST_blacklist_test_cancel (struct GST_BlacklistCheck *bc);
174
175
191 const struct GNUNET_HELLO_Address *address,
192 struct GNUNET_ATS_Session *session,
193 const struct GNUNET_MessageHeader *message);
194
201void
203 int may_drop);
204
205
214void
216 const struct
217 GNUNET_HELLO_Address *address,
218 enum GNUNET_TRANSPORT_PeerState state,
220 state_timeout);
221
222
229void
231
232
233#endif
234/* end of file gnunet-service-transport_plugins.h */
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
static char * address
GNS address for this phone.
enum State state
current state of profiling
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.
struct GNUNET_PeerIdentity GST_my_identity
Configuration handle.
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.
struct GNUNET_CRYPTO_EddsaPrivateKey GST_my_private_key
Our private key.
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.
Private ECC key encoded for transmission.
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.