GNUnet  0.17.6
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 #include "gnunet_util_lib.h"
47 
51 #define GNUNET_TRANSPORT_CORE_VERSION 0x00000000
52 
53 
58 
59 
72 typedef void *(*GNUNET_TRANSPORT_NotifyConnect) (
73  void *cls,
74  const struct GNUNET_PeerIdentity *peer,
75  struct GNUNET_MQ_Handle *mq);
76 
77 
90  void *cls,
91  const struct GNUNET_PeerIdentity *peer,
92  void *handler_cls);
93 
94 
114  const struct GNUNET_PeerIdentity *self,
115  const struct GNUNET_MQ_MessageHandler *handlers,
116  void *cls,
119 
120 
126 void
128 
129 
150 void
151 GNUNET_TRANSPORT_core_receive_continue (struct GNUNET_TRANSPORT_CoreHandle *ch,
152  const struct GNUNET_PeerIdentity *pid);
153 
154 
163 struct GNUNET_MQ_Handle *
165  const struct GNUNET_PeerIdentity *peer);
166 
167 
168 #if 0 /* keep Emacsens' auto-indent happy */
169 {
170 #endif
171 #ifdef __cplusplus
172 }
173 #endif
174 
175 /* ifndef GNUNET_TRANSPORT_CORE_SERVICE_H */
176 #endif
177  /* end of group */
179  /* end of group addition */
181 
182 /* 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:86
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.