GNUnet  0.10.x
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 GNUNET_PeerIdentity *peer,
87  const struct GNUNET_HELLO_Address *address,
89  struct GNUNET_TIME_Absolute state_timeout,
90  struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
91  struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out);
92 
93 
105 typedef void
107  const struct GNUNET_PeerIdentity *peer,
108  const struct GNUNET_HELLO_Address *address,
109  struct GNUNET_ATS_Session *session,
110  int result);
111 
112 
119 void
120 GST_blacklist_add_peer (const struct GNUNET_PeerIdentity *peer,
121  const char *transport_name);
122 
123 
127 struct GST_BlacklistCheck;
128 
129 
130 
143 struct GST_BlacklistCheck *
145  const char *transport_name,
147  void *cont_cls,
148  const struct GNUNET_HELLO_Address *address,
149  struct GNUNET_ATS_Session *session);
150 
151 
158 void
160  struct GNUNET_ATS_Session *session);
161 
167 void
169 
170 
185 GST_receive_callback (void *cls,
186  const struct GNUNET_HELLO_Address *address,
187  struct GNUNET_ATS_Session *session,
188  const struct GNUNET_MessageHeader *message);
189 
196 void
198  int may_drop);
199 
200 
209 void
211  const struct GNUNET_HELLO_Address *address,
212  enum GNUNET_TRANSPORT_PeerState state,
213  struct GNUNET_TIME_Absolute state_timeout);
214 
215 
222 void
224 
225 
226 
227 
228 #endif
229 /* end of file gnunet-service-transport_plugins.h */
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.
Handle to the interface scanner.
Definition: nt.c:103
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.
Handle to the peerinfo service.
Definition: peerinfo_api.c:86
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
void GST_blacklist_test_cancel(struct GST_BlacklistCheck *bc)
Cancel a blacklist check.
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.
GNUNET_TRANSPORT_PeerState
Possible state of a neighbour.
Context we use when performing a blacklist check.
Handle to the ATS subsystem for bandwidth/transport scheduling information.
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&#39;s address has changed.
struct GNUNET_PEERINFO_Handle * GST_peerinfo
Handle to peerinfo service.
struct GNUNET_ATS_ConnectivityHandle * GST_ats_connect
ATS connectivity handle.
Handle for the service.
struct GNUNET_STATISTICS_Handle * GST_stats
Statistics handle.
const struct GNUNET_CONFIGURATION_Handle * GST_cfg
Configuration 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 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.
enum State state
current state of profiling
Information about ongoing sessions of the transport client.
void GST_clients_broadcast(const struct GNUNET_MessageHeader *msg, int may_drop)
Broadcast the given message to all of our clients.
static int result
Global testing status.
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.
GST_BlacklistTestContinuation cont
Continuation to call with the result.
32-bit bandwidth used for network exchange by GNUnet, in bytes per second.
Private ECC key encoded for transmission.
The identity of the host (wraps the signing key of the peer).
configuration data
Definition: configuration.c:85
An address for communicating with a peer.
Automatic transport selection and outbound bandwidth determination.
Header for all communications.
Time for absolute times used by GNUnet, in microseconds.
struct GNUNET_ATS_SchedulingHandle * GST_ats
ATS handle.
struct GNUNET_PeerIdentity GST_my_identity
Configuration handle.
Handle to the ATS subsystem for connectivity management.
void * cont_cls
Closure for cont.
void GST_blacklist_abort_matching(const struct GNUNET_HELLO_Address *address, struct GNUNET_ATS_Session *session)
Abort blacklist if address and session match.
static char * address
GNS address for this phone.
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...
Time for relative time used by GNUnet, in microseconds.
struct GNUNET_NT_InterfaceScanner * GST_is
Interface scanner determines our LAN address range(s).