GNUnet  0.10.x
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  */
33 #ifndef GNUNET_TRANSPORT_CORE_SERVICE_H
34 #define GNUNET_TRANSPORT_CORE_SERVICE_H
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #if 0 /* keep Emacsens' auto-indent happy */
39 }
40 #endif
41 #endif
42 
43 #include "gnunet_util_lib.h"
44 
48 #define GNUNET_TRANSPORT_CORE_VERSION 0x00000000
49 
50 
55 
56 
69 typedef void *(*GNUNET_TRANSPORT_NotifyConnect) (
70  void *cls,
71  const struct GNUNET_PeerIdentity *peer,
72  struct GNUNET_MQ_Handle *mq);
73 
74 
87  void *cls,
88  const struct GNUNET_PeerIdentity *peer,
89  void *handler_cls);
90 
91 
111  const struct GNUNET_PeerIdentity *self,
112  const struct GNUNET_MQ_MessageHandler *handlers,
113  void *cls,
116 
117 
123 void
125 
126 
147 void
148 GNUNET_TRANSPORT_core_receive_continue(struct GNUNET_TRANSPORT_CoreHandle *ch,
149  const struct GNUNET_PeerIdentity *pid);
150 
151 
160 struct GNUNET_MQ_Handle *
162  const struct GNUNET_PeerIdentity *peer);
163 
164 
165 #if 0 /* keep Emacsens' auto-indent happy */
166 {
167 #endif
168 #ifdef __cplusplus
169 }
170 #endif
171 
172 /* ifndef GNUNET_TRANSPORT_CORE_SERVICE_H */
173 #endif
174  /* end of group */
176 
177 /* end of gnunet_transport_core_service.h */
static struct GNUNET_CADET_Channel * ch
Channel handle.
Definition: gnunet-cadet.c:117
void * cls
Closure for the callbacks.
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_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.
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. ...
static struct GNUNET_CADET_MessageHandler handlers[]
Handlers, for diverse services.
static struct GNUNET_DNS_Handle * handle
Handle to transport service.
Message handler for a specific message type.
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:104
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.
static struct GNUNET_PEERINFO_NotifyContext * nc
Iterator context.
Handle to a message queue.
Definition: mq.c:84
The identity of the host (wraps the signing key of the peer).
configuration data
Definition: configuration.c:83
void GNUNET_TRANSPORT_core_disconnect(struct GNUNET_TRANSPORT_CoreHandle *handle)
Disconnect from the transport service.
struct GNUNET_MQ_Handle * mq
Definition: 003.c:5
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.
static struct GNUNET_PeerIdentity pid
Identity of the peer we transmit to / connect to.
Handle for the transport service (includes all of the state for the transport service).