diff options
author | Willow Liquorice <willow@howhill.com> | 2022-08-31 22:50:00 +0100 |
---|---|---|
committer | Willow Liquorice <willow@howhill.com> | 2022-10-03 00:44:23 +0100 |
commit | 4d68c9fedf65188fec95205f39dad447e9b1ae44 (patch) | |
tree | d2d0492023380ed67065989bd66ed4dc52f81e2e /src/util | |
parent | 7b4d69a64e7390e57439c04e1e43e3ca78fc7bbe (diff) | |
download | gnunet-4d68c9fedf65188fec95205f39dad447e9b1ae44.tar.gz gnunet-4d68c9fedf65188fec95205f39dad447e9b1ae44.zip |
-DOC: Pass through UTIL libraries (HELPER, MST, NETWORK, OS, PEER)
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/helper.c | 46 | ||||
-rw-r--r-- | src/util/mst.c | 14 | ||||
-rw-r--r-- | src/util/network.c | 23 | ||||
-rw-r--r-- | src/util/os_installation.c | 5 | ||||
-rw-r--r-- | src/util/os_priority.c | 51 | ||||
-rw-r--r-- | src/util/peer.c | 12 |
6 files changed, 0 insertions, 151 deletions
diff --git a/src/util/helper.c b/src/util/helper.c index 0809c1f17..09d3fffab 100644 --- a/src/util/helper.c +++ b/src/util/helper.c | |||
@@ -164,15 +164,6 @@ struct GNUNET_HELPER_Handle | |||
164 | }; | 164 | }; |
165 | 165 | ||
166 | 166 | ||
167 | /** | ||
168 | * Sends termination signal to the helper process. The helper process is not | ||
169 | * reaped; call GNUNET_HELPER_wait() for reaping the dead helper process. | ||
170 | * | ||
171 | * @param h the helper handle | ||
172 | * @param soft_kill if GNUNET_YES, signals termination by closing the helper's | ||
173 | * stdin; GNUNET_NO to signal termination by sending SIGTERM to helper | ||
174 | * @return #GNUNET_OK on success; #GNUNET_SYSERR on error | ||
175 | */ | ||
176 | int | 167 | int |
177 | GNUNET_HELPER_kill (struct GNUNET_HELPER_Handle *h, int soft_kill) | 168 | GNUNET_HELPER_kill (struct GNUNET_HELPER_Handle *h, int soft_kill) |
178 | { | 169 | { |
@@ -213,14 +204,6 @@ GNUNET_HELPER_kill (struct GNUNET_HELPER_Handle *h, int soft_kill) | |||
213 | } | 204 | } |
214 | 205 | ||
215 | 206 | ||
216 | /** | ||
217 | * Reap the helper process. This call is blocking(!). The helper process | ||
218 | * should either be sent a termination signal before or should be dead before | ||
219 | * calling this function | ||
220 | * | ||
221 | * @param h the helper handle | ||
222 | * @return #GNUNET_OK on success; #GNUNET_SYSERR on error | ||
223 | */ | ||
224 | int | 207 | int |
225 | GNUNET_HELPER_wait (struct GNUNET_HELPER_Handle *h) | 208 | GNUNET_HELPER_wait (struct GNUNET_HELPER_Handle *h) |
226 | { | 209 | { |
@@ -475,22 +458,6 @@ restart_task (void *cls) | |||
475 | } | 458 | } |
476 | 459 | ||
477 | 460 | ||
478 | /** | ||
479 | * Starts a helper and begins reading from it. The helper process is | ||
480 | * restarted when it dies except when it is stopped using GNUNET_HELPER_stop() | ||
481 | * or when the exp_cb callback is not NULL. | ||
482 | * | ||
483 | * @param with_control_pipe does the helper support the use of a control pipe for signalling? | ||
484 | * @param binary_name name of the binary to run | ||
485 | * @param binary_argv NULL-terminated list of arguments to give when starting the binary (this | ||
486 | * argument must not be modified by the client for | ||
487 | * the lifetime of the helper handle) | ||
488 | * @param cb function to call if we get messages from the helper | ||
489 | * @param exp_cb the exception callback to call. Set this to NULL if the helper | ||
490 | * process has to be restarted automatically when it dies/crashes | ||
491 | * @param cb_cls closure for the above callback | ||
492 | * @return the new Handle, NULL on error | ||
493 | */ | ||
494 | struct GNUNET_HELPER_Handle * | 461 | struct GNUNET_HELPER_Handle * |
495 | GNUNET_HELPER_start (int with_control_pipe, | 462 | GNUNET_HELPER_start (int with_control_pipe, |
496 | const char *binary_name, | 463 | const char *binary_name, |
@@ -644,19 +611,6 @@ helper_write (void *cls) | |||
644 | } | 611 | } |
645 | 612 | ||
646 | 613 | ||
647 | /** | ||
648 | * Send an message to the helper. | ||
649 | * | ||
650 | * @param h helper to send message to | ||
651 | * @param msg message to send | ||
652 | * @param can_drop can the message be dropped if there is already one in the queue? | ||
653 | * @param cont continuation to run once the message is out (#GNUNET_OK on success, #GNUNET_NO | ||
654 | * if the helper process died, #GNUNET_SYSERR during #GNUNET_HELPER_destroy). | ||
655 | * @param cont_cls closure for @a cont | ||
656 | * @return NULL if the message was dropped, | ||
657 | * otherwise handle to cancel *cont* (actual transmission may | ||
658 | * not be abortable) | ||
659 | */ | ||
660 | struct GNUNET_HELPER_SendHandle * | 614 | struct GNUNET_HELPER_SendHandle * |
661 | GNUNET_HELPER_send (struct GNUNET_HELPER_Handle *h, | 615 | GNUNET_HELPER_send (struct GNUNET_HELPER_Handle *h, |
662 | const struct GNUNET_MessageHeader *msg, | 616 | const struct GNUNET_MessageHeader *msg, |
diff --git a/src/util/mst.c b/src/util/mst.c index 2236f2883..264fdb979 100644 --- a/src/util/mst.c +++ b/src/util/mst.c | |||
@@ -96,20 +96,6 @@ GNUNET_MST_create (GNUNET_MessageTokenizerCallback cb, | |||
96 | } | 96 | } |
97 | 97 | ||
98 | 98 | ||
99 | /** | ||
100 | * Add incoming data to the receive buffer and call the | ||
101 | * callback for all complete messages. | ||
102 | * | ||
103 | * @param mst tokenizer to use | ||
104 | * @param buf input data to add | ||
105 | * @param size number of bytes in @a buf | ||
106 | * @param purge should any excess bytes in the buffer be discarded | ||
107 | * (i.e. for packet-based services like UDP) | ||
108 | * @param one_shot only call callback once, keep rest of message in buffer | ||
109 | * @return #GNUNET_OK if we are done processing (need more data) | ||
110 | * #GNUNET_NO if @a one_shot was set and we have another message ready | ||
111 | * #GNUNET_SYSERR if the data stream is corrupt | ||
112 | */ | ||
113 | int | 99 | int |
114 | GNUNET_MST_from_buffer (struct GNUNET_MessageStreamTokenizer *mst, | 100 | GNUNET_MST_from_buffer (struct GNUNET_MessageStreamTokenizer *mst, |
115 | const char *buf, | 101 | const char *buf, |
diff --git a/src/util/network.c b/src/util/network.c index 2f77bc54e..7588033c4 100644 --- a/src/util/network.c +++ b/src/util/network.c | |||
@@ -561,11 +561,6 @@ GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc) | |||
561 | } | 561 | } |
562 | 562 | ||
563 | 563 | ||
564 | /** | ||
565 | * Only free memory of a socket, keep the file descriptor untouched. | ||
566 | * | ||
567 | * @param desc socket | ||
568 | */ | ||
569 | void | 564 | void |
570 | GNUNET_NETWORK_socket_free_memory_only_ (struct GNUNET_NETWORK_Handle *desc) | 565 | GNUNET_NETWORK_socket_free_memory_only_ (struct GNUNET_NETWORK_Handle *desc) |
571 | { | 566 | { |
@@ -688,16 +683,6 @@ GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle *desc) | |||
688 | } | 683 | } |
689 | 684 | ||
690 | 685 | ||
691 | /** | ||
692 | * Read data from a socket (always non-blocking). | ||
693 | * | ||
694 | * @param desc socket | ||
695 | * @param buffer buffer | ||
696 | * @param length length of @a buffer | ||
697 | * @param src_addr either the source to recv from, or all zeroes | ||
698 | * to be filled in by recvfrom | ||
699 | * @param addrlen length of the @a src_addr | ||
700 | */ | ||
701 | ssize_t | 686 | ssize_t |
702 | GNUNET_NETWORK_socket_recvfrom (const struct GNUNET_NETWORK_Handle *desc, | 687 | GNUNET_NETWORK_socket_recvfrom (const struct GNUNET_NETWORK_Handle *desc, |
703 | void *buffer, | 688 | void *buffer, |
@@ -748,14 +733,6 @@ GNUNET_NETWORK_socket_recv (const struct GNUNET_NETWORK_Handle *desc, | |||
748 | } | 733 | } |
749 | 734 | ||
750 | 735 | ||
751 | /** | ||
752 | * Send data (always non-blocking). | ||
753 | * | ||
754 | * @param desc socket | ||
755 | * @param buffer data to send | ||
756 | * @param length size of the @a buffer | ||
757 | * @return number of bytes sent, #GNUNET_SYSERR on error | ||
758 | */ | ||
759 | ssize_t | 736 | ssize_t |
760 | GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle *desc, | 737 | GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle *desc, |
761 | const void *buffer, | 738 | const void *buffer, |
diff --git a/src/util/os_installation.c b/src/util/os_installation.c index 1835c6e84..7a348b42e 100644 --- a/src/util/os_installation.c +++ b/src/util/os_installation.c | |||
@@ -117,11 +117,6 @@ GNUNET_OS_project_data_get () | |||
117 | } | 117 | } |
118 | 118 | ||
119 | 119 | ||
120 | /** | ||
121 | * Setup OS subsystem with project data. | ||
122 | * | ||
123 | * @param pd project data used to determine paths | ||
124 | */ | ||
125 | void | 120 | void |
126 | GNUNET_OS_init (const struct GNUNET_OS_ProjectData *pd) | 121 | GNUNET_OS_init (const struct GNUNET_OS_ProjectData *pd) |
127 | { | 122 | { |
diff --git a/src/util/os_priority.c b/src/util/os_priority.c index 2ed49b5aa..e60273814 100644 --- a/src/util/os_priority.c +++ b/src/util/os_priority.c | |||
@@ -128,14 +128,6 @@ parent_control_handler (void *cls) | |||
128 | } | 128 | } |
129 | 129 | ||
130 | 130 | ||
131 | /** | ||
132 | * Task that connects this process to its parent via pipe; | ||
133 | * essentially, the parent control handler will read signal numbers | ||
134 | * from the #GNUNET_OS_CONTROL_PIPE (as given in an environment | ||
135 | * variable) and raise those signals. | ||
136 | * | ||
137 | * @param cls closure (unused) | ||
138 | */ | ||
139 | void | 131 | void |
140 | GNUNET_OS_install_parent_control_handler (void *cls) | 132 | GNUNET_OS_install_parent_control_handler (void *cls) |
141 | { | 133 | { |
@@ -583,17 +575,6 @@ start_process (enum GNUNET_OS_InheritStdioFlags std_inheritance, | |||
583 | } | 575 | } |
584 | 576 | ||
585 | 577 | ||
586 | /** | ||
587 | * Start a process. | ||
588 | * | ||
589 | * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags | ||
590 | * @param pipe_stdin pipe to use to send input to child process (or NULL) | ||
591 | * @param pipe_stdout pipe to use to get output from child process (or NULL) | ||
592 | * @param pipe_stderr pipe to use to get output from child process (or NULL) | ||
593 | * @param filename name of the binary | ||
594 | * @param argv NULL-terminated array of arguments to the process | ||
595 | * @return pointer to process structure of the new process, NULL on error | ||
596 | */ | ||
597 | struct GNUNET_OS_Process * | 578 | struct GNUNET_OS_Process * |
598 | GNUNET_OS_start_process_vap (enum GNUNET_OS_InheritStdioFlags std_inheritance, | 579 | GNUNET_OS_start_process_vap (enum GNUNET_OS_InheritStdioFlags std_inheritance, |
599 | struct GNUNET_DISK_PipeHandle *pipe_stdin, | 580 | struct GNUNET_DISK_PipeHandle *pipe_stdin, |
@@ -612,17 +593,6 @@ GNUNET_OS_start_process_vap (enum GNUNET_OS_InheritStdioFlags std_inheritance, | |||
612 | } | 593 | } |
613 | 594 | ||
614 | 595 | ||
615 | /** | ||
616 | * Start a process. | ||
617 | * | ||
618 | * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags | ||
619 | * @param pipe_stdin pipe to use to send input to child process (or NULL) | ||
620 | * @param pipe_stdout pipe to use to get output from child process (or NULL) | ||
621 | * @param pipe_stderr pipe to use to get output from child process (or NULL) | ||
622 | * @param filename name of the binary | ||
623 | * @param va NULL-terminated list of arguments to the process | ||
624 | * @return pointer to process structure of the new process, NULL on error | ||
625 | */ | ||
626 | struct GNUNET_OS_Process * | 596 | struct GNUNET_OS_Process * |
627 | GNUNET_OS_start_process_va (enum GNUNET_OS_InheritStdioFlags std_inheritance, | 597 | GNUNET_OS_start_process_va (enum GNUNET_OS_InheritStdioFlags std_inheritance, |
628 | struct GNUNET_DISK_PipeHandle *pipe_stdin, | 598 | struct GNUNET_DISK_PipeHandle *pipe_stdin, |
@@ -658,16 +628,6 @@ GNUNET_OS_start_process_va (enum GNUNET_OS_InheritStdioFlags std_inheritance, | |||
658 | } | 628 | } |
659 | 629 | ||
660 | 630 | ||
661 | /** | ||
662 | * Start a process. | ||
663 | * | ||
664 | * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags | ||
665 | * @param pipe_stdin pipe to use to send input to child process (or NULL) | ||
666 | * @param pipe_stdout pipe to use to get output from child process (or NULL) | ||
667 | * @param filename name of the binary | ||
668 | * @param ... NULL-terminated list of arguments to the process | ||
669 | * @return pointer to process structure of the new process, NULL on error | ||
670 | */ | ||
671 | struct GNUNET_OS_Process * | 631 | struct GNUNET_OS_Process * |
672 | GNUNET_OS_start_process (enum GNUNET_OS_InheritStdioFlags std_inheritance, | 632 | GNUNET_OS_start_process (enum GNUNET_OS_InheritStdioFlags std_inheritance, |
673 | struct GNUNET_DISK_PipeHandle *pipe_stdin, | 633 | struct GNUNET_DISK_PipeHandle *pipe_stdin, |
@@ -1127,17 +1087,6 @@ cmd_read (void *cls) | |||
1127 | } | 1087 | } |
1128 | 1088 | ||
1129 | 1089 | ||
1130 | /** | ||
1131 | * Run the given command line and call the given function | ||
1132 | * for each line of the output. | ||
1133 | * | ||
1134 | * @param proc function to call for each line of the output | ||
1135 | * @param proc_cls closure for @a proc | ||
1136 | * @param timeout when to time out | ||
1137 | * @param binary command to run | ||
1138 | * @param ... arguments to command | ||
1139 | * @return NULL on error | ||
1140 | */ | ||
1141 | struct GNUNET_OS_CommandHandle * | 1090 | struct GNUNET_OS_CommandHandle * |
1142 | GNUNET_OS_command_run (GNUNET_OS_LineProcessor proc, | 1091 | GNUNET_OS_command_run (GNUNET_OS_LineProcessor proc, |
1143 | void *proc_cls, | 1092 | void *proc_cls, |
diff --git a/src/util/peer.c b/src/util/peer.c index 257922f36..809efdcd5 100644 --- a/src/util/peer.c +++ b/src/util/peer.c | |||
@@ -152,12 +152,6 @@ GNUNET_PEER_intern (const struct GNUNET_PeerIdentity *pid) | |||
152 | } | 152 | } |
153 | 153 | ||
154 | 154 | ||
155 | /** | ||
156 | * Decrement multiple RCs of peer identities by one. | ||
157 | * | ||
158 | * @param ids array of PIDs to decrement the RCs of | ||
159 | * @param count size of the ids array | ||
160 | */ | ||
161 | void | 155 | void |
162 | GNUNET_PEER_decrement_rcs (const GNUNET_PEER_Id *ids, unsigned int count) | 156 | GNUNET_PEER_decrement_rcs (const GNUNET_PEER_Id *ids, unsigned int count) |
163 | { | 157 | { |
@@ -235,12 +229,6 @@ GNUNET_PEER_resolve (GNUNET_PEER_Id id, struct GNUNET_PeerIdentity *pid) | |||
235 | } | 229 | } |
236 | 230 | ||
237 | 231 | ||
238 | /** | ||
239 | * Convert an interned PID to a normal peer identity. | ||
240 | * | ||
241 | * @param id interned PID to convert | ||
242 | * @return pointer to peer identity, valid as long 'id' is valid | ||
243 | */ | ||
244 | const struct GNUNET_PeerIdentity * | 232 | const struct GNUNET_PeerIdentity * |
245 | GNUNET_PEER_resolve2 (GNUNET_PEER_Id id) | 233 | GNUNET_PEER_resolve2 (GNUNET_PEER_Id id) |
246 | { | 234 | { |