GNUnet  0.20.0
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"
33 
34 #define VERBOSE_VALIDATION GNUNET_YES
35 
39 extern struct GNUNET_STATISTICS_Handle *GST_stats;
40 
44 extern const struct GNUNET_CONFIGURATION_Handle *GST_cfg;
45 
50 
55 
60 
65 
70 
74 extern struct GNUNET_NT_InterfaceScanner *GST_is;
75 
76 
84 typedef void
86  const struct
88  const struct
91  state,
93  state_timeout,
95  bandwidth_in,
97  bandwidth_out);
98 
99 
111 typedef void
112 (*GST_BlacklistTestContinuation) (void *cls,
113  const struct GNUNET_PeerIdentity *peer,
114  const struct GNUNET_HELLO_Address *address,
115  struct GNUNET_ATS_Session *session,
116  int result);
117 
118 
125 void
127  const char *transport_name);
128 
129 
133 struct GST_BlacklistCheck;
134 
135 
148 struct 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 
163 void
165  struct GNUNET_ATS_Session *session);
166 
172 void
174 
175 
190 GST_receive_callback (void *cls,
191  const struct GNUNET_HELLO_Address *address,
192  struct GNUNET_ATS_Session *session,
193  const struct GNUNET_MessageHeader *message);
194 
201 void
203  int may_drop);
204 
205 
214 void
216  const struct
219  struct GNUNET_TIME_Absolute
220  state_timeout);
221 
222 
229 void
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.
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.
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 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.
Automatic transport selection and outbound bandwidth determination.
API to create, modify and access statistics.
GNUNET_TRANSPORT_PeerState
Possible state of a neighbour.
Handle to the ATS subsystem for connectivity management.
Handle to the ATS subsystem for bandwidth/transport scheduling information.
Session handle for connections.
32-bit bandwidth used for network exchange by GNUnet, in bytes per second.
Private ECC key encoded for transmission.
An address for communicating with a peer.
Header for all communications.
Handle to the interface scanner.
Definition: nt.c:105
Handle to the peerinfo service.
Definition: peerinfo_api.c:85
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.
Context we use when performing a blacklist check.
GST_BlacklistTestContinuation cont
Continuation to call with the result.
struct GNUNET_ATS_Session * session
Session for GST_blacklist_abort_matching(), can be NULL.
void * cont_cls
Closure for cont.
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.