diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-04-03 21:25:59 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-04-03 21:26:08 +0200 |
commit | 670ebb20b9570120df1021e467b575a212743125 (patch) | |
tree | e94b1e8e2bb52da66b426c861f34f8e950dcf8ed /src/include | |
parent | f13792325fc3f7e49ec2b0880eb4f1aa978e00d7 (diff) | |
download | gnunet-670ebb20b9570120df1021e467b575a212743125.tar.gz gnunet-670ebb20b9570120df1021e467b575a212743125.zip |
allow applications expressing connection preferences directly to TNG, collect HELLOs from PEERSTORE for expressed prefs
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_ats_application_service.h | 6 | ||||
-rw-r--r-- | src/include/gnunet_peerstore_service.h | 4 | ||||
-rw-r--r-- | src/include/gnunet_protocols.h | 12 | ||||
-rw-r--r-- | src/include/gnunet_transport_application_service.h | 100 |
4 files changed, 117 insertions, 5 deletions
diff --git a/src/include/gnunet_ats_application_service.h b/src/include/gnunet_ats_application_service.h index e942ca4d8..fbc6f48ac 100644 --- a/src/include/gnunet_ats_application_service.h +++ b/src/include/gnunet_ats_application_service.h | |||
@@ -83,9 +83,9 @@ struct GNUNET_ATS_ApplicationSuggestHandle; | |||
83 | */ | 83 | */ |
84 | struct GNUNET_ATS_ApplicationSuggestHandle * | 84 | struct GNUNET_ATS_ApplicationSuggestHandle * |
85 | GNUNET_ATS_application_suggest (struct GNUNET_ATS_ApplicationHandle *ch, | 85 | GNUNET_ATS_application_suggest (struct GNUNET_ATS_ApplicationHandle *ch, |
86 | const struct GNUNET_PeerIdentity *peer, | 86 | const struct GNUNET_PeerIdentity *peer, |
87 | enum GNUNET_MQ_PreferenceKind pk, | 87 | enum GNUNET_MQ_PreferenceKind pk, |
88 | struct GNUNET_BANDWIDTH_Value32NBO bw); | 88 | struct GNUNET_BANDWIDTH_Value32NBO bw); |
89 | 89 | ||
90 | 90 | ||
91 | /** | 91 | /** |
diff --git a/src/include/gnunet_peerstore_service.h b/src/include/gnunet_peerstore_service.h index 55f371399..31567c004 100644 --- a/src/include/gnunet_peerstore_service.h +++ b/src/include/gnunet_peerstore_service.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | Copyright (C) | 3 | Copyright (C) GNUnet e.V. 2004--2019 |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 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 | 6 | under the terms of the GNU Affero General Public License as published |
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 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/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h index 46620b829..7f1667d51 100644 --- a/src/include/gnunet_protocols.h +++ b/src/include/gnunet_protocols.h | |||
@@ -3177,6 +3177,18 @@ extern "C" | |||
3177 | */ | 3177 | */ |
3178 | #define GNUNET_MESSAGE_TYPE_TRANSPORT_COMMUNICATOR_FC_LIMITS 1276 | 3178 | #define GNUNET_MESSAGE_TYPE_TRANSPORT_COMMUNICATOR_FC_LIMITS 1276 |
3179 | 3179 | ||
3180 | /** | ||
3181 | * Type of the 'struct ExpressPreferenceMessage' send by clients to TRANSPORT | ||
3182 | * to establish bandwidth preference. | ||
3183 | */ | ||
3184 | #define GNUNET_MESSAGE_TYPE_TRANSPORT_SUGGEST 1300 | ||
3185 | |||
3186 | /** | ||
3187 | * Type of the 'struct ExpressPreferenceMessage' send by clients to TRANSPORT | ||
3188 | * to abandon bandwidth preference. | ||
3189 | */ | ||
3190 | #define GNUNET_MESSAGE_TYPE_TRANSPORT_SUGGEST_CANCEL 1301 | ||
3191 | |||
3180 | 3192 | ||
3181 | /* ************** NEW (NG) ATS Messages ************* */ | 3193 | /* ************** NEW (NG) ATS Messages ************* */ |
3182 | 3194 | ||
diff --git a/src/include/gnunet_transport_application_service.h b/src/include/gnunet_transport_application_service.h new file mode 100644 index 000000000..31097b88e --- /dev/null +++ b/src/include/gnunet_transport_application_service.h | |||
@@ -0,0 +1,100 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | Copyright (C) 2010-2015, 2018, 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 | */ | ||
20 | /** | ||
21 | * @file | ||
22 | * Bandwidth allocation API for applications to interact with | ||
23 | * | ||
24 | * @author Christian Grothoff | ||
25 | * @author Matthias Wachs | ||
26 | * | ||
27 | * @defgroup TRANSPORT service | ||
28 | * Bandwidth allocation | ||
29 | * | ||
30 | * @{ | ||
31 | */ | ||
32 | #ifndef GNUNET_TRANSPORT_APPLICATION_SERVICE_H | ||
33 | #define GNUNET_TRANSPORT_APPLICATION_SERVICE_H | ||
34 | |||
35 | #include "gnunet_constants.h" | ||
36 | #include "gnunet_util_lib.h" | ||
37 | |||
38 | /** | ||
39 | * Handle to the TRANSPORT subsystem for making suggestions about | ||
40 | * connections the peer would like to have. | ||
41 | */ | ||
42 | struct GNUNET_TRANSPORT_ApplicationHandle; | ||
43 | |||
44 | |||
45 | /** | ||
46 | * Initialize the TRANSPORT application client handle. | ||
47 | * | ||
48 | * @param cfg configuration to use | ||
49 | * @return ats application handle, NULL on error | ||
50 | */ | ||
51 | struct GNUNET_TRANSPORT_ApplicationHandle * | ||
52 | GNUNET_TRANSPORT_application_init (const struct GNUNET_CONFIGURATION_Handle *cfg); | ||
53 | |||
54 | |||
55 | /** | ||
56 | * Shutdown TRANSPORT application client. | ||
57 | * | ||
58 | * @param ch handle to destroy | ||
59 | */ | ||
60 | void | ||
61 | GNUNET_TRANSPORT_application_done (struct GNUNET_TRANSPORT_ApplicationHandle *ch); | ||
62 | |||
63 | |||
64 | /** | ||
65 | * Handle for suggestion requests. | ||
66 | */ | ||
67 | struct GNUNET_TRANSPORT_ApplicationSuggestHandle; | ||
68 | |||
69 | |||
70 | /** | ||
71 | * An application would like to communicate with a peer. TRANSPORT should | ||
72 | * allocate bandwith using a suitable address for requiremetns @a pk | ||
73 | * to transport. | ||
74 | * | ||
75 | * @param ch handle | ||
76 | * @param peer identity of the peer we need an address for | ||
77 | * @param pk what kind of application will the application require (can be | ||
78 | * #GNUNET_MQ_PREFERENCE_NONE, we will still try to connect) | ||
79 | * @param bw desired bandwith, can be zero (we will still try to connect) | ||
80 | * @return suggestion handle, NULL if request is already pending | ||
81 | */ | ||
82 | struct GNUNET_TRANSPORT_ApplicationSuggestHandle * | ||
83 | GNUNET_TRANSPORT_application_suggest (struct GNUNET_TRANSPORT_ApplicationHandle *ch, | ||
84 | const struct GNUNET_PeerIdentity *peer, | ||
85 | enum GNUNET_MQ_PreferenceKind pk, | ||
86 | struct GNUNET_BANDWIDTH_Value32NBO bw); | ||
87 | |||
88 | |||
89 | /** | ||
90 | * We no longer care about communicating with a peer. | ||
91 | * | ||
92 | * @param sh handle | ||
93 | */ | ||
94 | void | ||
95 | GNUNET_TRANSPORT_application_suggest_cancel (struct GNUNET_TRANSPORT_ApplicationSuggestHandle *sh); | ||
96 | |||
97 | /** @} */ /* end of group */ | ||
98 | |||
99 | #endif | ||
100 | /* end of file gnunet_ats_application_service.h */ | ||