diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-04-22 19:19:22 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-04-22 19:19:22 +0000 |
commit | c7b9b0df9172a3d5049ecc8d477932f58cc70ced (patch) | |
tree | 6ee3a2e6d4d5e8071ee36424a02eaa188e44bc08 /src | |
parent | d0c4bdb23f28a8a7057814ae6aa690c53922ba76 (diff) | |
download | gnunet-c7b9b0df9172a3d5049ecc8d477932f58cc70ced.tar.gz gnunet-c7b9b0df9172a3d5049ecc8d477932f58cc70ced.zip |
-improving doc
Diffstat (limited to 'src')
-rw-r--r-- | src/util/service.c | 53 |
1 files changed, 31 insertions, 22 deletions
diff --git a/src/util/service.c b/src/util/service.c index 5f58bcf6a..4eb35d97a 100644 --- a/src/util/service.c +++ b/src/util/service.c | |||
@@ -536,11 +536,12 @@ struct GNUNET_SERVICE_Context | |||
536 | /* ****************** message handlers ****************** */ | 536 | /* ****************** message handlers ****************** */ |
537 | 537 | ||
538 | /** | 538 | /** |
539 | * Send a 'TEST' message back to the client. | ||
539 | * | 540 | * |
540 | * @param cls | 541 | * @param cls the 'struct GNUNET_SERVER_Client' to send TEST to |
541 | * @param size | 542 | * @param size number of bytes available in 'buf' |
542 | * @param buf | 543 | * @param buf where to copy the message |
543 | * @return | 544 | * @return number of bytes written to 'buf' |
544 | */ | 545 | */ |
545 | static size_t | 546 | static size_t |
546 | write_test (void *cls, size_t size, void *buf) | 547 | write_test (void *cls, size_t size, void *buf) |
@@ -725,10 +726,11 @@ get_pid_file_name (struct GNUNET_SERVICE_Context *sctx) | |||
725 | /** | 726 | /** |
726 | * Parse an IPv4 access control list. | 727 | * Parse an IPv4 access control list. |
727 | * | 728 | * |
728 | * @param ret | 729 | * @param ret location where to write the ACL (set) |
729 | * @param sctx | 730 | * @param sctx service context to use to get the configuration |
730 | * @param option | 731 | * @param option name of the ACL option to parse |
731 | * @return | 732 | * @return GNUNET_SYSERR on parse error, GNUNET_OK on success (including |
733 | * no ACL configured) | ||
732 | */ | 734 | */ |
733 | static int | 735 | static int |
734 | process_acl4 (struct IPv4NetworkSet **ret, struct GNUNET_SERVICE_Context *sctx, | 736 | process_acl4 (struct IPv4NetworkSet **ret, struct GNUNET_SERVICE_Context *sctx, |
@@ -737,7 +739,10 @@ process_acl4 (struct IPv4NetworkSet **ret, struct GNUNET_SERVICE_Context *sctx, | |||
737 | char *opt; | 739 | char *opt; |
738 | 740 | ||
739 | if (!GNUNET_CONFIGURATION_have_value (sctx->cfg, sctx->serviceName, option)) | 741 | if (!GNUNET_CONFIGURATION_have_value (sctx->cfg, sctx->serviceName, option)) |
742 | { | ||
743 | *ret = NULL; | ||
740 | return GNUNET_OK; | 744 | return GNUNET_OK; |
745 | } | ||
741 | GNUNET_break (GNUNET_OK == | 746 | GNUNET_break (GNUNET_OK == |
742 | GNUNET_CONFIGURATION_get_value_string (sctx->cfg, | 747 | GNUNET_CONFIGURATION_get_value_string (sctx->cfg, |
743 | sctx->serviceName, | 748 | sctx->serviceName, |
@@ -758,10 +763,11 @@ process_acl4 (struct IPv4NetworkSet **ret, struct GNUNET_SERVICE_Context *sctx, | |||
758 | /** | 763 | /** |
759 | * Parse an IPv6 access control list. | 764 | * Parse an IPv6 access control list. |
760 | * | 765 | * |
761 | * @param ret | 766 | * @param ret location where to write the ACL (set) |
762 | * @param sctx | 767 | * @param sctx service context to use to get the configuration |
763 | * @param option | 768 | * @param option name of the ACL option to parse |
764 | * @return | 769 | * @return GNUNET_SYSERR on parse error, GNUNET_OK on success (including |
770 | * no ACL configured) | ||
765 | */ | 771 | */ |
766 | static int | 772 | static int |
767 | process_acl6 (struct IPv6NetworkSet **ret, struct GNUNET_SERVICE_Context *sctx, | 773 | process_acl6 (struct IPv6NetworkSet **ret, struct GNUNET_SERVICE_Context *sctx, |
@@ -770,7 +776,10 @@ process_acl6 (struct IPv6NetworkSet **ret, struct GNUNET_SERVICE_Context *sctx, | |||
770 | char *opt; | 776 | char *opt; |
771 | 777 | ||
772 | if (!GNUNET_CONFIGURATION_have_value (sctx->cfg, sctx->serviceName, option)) | 778 | if (!GNUNET_CONFIGURATION_have_value (sctx->cfg, sctx->serviceName, option)) |
779 | { | ||
780 | *ret = NULL; | ||
773 | return GNUNET_OK; | 781 | return GNUNET_OK; |
782 | } | ||
774 | GNUNET_break (GNUNET_OK == | 783 | GNUNET_break (GNUNET_OK == |
775 | GNUNET_CONFIGURATION_get_value_string (sctx->cfg, | 784 | GNUNET_CONFIGURATION_get_value_string (sctx->cfg, |
776 | sctx->serviceName, | 785 | sctx->serviceName, |
@@ -1146,9 +1155,9 @@ GNUNET_SERVICE_get_server_addresses (const char *serviceName, | |||
1146 | 1155 | ||
1147 | #ifdef MINGW | 1156 | #ifdef MINGW |
1148 | /** | 1157 | /** |
1158 | * Read listen sockets from the parent process (ARM). | ||
1149 | * | 1159 | * |
1150 | * | 1160 | * @param sctx service context to initialize |
1151 | * @param sctx | ||
1152 | * @return GNUNET_YES if ok, GNUNET_NO if not ok (must bind yourself), | 1161 | * @return GNUNET_YES if ok, GNUNET_NO if not ok (must bind yourself), |
1153 | * and GNUNET_SYSERR on error. | 1162 | * and GNUNET_SYSERR on error. |
1154 | */ | 1163 | */ |
@@ -1243,7 +1252,7 @@ receive_sockets_from_parent (struct GNUNET_SERVICE_Context *sctx) | |||
1243 | * - REJECT_FROM (disallow allow connections from specified IPv4 subnets) | 1252 | * - REJECT_FROM (disallow allow connections from specified IPv4 subnets) |
1244 | * - REJECT_FROM6 (disallow allow connections from specified IPv6 subnets) | 1253 | * - REJECT_FROM6 (disallow allow connections from specified IPv6 subnets) |
1245 | * | 1254 | * |
1246 | * @param sctx | 1255 | * @param sctx service context to initialize |
1247 | * @return GNUNET_OK if configuration succeeded | 1256 | * @return GNUNET_OK if configuration succeeded |
1248 | */ | 1257 | */ |
1249 | static int | 1258 | static int |
@@ -1358,8 +1367,8 @@ setup_service (struct GNUNET_SERVICE_Context *sctx) | |||
1358 | * Get the name of the user that'll be used | 1367 | * Get the name of the user that'll be used |
1359 | * to provide the service. | 1368 | * to provide the service. |
1360 | * | 1369 | * |
1361 | * @param sctx | 1370 | * @param sctx service context |
1362 | * @return | 1371 | * @return value of the 'USERNAME' option |
1363 | */ | 1372 | */ |
1364 | static char * | 1373 | static char * |
1365 | get_user_name (struct GNUNET_SERVICE_Context *sctx) | 1374 | get_user_name (struct GNUNET_SERVICE_Context *sctx) |
@@ -1376,9 +1385,9 @@ get_user_name (struct GNUNET_SERVICE_Context *sctx) | |||
1376 | /** | 1385 | /** |
1377 | * Write PID file. | 1386 | * Write PID file. |
1378 | * | 1387 | * |
1379 | * @param sctx | 1388 | * @param sctx service context |
1380 | * @param pid | 1389 | * @param pid PID to write (should be equal to 'getpid()' |
1381 | * @return | 1390 | * @return GNUNET_OK on success (including no work to be done) |
1382 | */ | 1391 | */ |
1383 | static int | 1392 | static int |
1384 | write_pid_file (struct GNUNET_SERVICE_Context *sctx, pid_t pid) | 1393 | write_pid_file (struct GNUNET_SERVICE_Context *sctx, pid_t pid) |
@@ -1524,7 +1533,7 @@ service_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1524 | * Detach from terminal. | 1533 | * Detach from terminal. |
1525 | * | 1534 | * |
1526 | * @param sctx service context | 1535 | * @param sctx service context |
1527 | * @return | 1536 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
1528 | */ | 1537 | */ |
1529 | static int | 1538 | static int |
1530 | detach_terminal (struct GNUNET_SERVICE_Context *sctx) | 1539 | detach_terminal (struct GNUNET_SERVICE_Context *sctx) |
@@ -1605,7 +1614,7 @@ detach_terminal (struct GNUNET_SERVICE_Context *sctx) | |||
1605 | * Set user ID. | 1614 | * Set user ID. |
1606 | * | 1615 | * |
1607 | * @param sctx service context | 1616 | * @param sctx service context |
1608 | * @return | 1617 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
1609 | */ | 1618 | */ |
1610 | static int | 1619 | static int |
1611 | set_user_id (struct GNUNET_SERVICE_Context *sctx) | 1620 | set_user_id (struct GNUNET_SERVICE_Context *sctx) |