aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>2018-01-02 16:48:03 +0100
committerSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>2018-01-02 16:48:03 +0100
commit7c1f035ed971e12882cd7a65c7d36883842945b1 (patch)
tree3828089ef8124270b976ac94902ba27210d275a3 /src/include
parent92d8c8a77e242a61927acc0e22fcecea479e6c43 (diff)
parent61f532f18450e0d7c72f0c17f4a20b5854cf53bf (diff)
downloadgnunet-7c1f035ed971e12882cd7a65c7d36883842945b1.tar.gz
gnunet-7c1f035ed971e12882cd7a65c7d36883842945b1.zip
-merge
Diffstat (limited to 'src/include')
-rw-r--r--src/include/Makefile.am7
-rw-r--r--src/include/gnunet_common.h15
-rw-r--r--src/include/gnunet_mst_lib.h4
-rw-r--r--src/include/gnunet_network_lib.h6
-rw-r--r--src/include/gnunet_protocols.h30
-rw-r--r--src/include/gnunet_rest_lib.h2
-rw-r--r--src/include/gnunet_scheduler_lib.h44
-rw-r--r--src/include/gnunet_service_lib.h7
8 files changed, 77 insertions, 38 deletions
diff --git a/src/include/Makefile.am b/src/include/Makefile.am
index e5abec416..08e9dd156 100644
--- a/src/include/Makefile.am
+++ b/src/include/Makefile.am
@@ -33,6 +33,7 @@ gnunetinclude_HEADERS = \
33 gnunet_bandwidth_lib.h \ 33 gnunet_bandwidth_lib.h \
34 gnunet_bio_lib.h \ 34 gnunet_bio_lib.h \
35 gnunet_block_lib.h \ 35 gnunet_block_lib.h \
36 gnunet_block_group_lib.h \
36 gnunet_block_plugin.h \ 37 gnunet_block_plugin.h \
37 gnunet_client_lib.h \ 38 gnunet_client_lib.h \
38 gnunet_common.h \ 39 gnunet_common.h \
@@ -65,7 +66,10 @@ gnunetinclude_HEADERS = \
65 gnunet_hello_lib.h \ 66 gnunet_hello_lib.h \
66 gnunet_helper_lib.h \ 67 gnunet_helper_lib.h \
67 gnunet_identity_service.h \ 68 gnunet_identity_service.h \
69 gnunet_identity_provider_service.h \
68 gnunet_json_lib.h \ 70 gnunet_json_lib.h \
71 gnunet_jsonapi_lib.h \
72 gnunet_jsonapi_util.h \
69 gnunet_load_lib.h \ 73 gnunet_load_lib.h \
70 gnunet_cadet_service.h \ 74 gnunet_cadet_service.h \
71 gnunet_microphone_lib.h \ 75 gnunet_microphone_lib.h \
@@ -102,6 +106,8 @@ gnunetinclude_HEADERS = \
102 gnunet_protocols.h \ 106 gnunet_protocols.h \
103 gnunet_resolver_service.h \ 107 gnunet_resolver_service.h \
104 gnunet_regex_service.h \ 108 gnunet_regex_service.h \
109 gnunet_rest_lib.h \
110 gnunet_rest_plugin.h \
105 gnunet_revocation_service.h \ 111 gnunet_revocation_service.h \
106 gnunet_scalarproduct_service.h \ 112 gnunet_scalarproduct_service.h \
107 gnunet_scheduler_lib.h \ 113 gnunet_scheduler_lib.h \
@@ -111,6 +117,7 @@ gnunetinclude_HEADERS = \
111 gnunet_signal_lib.h \ 117 gnunet_signal_lib.h \
112 gnunet_signatures.h \ 118 gnunet_signatures.h \
113 gnunet_social_service.h \ 119 gnunet_social_service.h \
120 gnunet_socks.h \
114 gnunet_speaker_lib.h \ 121 gnunet_speaker_lib.h \
115 gnunet_sq_lib.h \ 122 gnunet_sq_lib.h \
116 gnunet_statistics_service.h \ 123 gnunet_statistics_service.h \
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h
index d7f7b76ff..7d23e6f9b 100644
--- a/src/include/gnunet_common.h
+++ b/src/include/gnunet_common.h
@@ -988,7 +988,8 @@ GNUNET_ntoh_double (double d);
988 * arr is important since size is the number of elements and 988 * arr is important since size is the number of elements and
989 * not the size in bytes 989 * not the size in bytes
990 * @param size the number of elements in the existing vector (number 990 * @param size the number of elements in the existing vector (number
991 * of elements to copy over) 991 * of elements to copy over), will be updated with the new
992 * array size
992 * @param tsize the target size for the resulting vector, use 0 to 993 * @param tsize the target size for the resulting vector, use 0 to
993 * free the vector (then, arr will be NULL afterwards). 994 * free the vector (then, arr will be NULL afterwards).
994 */ 995 */
@@ -996,8 +997,16 @@ GNUNET_ntoh_double (double d);
996 997
997/** 998/**
998 * @ingroup memory 999 * @ingroup memory
999 * Append an element to a list (growing the 1000 * Append an element to a list (growing the list by one).
1000 * list by one). 1001 *
1002 * @param arr base-pointer of the vector, may be NULL if size is 0;
1003 * will be updated to reflect the new address. The TYPE of
1004 * arr is important since size is the number of elements and
1005 * not the size in bytes
1006 * @param size the number of elements in the existing vector (number
1007 * of elements to copy over), will be updated with the new
1008 * array size
1009 * @param element the element that will be appended to the array
1001 */ 1010 */
1002#define GNUNET_array_append(arr,size,element) do { GNUNET_array_grow(arr,size,size+1); arr[size-1] = element; } while(0) 1011#define GNUNET_array_append(arr,size,element) do { GNUNET_array_grow(arr,size,size+1); arr[size-1] = element; } while(0)
1003 1012
diff --git a/src/include/gnunet_mst_lib.h b/src/include/gnunet_mst_lib.h
index 7a1ca7a55..fe6524eb3 100644
--- a/src/include/gnunet_mst_lib.h
+++ b/src/include/gnunet_mst_lib.h
@@ -61,7 +61,9 @@ struct GNUNET_MessageStreamTokenizer;
61 * 61 *
62 * @param cls closure 62 * @param cls closure
63 * @param message the actual message 63 * @param message the actual message
64 * @return #GNUNET_OK on success, #GNUNET_SYSERR to stop further processing 64 * @return #GNUNET_OK on success,
65 * #GNUNET_NO to stop further processing due to disconnect (no error)
66 * #GNUNET_SYSERR to stop further processing due to error
65 */ 67 */
66typedef int 68typedef int
67(*GNUNET_MessageTokenizerCallback) (void *cls, 69(*GNUNET_MessageTokenizerCallback) (void *cls,
diff --git a/src/include/gnunet_network_lib.h b/src/include/gnunet_network_lib.h
index d9d3d90e7..9e692bbbf 100644
--- a/src/include/gnunet_network_lib.h
+++ b/src/include/gnunet_network_lib.h
@@ -464,7 +464,7 @@ GNUNET_NETWORK_fdset_copy (struct GNUNET_NETWORK_FDSet *to,
464 * @return POSIX file descriptor 464 * @return POSIX file descriptor
465 */ 465 */
466int 466int
467GNUNET_NETWORK_get_fd (struct GNUNET_NETWORK_Handle *desc); 467GNUNET_NETWORK_get_fd (const struct GNUNET_NETWORK_Handle *desc);
468 468
469 469
470/** 470/**
@@ -474,7 +474,7 @@ GNUNET_NETWORK_get_fd (struct GNUNET_NETWORK_Handle *desc);
474 * @return POSIX file descriptor 474 * @return POSIX file descriptor
475 */ 475 */
476struct sockaddr* 476struct sockaddr*
477GNUNET_NETWORK_get_addr (struct GNUNET_NETWORK_Handle *desc); 477GNUNET_NETWORK_get_addr (const struct GNUNET_NETWORK_Handle *desc);
478 478
479 479
480/** 480/**
@@ -484,7 +484,7 @@ GNUNET_NETWORK_get_addr (struct GNUNET_NETWORK_Handle *desc);
484 * @return socklen_t for sockaddr 484 * @return socklen_t for sockaddr
485 */ 485 */
486socklen_t 486socklen_t
487GNUNET_NETWORK_get_addrlen (struct GNUNET_NETWORK_Handle *desc); 487GNUNET_NETWORK_get_addrlen (const struct GNUNET_NETWORK_Handle *desc);
488 488
489 489
490/** 490/**
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h
index 6710d749f..436adc5a4 100644
--- a/src/include/gnunet_protocols.h
+++ b/src/include/gnunet_protocols.h
@@ -2067,7 +2067,11 @@ extern "C"
2067/** S->C: slave join acknowledgement */ 2067/** S->C: slave join acknowledgement */
2068#define GNUNET_MESSAGE_TYPE_PSYC_SLAVE_JOIN_ACK 684 2068#define GNUNET_MESSAGE_TYPE_PSYC_SLAVE_JOIN_ACK 684
2069 2069
2070/* 685-686 */ 2070/** C->S: request to part from a channel */
2071#define GNUNET_MESSAGE_TYPE_PSYC_PART_REQUEST 685
2072
2073/** S->C: acknowledgement that a slave of master parted from a channel */
2074#define GNUNET_MESSAGE_TYPE_PSYC_PART_ACK 686
2071 2075
2072/** M->S->C: incoming join request from multicast */ 2076/** M->S->C: incoming join request from multicast */
2073#define GNUNET_MESSAGE_TYPE_PSYC_JOIN_REQUEST 687 2077#define GNUNET_MESSAGE_TYPE_PSYC_JOIN_REQUEST 687
@@ -2258,6 +2262,7 @@ extern "C"
2258 */ 2262 */
2259#define GNUNET_MESSAGE_TYPE_MULTICAST_PART_ACK 755 2263#define GNUNET_MESSAGE_TYPE_MULTICAST_PART_ACK 755
2260 2264
2265// FIXME: this is never used!
2261/** 2266/**
2262 * Group terminated. 2267 * Group terminated.
2263 */ 2268 */
@@ -2398,35 +2403,38 @@ extern "C"
2398/** C->S: request to leave a place */ 2403/** C->S: request to leave a place */
2399#define GNUNET_MESSAGE_TYPE_SOCIAL_PLACE_LEAVE 848 2404#define GNUNET_MESSAGE_TYPE_SOCIAL_PLACE_LEAVE 848
2400 2405
2406/** S->C: place leave acknowledgement */
2407#define GNUNET_MESSAGE_TYPE_SOCIAL_PLACE_LEAVE_ACK 849
2408
2401/** C->S: add place to GNS zone */ 2409/** C->S: add place to GNS zone */
2402#define GNUNET_MESSAGE_TYPE_SOCIAL_ZONE_ADD_PLACE 849 2410#define GNUNET_MESSAGE_TYPE_SOCIAL_ZONE_ADD_PLACE 850
2403 2411
2404/** C->S: add nym to GNS zone */ 2412/** C->S: add nym to GNS zone */
2405#define GNUNET_MESSAGE_TYPE_SOCIAL_ZONE_ADD_NYM 850 2413#define GNUNET_MESSAGE_TYPE_SOCIAL_ZONE_ADD_NYM 851
2406 2414
2407/** C->S: connect application */ 2415/** C->S: connect application */
2408#define GNUNET_MESSAGE_TYPE_SOCIAL_APP_CONNECT 851 2416#define GNUNET_MESSAGE_TYPE_SOCIAL_APP_CONNECT 852
2409 2417
2410/** C->S: detach a place from application */ 2418/** C->S: detach a place from application */
2411#define GNUNET_MESSAGE_TYPE_SOCIAL_APP_DETACH 852 2419#define GNUNET_MESSAGE_TYPE_SOCIAL_APP_DETACH 853
2412 2420
2413/** S->C: notify about an existing ego */ 2421/** S->C: notify about an existing ego */
2414#define GNUNET_MESSAGE_TYPE_SOCIAL_APP_EGO 853 2422#define GNUNET_MESSAGE_TYPE_SOCIAL_APP_EGO 854
2415 2423
2416/** S->C: end of ego list */ 2424/** S->C: end of ego list */
2417#define GNUNET_MESSAGE_TYPE_SOCIAL_APP_EGO_END 854 2425#define GNUNET_MESSAGE_TYPE_SOCIAL_APP_EGO_END 855
2418 2426
2419/** S->C: notify about an existing place */ 2427/** S->C: notify about an existing place */
2420#define GNUNET_MESSAGE_TYPE_SOCIAL_APP_PLACE 855 2428#define GNUNET_MESSAGE_TYPE_SOCIAL_APP_PLACE 856
2421 2429
2422/** S->C: end of place list */ 2430/** S->C: end of place list */
2423#define GNUNET_MESSAGE_TYPE_SOCIAL_APP_PLACE_END 856 2431#define GNUNET_MESSAGE_TYPE_SOCIAL_APP_PLACE_END 857
2424 2432
2425/** C->S: set message processing flags */ 2433/** C->S: set message processing flags */
2426#define GNUNET_MESSAGE_TYPE_SOCIAL_MSG_PROC_SET 860 2434#define GNUNET_MESSAGE_TYPE_SOCIAL_MSG_PROC_SET 858
2427 2435
2428/** C->S: clear message processing flags */ 2436/** C->S: clear message processing flags */
2429#define GNUNET_MESSAGE_TYPE_SOCIAL_MSG_PROC_CLEAR 861 2437#define GNUNET_MESSAGE_TYPE_SOCIAL_MSG_PROC_CLEAR 859
2430 2438
2431/******************************************************************************* 2439/*******************************************************************************
2432 * X-VINE DHT messages 2440 * X-VINE DHT messages
diff --git a/src/include/gnunet_rest_lib.h b/src/include/gnunet_rest_lib.h
index 243c38403..a4dbb0696 100644
--- a/src/include/gnunet_rest_lib.h
+++ b/src/include/gnunet_rest_lib.h
@@ -32,7 +32,7 @@
32#define GNUNET_REST_LIB_H 32#define GNUNET_REST_LIB_H
33 33
34#include "gnunet_util_lib.h" 34#include "gnunet_util_lib.h"
35#include "microhttpd.h" 35#include <microhttpd.h>
36 36
37#define GNUNET_REST_HANDLER_END {NULL, NULL, NULL} 37#define GNUNET_REST_HANDLER_END {NULL, NULL, NULL}
38 38
diff --git a/src/include/gnunet_scheduler_lib.h b/src/include/gnunet_scheduler_lib.h
index a855ab8ab..d2805a685 100644
--- a/src/include/gnunet_scheduler_lib.h
+++ b/src/include/gnunet_scheduler_lib.h
@@ -152,14 +152,14 @@ struct GNUNET_SCHEDULER_FdInfo
152 * NULL if this is about a file handle or if no network 152 * NULL if this is about a file handle or if no network
153 * handle was given to the scheduler originally. 153 * handle was given to the scheduler originally.
154 */ 154 */
155 struct GNUNET_NETWORK_Handle *fd; 155 const struct GNUNET_NETWORK_Handle *fd;
156 156
157 /** 157 /**
158 * GNUnet file handle the event is about, matches @a sock, 158 * GNUnet file handle the event is about, matches @a sock,
159 * NULL if this is about a network socket or if no network 159 * NULL if this is about a network socket or if no network
160 * handle was given to the scheduler originally. 160 * handle was given to the scheduler originally.
161 */ 161 */
162 struct GNUNET_DISK_FileHandle *fh; 162 const struct GNUNET_DISK_FileHandle *fh;
163 163
164 /** 164 /**
165 * Type of the event that was generated related to @e sock. 165 * Type of the event that was generated related to @e sock.
@@ -216,17 +216,18 @@ struct GNUNET_SCHEDULER_TaskContext
216 216
217/** 217/**
218 * Function used by event-loop implementations to signal the scheduler 218 * Function used by event-loop implementations to signal the scheduler
219 * that a particular @a task is ready due to an event of type @a et. 219 * that a particular @a task is ready due to an event specified in the
220 * et field of @a fdi.
220 * 221 *
221 * This function will then queue the task to notify the application 222 * This function will then queue the task to notify the application
222 * that the task is ready (with the respective priority). 223 * that the task is ready (with the respective priority).
223 * 224 *
224 * @param task the task that is ready 225 * @param task the task that is ready
225 * @param et information about why the task is ready 226 * @param fdi information about the related FD
226 */ 227 */
227void 228void
228GNUNET_SCHEDULER_task_ready (struct GNUNET_SCHEDULER_Task *task, 229GNUNET_SCHEDULER_task_ready (struct GNUNET_SCHEDULER_Task *task,
229 enum GNUNET_SCHEDULER_EventType et); 230 struct GNUNET_SCHEDULER_FdInfo *fdi);
230 231
231 232
232/** 233/**
@@ -241,15 +242,16 @@ struct GNUNET_SCHEDULER_Handle;
241 * there are tasks left to run just to give other tasks a chance as 242 * there are tasks left to run just to give other tasks a chance as
242 * well. If we return #GNUNET_YES, the driver should call this 243 * well. If we return #GNUNET_YES, the driver should call this
243 * function again as soon as possible, while if we return #GNUNET_NO 244 * function again as soon as possible, while if we return #GNUNET_NO
244 * it must block until the operating system has more work as the 245 * it must block until either the operating system has more work (the
245 * scheduler has no more work to do right now. 246 * scheduler has no more work to do right now) or the timeout set by
247 * the scheduler (using the set_wakeup callback) is reached.
246 * 248 *
247 * @param sh scheduler handle that was given to the `loop` 249 * @param sh scheduler handle that was given to the `loop`
248 * @return #GNUNET_OK if there are more tasks that are ready, 250 * @return #GNUNET_OK if there are more tasks that are ready,
249 * and thus we would like to run more (yield to avoid 251 * and thus we would like to run more (yield to avoid
250 * blocking other activities for too long) 252 * blocking other activities for too long)
251 * #GNUNET_NO if we are done running tasks (yield to block) 253 * #GNUNET_NO if we are done running tasks (yield to block)
252 * #GNUNET_SYSERR on error 254 * #GNUNET_SYSERR on error, e.g. no tasks were ready
253 */ 255 */
254int 256int
255GNUNET_SCHEDULER_run_from_driver (struct GNUNET_SCHEDULER_Handle *sh); 257GNUNET_SCHEDULER_run_from_driver (struct GNUNET_SCHEDULER_Handle *sh);
@@ -268,8 +270,11 @@ struct GNUNET_SCHEDULER_Driver
268 void *cls; 270 void *cls;
269 271
270 /** 272 /**
271 * Add a @a task to be run if the conditions given 273 * Add a @a task to be run if the conditions specified in the
272 * in @a fdi are satisfied. 274 * et field of the given @a fdi are satisfied. The et field will
275 * be cleared after this call and the driver is expected to set
276 * the type of the actual event before passing @a fdi to
277 * #GNUNET_SCHEDULER_task_ready.
273 * 278 *
274 * @param cls closure 279 * @param cls closure
275 * @param task task to add 280 * @param task task to add
@@ -280,21 +285,21 @@ struct GNUNET_SCHEDULER_Driver
280 int 285 int
281 (*add)(void *cls, 286 (*add)(void *cls,
282 struct GNUNET_SCHEDULER_Task *task, 287 struct GNUNET_SCHEDULER_Task *task,
283 struct GNUNET_SCHEDULER_FdInfo *fdi); 288 struct GNUNET_SCHEDULER_FdInfo *fdi);
284 289
285 /** 290 /**
286 * Delete a @a task from the set of tasks to be run. 291 * Delete a @a task from the set of tasks to be run. A task may
292 * comprise multiple FdInfo entries previously added with the add
293 * function. The driver is expected to delete them all.
287 * 294 *
288 * @param cls closure 295 * @param cls closure
289 * @param task task to delete 296 * @param task task to delete
290 * @param fdi conditions to watch for (must match @e add call)
291 * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure 297 * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure
292 * (i.e. @a task or @a fdi do not match prior @e add call) 298 * (i.e. @a task does not match prior @e add call)
293 */ 299 */
294 int 300 int
295 (*del)(void *cls, 301 (*del)(void *cls,
296 struct GNUNET_SCHEDULER_Task *task, 302 struct GNUNET_SCHEDULER_Task *task);
297 const struct GNUNET_SCHEDULER_FdInfo *fdi);
298 303
299 /** 304 /**
300 * Set time at which we definitively want to get a wakeup call. 305 * Set time at which we definitively want to get a wakeup call.
@@ -309,7 +314,10 @@ struct GNUNET_SCHEDULER_Driver
309 /** 314 /**
310 * Event loop's "main" function, to be called from 315 * Event loop's "main" function, to be called from
311 * #GNUNET_SCHEDULER_run_with_driver() to actually 316 * #GNUNET_SCHEDULER_run_with_driver() to actually
312 * launch the loop. 317 * launch the loop. The loop should run as long as
318 * tasks (added by the add callback) are available
319 * OR the wakeup time (added by the set_wakeup
320 * callback) is not FOREVER.
313 * 321 *
314 * @param cls closure 322 * @param cls closure
315 * @param sh scheduler handle to pass to 323 * @param sh scheduler handle to pass to
@@ -359,7 +367,7 @@ GNUNET_SCHEDULER_run_with_driver (const struct GNUNET_SCHEDULER_Driver *driver,
359 * 367 *
360 * @return NULL on error 368 * @return NULL on error
361 */ 369 */
362const struct GNUNET_SCHEDULER_Driver * 370struct GNUNET_SCHEDULER_Driver *
363GNUNET_SCHEDULER_driver_select (void); 371GNUNET_SCHEDULER_driver_select (void);
364 372
365 373
diff --git a/src/include/gnunet_service_lib.h b/src/include/gnunet_service_lib.h
index aacafe956..dda827c95 100644
--- a/src/include/gnunet_service_lib.h
+++ b/src/include/gnunet_service_lib.h
@@ -366,11 +366,16 @@ GNUNET_SERVICE_client_disable_continue_warning (struct GNUNET_SERVICE_Client *c)
366/** 366/**
367 * Ask the server to disconnect from the given client. This is the 367 * Ask the server to disconnect from the given client. This is the
368 * same as returning #GNUNET_SYSERR within the check procedure when 368 * same as returning #GNUNET_SYSERR within the check procedure when
369 * handling a message, wexcept that it allows dropping of a client even 369 * handling a message, except that it allows dropping of a client even
370 * when not handling a message from that client. The `disconnect_cb` 370 * when not handling a message from that client. The `disconnect_cb`
371 * will be called on @a c even if the application closes the connection 371 * will be called on @a c even if the application closes the connection
372 * using this function. 372 * using this function.
373 * 373 *
374 * This function should be called (outside of util's internal logic)
375 * if (and usually only if) the client has violated the
376 * protocol. Otherwise, we should leave it to the client to disconnect
377 * from the service.
378 *
374 * @param c client to disconnect now 379 * @param c client to disconnect now
375 */ 380 */
376void 381void