aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-06-07 18:37:09 +0000
committerChristian Grothoff <christian@grothoff.org>2014-06-07 18:37:09 +0000
commitaf0501960d6041f27758678c8f8ffdc3ed7ac6c9 (patch)
treec2aefd184f975731f5e2957f979af2dd05dc352e /src
parentef0def7ccde140b2b4558761dfd46cbb16c625f4 (diff)
downloadgnunet-af0501960d6041f27758678c8f8ffdc3ed7ac6c9.tar.gz
gnunet-af0501960d6041f27758678c8f8ffdc3ed7ac6c9.zip
-indent, doxygen
Diffstat (limited to 'src')
-rw-r--r--src/include/gnunet_common.h41
-rw-r--r--src/include/gnunet_network_lib.h59
2 files changed, 63 insertions, 37 deletions
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h
index ec077d355..d8444e100 100644
--- a/src/include/gnunet_common.h
+++ b/src/include/gnunet_common.h
@@ -259,7 +259,9 @@ GNUNET_NETWORK_STRUCT_END
259 * #GNUNET_NO to stop iteration with no error, 259 * #GNUNET_NO to stop iteration with no error,
260 * #GNUNET_SYSERR to abort iteration with error! 260 * #GNUNET_SYSERR to abort iteration with error!
261 */ 261 */
262typedef int (*GNUNET_FileNameCallback) (void *cls, const char *filename); 262typedef int
263(*GNUNET_FileNameCallback) (void *cls,
264 const char *filename);
263 265
264 266
265/* ****************************** logging ***************************** */ 267/* ****************************** logging ***************************** */
@@ -291,8 +293,10 @@ enum GNUNET_ErrorType
291 * @param date when was the message logged? 293 * @param date when was the message logged?
292 * @param message what is the message 294 * @param message what is the message
293 */ 295 */
294typedef void (*GNUNET_Logger) (void *cls, enum GNUNET_ErrorType kind, 296typedef void (*GNUNET_Logger) (void *cls,
295 const char *component, const char *date, 297 enum GNUNET_ErrorType kind,
298 const char *component,
299 const char *date,
296 const char *message); 300 const char *message);
297 301
298 302
@@ -310,7 +314,8 @@ int
310GNUNET_get_log_call_status (int caller_level, 314GNUNET_get_log_call_status (int caller_level,
311 const char *comp, 315 const char *comp,
312 const char *file, 316 const char *file,
313 const char *function, int line); 317 const char *function,
318 int line);
314#endif 319#endif
315 320
316 321
@@ -437,10 +442,11 @@ GNUNET_abort (void) GNUNET_NORETURN;
437 * Ignore the next @a n calls to the log function. 442 * Ignore the next @a n calls to the log function.
438 * 443 *
439 * @param n number of log calls to ignore (could be negative) 444 * @param n number of log calls to ignore (could be negative)
440 * @param check_reset GNUNET_YES to assert that the log skip counter is currently zero 445 * @param check_reset #GNUNET_YES to assert that the log skip counter is currently zero
441 */ 446 */
442void 447void
443GNUNET_log_skip (int n, int check_reset); 448GNUNET_log_skip (int n,
449 int check_reset);
444 450
445 451
446/** 452/**
@@ -453,7 +459,9 @@ GNUNET_log_skip (int n, int check_reset);
453 * @return #GNUNET_OK on success, #GNUNET_SYSERR if logfile could not be opened 459 * @return #GNUNET_OK on success, #GNUNET_SYSERR if logfile could not be opened
454 */ 460 */
455int 461int
456GNUNET_log_setup (const char *comp, const char *loglevel, const char *logfile); 462GNUNET_log_setup (const char *comp,
463 const char *loglevel,
464 const char *logfile);
457 465
458 466
459/** 467/**
@@ -464,7 +472,8 @@ GNUNET_log_setup (const char *comp, const char *loglevel, const char *logfile);
464 * @param logger_cls closure for @a logger 472 * @param logger_cls closure for @a logger
465 */ 473 */
466void 474void
467GNUNET_logger_add (GNUNET_Logger logger, void *logger_cls); 475GNUNET_logger_add (GNUNET_Logger logger,
476 void *logger_cls);
468 477
469 478
470/** 479/**
@@ -472,10 +481,11 @@ GNUNET_logger_add (GNUNET_Logger logger, void *logger_cls);
472 * Remove a custom logger. 481 * Remove a custom logger.
473 * 482 *
474 * @param logger log function 483 * @param logger log function
475 * @param logger_cls closure for logger 484 * @param logger_cls closure for @a logger
476 */ 485 */
477void 486void
478GNUNET_logger_remove (GNUNET_Logger logger, void *logger_cls); 487GNUNET_logger_remove (GNUNET_Logger logger,
488 void *logger_cls);
479 489
480 490
481/** 491/**
@@ -513,7 +523,7 @@ GNUNET_h2s_full (const struct GNUNET_HashCode * hc);
513 * 523 *
514 * @param pid the peer identity 524 * @param pid the peer identity
515 * @return string form of the pid; will be overwritten by next 525 * @return string form of the pid; will be overwritten by next
516 * call to #GNUNET_i2s. 526 * call to #GNUNET_i2s().
517 */ 527 */
518const char * 528const char *
519GNUNET_i2s (const struct GNUNET_PeerIdentity *pid); 529GNUNET_i2s (const struct GNUNET_PeerIdentity *pid);
@@ -527,7 +537,7 @@ GNUNET_i2s (const struct GNUNET_PeerIdentity *pid);
527 * 537 *
528 * @param pid the peer identity 538 * @param pid the peer identity
529 * @return string form of the pid; will be overwritten by next 539 * @return string form of the pid; will be overwritten by next
530 * call to #GNUNET_i2s. 540 * call to #GNUNET_i2s_full().
531 */ 541 */
532const char * 542const char *
533GNUNET_i2s_full (const struct GNUNET_PeerIdentity *pid); 543GNUNET_i2s_full (const struct GNUNET_PeerIdentity *pid);
@@ -540,12 +550,13 @@ GNUNET_i2s_full (const struct GNUNET_PeerIdentity *pid);
540 * in the entire API that is NOT reentrant! 550 * in the entire API that is NOT reentrant!
541 * 551 *
542 * @param addr the address 552 * @param addr the address
543 * @param addrlen the length of the address 553 * @param addrlen the length of the @a addr
544 * @return nicely formatted string for the address 554 * @return nicely formatted string for the address
545 * will be overwritten by next call to GNUNET_a2s. 555 * will be overwritten by next call to #GNUNET_a2s().
546 */ 556 */
547const char * 557const char *
548GNUNET_a2s (const struct sockaddr *addr, socklen_t addrlen); 558GNUNET_a2s (const struct sockaddr *addr,
559 socklen_t addrlen);
549 560
550 561
551/** 562/**
diff --git a/src/include/gnunet_network_lib.h b/src/include/gnunet_network_lib.h
index 0081f0973..cc01a8133 100644
--- a/src/include/gnunet_network_lib.h
+++ b/src/include/gnunet_network_lib.h
@@ -167,7 +167,7 @@ GNUNET_NETWORK_socket_free_memory_only_ (struct GNUNET_NETWORK_Handle *desc);
167 * 167 *
168 * @param desc socket to connect 168 * @param desc socket to connect
169 * @param address peer address 169 * @param address peer address
170 * @param address_len of address 170 * @param address_len of @a address
171 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise 171 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
172 */ 172 */
173int 173int
@@ -188,8 +188,10 @@ GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc,
188 */ 188 */
189int 189int
190GNUNET_NETWORK_socket_getsockopt (const struct GNUNET_NETWORK_Handle *desc, 190GNUNET_NETWORK_socket_getsockopt (const struct GNUNET_NETWORK_Handle *desc,
191 int level, int optname, void *optval, 191 int level,
192 socklen_t * optlen); 192 int optname,
193 void *optval,
194 socklen_t *optlen);
193 195
194 196
195/** 197/**
@@ -211,8 +213,7 @@ GNUNET_NETWORK_socket_listen (const struct GNUNET_NETWORK_Handle *desc,
211 * @returns #GNUNET_NO if no data is available, or on error! 213 * @returns #GNUNET_NO if no data is available, or on error!
212 */ 214 */
213ssize_t 215ssize_t
214GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle 216GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle *desc);
215 *desc);
216 217
217 218
218/** 219/**
@@ -227,8 +228,10 @@ GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle
227 */ 228 */
228ssize_t 229ssize_t
229GNUNET_NETWORK_socket_recvfrom (const struct GNUNET_NETWORK_Handle *desc, 230GNUNET_NETWORK_socket_recvfrom (const struct GNUNET_NETWORK_Handle *desc,
230 void *buffer, size_t length, 231 void *buffer,
231 struct sockaddr *src_addr, socklen_t *addrlen); 232 size_t length,
233 struct sockaddr *src_addr,
234 socklen_t *addrlen);
232 235
233 236
234/** 237/**
@@ -241,11 +244,13 @@ GNUNET_NETWORK_socket_recvfrom (const struct GNUNET_NETWORK_Handle *desc,
241 */ 244 */
242ssize_t 245ssize_t
243GNUNET_NETWORK_socket_recv (const struct GNUNET_NETWORK_Handle *desc, 246GNUNET_NETWORK_socket_recv (const struct GNUNET_NETWORK_Handle *desc,
244 void *buffer, size_t length); 247 void *buffer,
248 size_t length);
245 249
246 250
247/** 251/**
248 * Check if sockets meet certain conditions 252 * Check if sockets meet certain conditions.
253 *
249 * @param rfds set of sockets to be checked for readability 254 * @param rfds set of sockets to be checked for readability
250 * @param wfds set of sockets to be checked for writability 255 * @param wfds set of sockets to be checked for writability
251 * @param efds set of sockets to be checked for exceptions 256 * @param efds set of sockets to be checked for exceptions
@@ -269,7 +274,8 @@ GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds,
269 */ 274 */
270ssize_t 275ssize_t
271GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle *desc, 276GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle *desc,
272 const void *buffer, size_t length); 277 const void *buffer,
278 size_t length);
273 279
274 280
275/** 281/**
@@ -278,14 +284,15 @@ GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle *desc,
278 * 284 *
279 * @param desc socket 285 * @param desc socket
280 * @param message data to send 286 * @param message data to send
281 * @param length size of the data 287 * @param length size of the data in @a message
282 * @param dest_addr destination address 288 * @param dest_addr destination address
283 * @param dest_len length of address 289 * @param dest_len length of @a dest_addr
284 * @return number of bytes sent, #GNUNET_SYSERR on error 290 * @return number of bytes sent, #GNUNET_SYSERR on error
285 */ 291 */
286ssize_t 292ssize_t
287GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle *desc, 293GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle *desc,
288 const void *message, size_t length, 294 const void *message,
295 size_t length,
289 const struct sockaddr *dest_addr, 296 const struct sockaddr *dest_addr,
290 socklen_t dest_len); 297 socklen_t dest_len);
291 298
@@ -297,12 +304,14 @@ GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle *desc,
297 * @param level protocol level of the option 304 * @param level protocol level of the option
298 * @param option_name option identifier 305 * @param option_name option identifier
299 * @param option_value value to set 306 * @param option_value value to set
300 * @param option_len size of option_value 307 * @param option_len size of @a option_value
301 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise 308 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
302 */ 309 */
303int 310int
304GNUNET_NETWORK_socket_setsockopt (struct GNUNET_NETWORK_Handle *fd, int level, 311GNUNET_NETWORK_socket_setsockopt (struct GNUNET_NETWORK_Handle *fd,
305 int option_name, const void *option_value, 312 int level,
313 int option_name,
314 const void *option_value,
306 socklen_t option_len); 315 socklen_t option_len);
307 316
308 317
@@ -314,7 +323,8 @@ GNUNET_NETWORK_socket_setsockopt (struct GNUNET_NETWORK_Handle *fd, int level,
314 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise 323 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
315 */ 324 */
316int 325int
317GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc, int how); 326GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc,
327 int how);
318 328
319 329
320/** 330/**
@@ -341,7 +351,9 @@ GNUNET_NETWORK_socket_disable_corking (struct GNUNET_NETWORK_Handle *desc);
341 * @return new socket, NULL on error 351 * @return new socket, NULL on error
342 */ 352 */
343struct GNUNET_NETWORK_Handle * 353struct GNUNET_NETWORK_Handle *
344GNUNET_NETWORK_socket_create (int domain, int type, int protocol); 354GNUNET_NETWORK_socket_create (int domain,
355 int type,
356 int protocol);
345 357
346 358
347/** 359/**
@@ -372,7 +384,7 @@ GNUNET_NETWORK_fdset_set (struct GNUNET_NETWORK_FDSet *fds,
372 * @param h the file handle to add 384 * @param h the file handle to add
373 */ 385 */
374void 386void
375GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct GNUNET_NETWORK_FDSet *fds 387GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct GNUNET_NETWORK_FDSet *fds,
376 HANDLE h); 388 HANDLE h);
377#endif 389#endif
378 390
@@ -450,7 +462,8 @@ GNUNET_NETWORK_get_addrlen (struct GNUNET_NETWORK_Handle *desc);
450 */ 462 */
451void 463void
452GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to, 464GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to,
453 const fd_set *from, int nfds); 465 const fd_set *from,
466 int nfds);
454 467
455 468
456/** 469/**
@@ -460,7 +473,8 @@ GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to,
460 * @param nfd native FD to set 473 * @param nfd native FD to set
461 */ 474 */
462void 475void
463GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to, int nfd); 476GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to,
477 int nfd);
464 478
465 479
466/** 480/**
@@ -468,7 +482,7 @@ GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to, int nfd);
468 * 482 *
469 * @param to set to test, NULL for empty set 483 * @param to set to test, NULL for empty set
470 * @param nfd native FD to test, -1 for none 484 * @param nfd native FD to test, -1 for none
471 * @return GNUNET_YES if to contains nfd 485 * @return #GNUNET_YES if to contains nfd
472 */ 486 */
473int 487int
474GNUNET_NETWORK_fdset_test_native (const struct GNUNET_NETWORK_FDSet *to, 488GNUNET_NETWORK_fdset_test_native (const struct GNUNET_NETWORK_FDSet *to,
@@ -488,6 +502,7 @@ GNUNET_NETWORK_fdset_handle_set (struct GNUNET_NETWORK_FDSet *fds,
488 502
489/** 503/**
490 * Check if a file handle is part of an fd set 504 * Check if a file handle is part of an fd set
505 *
491 * @param fds fd set 506 * @param fds fd set
492 * @param h file handle 507 * @param h file handle
493 * @return #GNUNET_YES if the file handle is part of the set 508 * @return #GNUNET_YES if the file handle is part of the set