diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-15 12:44:36 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-15 12:44:36 +0000 |
commit | 89eaed3f777bd076391f006b830f20be23d38210 (patch) | |
tree | 757aeccfac4bf16e14a159d5f998f98802fcedf0 /src | |
parent | 4b5e3086a0813daa6709ee7c0087ece6222bb022 (diff) | |
download | gnunet-89eaed3f777bd076391f006b830f20be23d38210.tar.gz gnunet-89eaed3f777bd076391f006b830f20be23d38210.zip |
cleanup
Diffstat (limited to 'src')
-rw-r--r-- | src/include/gnunet_container_lib.h | 2 | ||||
-rw-r--r-- | src/include/gnunet_network_lib.h | 22 | ||||
-rw-r--r-- | src/util/container_slist.c | 2 |
3 files changed, 22 insertions, 4 deletions
diff --git a/src/include/gnunet_container_lib.h b/src/include/gnunet_container_lib.h index 4582c1a14..3319b710b 100644 --- a/src/include/gnunet_container_lib.h +++ b/src/include/gnunet_container_lib.h | |||
@@ -1199,7 +1199,7 @@ int GNUNET_CONTAINER_slist_end (struct GNUNET_CONTAINER_SList_Iterator *i); | |||
1199 | * @param len set to the payload length | 1199 | * @param len set to the payload length |
1200 | * @return payload | 1200 | * @return payload |
1201 | */ | 1201 | */ |
1202 | const void * | 1202 | void * |
1203 | GNUNET_CONTAINER_slist_get (const struct GNUNET_CONTAINER_SList_Iterator *i, | 1203 | GNUNET_CONTAINER_slist_get (const struct GNUNET_CONTAINER_SList_Iterator *i, |
1204 | size_t *len); | 1204 | size_t *len); |
1205 | 1205 | ||
diff --git a/src/include/gnunet_network_lib.h b/src/include/gnunet_network_lib.h index aed4cabbf..1405efa2a 100644 --- a/src/include/gnunet_network_lib.h +++ b/src/include/gnunet_network_lib.h | |||
@@ -36,12 +36,12 @@ extern "C" | |||
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | 38 | ||
39 | |||
40 | /** | 39 | /** |
41 | * @brief handle to a socket | 40 | * @brief handle to a socket |
42 | */ | 41 | */ |
43 | struct GNUNET_NETWORK_Handle; | 42 | struct GNUNET_NETWORK_Handle; |
44 | 43 | ||
44 | |||
45 | /** | 45 | /** |
46 | * @brief collection of IO descriptors | 46 | * @brief collection of IO descriptors |
47 | */ | 47 | */ |
@@ -122,6 +122,7 @@ int GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc, | |||
122 | */ | 122 | */ |
123 | int GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc); | 123 | int GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc); |
124 | 124 | ||
125 | |||
125 | /** | 126 | /** |
126 | * Connect a socket | 127 | * Connect a socket |
127 | * | 128 | * |
@@ -160,6 +161,7 @@ int GNUNET_NETWORK_socket_getsockopt (const struct GNUNET_NETWORK_Handle | |||
160 | int GNUNET_NETWORK_socket_listen (const struct GNUNET_NETWORK_Handle *desc, | 161 | int GNUNET_NETWORK_socket_listen (const struct GNUNET_NETWORK_Handle *desc, |
161 | int backlog); | 162 | int backlog); |
162 | 163 | ||
164 | |||
163 | /** | 165 | /** |
164 | * How much data is available to be read on this descriptor? | 166 | * How much data is available to be read on this descriptor? |
165 | * @param desc socket | 167 | * @param desc socket |
@@ -168,6 +170,7 @@ ssize_t | |||
168 | GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle | 170 | GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle |
169 | *desc); | 171 | *desc); |
170 | 172 | ||
173 | |||
171 | /** | 174 | /** |
172 | * Read data from a connected socket (always non-blocking). | 175 | * Read data from a connected socket (always non-blocking). |
173 | * @param desc socket | 176 | * @param desc socket |
@@ -183,6 +186,7 @@ GNUNET_NETWORK_socket_recvfrom (const struct GNUNET_NETWORK_Handle *desc, | |||
183 | struct sockaddr *src_addr, | 186 | struct sockaddr *src_addr, |
184 | socklen_t * addrlen); | 187 | socklen_t * addrlen); |
185 | 188 | ||
189 | |||
186 | /** | 190 | /** |
187 | * Read data from a connected socket (always non-blocking). | 191 | * Read data from a connected socket (always non-blocking). |
188 | * | 192 | * |
@@ -194,6 +198,7 @@ GNUNET_NETWORK_socket_recvfrom (const struct GNUNET_NETWORK_Handle *desc, | |||
194 | ssize_t GNUNET_NETWORK_socket_recv (const struct GNUNET_NETWORK_Handle *desc, | 198 | ssize_t GNUNET_NETWORK_socket_recv (const struct GNUNET_NETWORK_Handle *desc, |
195 | void *buffer, size_t length); | 199 | void *buffer, size_t length); |
196 | 200 | ||
201 | |||
197 | /** | 202 | /** |
198 | * Check if sockets meet certain conditions | 203 | * Check if sockets meet certain conditions |
199 | * @param rfds set of sockets to be checked for readability | 204 | * @param rfds set of sockets to be checked for readability |
@@ -208,7 +213,6 @@ int GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds, | |||
208 | struct GNUNET_TIME_Relative timeout); | 213 | struct GNUNET_TIME_Relative timeout); |
209 | 214 | ||
210 | 215 | ||
211 | |||
212 | /** | 216 | /** |
213 | * Send data (always non-blocking). | 217 | * Send data (always non-blocking). |
214 | * | 218 | * |
@@ -238,8 +242,10 @@ ssize_t GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle | |||
238 | const struct sockaddr *dest_addr, | 242 | const struct sockaddr *dest_addr, |
239 | socklen_t dest_len); | 243 | socklen_t dest_len); |
240 | 244 | ||
245 | |||
241 | /** | 246 | /** |
242 | * Set socket option | 247 | * Set socket option |
248 | * | ||
243 | * @param fd socket | 249 | * @param fd socket |
244 | * @param level protocol level of the option | 250 | * @param level protocol level of the option |
245 | * @param option_name option identifier | 251 | * @param option_name option identifier |
@@ -252,8 +258,10 @@ int GNUNET_NETWORK_socket_setsockopt (struct GNUNET_NETWORK_Handle *fd, | |||
252 | const void *option_value, | 258 | const void *option_value, |
253 | socklen_t option_len); | 259 | socklen_t option_len); |
254 | 260 | ||
261 | |||
255 | /** | 262 | /** |
256 | * Shut down socket operations | 263 | * Shut down socket operations |
264 | * | ||
257 | * @param desc socket | 265 | * @param desc socket |
258 | * @param how type of shutdown | 266 | * @param how type of shutdown |
259 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 267 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
@@ -261,6 +269,7 @@ int GNUNET_NETWORK_socket_setsockopt (struct GNUNET_NETWORK_Handle *fd, | |||
261 | int GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc, | 269 | int GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc, |
262 | int how); | 270 | int how); |
263 | 271 | ||
272 | |||
264 | /** | 273 | /** |
265 | * Disable the "CORK" feature for communication with the given socket, | 274 | * Disable the "CORK" feature for communication with the given socket, |
266 | * forcing the OS to immediately flush the buffer on transmission | 275 | * forcing the OS to immediately flush the buffer on transmission |
@@ -287,6 +296,7 @@ struct GNUNET_NETWORK_Handle *GNUNET_NETWORK_socket_create (int domain, | |||
287 | int type, | 296 | int type, |
288 | int protocol); | 297 | int protocol); |
289 | 298 | ||
299 | |||
290 | /** | 300 | /** |
291 | * Reset FD set (clears all file descriptors). | 301 | * Reset FD set (clears all file descriptors). |
292 | * | 302 | * |
@@ -294,6 +304,7 @@ struct GNUNET_NETWORK_Handle *GNUNET_NETWORK_socket_create (int domain, | |||
294 | */ | 304 | */ |
295 | void GNUNET_NETWORK_fdset_zero (struct GNUNET_NETWORK_FDSet *fds); | 305 | void GNUNET_NETWORK_fdset_zero (struct GNUNET_NETWORK_FDSet *fds); |
296 | 306 | ||
307 | |||
297 | /** | 308 | /** |
298 | * Add a socket to the FD set | 309 | * Add a socket to the FD set |
299 | * @param fds fd set | 310 | * @param fds fd set |
@@ -325,6 +336,7 @@ GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct GNUNET_NETWORK_FDSet * | |||
325 | int GNUNET_NETWORK_fdset_isset (const struct GNUNET_NETWORK_FDSet *fds, | 336 | int GNUNET_NETWORK_fdset_isset (const struct GNUNET_NETWORK_FDSet *fds, |
326 | const struct GNUNET_NETWORK_Handle *desc); | 337 | const struct GNUNET_NETWORK_Handle *desc); |
327 | 338 | ||
339 | |||
328 | /** | 340 | /** |
329 | * Add one fd set to another | 341 | * Add one fd set to another |
330 | * @param dst the fd set to add to | 342 | * @param dst the fd set to add to |
@@ -333,6 +345,7 @@ int GNUNET_NETWORK_fdset_isset (const struct GNUNET_NETWORK_FDSet *fds, | |||
333 | void GNUNET_NETWORK_fdset_add (struct GNUNET_NETWORK_FDSet *dst, | 345 | void GNUNET_NETWORK_fdset_add (struct GNUNET_NETWORK_FDSet *dst, |
334 | const struct GNUNET_NETWORK_FDSet *src); | 346 | const struct GNUNET_NETWORK_FDSet *src); |
335 | 347 | ||
348 | |||
336 | /** | 349 | /** |
337 | * Copy one fd set to another | 350 | * Copy one fd set to another |
338 | * @param to destination | 351 | * @param to destination |
@@ -350,6 +363,7 @@ void GNUNET_NETWORK_fdset_copy (struct GNUNET_NETWORK_FDSet *to, | |||
350 | */ | 363 | */ |
351 | int GNUNET_NETWORK_get_fd (struct GNUNET_NETWORK_Handle *desc); | 364 | int GNUNET_NETWORK_get_fd (struct GNUNET_NETWORK_Handle *desc); |
352 | 365 | ||
366 | |||
353 | /** | 367 | /** |
354 | * Copy a native fd set | 368 | * Copy a native fd set |
355 | * @param to destination | 369 | * @param to destination |
@@ -390,6 +404,7 @@ GNUNET_NETWORK_fdset_test_native (const struct GNUNET_NETWORK_FDSet *to, | |||
390 | void GNUNET_NETWORK_fdset_handle_set (struct GNUNET_NETWORK_FDSet *fds, | 404 | void GNUNET_NETWORK_fdset_handle_set (struct GNUNET_NETWORK_FDSet *fds, |
391 | const struct GNUNET_DISK_FileHandle *h); | 405 | const struct GNUNET_DISK_FileHandle *h); |
392 | 406 | ||
407 | |||
393 | /** | 408 | /** |
394 | * Check if a file handle is part of an fd set | 409 | * Check if a file handle is part of an fd set |
395 | * @param fds fd set | 410 | * @param fds fd set |
@@ -400,6 +415,7 @@ int GNUNET_NETWORK_fdset_handle_isset (const struct GNUNET_NETWORK_FDSet *fds, | |||
400 | const struct GNUNET_DISK_FileHandle | 415 | const struct GNUNET_DISK_FileHandle |
401 | *h); | 416 | *h); |
402 | 417 | ||
418 | |||
403 | /** | 419 | /** |
404 | * Checks if two fd sets overlap | 420 | * Checks if two fd sets overlap |
405 | * @param fds1 first fd set | 421 | * @param fds1 first fd set |
@@ -409,12 +425,14 @@ int GNUNET_NETWORK_fdset_handle_isset (const struct GNUNET_NETWORK_FDSet *fds, | |||
409 | int GNUNET_NETWORK_fdset_overlap (const struct GNUNET_NETWORK_FDSet *fds1, | 425 | int GNUNET_NETWORK_fdset_overlap (const struct GNUNET_NETWORK_FDSet *fds1, |
410 | const struct GNUNET_NETWORK_FDSet *fds2); | 426 | const struct GNUNET_NETWORK_FDSet *fds2); |
411 | 427 | ||
428 | |||
412 | /** | 429 | /** |
413 | * Creates an fd set | 430 | * Creates an fd set |
414 | * @return a new fd set | 431 | * @return a new fd set |
415 | */ | 432 | */ |
416 | struct GNUNET_NETWORK_FDSet *GNUNET_NETWORK_fdset_create (void); | 433 | struct GNUNET_NETWORK_FDSet *GNUNET_NETWORK_fdset_create (void); |
417 | 434 | ||
435 | |||
418 | /** | 436 | /** |
419 | * Releases the associated memory of an fd set | 437 | * Releases the associated memory of an fd set |
420 | * @param fds fd set | 438 | * @param fds fd set |
diff --git a/src/util/container_slist.c b/src/util/container_slist.c index 8c4886ef5..cecc74ce2 100644 --- a/src/util/container_slist.c +++ b/src/util/container_slist.c | |||
@@ -380,7 +380,7 @@ GNUNET_CONTAINER_slist_end (struct GNUNET_CONTAINER_SList_Iterator *i) | |||
380 | * @param len payload length | 380 | * @param len payload length |
381 | * @return payload | 381 | * @return payload |
382 | */ | 382 | */ |
383 | const void * | 383 | void * |
384 | GNUNET_CONTAINER_slist_get (const struct GNUNET_CONTAINER_SList_Iterator *i, | 384 | GNUNET_CONTAINER_slist_get (const struct GNUNET_CONTAINER_SList_Iterator *i, |
385 | size_t * len) | 385 | size_t * len) |
386 | { | 386 | { |