GNUnet  0.19.3
gnunet_transport_core_service.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2009-2019 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_TRANSPORT_CORE_SERVICE_H
37 #define GNUNET_TRANSPORT_CORE_SERVICE_H
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #if 0 /* keep Emacsens' auto-indent happy */
42 }
43 #endif
44 #endif
45 
46 
47 #include "gnunet_util_lib.h"
48 
52 #define GNUNET_TRANSPORT_CORE_VERSION 0x00000000
53 
54 
59 
60 
73 typedef void *(*GNUNET_TRANSPORT_NotifyConnect) (
74  void *cls,
75  const struct GNUNET_PeerIdentity *peer,
76  struct GNUNET_MQ_Handle *mq);
77 
78 
91  void *cls,
92  const struct GNUNET_PeerIdentity *peer,
93  void *handler_cls);
94 
95 
115  const struct GNUNET_PeerIdentity *self,
116  const struct GNUNET_MQ_MessageHandler *handlers,
117  void *cls,
120 
121 
127 void
129 
130 
151 void
152 GNUNET_TRANSPORT_core_receive_continue (struct GNUNET_TRANSPORT_CoreHandle *ch,
153  const struct GNUNET_PeerIdentity *pid);
154 
155 
164 struct GNUNET_MQ_Handle *
166  const struct GNUNET_PeerIdentity *peer);
167 
168 
169 #if 0 /* keep Emacsens' auto-indent happy */
170 {
171 #endif
172 #ifdef __cplusplus
173 }
174 #endif
175 
176 /* ifndef GNUNET_TRANSPORT_CORE_SERVICE_H */
177 #endif
178  /* end of group */
180  /* end of group addition */
182 
183 /* end of gnunet_transport_core_service.h */
struct GNUNET_MQ_Handle * mq
Definition: 003.c:5
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
static struct GNUNET_CADET_MessageHandler handlers[]
Handlers, for diverse services.
static struct GNUNET_CADET_Channel * ch
Channel handle.
Definition: gnunet-cadet.c:117
static struct GNUNET_DNS_Handle * handle
Handle to transport service.
static struct GNUNET_PEERINFO_NotifyContext * nc
Iterator context.
static struct GNUNET_PeerIdentity pid
Identity of the peer we transmit to / connect to.
struct GNUNET_MQ_Handle * GNUNET_TRANSPORT_core_get_mq(struct GNUNET_TRANSPORT_CoreHandle *handle, const struct GNUNET_PeerIdentity *peer)
Checks if a given peer is connected to us and get the message queue.
void *(* GNUNET_TRANSPORT_NotifyConnect)(void *cls, const struct GNUNET_PeerIdentity *peer, struct GNUNET_MQ_Handle *mq)
Function called to notify transport users that another peer connected to us.
struct GNUNET_TRANSPORT_CoreHandle * GNUNET_TRANSPORT_core_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_PeerIdentity *self, const struct GNUNET_MQ_MessageHandler *handlers, void *cls, GNUNET_TRANSPORT_NotifyConnect nc, GNUNET_TRANSPORT_NotifyDisconnect nd)
Connect to the transport service.
void(* GNUNET_TRANSPORT_NotifyDisconnect)(void *cls, const struct GNUNET_PeerIdentity *peer, void *handler_cls)
Function called to notify transport users that another peer disconnected from us.
void GNUNET_TRANSPORT_core_disconnect(struct GNUNET_TRANSPORT_CoreHandle *handle)
Disconnect from the transport service.
Handle to a message queue.
Definition: mq.c:87
Message handler for a specific message type.
The identity of the host (wraps the signing key of the peer).
Handle for the transport service (includes all of the state for the transport service).
void * cls
Closure for the callbacks.
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.