diff options
author | t3sserakt <t3ss@posteo.de> | 2021-09-20 09:00:16 +0200 |
---|---|---|
committer | t3sserakt <t3ss@posteo.de> | 2021-09-20 11:10:54 +0200 |
commit | b97b260a0461401b317958002b472ff7ed29fb68 (patch) | |
tree | 0681d8e7e91626cdcd22f5724557e39153b45306 /src/include | |
parent | d5df403e64bbde52c5436165eee5231a1b2f876b (diff) | |
parent | 48896731e966376ec6f256e175e0d12cd17afa42 (diff) | |
download | gnunet-b97b260a0461401b317958002b472ff7ed29fb68.tar.gz gnunet-b97b260a0461401b317958002b472ff7ed29fb68.zip |
Merge branch 'master' of ssh://git.gnunet.org/gnunet
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_common.h | 8 | ||||
-rw-r--r-- | src/include/gnunet_dhtu_plugin.h | 54 | ||||
-rw-r--r-- | src/include/gnunet_hello_lib.h | 7 | ||||
-rw-r--r-- | src/include/gnunet_mq_lib.h | 21 | ||||
-rw-r--r-- | src/include/gnunet_transport_service.h | 21 |
5 files changed, 50 insertions, 61 deletions
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h index ca3ddceaa..4472d3ee8 100644 --- a/src/include/gnunet_common.h +++ b/src/include/gnunet_common.h | |||
@@ -151,10 +151,10 @@ enum GNUNET_GenericReturnValue | |||
151 | */ | 151 | */ |
152 | 152 | ||
153 | #if __BYTE_ORDER == __LITTLE_ENDIAN | 153 | #if __BYTE_ORDER == __LITTLE_ENDIAN |
154 | #if defined(__linux__) | 154 | #ifdef HAVE_BYTESWAP_H |
155 | #define BYTE_SWAP_16(x) __bswap_16 (x) | 155 | #define BYTE_SWAP_16(x) bswap_16 (x) |
156 | #define BYTE_SWAP_32(x) __bswap_32 (x) | 156 | #define BYTE_SWAP_32(x) bswap_32 (x) |
157 | #define BYTE_SWAP_64(x) __bswap_64 (x) | 157 | #define BYTE_SWAP_64(x) bswap_64 (x) |
158 | #else | 158 | #else |
159 | #define BYTE_SWAP_16(x) ((((x) & 0x00ff) << 8) | (((x) & 0xff00) >> 8)) | 159 | #define BYTE_SWAP_16(x) ((((x) & 0x00ff) << 8) | (((x) & 0xff00) >> 8)) |
160 | 160 | ||
diff --git a/src/include/gnunet_dhtu_plugin.h b/src/include/gnunet_dhtu_plugin.h index df9729a23..e65318fb5 100644 --- a/src/include/gnunet_dhtu_plugin.h +++ b/src/include/gnunet_dhtu_plugin.h | |||
@@ -75,42 +75,18 @@ struct GNUNET_DHTU_PublicKey | |||
75 | 75 | ||
76 | /* followed by size-2 bytes of the actual public key */ | 76 | /* followed by size-2 bytes of the actual public key */ |
77 | }; | 77 | }; |
78 | 78 | ||
79 | 79 | ||
80 | /** | 80 | /** |
81 | * Hash used by the DHT for keys and peers. | 81 | * Hash used by the DHT for keys and peers. |
82 | */ | 82 | */ |
83 | struct GNUNET_DHTU_Hash | 83 | struct GNUNET_DHTU_Hash |
84 | { | 84 | { |
85 | |||
86 | /** | ||
87 | * For now, use a 512 bit hash. (To be discussed). | ||
88 | */ | ||
89 | struct GNUNET_HashCode hc; | ||
90 | }; | ||
91 | |||
92 | 85 | ||
93 | /** | ||
94 | * @brief header of what an DHTU signature signs | ||
95 | * this must be followed by "size - 8" bytes of | ||
96 | * the actual signed data | ||
97 | */ | ||
98 | struct GNUNET_DHTU_SignaturePurpose | ||
99 | { | ||
100 | /** | 86 | /** |
101 | * How many bytes does this signature sign? | 87 | * For now, use a 512 bit hash. (To be discussed). |
102 | * (including this purpose header); in network | ||
103 | * byte order (!). | ||
104 | */ | ||
105 | uint32_t size GNUNET_PACKED; | ||
106 | |||
107 | /** | ||
108 | * What does this signature vouch for? This | ||
109 | * must contain a GNUNET_SIGNATURE_PURPOSE_XXX | ||
110 | * constant (from gnunet_signatures.h). In | ||
111 | * network byte order! | ||
112 | */ | 88 | */ |
113 | uint32_t purpose GNUNET_PACKED; | 89 | struct GNUNET_HashCode hc; |
114 | }; | 90 | }; |
115 | 91 | ||
116 | 92 | ||
@@ -131,7 +107,7 @@ struct GNUNET_DHTU_PluginEnvironment | |||
131 | */ | 107 | */ |
132 | void *cls; | 108 | void *cls; |
133 | 109 | ||
134 | /** | 110 | /** |
135 | * Function to call with new addresses of this peer. | 111 | * Function to call with new addresses of this peer. |
136 | * | 112 | * |
137 | * @param cls the closure | 113 | * @param cls the closure |
@@ -151,7 +127,7 @@ struct GNUNET_DHTU_PluginEnvironment | |||
151 | struct GNUNET_DHTU_Source *source, | 127 | struct GNUNET_DHTU_Source *source, |
152 | void **ctx); | 128 | void **ctx); |
153 | 129 | ||
154 | /** | 130 | /** |
155 | * Function to call with expired addresses of this peer. | 131 | * Function to call with expired addresses of this peer. |
156 | * | 132 | * |
157 | * @param[in] ctx storage space used by the DHT in association with this address | 133 | * @param[in] ctx storage space used by the DHT in association with this address |
@@ -160,7 +136,7 @@ struct GNUNET_DHTU_PluginEnvironment | |||
160 | (*address_del_cb)(void *ctx); | 136 | (*address_del_cb)(void *ctx); |
161 | 137 | ||
162 | /** | 138 | /** |
163 | * We have a new estimate on the size of the underlay. | 139 | * We have a new estimate on the size of the underlay. |
164 | * | 140 | * |
165 | * @param cls closure | 141 | * @param cls closure |
166 | * @param timestamp time when the estimate was received from the server (or created by the server) | 142 | * @param timestamp time when the estimate was received from the server (or created by the server) |
@@ -172,7 +148,7 @@ struct GNUNET_DHTU_PluginEnvironment | |||
172 | struct GNUNET_TIME_Absolute timestamp, | 148 | struct GNUNET_TIME_Absolute timestamp, |
173 | double logestimate, | 149 | double logestimate, |
174 | double std_dev); | 150 | double std_dev); |
175 | 151 | ||
176 | /** | 152 | /** |
177 | * Function to call when we connect to a peer and can henceforth transmit to | 153 | * Function to call when we connect to a peer and can henceforth transmit to |
178 | * that peer. | 154 | * that peer. |
@@ -208,7 +184,7 @@ struct GNUNET_DHTU_PluginEnvironment | |||
208 | * @param cls the closure | 184 | * @param cls the closure |
209 | * @param origin where the message originated from | 185 | * @param origin where the message originated from |
210 | * @param[in,out] tctx ctx of target address where we received the message from | 186 | * @param[in,out] tctx ctx of target address where we received the message from |
211 | * @param[in,out] sctx ctx of our own source address at which we received the message | 187 | * @param[in,out] sctx ctx of our own source address at which we received the message |
212 | * @param message the message we received @param message_size number of | 188 | * @param message the message we received @param message_size number of |
213 | * bytes in @a message | 189 | * bytes in @a message |
214 | */ | 190 | */ |
@@ -244,7 +220,7 @@ struct GNUNET_DHTU_PluginFunctions | |||
244 | ssize_t | 220 | ssize_t |
245 | (*sign)(void *cls, | 221 | (*sign)(void *cls, |
246 | const struct GNUNET_DHTU_PrivateKey *pk, | 222 | const struct GNUNET_DHTU_PrivateKey *pk, |
247 | const struct GNUNET_DHTU_SignaturePurpose *purpose, | 223 | const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, |
248 | void **sig); | 224 | void **sig); |
249 | 225 | ||
250 | /** | 226 | /** |
@@ -262,7 +238,7 @@ struct GNUNET_DHTU_PluginFunctions | |||
262 | enum GNUNET_GenericReturnValue | 238 | enum GNUNET_GenericReturnValue |
263 | (*verify)(void *cls, | 239 | (*verify)(void *cls, |
264 | const struct GNUNET_DHTU_PublicKey *pk, | 240 | const struct GNUNET_DHTU_PublicKey *pk, |
265 | const struct GNUNET_DHTU_SignaturePurpose *purpose, | 241 | const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, |
266 | const void *sig, | 242 | const void *sig, |
267 | size_t sig_size); | 243 | size_t sig_size); |
268 | 244 | ||
@@ -281,7 +257,7 @@ struct GNUNET_DHTU_PluginFunctions | |||
281 | * Request underlay to keep the connection to @a target alive if possible. | 257 | * Request underlay to keep the connection to @a target alive if possible. |
282 | * Hold may be called multiple times to express a strong preference to | 258 | * Hold may be called multiple times to express a strong preference to |
283 | * keep a connection, say because a @a target is in multiple tables. | 259 | * keep a connection, say because a @a target is in multiple tables. |
284 | * | 260 | * |
285 | * @param cls closure | 261 | * @param cls closure |
286 | * @param target connection to keep alive | 262 | * @param target connection to keep alive |
287 | */ | 263 | */ |
@@ -291,13 +267,13 @@ struct GNUNET_DHTU_PluginFunctions | |||
291 | 267 | ||
292 | /** | 268 | /** |
293 | * Do no long request underlay to keep the connection alive. | 269 | * Do no long request underlay to keep the connection alive. |
294 | * | 270 | * |
295 | * @param cls closure | 271 | * @param cls closure |
296 | * @param target connection to keep alive | 272 | * @param target connection to keep alive |
297 | */ | 273 | */ |
298 | void | 274 | void |
299 | (*drop)(struct GNUNET_DHTU_PreferenceHandle *ph); | 275 | (*drop)(struct GNUNET_DHTU_PreferenceHandle *ph); |
300 | 276 | ||
301 | /** | 277 | /** |
302 | * Send message to some other participant over the network. Note that | 278 | * Send message to some other participant over the network. Note that |
303 | * sending is not guaranteeing that the other peer actually received the | 279 | * sending is not guaranteeing that the other peer actually received the |
@@ -310,7 +286,7 @@ struct GNUNET_DHTU_PluginFunctions | |||
310 | * @param msg_size number of bytes in @a msg | 286 | * @param msg_size number of bytes in @a msg |
311 | * @param finished_cb function called once transmission is done | 287 | * @param finished_cb function called once transmission is done |
312 | * (not called if @a target disconnects, then only the | 288 | * (not called if @a target disconnects, then only the |
313 | * disconnect_cb is called). | 289 | * disconnect_cb is called). |
314 | * @param finished_cb_cls closure for @a finished_cb | 290 | * @param finished_cb_cls closure for @a finished_cb |
315 | */ | 291 | */ |
316 | void | 292 | void |
@@ -320,7 +296,7 @@ struct GNUNET_DHTU_PluginFunctions | |||
320 | size_t msg_size, | 296 | size_t msg_size, |
321 | GNUNET_SCHEDULER_TaskCallback finished_cb, | 297 | GNUNET_SCHEDULER_TaskCallback finished_cb, |
322 | void *finished_cb_cls); | 298 | void *finished_cb_cls); |
323 | 299 | ||
324 | }; | 300 | }; |
325 | 301 | ||
326 | 302 | ||
diff --git a/src/include/gnunet_hello_lib.h b/src/include/gnunet_hello_lib.h index fff0045aa..74eca999d 100644 --- a/src/include/gnunet_hello_lib.h +++ b/src/include/gnunet_hello_lib.h | |||
@@ -268,9 +268,10 @@ GNUNET_HELLO_add_address (const struct GNUNET_HELLO_Address *address, | |||
268 | * @return number of bytes written or 0, #GNUNET_SYSERR to signal the | 268 | * @return number of bytes written or 0, #GNUNET_SYSERR to signal the |
269 | * end of the iteration. | 269 | * end of the iteration. |
270 | */ | 270 | */ |
271 | typedef ssize_t (*GNUNET_HELLO_GenerateAddressListCallback) (void *cls, | 271 | typedef ssize_t |
272 | size_t max, | 272 | (*GNUNET_HELLO_GenerateAddressListCallback) (void *cls, |
273 | void *buf); | 273 | size_t max, |
274 | void *buf); | ||
274 | 275 | ||
275 | 276 | ||
276 | /** | 277 | /** |
diff --git a/src/include/gnunet_mq_lib.h b/src/include/gnunet_mq_lib.h index 37bba8c1b..765647a98 100644 --- a/src/include/gnunet_mq_lib.h +++ b/src/include/gnunet_mq_lib.h | |||
@@ -331,9 +331,10 @@ typedef int (*GNUNET_MQ_MessageValidationCallback) ( | |||
331 | * @param msg the message to send | 331 | * @param msg the message to send |
332 | * @param impl_state state of the implementation | 332 | * @param impl_state state of the implementation |
333 | */ | 333 | */ |
334 | typedef void (*GNUNET_MQ_SendImpl) (struct GNUNET_MQ_Handle *mq, | 334 | typedef void |
335 | const struct GNUNET_MessageHeader *msg, | 335 | (*GNUNET_MQ_SendImpl) (struct GNUNET_MQ_Handle *mq, |
336 | void *impl_state); | 336 | const struct GNUNET_MessageHeader *msg, |
337 | void *impl_state); | ||
337 | 338 | ||
338 | 339 | ||
339 | /** | 340 | /** |
@@ -345,8 +346,9 @@ typedef void (*GNUNET_MQ_SendImpl) (struct GNUNET_MQ_Handle *mq, | |||
345 | * @param mq the message queue to destroy | 346 | * @param mq the message queue to destroy |
346 | * @param impl_state state of the implementation | 347 | * @param impl_state state of the implementation |
347 | */ | 348 | */ |
348 | typedef void (*GNUNET_MQ_DestroyImpl) (struct GNUNET_MQ_Handle *mq, | 349 | typedef void |
349 | void *impl_state); | 350 | (*GNUNET_MQ_DestroyImpl) (struct GNUNET_MQ_Handle *mq, |
351 | void *impl_state); | ||
350 | 352 | ||
351 | 353 | ||
352 | /** | 354 | /** |
@@ -355,8 +357,9 @@ typedef void (*GNUNET_MQ_DestroyImpl) (struct GNUNET_MQ_Handle *mq, | |||
355 | * @param mq message queue | 357 | * @param mq message queue |
356 | * @param impl_state state specific to the implementation | 358 | * @param impl_state state specific to the implementation |
357 | */ | 359 | */ |
358 | typedef void (*GNUNET_MQ_CancelImpl) (struct GNUNET_MQ_Handle *mq, | 360 | typedef void |
359 | void *impl_state); | 361 | (*GNUNET_MQ_CancelImpl) (struct GNUNET_MQ_Handle *mq, |
362 | void *impl_state); | ||
360 | 363 | ||
361 | 364 | ||
362 | /** | 365 | /** |
@@ -368,7 +371,9 @@ typedef void (*GNUNET_MQ_CancelImpl) (struct GNUNET_MQ_Handle *mq, | |||
368 | * @param cls closure | 371 | * @param cls closure |
369 | * @param error error code | 372 | * @param error error code |
370 | */ | 373 | */ |
371 | typedef void (*GNUNET_MQ_ErrorHandler) (void *cls, enum GNUNET_MQ_Error error); | 374 | typedef void |
375 | (*GNUNET_MQ_ErrorHandler) (void *cls, | ||
376 | enum GNUNET_MQ_Error error); | ||
372 | 377 | ||
373 | 378 | ||
374 | /** | 379 | /** |
diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h index d190eff92..545bb28d2 100644 --- a/src/include/gnunet_transport_service.h +++ b/src/include/gnunet_transport_service.h | |||
@@ -115,7 +115,8 @@ struct GNUNET_TRANSPORT_AddressToStringContext; | |||
115 | * if #GNUNET_NO: address was invalid (or not supported) | 115 | * if #GNUNET_NO: address was invalid (or not supported) |
116 | * if #GNUNET_SYSERR: communication error (IPC error) | 116 | * if #GNUNET_SYSERR: communication error (IPC error) |
117 | */ | 117 | */ |
118 | typedef void (*GNUNET_TRANSPORT_AddressToStringCallback) (void *cls, | 118 | typedef void |
119 | (*GNUNET_TRANSPORT_AddressToStringCallback) (void *cls, | ||
119 | const char *address, | 120 | const char *address, |
120 | int res); | 121 | int res); |
121 | 122 | ||
@@ -326,7 +327,8 @@ struct GNUNET_TRANSPORT_PeerMonitoringContext; | |||
326 | * @param state current state this peer is in | 327 | * @param state current state this peer is in |
327 | * @param state_timeout timeout for the current state of the peer | 328 | * @param state_timeout timeout for the current state of the peer |
328 | */ | 329 | */ |
329 | typedef void (*GNUNET_TRANSPORT_PeerIterateCallback) ( | 330 | typedef void |
331 | (*GNUNET_TRANSPORT_PeerIterateCallback) ( | ||
330 | void *cls, | 332 | void *cls, |
331 | const struct GNUNET_PeerIdentity *peer, | 333 | const struct GNUNET_PeerIdentity *peer, |
332 | const struct GNUNET_HELLO_Address *address, | 334 | const struct GNUNET_HELLO_Address *address, |
@@ -394,7 +396,8 @@ struct GNUNET_TRANSPORT_Blacklist; | |||
394 | * @param pid peer to approve or disapproave | 396 | * @param pid peer to approve or disapproave |
395 | * @return #GNUNET_OK if the connection is allowed, #GNUNET_SYSERR if not | 397 | * @return #GNUNET_OK if the connection is allowed, #GNUNET_SYSERR if not |
396 | */ | 398 | */ |
397 | typedef int (*GNUNET_TRANSPORT_BlacklistCallback) ( | 399 | typedef int |
400 | (*GNUNET_TRANSPORT_BlacklistCallback) ( | ||
398 | void *cls, | 401 | void *cls, |
399 | const struct GNUNET_PeerIdentity *pid); | 402 | const struct GNUNET_PeerIdentity *pid); |
400 | 403 | ||
@@ -541,7 +544,8 @@ struct GNUNET_TRANSPORT_SessionInfo | |||
541 | * NULL with @a session being non-NULL if the monitor | 544 | * NULL with @a session being non-NULL if the monitor |
542 | * was being cancelled while sessions were active | 545 | * was being cancelled while sessions were active |
543 | */ | 546 | */ |
544 | typedef void (*GNUNET_TRANSPORT_SessionMonitorCallback) ( | 547 | typedef void |
548 | (*GNUNET_TRANSPORT_SessionMonitorCallback) ( | ||
545 | void *cls, | 549 | void *cls, |
546 | struct GNUNET_TRANSPORT_PluginSession *session, | 550 | struct GNUNET_TRANSPORT_PluginSession *session, |
547 | void **session_ctx, | 551 | void **session_ctx, |
@@ -593,7 +597,8 @@ struct GNUNET_TRANSPORT_CoreHandle; | |||
593 | * @param mq message queue to use to transmit to @a peer | 597 | * @param mq message queue to use to transmit to @a peer |
594 | * @return closure to use in MQ handlers | 598 | * @return closure to use in MQ handlers |
595 | */ | 599 | */ |
596 | typedef void *(*GNUNET_TRANSPORT_NotifyConnect) ( | 600 | typedef void * |
601 | (*GNUNET_TRANSPORT_NotifyConnect) ( | ||
597 | void *cls, | 602 | void *cls, |
598 | const struct GNUNET_PeerIdentity *peer, | 603 | const struct GNUNET_PeerIdentity *peer, |
599 | struct GNUNET_MQ_Handle *mq); | 604 | struct GNUNET_MQ_Handle *mq); |
@@ -610,7 +615,8 @@ typedef void *(*GNUNET_TRANSPORT_NotifyConnect) ( | |||
610 | * @param handlers_cls closure of the handlers, was returned from the | 615 | * @param handlers_cls closure of the handlers, was returned from the |
611 | * connect notification callback | 616 | * connect notification callback |
612 | */ | 617 | */ |
613 | typedef void (*GNUNET_TRANSPORT_NotifyDisconnect) ( | 618 | typedef void |
619 | (*GNUNET_TRANSPORT_NotifyDisconnect) ( | ||
614 | void *cls, | 620 | void *cls, |
615 | const struct GNUNET_PeerIdentity *peer, | 621 | const struct GNUNET_PeerIdentity *peer, |
616 | void *handler_cls); | 622 | void *handler_cls); |
@@ -632,7 +638,8 @@ typedef void (*GNUNET_TRANSPORT_NotifyDisconnect) ( | |||
632 | * @param handlers_cls closure of the handlers, was returned from the | 638 | * @param handlers_cls closure of the handlers, was returned from the |
633 | * connect notification callback | 639 | * connect notification callback |
634 | */ | 640 | */ |
635 | typedef void (*GNUNET_TRANSPORT_NotifyExcessBandwidth) ( | 641 | typedef void |
642 | (*GNUNET_TRANSPORT_NotifyExcessBandwidth) ( | ||
636 | void *cls, | 643 | void *cls, |
637 | const struct GNUNET_PeerIdentity *neighbour, | 644 | const struct GNUNET_PeerIdentity *neighbour, |
638 | void *handlers_cls); | 645 | void *handlers_cls); |