GNUnet 0.21.1
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
40extern "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
73typedef 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,
117 void *cls,
120
121
127void
129
130
151void
152GNUNET_TRANSPORT_core_receive_continue (struct GNUNET_TRANSPORT_CoreHandle *ch,
153 const struct GNUNET_PeerIdentity *pid);
154
155
164struct 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_MessageHandlers handlers[]
Definition: 003.c:1
struct GNUNET_MQ_Handle * mq
Definition: 003.c:5
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:109
static struct GNUNET_CADET_Channel * ch
Channel handle.
Definition: gnunet-cadet.c:117
static struct GNUNET_NotificationContext * nc
Notification context for broadcasting to monitors.
static struct GNUNET_PeerIdentity pid
Identity of the peer we transmit to / connect to.
static struct GNUNET_VPN_Handle * handle
Handle to vpn service.
Definition: gnunet-vpn.c:35
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_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_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).
struct GNUNET_PeerIdentity self
Peer identity as assumed by this process, or all zeros.
void * cls
Closure for the callbacks.
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.