aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-07-25 00:30:00 +0000
committerChristian Grothoff <christian@grothoff.org>2016-07-25 00:30:00 +0000
commitd0701eb6315fc3f5aca74415bbf0ff7418409f87 (patch)
treefcacb97bbcca542ce9493001c825fd265cb8a801 /src/include
parent9bfb8bff3fd253407530c76c7590b33bacf033f1 (diff)
downloadgnunet-d0701eb6315fc3f5aca74415bbf0ff7418409f87.tar.gz
gnunet-d0701eb6315fc3f5aca74415bbf0ff7418409f87.zip
switching transport tests to new MQ-based transport API
Diffstat (limited to 'src/include')
-rw-r--r--src/include/Makefile.am5
-rw-r--r--src/include/gnunet_transport_core_service.h5
-rw-r--r--src/include/gnunet_transport_manipulation_service.h113
3 files changed, 122 insertions, 1 deletions
diff --git a/src/include/Makefile.am b/src/include/Makefile.am
index 0faec4cfc..0ba6f8c74 100644
--- a/src/include/Makefile.am
+++ b/src/include/Makefile.am
@@ -118,6 +118,11 @@ gnunetinclude_HEADERS = \
118 gnunet_testing_lib.h \ 118 gnunet_testing_lib.h \
119 gnunet_time_lib.h \ 119 gnunet_time_lib.h \
120 gnunet_transport_service.h \ 120 gnunet_transport_service.h \
121 gnunet_transport_communication_service.h \
122 gnunet_transport_core_service.h \
123 gnunet_transport_hello_service.h \
124 gnunet_transport_manipulation_service.h \
125 gnunet_transport_monitor_service.h \
121 gnunet_transport_plugin.h \ 126 gnunet_transport_plugin.h \
122 gnunet_tun_lib.h \ 127 gnunet_tun_lib.h \
123 gnunet_util_lib.h \ 128 gnunet_util_lib.h \
diff --git a/src/include/gnunet_transport_core_service.h b/src/include/gnunet_transport_core_service.h
index 6dada4f54..941ef27e4 100644
--- a/src/include/gnunet_transport_core_service.h
+++ b/src/include/gnunet_transport_core_service.h
@@ -60,7 +60,10 @@ struct GNUNET_TRANSPORT_CoreHandle;
60 * peer connected to us. 60 * peer connected to us.
61 * 61 *
62 * @param cls closure 62 * @param cls closure
63 * @param peer the peer that connected 63 * @param peer the identity of the peer that connected; this
64 * pointer will remain valid until the disconnect, hence
65 * applications do not necessarily have to make a copy
66 * of the value if they only need it until disconnect
64 * @param mq message queue to use to transmit to @a peer 67 * @param mq message queue to use to transmit to @a peer
65 * @return closure to use in MQ handlers 68 * @return closure to use in MQ handlers
66 */ 69 */
diff --git a/src/include/gnunet_transport_manipulation_service.h b/src/include/gnunet_transport_manipulation_service.h
new file mode 100644
index 000000000..8c1789636
--- /dev/null
+++ b/src/include/gnunet_transport_manipulation_service.h
@@ -0,0 +1,113 @@
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2009-2014, 2016 GNUnet e.V.
4
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 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 General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21/**
22 * @author Christian Grothoff
23 *
24 * @file
25 * Low-level P2P IO
26 *
27 * @defgroup transport Transport service
28 * Low-level P2P IO
29 *
30 * @see [Documentation](https://gnunet.org/transport-service)
31 *
32 * @{
33 */
34
35#ifndef GNUNET_TRANSPORT_MANIPULATION_SERVICE_H
36#define GNUNET_TRANSPORT_MANIPULATION_SERVICE_H
37
38
39#ifdef __cplusplus
40extern "C"
41{
42#if 0 /* keep Emacsens' auto-indent happy */
43}
44#endif
45#endif
46
47#include "gnunet_util_lib.h"
48#include "gnunet_ats_service.h"
49
50/**
51 * Version number of the transport API.
52 */
53#define GNUNET_TRANSPORT_MANIPULATION_VERSION 0x00000003
54
55/**
56 * Handle for transport manipulation.
57 */
58struct GNUNET_TRANSPORT_ManipulationHandle;
59
60
61/**
62 * Connect to the transport service. Note that the connection may
63 * complete (or fail) asynchronously.
64 *
65 * @param cfg configuration to use
66 * @return NULL on error
67 */
68struct GNUNET_TRANSPORT_ManipulationHandle *
69GNUNET_TRANSPORT_manipulation_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
70
71
72/**
73 * Disconnect from the transport service.
74 *
75 * @param handle handle returned from connect
76 */
77void
78GNUNET_TRANSPORT_manipulation_disconnect (struct GNUNET_TRANSPORT_ManipulationHandle *handle);
79
80
81/**
82 * Set transport metrics for a peer and a direction
83 *
84 * @param handle transport handle
85 * @param peer the peer to set the metric for
86 * @param prop the performance metrics to set
87 * @param delay_in inbound delay to introduce
88 * @param delay_out outbound delay to introduce
89 *
90 * Note: Delay restrictions in receiving direction will be enforced
91 * with one message delay.
92 */
93void
94GNUNET_TRANSPORT_manipulation_set (struct GNUNET_TRANSPORT_ManipulationHandle *handle,
95 const struct GNUNET_PeerIdentity *peer,
96 const struct GNUNET_ATS_Properties *prop,
97 struct GNUNET_TIME_Relative delay_in,
98 struct GNUNET_TIME_Relative delay_out);
99
100
101#if 0 /* keep Emacsens' auto-indent happy */
102{
103#endif
104#ifdef __cplusplus
105}
106#endif
107
108/* ifndef GNUNET_TRANSPORT_MANIPULATION_SERVICE_H */
109#endif
110
111/** @} */ /* end of group */
112
113/* end of gnunet_transport_manipulation_service.h */