From: Christian Grothoff Date: Sat, 29 Aug 2009 18:29:34 +0000 (+0000) Subject: more naming fixes X-Git-Tag: initial-import-from-subversion-38251~23575 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=eb0874673e122ddd822af3f4a9f9090c6104cd2a;p=oweals%2Fgnunet.git more naming fixes --- diff --git a/src/include/gnunet_connection_lib.h b/src/include/gnunet_connection_lib.h index 34f6bd8a2..41d56ec0f 100644 --- a/src/include/gnunet_connection_lib.h +++ b/src/include/gnunet_connection_lib.h @@ -47,7 +47,7 @@ extern "C" /** * @brief handle for a network connection */ -struct GNUNET_NETWORK_ConnectionHandle; +struct GNUNET_CONNECTION_Handle; /** @@ -94,7 +94,7 @@ typedef void (*GNUNET_NETWORK_Receiver) (void *cls, * 0 for sockets that need no write buffers, such as listen sockets) * @return the boxed socket handle */ -struct GNUNET_NETWORK_ConnectionHandle +struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_existing (struct GNUNET_SCHEDULER_Handle *sched, @@ -115,7 +115,7 @@ struct GNUNET_NETWORK_ConnectionHandle * 0 for sockets that need no write buffers, such as listen sockets) * @return the socket handle, NULL on error (for example, access refused) */ -struct GNUNET_NETWORK_ConnectionHandle +struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_accept (struct GNUNET_SCHEDULER_Handle *sched, @@ -138,7 +138,7 @@ struct GNUNET_NETWORK_ConnectionHandle * 0 for sockets that need no write buffers, such as listen sockets) * @return the socket handle */ -struct GNUNET_NETWORK_ConnectionHandle +struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_connect (struct GNUNET_SCHEDULER_Handle *sched, @@ -161,7 +161,7 @@ struct GNUNET_NETWORK_ConnectionHandle * 0 for sockets that need no write buffers, such as listen sockets) * @return the socket handle */ -struct GNUNET_NETWORK_ConnectionHandle +struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_sockaddr (struct GNUNET_SCHEDULER_Handle *sched, int af_family, @@ -178,7 +178,7 @@ struct GNUNET_NETWORK_ConnectionHandle * @param sock socket to check * @return GNUNET_YES if valid, GNUNET_NO otherwise */ -int GNUNET_CONNECTION_check (struct GNUNET_NETWORK_ConnectionHandle +int GNUNET_CONNECTION_check (struct GNUNET_CONNECTION_Handle *sock); @@ -191,7 +191,7 @@ int GNUNET_CONNECTION_check (struct GNUNET_NETWORK_ConnectionHandle * @return GNUNET_OK on success */ int GNUNET_CONNECTION_get_address (struct - GNUNET_NETWORK_ConnectionHandle + GNUNET_CONNECTION_Handle *sock, void **addr, size_t * addrlen); @@ -202,7 +202,7 @@ int GNUNET_CONNECTION_get_address (struct * * @param sock socket to destroy */ -void GNUNET_CONNECTION_destroy (struct GNUNET_NETWORK_ConnectionHandle +void GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock); @@ -221,7 +221,7 @@ void GNUNET_CONNECTION_destroy (struct GNUNET_NETWORK_ConnectionHandle * @return scheduler task ID used for receiving, GNUNET_SCHEDULER_NO_TASK on error */ GNUNET_SCHEDULER_TaskIdentifier -GNUNET_CONNECTION_receive (struct GNUNET_NETWORK_ConnectionHandle +GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *sock, size_t max, struct GNUNET_TIME_Relative timeout, GNUNET_NETWORK_Receiver receiver, @@ -238,7 +238,7 @@ GNUNET_CONNECTION_receive (struct GNUNET_NETWORK_ConnectionHandle * @return closure of the original receiver callback */ void *GNUNET_CONNECTION_receive_cancel (struct - GNUNET_NETWORK_ConnectionHandle + GNUNET_CONNECTION_Handle *sock, GNUNET_SCHEDULER_TaskIdentifier task); @@ -296,7 +296,7 @@ struct GNUNET_NETWORK_TransmitHandle; */ struct GNUNET_NETWORK_TransmitHandle *GNUNET_CONNECTION_notify_transmit_ready (struct - GNUNET_NETWORK_ConnectionHandle + GNUNET_CONNECTION_Handle *sock, size_t size, struct GNUNET_TIME_Relative diff --git a/src/include/gnunet_server_lib.h b/src/include/gnunet_server_lib.h index f62a409ce..bed5786ab 100644 --- a/src/include/gnunet_server_lib.h +++ b/src/include/gnunet_server_lib.h @@ -238,7 +238,7 @@ struct GNUNET_SERVER_Client *GNUNET_SERVER_connect_socket (struct GNUNET_SERVER_Handle *server, struct - GNUNET_NETWORK_ConnectionHandle + GNUNET_CONNECTION_Handle *connection); diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index feab67195..c14654be0 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c @@ -357,7 +357,7 @@ struct Plugin /** * The listen socket. */ - struct GNUNET_NETWORK_ConnectionHandle *lsock; + struct GNUNET_CONNECTION_Handle *lsock; /** * List of open TCP sessions. @@ -652,7 +652,7 @@ connect_and_create_validation_session (struct Plugin *plugin, const void *addr, size_t addrlen) { struct GNUNET_SERVER_Client *client; - struct GNUNET_NETWORK_ConnectionHandle *conn; + struct GNUNET_CONNECTION_Handle *conn; struct Session *session; int af; @@ -877,7 +877,7 @@ struct ConnectContext { struct Plugin *plugin; - struct GNUNET_NETWORK_ConnectionHandle *sa; + struct GNUNET_CONNECTION_Handle *sa; struct PendingMessage *welcome; diff --git a/src/util/client.c b/src/util/client.c index 9836b3e79..09eaeff1a 100644 --- a/src/util/client.c +++ b/src/util/client.c @@ -48,7 +48,7 @@ struct GNUNET_CLIENT_Connection /** * the socket handle, NULL if not live */ - struct GNUNET_NETWORK_ConnectionHandle *sock; + struct GNUNET_CONNECTION_Handle *sock; /** * Our scheduler. @@ -127,7 +127,7 @@ GNUNET_CLIENT_connect (struct GNUNET_SCHEDULER_Handle *sched, const struct GNUNET_CONFIGURATION_Handle *cfg) { struct GNUNET_CLIENT_Connection *ret; - struct GNUNET_NETWORK_ConnectionHandle *sock; + struct GNUNET_CONNECTION_Handle *sock; char *hostname; unsigned long long port; diff --git a/src/util/network.c b/src/util/network.c index 02d9e5dfd..fd5fe1217 100644 --- a/src/util/network.c +++ b/src/util/network.c @@ -66,7 +66,7 @@ struct GNUNET_NETWORK_TransmitHandle /** * Our socket handle. */ - struct GNUNET_NETWORK_ConnectionHandle *sh; + struct GNUNET_CONNECTION_Handle *sh; /** * Timeout for receiving (in absolute time). @@ -89,7 +89,7 @@ struct GNUNET_NETWORK_TransmitHandle /** * @brief handle for a network socket */ -struct GNUNET_NETWORK_ConnectionHandle +struct GNUNET_CONNECTION_Handle { /** @@ -217,13 +217,13 @@ struct GNUNET_NETWORK_ConnectionHandle * 0 for sockets that need no write buffers, such as listen sockets) * @return the boxed socket handle */ -struct GNUNET_NETWORK_ConnectionHandle * +struct GNUNET_CONNECTION_Handle * GNUNET_CONNECTION_create_from_existing (struct GNUNET_SCHEDULER_Handle *sched, struct GNUNET_NETWORK_Descriptor *osSocket, size_t maxbuf) { - struct GNUNET_NETWORK_ConnectionHandle *ret; - ret = GNUNET_malloc (sizeof (struct GNUNET_NETWORK_ConnectionHandle) + maxbuf); + struct GNUNET_CONNECTION_Handle *ret; + ret = GNUNET_malloc (sizeof (struct GNUNET_CONNECTION_Handle) + maxbuf); ret->write_buffer = (char *) &ret[1]; ret->write_buffer_size = maxbuf; ret->sock = osSocket; @@ -244,14 +244,14 @@ GNUNET_CONNECTION_create_from_existing (struct GNUNET_SCHEDULER_Handle * 0 for sockets that need no write buffers, such as listen sockets) * @return the socket handle, NULL on error */ -struct GNUNET_NETWORK_ConnectionHandle * +struct GNUNET_CONNECTION_Handle * GNUNET_CONNECTION_create_from_accept (struct GNUNET_SCHEDULER_Handle *sched, GNUNET_NETWORK_AccessCheck access, void *access_cls, struct GNUNET_NETWORK_Descriptor *lsock, size_t maxbuf) { - struct GNUNET_NETWORK_ConnectionHandle *ret; + struct GNUNET_CONNECTION_Handle *ret; char addr[32]; socklen_t addrlen; struct GNUNET_NETWORK_Descriptor *sock; @@ -319,7 +319,7 @@ GNUNET_CONNECTION_create_from_accept (struct GNUNET_SCHEDULER_Handle _("Accepting connection from `%s'\n"), GNUNET_a2s(uaddr, addrlen)); #endif - ret = GNUNET_malloc (sizeof (struct GNUNET_NETWORK_ConnectionHandle) + maxbuf); + ret = GNUNET_malloc (sizeof (struct GNUNET_CONNECTION_Handle) + maxbuf); ret->write_buffer = (char *) &ret[1]; ret->write_buffer_size = maxbuf; ret->addr = uaddr; @@ -338,7 +338,7 @@ GNUNET_CONNECTION_create_from_accept (struct GNUNET_SCHEDULER_Handle * @return GNUNET_OK on success */ int -GNUNET_CONNECTION_get_address (struct GNUNET_NETWORK_ConnectionHandle *sock, +GNUNET_CONNECTION_get_address (struct GNUNET_CONNECTION_Handle *sock, void **addr, size_t * addrlen) { if ((sock->addr == NULL) || (sock->addrlen == 0)) @@ -355,7 +355,7 @@ GNUNET_CONNECTION_get_address (struct GNUNET_NETWORK_ConnectionHandle *sock, * families as specified in the "address_families" array. */ static void -try_lookup (struct GNUNET_NETWORK_ConnectionHandle *sock) +try_lookup (struct GNUNET_CONNECTION_Handle *sock) { struct addrinfo hints; int ec; @@ -387,7 +387,7 @@ try_lookup (struct GNUNET_NETWORK_ConnectionHandle *sock) * @return GNUNET_SYSERR error (no more addresses to try) */ static int -try_connect (struct GNUNET_NETWORK_ConnectionHandle *sock) +try_connect (struct GNUNET_CONNECTION_Handle *sock) { struct GNUNET_NETWORK_Descriptor *s; @@ -476,7 +476,7 @@ static void connect_continuation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - struct GNUNET_NETWORK_ConnectionHandle *sock = cls; + struct GNUNET_CONNECTION_Handle *sock = cls; unsigned int len; int error; @@ -545,14 +545,14 @@ connect_continuation (void *cls, * 0 for sockets that need no write buffers, such as listen sockets) * @return the socket handle */ -struct GNUNET_NETWORK_ConnectionHandle * +struct GNUNET_CONNECTION_Handle * GNUNET_CONNECTION_create_from_connect (struct GNUNET_SCHEDULER_Handle *sched, const char *hostname, uint16_t port, size_t maxbuf) { - struct GNUNET_NETWORK_ConnectionHandle *ret; + struct GNUNET_CONNECTION_Handle *ret; - ret = GNUNET_malloc (sizeof (struct GNUNET_NETWORK_ConnectionHandle) + maxbuf); + ret = GNUNET_malloc (sizeof (struct GNUNET_CONNECTION_Handle) + maxbuf); ret->sock = NULL; ret->sched = sched; ret->write_buffer = (char *) &ret[1]; @@ -592,14 +592,14 @@ GNUNET_CONNECTION_create_from_connect (struct GNUNET_SCHEDULER_Handle * 0 for sockets that need no write buffers, such as listen sockets) * @return the socket handle */ -struct GNUNET_NETWORK_ConnectionHandle * +struct GNUNET_CONNECTION_Handle * GNUNET_CONNECTION_create_from_sockaddr (struct GNUNET_SCHEDULER_Handle *sched, int af_family, const struct sockaddr *serv_addr, socklen_t addrlen, size_t maxbuf) { struct GNUNET_NETWORK_Descriptor *s; - struct GNUNET_NETWORK_ConnectionHandle *ret; + struct GNUNET_CONNECTION_Handle *ret; s = GNUNET_NETWORK_socket_socket (af_family, SOCK_STREAM, 0); if (s == NULL) @@ -651,7 +651,7 @@ GNUNET_CONNECTION_create_from_sockaddr (struct GNUNET_SCHEDULER_Handle * @return GNUNET_YES if valid, GNUNET_NO otherwise */ int -GNUNET_CONNECTION_check (struct GNUNET_NETWORK_ConnectionHandle *sock) +GNUNET_CONNECTION_check (struct GNUNET_CONNECTION_Handle *sock) { if (sock->ai != NULL) return GNUNET_YES; /* still trying to connect */ @@ -667,7 +667,7 @@ static void destroy_continuation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - struct GNUNET_NETWORK_ConnectionHandle *sock = cls; + struct GNUNET_CONNECTION_Handle *sock = cls; GNUNET_NETWORK_TransmitReadyNotify notify; if (sock->write_task != GNUNET_SCHEDULER_NO_TASK) @@ -723,7 +723,7 @@ destroy_continuation (void *cls, * @param sock socket to destroy */ void -GNUNET_CONNECTION_destroy (struct GNUNET_NETWORK_ConnectionHandle *sock) +GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock) { if (sock->write_buffer_off == 0) sock->ai_pos = NULL; /* if we're still trying to connect and have @@ -740,7 +740,7 @@ GNUNET_CONNECTION_destroy (struct GNUNET_NETWORK_ConnectionHandle *sock) * Tell the receiver callback that a timeout was reached. */ static void -signal_timeout (struct GNUNET_NETWORK_ConnectionHandle *sh) +signal_timeout (struct GNUNET_CONNECTION_Handle *sh) { GNUNET_NETWORK_Receiver receiver; @@ -758,7 +758,7 @@ signal_timeout (struct GNUNET_NETWORK_ConnectionHandle *sh) * Tell the receiver callback that we had an IO error. */ static void -signal_error (struct GNUNET_NETWORK_ConnectionHandle *sh, int errcode) +signal_error (struct GNUNET_CONNECTION_Handle *sh, int errcode) { GNUNET_NETWORK_Receiver receiver; GNUNET_assert (NULL != (receiver = sh->receiver)); @@ -774,7 +774,7 @@ signal_error (struct GNUNET_NETWORK_ConnectionHandle *sh, int errcode) static void receive_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - struct GNUNET_NETWORK_ConnectionHandle *sh = cls; + struct GNUNET_CONNECTION_Handle *sh = cls; struct GNUNET_TIME_Absolute now; char buffer[sh->max]; ssize_t ret; @@ -847,7 +847,7 @@ RETRY: static void receive_again (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - struct GNUNET_NETWORK_ConnectionHandle *sh = cls; + struct GNUNET_CONNECTION_Handle *sh = cls; struct GNUNET_TIME_Absolute now; sh->read_task = GNUNET_SCHEDULER_NO_TASK; @@ -911,7 +911,7 @@ receive_again (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) * @return scheduler task ID used for receiving, GNUNET_SCHEDULER_NO_TASK on error */ GNUNET_SCHEDULER_TaskIdentifier -GNUNET_CONNECTION_receive (struct GNUNET_NETWORK_ConnectionHandle *sock, +GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *sock, size_t max, struct GNUNET_TIME_Relative timeout, GNUNET_NETWORK_Receiver receiver, void *receiver_cls) @@ -942,7 +942,7 @@ GNUNET_CONNECTION_receive (struct GNUNET_NETWORK_ConnectionHandle *sock, * @return closure of the original receiver callback */ void * -GNUNET_CONNECTION_receive_cancel (struct GNUNET_NETWORK_ConnectionHandle *sock, +GNUNET_CONNECTION_receive_cancel (struct GNUNET_CONNECTION_Handle *sock, GNUNET_SCHEDULER_TaskIdentifier task) { GNUNET_assert (sock->read_task == task); @@ -961,7 +961,7 @@ GNUNET_CONNECTION_receive_cancel (struct GNUNET_NETWORK_ConnectionHandle *sock, * @return GNUNET_YES if we were able to call notify */ static int -process_notify (struct GNUNET_NETWORK_ConnectionHandle *sock) +process_notify (struct GNUNET_CONNECTION_Handle *sock) { size_t used; size_t avail; @@ -1010,7 +1010,7 @@ process_notify (struct GNUNET_NETWORK_ConnectionHandle *sock) static void transmit_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - struct GNUNET_NETWORK_ConnectionHandle *sock = cls; + struct GNUNET_CONNECTION_Handle *sock = cls; GNUNET_NETWORK_TransmitReadyNotify notify; #if DEBUG_NETWORK @@ -1023,7 +1023,7 @@ transmit_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) static void -transmit_error (struct GNUNET_NETWORK_ConnectionHandle *sock) +transmit_error (struct GNUNET_CONNECTION_Handle *sock) { if (sock->nth.notify_ready == NULL) return; /* nobody to tell about it */ @@ -1044,7 +1044,7 @@ transmit_error (struct GNUNET_NETWORK_ConnectionHandle *sock) static void transmit_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - struct GNUNET_NETWORK_ConnectionHandle *sock = cls; + struct GNUNET_CONNECTION_Handle *sock = cls; ssize_t ret; size_t have; @@ -1164,7 +1164,7 @@ SCHEDULE_WRITE: * NULL if we are already going to notify someone else (busy) */ struct GNUNET_NETWORK_TransmitHandle * -GNUNET_CONNECTION_notify_transmit_ready (struct GNUNET_NETWORK_ConnectionHandle +GNUNET_CONNECTION_notify_transmit_ready (struct GNUNET_CONNECTION_Handle *sock, size_t size, struct GNUNET_TIME_Relative timeout, GNUNET_NETWORK_TransmitReadyNotify diff --git a/src/util/server.c b/src/util/server.c index e8683dce8..ab52b396f 100644 --- a/src/util/server.c +++ b/src/util/server.c @@ -312,7 +312,7 @@ process_listen_socket (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { struct GNUNET_SERVER_Handle *server = cls; - struct GNUNET_NETWORK_ConnectionHandle *sock; + struct GNUNET_CONNECTION_Handle *sock; struct GNUNET_SERVER_Client *client; struct GNUNET_NETWORK_FDSet *r; const struct GNUNET_DISK_FileHandle *shutpipe; @@ -877,7 +877,7 @@ sock_receive (void *cls, /** * Wrapper to cancel receiving from a socket. * - * @param cls handle to the GNUNET_NETWORK_ConnectionHandle to cancel + * @param cls handle to the GNUNET_CONNECTION_Handle to cancel * @param tc task ID that was returned by GNUNET_CONNECTION_receive */ static void @@ -953,7 +953,7 @@ struct GNUNET_SERVER_Client * GNUNET_SERVER_connect_socket (struct GNUNET_SERVER_Handle *server, - struct GNUNET_NETWORK_ConnectionHandle *connection) + struct GNUNET_CONNECTION_Handle *connection) { struct GNUNET_SERVER_Client *client; diff --git a/src/util/test_network.c b/src/util/test_network.c index b628a18db..712167b99 100644 --- a/src/util/test_network.c +++ b/src/util/test_network.c @@ -32,11 +32,11 @@ #define PORT 12435 -static struct GNUNET_NETWORK_ConnectionHandle *csock; +static struct GNUNET_CONNECTION_Handle *csock; -static struct GNUNET_NETWORK_ConnectionHandle *asock; +static struct GNUNET_CONNECTION_Handle *asock; -static struct GNUNET_NETWORK_ConnectionHandle *lsock; +static struct GNUNET_CONNECTION_Handle *lsock; static size_t sofar; diff --git a/src/util/test_network_addressing.c b/src/util/test_network_addressing.c index 177810eae..3b96dd06e 100644 --- a/src/util/test_network_addressing.c +++ b/src/util/test_network_addressing.c @@ -32,11 +32,11 @@ #define PORT 12435 -static struct GNUNET_NETWORK_ConnectionHandle *csock; +static struct GNUNET_CONNECTION_Handle *csock; -static struct GNUNET_NETWORK_ConnectionHandle *asock; +static struct GNUNET_CONNECTION_Handle *asock; -static struct GNUNET_NETWORK_ConnectionHandle *lsock; +static struct GNUNET_CONNECTION_Handle *lsock; static size_t sofar; diff --git a/src/util/test_network_receive_cancel.c b/src/util/test_network_receive_cancel.c index a9834c0e2..511bf9f22 100644 --- a/src/util/test_network_receive_cancel.c +++ b/src/util/test_network_receive_cancel.c @@ -32,11 +32,11 @@ #define PORT 12435 -static struct GNUNET_NETWORK_ConnectionHandle *csock; +static struct GNUNET_CONNECTION_Handle *csock; -static struct GNUNET_NETWORK_ConnectionHandle *asock; +static struct GNUNET_CONNECTION_Handle *asock; -static struct GNUNET_NETWORK_ConnectionHandle *lsock; +static struct GNUNET_CONNECTION_Handle *lsock; static struct GNUNET_NETWORK_Descriptor *ls; diff --git a/src/util/test_network_timeout.c b/src/util/test_network_timeout.c index ef39ac2a1..69aff307a 100644 --- a/src/util/test_network_timeout.c +++ b/src/util/test_network_timeout.c @@ -31,9 +31,9 @@ #define PORT 12435 -static struct GNUNET_NETWORK_ConnectionHandle *csock; +static struct GNUNET_CONNECTION_Handle *csock; -static struct GNUNET_NETWORK_ConnectionHandle *lsock; +static struct GNUNET_CONNECTION_Handle *lsock; static struct GNUNET_NETWORK_Descriptor *ls; diff --git a/src/util/test_network_timeout_no_connect.c b/src/util/test_network_timeout_no_connect.c index 823216104..c0e1b5e4d 100644 --- a/src/util/test_network_timeout_no_connect.c +++ b/src/util/test_network_timeout_no_connect.c @@ -31,7 +31,7 @@ #define PORT 13425 -static struct GNUNET_NETWORK_ConnectionHandle *csock; +static struct GNUNET_CONNECTION_Handle *csock; static size_t handle_timeout (void *cls, size_t size, void *buf) diff --git a/src/util/test_network_transmit_cancel.c b/src/util/test_network_transmit_cancel.c index edc45bb9f..351a7d444 100644 --- a/src/util/test_network_transmit_cancel.c +++ b/src/util/test_network_transmit_cancel.c @@ -46,7 +46,7 @@ task_transmit_cancel (void *cls, { int *ok = cls; struct GNUNET_NETWORK_TransmitHandle *th; - struct GNUNET_NETWORK_ConnectionHandle *csock; + struct GNUNET_CONNECTION_Handle *csock; csock = GNUNET_CONNECTION_create_from_connect (tc->sched, "localhost", PORT, 1024);