aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-02-18 14:05:44 +0000
committerChristian Grothoff <christian@grothoff.org>2015-02-18 14:05:44 +0000
commit2fc4f88977dd638ebc718c9374bb3fa56551171f (patch)
treee8648edb413e02bb34959946a580b98905852403 /src
parent433e2295e3f7fbb3e61b54489b9ee392914f3bff (diff)
downloadgnunet-2fc4f88977dd638ebc718c9374bb3fa56551171f.tar.gz
gnunet-2fc4f88977dd638ebc718c9374bb3fa56551171f.zip
-doxygen
Diffstat (limited to 'src')
-rw-r--r--src/include/gnunet_connection_lib.h8
-rw-r--r--src/include/gnunet_server_lib.h15
-rw-r--r--src/util/connection.c16
-rw-r--r--src/util/server.c36
4 files changed, 40 insertions, 35 deletions
diff --git a/src/include/gnunet_connection_lib.h b/src/include/gnunet_connection_lib.h
index c37666e38..c4c76a7eb 100644
--- a/src/include/gnunet_connection_lib.h
+++ b/src/include/gnunet_connection_lib.h
@@ -161,14 +161,14 @@ GNUNET_CONNECTION_create_from_existing (struct GNUNET_NETWORK_Handle *osSocket);
161 * Create a connection handle by accepting on a listen socket. This 161 * Create a connection handle by accepting on a listen socket. This
162 * function may block if the listen socket has no connection ready. 162 * function may block if the listen socket has no connection ready.
163 * 163 *
164 * @param access function to use to check if access is allowed 164 * @param access_cb function to use to check if access is allowed
165 * @param access_cls closure for access 165 * @param access_cb_cls closure for @a access_cb
166 * @param lsock listen socket 166 * @param lsock listen socket
167 * @return the connection handle, NULL on error (for example, access refused) 167 * @return the connection handle, NULL on error (for example, access refused)
168 */ 168 */
169struct GNUNET_CONNECTION_Handle * 169struct GNUNET_CONNECTION_Handle *
170GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck access, 170GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck access_cb,
171 void *access_cls, 171 void *access_cb_cls,
172 struct GNUNET_NETWORK_Handle *lsock); 172 struct GNUNET_NETWORK_Handle *lsock);
173 173
174 174
diff --git a/src/include/gnunet_server_lib.h b/src/include/gnunet_server_lib.h
index 207f76a44..6b6dac1ac 100644
--- a/src/include/gnunet_server_lib.h
+++ b/src/include/gnunet_server_lib.h
@@ -119,8 +119,8 @@ struct GNUNET_SERVER_MessageHandler
119/** 119/**
120 * Create a new server. 120 * Create a new server.
121 * 121 *
122 * @param access function for access control 122 * @param access_cb function for access control
123 * @param access_cls closure for @a access 123 * @param access_cb_cls closure for @a access_cb
124 * @param lsocks NULL-terminated array of listen sockets 124 * @param lsocks NULL-terminated array of listen sockets
125 * @param idle_timeout after how long should we timeout idle connections? 125 * @param idle_timeout after how long should we timeout idle connections?
126 * @param require_found if #GNUNET_YES, connections sending messages of unknown type 126 * @param require_found if #GNUNET_YES, connections sending messages of unknown type
@@ -129,8 +129,8 @@ struct GNUNET_SERVER_MessageHandler
129 * (typically, "port" already in use) 129 * (typically, "port" already in use)
130 */ 130 */
131struct GNUNET_SERVER_Handle * 131struct GNUNET_SERVER_Handle *
132GNUNET_SERVER_create_with_sockets (GNUNET_CONNECTION_AccessCheck access, 132GNUNET_SERVER_create_with_sockets (GNUNET_CONNECTION_AccessCheck access_cb,
133 void *access_cls, 133 void *access_cb_cls,
134 struct GNUNET_NETWORK_Handle **lsocks, 134 struct GNUNET_NETWORK_Handle **lsocks,
135 struct GNUNET_TIME_Relative idle_timeout, 135 struct GNUNET_TIME_Relative idle_timeout,
136 int require_found); 136 int require_found);
@@ -138,8 +138,8 @@ GNUNET_SERVER_create_with_sockets (GNUNET_CONNECTION_AccessCheck access,
138/** 138/**
139 * Create a new server. 139 * Create a new server.
140 * 140 *
141 * @param access function for access control 141 * @param access_cb function for access control
142 * @param access_cls closure for @a access 142 * @param access_cb_cls closure for @a access_cb
143 * @param server_addr address toes listen on (including port), NULL terminated array 143 * @param server_addr address toes listen on (including port), NULL terminated array
144 * @param socklen lengths of respective @a server_addr 144 * @param socklen lengths of respective @a server_addr
145 * @param idle_timeout after how long should we timeout idle connections? 145 * @param idle_timeout after how long should we timeout idle connections?
@@ -149,7 +149,8 @@ GNUNET_SERVER_create_with_sockets (GNUNET_CONNECTION_AccessCheck access,
149 * (typically, "port" already in use) 149 * (typically, "port" already in use)
150 */ 150 */
151struct GNUNET_SERVER_Handle * 151struct GNUNET_SERVER_Handle *
152GNUNET_SERVER_create (GNUNET_CONNECTION_AccessCheck access, void *access_cls, 152GNUNET_SERVER_create (GNUNET_CONNECTION_AccessCheck access_cb,
153 void *access_cb_cls,
153 struct sockaddr *const *server_addr, 154 struct sockaddr *const *server_addr,
154 const socklen_t * socklen, 155 const socklen_t * socklen,
155 struct GNUNET_TIME_Relative idle_timeout, 156 struct GNUNET_TIME_Relative idle_timeout,
diff --git a/src/util/connection.c b/src/util/connection.c
index 71135d6b8..8fe136b02 100644
--- a/src/util/connection.c
+++ b/src/util/connection.c
@@ -204,12 +204,12 @@ struct GNUNET_CONNECTION_Handle
204 /** 204 /**
205 * Read task that we may need to wait for. 205 * Read task that we may need to wait for.
206 */ 206 */
207 struct GNUNET_SCHEDULER_Task * read_task; 207 struct GNUNET_SCHEDULER_Task *read_task;
208 208
209 /** 209 /**
210 * Write task that we may need to wait for. 210 * Write task that we may need to wait for.
211 */ 211 */
212 struct GNUNET_SCHEDULER_Task * write_task; 212 struct GNUNET_SCHEDULER_Task *write_task;
213 213
214 /** 214 /**
215 * Handle to a pending DNS lookup request. 215 * Handle to a pending DNS lookup request.
@@ -311,14 +311,14 @@ GNUNET_CONNECTION_create_from_existing (struct GNUNET_NETWORK_Handle *osSocket)
311 * Create a connection handle by accepting on a listen socket. This 311 * Create a connection handle by accepting on a listen socket. This
312 * function may block if the listen socket has no connection ready. 312 * function may block if the listen socket has no connection ready.
313 * 313 *
314 * @param access function to use to check if access is allowed 314 * @param access_cb function to use to check if access is allowed
315 * @param access_cls closure for access 315 * @param access_cb_cls closure for @a access_cb
316 * @param lsock listen socket 316 * @param lsock listen socket
317 * @return the connection handle, NULL on error 317 * @return the connection handle, NULL on error
318 */ 318 */
319struct GNUNET_CONNECTION_Handle * 319struct GNUNET_CONNECTION_Handle *
320GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck access, 320GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck access_cb,
321 void *access_cls, 321 void *access_cb_cls,
322 struct GNUNET_NETWORK_Handle *lsock) 322 struct GNUNET_NETWORK_Handle *lsock)
323{ 323{
324 struct GNUNET_CONNECTION_Handle *connection; 324 struct GNUNET_CONNECTION_Handle *connection;
@@ -415,8 +415,8 @@ GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck access,
415#endif 415#endif
416 } 416 }
417 417
418 if ((NULL != access) && 418 if ((NULL != access_cb) &&
419 (GNUNET_YES != (aret = access (access_cls, gcp, uaddr, addrlen)))) 419 (GNUNET_YES != (aret = access_cb (access_cb_cls, gcp, uaddr, addrlen))))
420 { 420 {
421 if (GNUNET_NO == aret) 421 if (GNUNET_NO == aret)
422 LOG (GNUNET_ERROR_TYPE_INFO, 422 LOG (GNUNET_ERROR_TYPE_INFO,
diff --git a/src/util/server.c b/src/util/server.c
index 94d781870..d05df089f 100644
--- a/src/util/server.c
+++ b/src/util/server.c
@@ -122,12 +122,12 @@ struct GNUNET_SERVER_Handle
122 /** 122 /**
123 * Function to call for access control. 123 * Function to call for access control.
124 */ 124 */
125 GNUNET_CONNECTION_AccessCheck access; 125 GNUNET_CONNECTION_AccessCheck access_cb;
126 126
127 /** 127 /**
128 * Closure for access. 128 * Closure for @e access_cb.
129 */ 129 */
130 void *access_cls; 130 void *access_cb_cls;
131 131
132 /** 132 /**
133 * NULL-terminated array of sockets used to listen for new 133 * NULL-terminated array of sockets used to listen for new
@@ -413,8 +413,8 @@ process_listen_socket (void *cls,
413 if (GNUNET_NETWORK_fdset_isset (tc->read_ready, server->listen_sockets[i])) 413 if (GNUNET_NETWORK_fdset_isset (tc->read_ready, server->listen_sockets[i]))
414 { 414 {
415 sock = 415 sock =
416 GNUNET_CONNECTION_create_from_accept (server->access, 416 GNUNET_CONNECTION_create_from_accept (server->access_cb,
417 server->access_cls, 417 server->access_cb_cls,
418 server->listen_sockets[i]); 418 server->listen_sockets[i]);
419 if (NULL != sock) 419 if (NULL != sock)
420 { 420 {
@@ -522,8 +522,8 @@ open_listen_socket (const struct sockaddr *server_addr, socklen_t socklen)
522/** 522/**
523 * Create a new server. 523 * Create a new server.
524 * 524 *
525 * @param access function for access control 525 * @param access_cb function for access control
526 * @param access_cls closure for access 526 * @param access_cb_cls closure for @a access_cb
527 * @param lsocks NULL-terminated array of listen sockets 527 * @param lsocks NULL-terminated array of listen sockets
528 * @param idle_timeout after how long should we timeout idle connections? 528 * @param idle_timeout after how long should we timeout idle connections?
529 * @param require_found if #GNUNET_YES, connections sending messages of unknown type 529 * @param require_found if #GNUNET_YES, connections sending messages of unknown type
@@ -532,8 +532,8 @@ open_listen_socket (const struct sockaddr *server_addr, socklen_t socklen)
532 * (typically, "port" already in use) 532 * (typically, "port" already in use)
533 */ 533 */
534struct GNUNET_SERVER_Handle * 534struct GNUNET_SERVER_Handle *
535GNUNET_SERVER_create_with_sockets (GNUNET_CONNECTION_AccessCheck access, 535GNUNET_SERVER_create_with_sockets (GNUNET_CONNECTION_AccessCheck access_cb,
536 void *access_cls, 536 void *access_cb_cls,
537 struct GNUNET_NETWORK_Handle **lsocks, 537 struct GNUNET_NETWORK_Handle **lsocks,
538 struct GNUNET_TIME_Relative idle_timeout, 538 struct GNUNET_TIME_Relative idle_timeout,
539 int require_found) 539 int require_found)
@@ -543,8 +543,8 @@ GNUNET_SERVER_create_with_sockets (GNUNET_CONNECTION_AccessCheck access,
543 server = GNUNET_new (struct GNUNET_SERVER_Handle); 543 server = GNUNET_new (struct GNUNET_SERVER_Handle);
544 server->idle_timeout = idle_timeout; 544 server->idle_timeout = idle_timeout;
545 server->listen_sockets = lsocks; 545 server->listen_sockets = lsocks;
546 server->access = access; 546 server->access_cb = access_cb;
547 server->access_cls = access_cls; 547 server->access_cb_cls = access_cb_cls;
548 server->require_found = require_found; 548 server->require_found = require_found;
549 if (NULL != lsocks) 549 if (NULL != lsocks)
550 GNUNET_SERVER_resume (server); 550 GNUNET_SERVER_resume (server);
@@ -555,8 +555,8 @@ GNUNET_SERVER_create_with_sockets (GNUNET_CONNECTION_AccessCheck access,
555/** 555/**
556 * Create a new server. 556 * Create a new server.
557 * 557 *
558 * @param access function for access control 558 * @param access_cb function for access control
559 * @param access_cls closure for access 559 * @param access_cb_cls closure for @a access_cb
560 * @param server_addr address to listen on (including port), NULL terminated array 560 * @param server_addr address to listen on (including port), NULL terminated array
561 * @param socklen length of server_addr 561 * @param socklen length of server_addr
562 * @param idle_timeout after how long should we timeout idle connections? 562 * @param idle_timeout after how long should we timeout idle connections?
@@ -566,7 +566,8 @@ GNUNET_SERVER_create_with_sockets (GNUNET_CONNECTION_AccessCheck access,
566 * (typically, "port" already in use) 566 * (typically, "port" already in use)
567 */ 567 */
568struct GNUNET_SERVER_Handle * 568struct GNUNET_SERVER_Handle *
569GNUNET_SERVER_create (GNUNET_CONNECTION_AccessCheck access, void *access_cls, 569GNUNET_SERVER_create (GNUNET_CONNECTION_AccessCheck access_cb,
570 void *access_cb_cls,
570 struct sockaddr *const *server_addr, 571 struct sockaddr *const *server_addr,
571 const socklen_t * socklen, 572 const socklen_t * socklen,
572 struct GNUNET_TIME_Relative idle_timeout, 573 struct GNUNET_TIME_Relative idle_timeout,
@@ -619,8 +620,11 @@ GNUNET_SERVER_create (GNUNET_CONNECTION_AccessCheck access, void *access_cls,
619 { 620 {
620 lsocks = NULL; 621 lsocks = NULL;
621 } 622 }
622 return GNUNET_SERVER_create_with_sockets (access, access_cls, lsocks, 623 return GNUNET_SERVER_create_with_sockets (access_cb,
623 idle_timeout, require_found); 624 access_cb_cls,
625 lsocks,
626 idle_timeout,
627 require_found);
624} 628}
625 629
626 630