diff options
Diffstat (limited to 'src/include/gnunet_transport_hello_service.h')
-rw-r--r-- | src/include/gnunet_transport_hello_service.h | 209 |
1 files changed, 0 insertions, 209 deletions
diff --git a/src/include/gnunet_transport_hello_service.h b/src/include/gnunet_transport_hello_service.h deleted file mode 100644 index 34d3c8e4a..000000000 --- a/src/include/gnunet_transport_hello_service.h +++ /dev/null | |||
@@ -1,209 +0,0 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | Copyright (C) 2009-2016 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 | /** | ||
22 | * @addtogroup Backbone | ||
23 | * @{ | ||
24 | * | ||
25 | * @author Christian Grothoff | ||
26 | * | ||
27 | * @file | ||
28 | * obtain information about our current address | ||
29 | * | ||
30 | * @deprecated, in TNG applications should query PEERSTORE directly! | ||
31 | * | ||
32 | * @defgroup transport Transport service | ||
33 | * address information | ||
34 | * | ||
35 | * @see [Documentation](https://gnunet.org/transport-service) | ||
36 | * | ||
37 | * @{ | ||
38 | */ | ||
39 | #ifndef GNUNET_TRANSPORT_HELLO_SERVICE_H | ||
40 | #define GNUNET_TRANSPORT_HELLO_SERVICE_H | ||
41 | |||
42 | #ifdef __cplusplus | ||
43 | extern "C" { | ||
44 | #if 0 /* keep Emacsens' auto-indent happy */ | ||
45 | } | ||
46 | #endif | ||
47 | #endif | ||
48 | |||
49 | |||
50 | #include "gnunet_util_lib.h" | ||
51 | #include "gnunet_ats_service.h" | ||
52 | |||
53 | /** | ||
54 | * Version number of the transport API. | ||
55 | */ | ||
56 | #define GNUNET_TRANSPORT_HELLO_VERSION 0x00000000 | ||
57 | |||
58 | |||
59 | /** | ||
60 | * Some addresses contain sensitive information or are | ||
61 | * not suitable for global distribution. We use address | ||
62 | * classes to filter addresses by which domain they make | ||
63 | * sense to be used in. These are used in a bitmask. | ||
64 | */ | ||
65 | enum GNUNET_TRANSPORT_AddressClass | ||
66 | { | ||
67 | /** | ||
68 | * No address. | ||
69 | */ | ||
70 | GNUNET_TRANSPORT_AC_NONE = 0, | ||
71 | |||
72 | /** | ||
73 | * Addresses that fall into no other category | ||
74 | * (i.e. incoming which we cannot use elsewhere). | ||
75 | */ | ||
76 | GNUNET_TRANSPORT_AC_OTHER = 1, | ||
77 | |||
78 | /** | ||
79 | * Addresses that are global and are insensitive | ||
80 | * (i.e. IPv4). | ||
81 | */ | ||
82 | GNUNET_TRANSPORT_AC_GLOBAL = 2, | ||
83 | |||
84 | /** | ||
85 | * Addresses that are global and are sensitive | ||
86 | * (i.e. IPv6 with our MAC). | ||
87 | */ | ||
88 | GNUNET_TRANSPORT_AC_GLOBAL_PRIVATE = 4, | ||
89 | |||
90 | /** | ||
91 | * Addresses useful in the local wired network, | ||
92 | * i.e. a MAC. Sensitive, but obvious to people nearby. | ||
93 | * Useful for broadcasts. | ||
94 | */ | ||
95 | GNUNET_TRANSPORT_AC_LAN = 8, | ||
96 | |||
97 | /** | ||
98 | * Addresses useful in the local wireless network, | ||
99 | * i.e. a MAC. Sensitive, but obvious to people nearby. | ||
100 | * Useful for broadcasts. | ||
101 | */ | ||
102 | GNUNET_TRANSPORT_AC_WLAN = 16, | ||
103 | |||
104 | /** | ||
105 | * Addresses useful in the local bluetooth network. Sensitive, but | ||
106 | * obvious to people nearby. Useful for broadcasts. | ||
107 | */ | ||
108 | GNUNET_TRANSPORT_AC_BT = 32, | ||
109 | |||
110 | /** | ||
111 | * Bitmask for "any" address. | ||
112 | */ | ||
113 | GNUNET_TRANSPORT_AC_ANY = 65535 | ||
114 | }; | ||
115 | |||
116 | |||
117 | /** | ||
118 | * Function called whenever there is an update to the | ||
119 | * HELLO of this peer. | ||
120 | * | ||
121 | * @param cls closure | ||
122 | * @param hello our updated HELLO | ||
123 | */ | ||
124 | typedef void (*GNUNET_TRANSPORT_HelloUpdateCallback) ( | ||
125 | void *cls, | ||
126 | const struct GNUNET_MessageHeader *hello); | ||
127 | |||
128 | |||
129 | /** | ||
130 | * Handle to cancel a #GNUNET_TRANSPORT_hello_get() operation. | ||
131 | */ | ||
132 | struct GNUNET_TRANSPORT_HelloGetHandle; | ||
133 | |||
134 | |||
135 | /** | ||
136 | * Obtain updates on changes to the HELLO message for this peer. The callback | ||
137 | * given in this function is never called synchronously. | ||
138 | * | ||
139 | * @param cfg configuration to use | ||
140 | * @param ac which network type should the addresses from the HELLO belong to? | ||
141 | * @param rec function to call with the HELLO | ||
142 | * @param rec_cls closure for @a rec | ||
143 | * @return handle to cancel the operation | ||
144 | */ | ||
145 | struct GNUNET_TRANSPORT_HelloGetHandle * | ||
146 | GNUNET_TRANSPORT_hello_get (const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
147 | enum GNUNET_TRANSPORT_AddressClass ac, | ||
148 | GNUNET_TRANSPORT_HelloUpdateCallback rec, | ||
149 | void *rec_cls) __attribute__((deprecated)); | ||
150 | |||
151 | |||
152 | /** | ||
153 | * Stop receiving updates about changes to our HELLO message. | ||
154 | * | ||
155 | * @param ghh handle to cancel | ||
156 | */ | ||
157 | void | ||
158 | GNUNET_TRANSPORT_hello_get_cancel (struct | ||
159 | GNUNET_TRANSPORT_HelloGetHandle *ghh) | ||
160 | __attribute__((deprecated)); | ||
161 | |||
162 | |||
163 | /** | ||
164 | * Function with addresses found in a HELLO. | ||
165 | * | ||
166 | * @param cls closure | ||
167 | * @param peer identity of the peer | ||
168 | * @param address the address (UTF-8, 0-terminated) | ||
169 | * @param nt network type of the address | ||
170 | * @param expiration when does this address expire? | ||
171 | */ | ||
172 | typedef void (*GNUNET_TRANSPORT_AddressCallback)( | ||
173 | void *cls, | ||
174 | const struct GNUNET_PeerIdentity *peer, | ||
175 | const char *address, | ||
176 | enum GNUNET_NetworkType nt, | ||
177 | struct GNUNET_TIME_Absolute expiration) __attribute__((deprecated)); | ||
178 | |||
179 | |||
180 | /** | ||
181 | * Parse a HELLO message that we have received into its | ||
182 | * constituent addresses. | ||
183 | * | ||
184 | * @param hello message to parse | ||
185 | * @param cb function to call on each address found | ||
186 | * @param cb_cls closure for @a cb | ||
187 | * @return #GNUNET_OK if hello was well-formed, #GNUNET_SYSERR if not | ||
188 | */ | ||
189 | int | ||
190 | GNUNET_TRANSPORT_hello_parse (const struct GNUNET_MessageHeader *hello, | ||
191 | GNUNET_TRANSPORT_AddressCallback cb, | ||
192 | void *cb_cls) __attribute__((deprecated)); | ||
193 | |||
194 | |||
195 | #if 0 /* keep Emacsens' auto-indent happy */ | ||
196 | { | ||
197 | #endif | ||
198 | #ifdef __cplusplus | ||
199 | } | ||
200 | #endif | ||
201 | |||
202 | /* ifndef GNUNET_TRANSPORT_HELLO_SERVICE_H */ | ||
203 | #endif | ||
204 | |||
205 | /** @} */ /* end of group */ | ||
206 | |||
207 | /** @} */ /* end of group addition */ | ||
208 | |||
209 | /* end of gnunet_transport_hello_service.h */ | ||