diff options
author | Nils Durner <durner@gnunet.org> | 2009-08-29 17:55:26 +0000 |
---|---|---|
committer | Nils Durner <durner@gnunet.org> | 2009-08-29 17:55:26 +0000 |
commit | b1a757d39ec31b6e745ee4f5974a81e2af7ea06b (patch) | |
tree | 755563a839003dfae8c222076e0f67a839b023c9 /src | |
parent | 77b14843ec9990facf63586919c865d59c3a5996 (diff) | |
download | gnunet-b1a757d39ec31b6e745ee4f5974a81e2af7ea06b.tar.gz gnunet-b1a757d39ec31b6e745ee4f5974a81e2af7ea06b.zip |
naming
Diffstat (limited to 'src')
-rw-r--r-- | src/core/core_api.c | 2 | ||||
-rw-r--r-- | src/core/gnunet-service-core.c | 2 | ||||
-rw-r--r-- | src/include/gnunet_client_lib.h | 2 | ||||
-rw-r--r-- | src/include/gnunet_connection_lib.h | 22 | ||||
-rw-r--r-- | src/include/gnunet_server_lib.h | 2 | ||||
-rw-r--r-- | src/transport/plugin_transport_tcp.c | 6 | ||||
-rw-r--r-- | src/transport/transport_api.c | 4 | ||||
-rw-r--r-- | src/util/client.c | 12 | ||||
-rw-r--r-- | src/util/network.c | 26 | ||||
-rw-r--r-- | src/util/server.c | 20 | ||||
-rw-r--r-- | src/util/test_network.c | 20 | ||||
-rw-r--r-- | src/util/test_network_addressing.c | 22 | ||||
-rw-r--r-- | src/util/test_network_receive_cancel.c | 18 | ||||
-rw-r--r-- | src/util/test_network_timeout.c | 12 | ||||
-rw-r--r-- | src/util/test_network_timeout_no_connect.c | 4 | ||||
-rw-r--r-- | src/util/test_network_transmit_cancel.c | 8 |
16 files changed, 91 insertions, 91 deletions
diff --git a/src/core/core_api.c b/src/core/core_api.c index 6a1b88147..619a0420f 100644 --- a/src/core/core_api.c +++ b/src/core/core_api.c | |||
@@ -836,7 +836,7 @@ void | |||
836 | GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle) | 836 | GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle) |
837 | { | 837 | { |
838 | if (handle->th != NULL) | 838 | if (handle->th != NULL) |
839 | GNUNET_NETWORK_connection_notify_transmit_ready_cancel (handle->th); | 839 | GNUNET_CONNECTION_notify_transmit_ready_cancel (handle->th); |
840 | if (handle->reconnect_task != GNUNET_SCHEDULER_NO_TASK) | 840 | if (handle->reconnect_task != GNUNET_SCHEDULER_NO_TASK) |
841 | GNUNET_SCHEDULER_cancel (handle->sched, handle->reconnect_task); | 841 | GNUNET_SCHEDULER_cancel (handle->sched, handle->reconnect_task); |
842 | GNUNET_CLIENT_disconnect (handle->client); | 842 | GNUNET_CLIENT_disconnect (handle->client); |
diff --git a/src/core/gnunet-service-core.c b/src/core/gnunet-service-core.c index 8a750fd69..eab031f1c 100644 --- a/src/core/gnunet-service-core.c +++ b/src/core/gnunet-service-core.c | |||
@@ -1021,7 +1021,7 @@ handle_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client) | |||
1021 | else | 1021 | else |
1022 | prev->next = pos->next; | 1022 | prev->next = pos->next; |
1023 | if (pos->th != NULL) | 1023 | if (pos->th != NULL) |
1024 | GNUNET_NETWORK_connection_notify_transmit_ready_cancel (pos->th); | 1024 | GNUNET_CONNECTION_notify_transmit_ready_cancel (pos->th); |
1025 | while (NULL != (e = pos->event_head)) | 1025 | while (NULL != (e = pos->event_head)) |
1026 | { | 1026 | { |
1027 | pos->event_head = e->next; | 1027 | pos->event_head = e->next; |
diff --git a/src/include/gnunet_client_lib.h b/src/include/gnunet_client_lib.h index eb75e8d1e..4ac993dea 100644 --- a/src/include/gnunet_client_lib.h +++ b/src/include/gnunet_client_lib.h | |||
@@ -109,7 +109,7 @@ void GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *sock, | |||
109 | * @param notify_cls closure for notify | 109 | * @param notify_cls closure for notify |
110 | * @return NULL if someone else is already waiting to be notified | 110 | * @return NULL if someone else is already waiting to be notified |
111 | * non-NULL if the notify callback was queued (can be used to cancel | 111 | * non-NULL if the notify callback was queued (can be used to cancel |
112 | * using GNUNET_NETWORK_connection_notify_transmit_ready_cancel) | 112 | * using GNUNET_CONNECTION_notify_transmit_ready_cancel) |
113 | */ | 113 | */ |
114 | struct GNUNET_NETWORK_TransmitHandle | 114 | struct GNUNET_NETWORK_TransmitHandle |
115 | *GNUNET_CLIENT_notify_transmit_ready (struct GNUNET_CLIENT_Connection *sock, | 115 | *GNUNET_CLIENT_notify_transmit_ready (struct GNUNET_CLIENT_Connection *sock, |
diff --git a/src/include/gnunet_connection_lib.h b/src/include/gnunet_connection_lib.h index 69bd7d4a6..34f6bd8a2 100644 --- a/src/include/gnunet_connection_lib.h +++ b/src/include/gnunet_connection_lib.h | |||
@@ -95,7 +95,7 @@ typedef void (*GNUNET_NETWORK_Receiver) (void *cls, | |||
95 | * @return the boxed socket handle | 95 | * @return the boxed socket handle |
96 | */ | 96 | */ |
97 | struct GNUNET_NETWORK_ConnectionHandle | 97 | struct GNUNET_NETWORK_ConnectionHandle |
98 | *GNUNET_NETWORK_connection_create_from_existing (struct | 98 | *GNUNET_CONNECTION_create_from_existing (struct |
99 | GNUNET_SCHEDULER_Handle | 99 | GNUNET_SCHEDULER_Handle |
100 | *sched, | 100 | *sched, |
101 | struct | 101 | struct |
@@ -116,7 +116,7 @@ struct GNUNET_NETWORK_ConnectionHandle | |||
116 | * @return the socket handle, NULL on error (for example, access refused) | 116 | * @return the socket handle, NULL on error (for example, access refused) |
117 | */ | 117 | */ |
118 | struct GNUNET_NETWORK_ConnectionHandle | 118 | struct GNUNET_NETWORK_ConnectionHandle |
119 | *GNUNET_NETWORK_connection_create_from_accept (struct | 119 | *GNUNET_CONNECTION_create_from_accept (struct |
120 | GNUNET_SCHEDULER_Handle | 120 | GNUNET_SCHEDULER_Handle |
121 | *sched, | 121 | *sched, |
122 | GNUNET_NETWORK_AccessCheck | 122 | GNUNET_NETWORK_AccessCheck |
@@ -139,7 +139,7 @@ struct GNUNET_NETWORK_ConnectionHandle | |||
139 | * @return the socket handle | 139 | * @return the socket handle |
140 | */ | 140 | */ |
141 | struct GNUNET_NETWORK_ConnectionHandle | 141 | struct GNUNET_NETWORK_ConnectionHandle |
142 | *GNUNET_NETWORK_connection_create_from_connect (struct | 142 | *GNUNET_CONNECTION_create_from_connect (struct |
143 | GNUNET_SCHEDULER_Handle | 143 | GNUNET_SCHEDULER_Handle |
144 | *sched, | 144 | *sched, |
145 | const char *hostname, | 145 | const char *hostname, |
@@ -162,7 +162,7 @@ struct GNUNET_NETWORK_ConnectionHandle | |||
162 | * @return the socket handle | 162 | * @return the socket handle |
163 | */ | 163 | */ |
164 | struct GNUNET_NETWORK_ConnectionHandle | 164 | struct GNUNET_NETWORK_ConnectionHandle |
165 | *GNUNET_NETWORK_connection_create_from_sockaddr (struct | 165 | *GNUNET_CONNECTION_create_from_sockaddr (struct |
166 | GNUNET_SCHEDULER_Handle | 166 | GNUNET_SCHEDULER_Handle |
167 | *sched, int af_family, | 167 | *sched, int af_family, |
168 | const struct sockaddr | 168 | const struct sockaddr |
@@ -178,7 +178,7 @@ struct GNUNET_NETWORK_ConnectionHandle | |||
178 | * @param sock socket to check | 178 | * @param sock socket to check |
179 | * @return GNUNET_YES if valid, GNUNET_NO otherwise | 179 | * @return GNUNET_YES if valid, GNUNET_NO otherwise |
180 | */ | 180 | */ |
181 | int GNUNET_NETWORK_connection_check (struct GNUNET_NETWORK_ConnectionHandle | 181 | int GNUNET_CONNECTION_check (struct GNUNET_NETWORK_ConnectionHandle |
182 | *sock); | 182 | *sock); |
183 | 183 | ||
184 | 184 | ||
@@ -190,7 +190,7 @@ int GNUNET_NETWORK_connection_check (struct GNUNET_NETWORK_ConnectionHandle | |||
190 | * @param addrlen where to store the length of the address | 190 | * @param addrlen where to store the length of the address |
191 | * @return GNUNET_OK on success | 191 | * @return GNUNET_OK on success |
192 | */ | 192 | */ |
193 | int GNUNET_NETWORK_connection_get_address (struct | 193 | int GNUNET_CONNECTION_get_address (struct |
194 | GNUNET_NETWORK_ConnectionHandle | 194 | GNUNET_NETWORK_ConnectionHandle |
195 | *sock, void **addr, | 195 | *sock, void **addr, |
196 | size_t * addrlen); | 196 | size_t * addrlen); |
@@ -202,7 +202,7 @@ int GNUNET_NETWORK_connection_get_address (struct | |||
202 | * | 202 | * |
203 | * @param sock socket to destroy | 203 | * @param sock socket to destroy |
204 | */ | 204 | */ |
205 | void GNUNET_NETWORK_connection_destroy (struct GNUNET_NETWORK_ConnectionHandle | 205 | void GNUNET_CONNECTION_destroy (struct GNUNET_NETWORK_ConnectionHandle |
206 | *sock); | 206 | *sock); |
207 | 207 | ||
208 | 208 | ||
@@ -221,7 +221,7 @@ void GNUNET_NETWORK_connection_destroy (struct GNUNET_NETWORK_ConnectionHandle | |||
221 | * @return scheduler task ID used for receiving, GNUNET_SCHEDULER_NO_TASK on error | 221 | * @return scheduler task ID used for receiving, GNUNET_SCHEDULER_NO_TASK on error |
222 | */ | 222 | */ |
223 | GNUNET_SCHEDULER_TaskIdentifier | 223 | GNUNET_SCHEDULER_TaskIdentifier |
224 | GNUNET_NETWORK_connection_receive (struct GNUNET_NETWORK_ConnectionHandle | 224 | GNUNET_CONNECTION_receive (struct GNUNET_NETWORK_ConnectionHandle |
225 | *sock, size_t max, | 225 | *sock, size_t max, |
226 | struct GNUNET_TIME_Relative timeout, | 226 | struct GNUNET_TIME_Relative timeout, |
227 | GNUNET_NETWORK_Receiver receiver, | 227 | GNUNET_NETWORK_Receiver receiver, |
@@ -237,7 +237,7 @@ GNUNET_NETWORK_connection_receive (struct GNUNET_NETWORK_ConnectionHandle | |||
237 | * @param task task identifier returned from the receive call | 237 | * @param task task identifier returned from the receive call |
238 | * @return closure of the original receiver callback | 238 | * @return closure of the original receiver callback |
239 | */ | 239 | */ |
240 | void *GNUNET_NETWORK_connection_receive_cancel (struct | 240 | void *GNUNET_CONNECTION_receive_cancel (struct |
241 | GNUNET_NETWORK_ConnectionHandle | 241 | GNUNET_NETWORK_ConnectionHandle |
242 | *sock, | 242 | *sock, |
243 | GNUNET_SCHEDULER_TaskIdentifier | 243 | GNUNET_SCHEDULER_TaskIdentifier |
@@ -295,7 +295,7 @@ struct GNUNET_NETWORK_TransmitHandle; | |||
295 | * NULL if we are already going to notify someone else (busy) | 295 | * NULL if we are already going to notify someone else (busy) |
296 | */ | 296 | */ |
297 | struct GNUNET_NETWORK_TransmitHandle | 297 | struct GNUNET_NETWORK_TransmitHandle |
298 | *GNUNET_NETWORK_connection_notify_transmit_ready (struct | 298 | *GNUNET_CONNECTION_notify_transmit_ready (struct |
299 | GNUNET_NETWORK_ConnectionHandle | 299 | GNUNET_NETWORK_ConnectionHandle |
300 | *sock, size_t size, | 300 | *sock, size_t size, |
301 | struct | 301 | struct |
@@ -312,7 +312,7 @@ struct GNUNET_NETWORK_TransmitHandle | |||
312 | * @param h handle for notification to cancel | 312 | * @param h handle for notification to cancel |
313 | */ | 313 | */ |
314 | void | 314 | void |
315 | GNUNET_NETWORK_connection_notify_transmit_ready_cancel (struct | 315 | GNUNET_CONNECTION_notify_transmit_ready_cancel (struct |
316 | GNUNET_NETWORK_TransmitHandle | 316 | GNUNET_NETWORK_TransmitHandle |
317 | *h); | 317 | *h); |
318 | 318 | ||
diff --git a/src/include/gnunet_server_lib.h b/src/include/gnunet_server_lib.h index 092bab40b..f62a409ce 100644 --- a/src/include/gnunet_server_lib.h +++ b/src/include/gnunet_server_lib.h | |||
@@ -175,7 +175,7 @@ GNUNET_SERVER_add_handlers (struct GNUNET_SERVER_Handle *server, | |||
175 | * @param callback_cls closure for callback | 175 | * @param callback_cls closure for callback |
176 | * @return non-NULL if the notify callback was queued; can be used | 176 | * @return non-NULL if the notify callback was queued; can be used |
177 | * to cancel the request using | 177 | * to cancel the request using |
178 | * GNUNET_NETWORK_connection_notify_transmit_ready_cancel. | 178 | * GNUNET_CONNECTION_notify_transmit_ready_cancel. |
179 | * NULL if we are already going to notify someone else (busy) | 179 | * NULL if we are already going to notify someone else (busy) |
180 | */ | 180 | */ |
181 | struct GNUNET_NETWORK_TransmitHandle | 181 | struct GNUNET_NETWORK_TransmitHandle |
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index 2e174f80a..feab67195 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c | |||
@@ -665,7 +665,7 @@ connect_and_create_validation_session (struct Plugin *plugin, | |||
665 | GNUNET_break_op (0); | 665 | GNUNET_break_op (0); |
666 | return NULL; /* invalid address */ | 666 | return NULL; /* invalid address */ |
667 | } | 667 | } |
668 | conn = GNUNET_NETWORK_connection_create_from_sockaddr (plugin->env->sched, | 668 | conn = GNUNET_CONNECTION_create_from_sockaddr (plugin->env->sched, |
669 | af, | 669 | af, |
670 | addr, | 670 | addr, |
671 | addrlen, | 671 | addrlen, |
@@ -796,7 +796,7 @@ disconnect_session (struct Session *session) | |||
796 | /* clean up state */ | 796 | /* clean up state */ |
797 | if (session->transmit_handle != NULL) | 797 | if (session->transmit_handle != NULL) |
798 | { | 798 | { |
799 | GNUNET_NETWORK_connection_notify_transmit_ready_cancel (session->transmit_handle); | 799 | GNUNET_CONNECTION_notify_transmit_ready_cancel (session->transmit_handle); |
800 | session->transmit_handle = NULL; | 800 | session->transmit_handle = NULL; |
801 | } | 801 | } |
802 | while (NULL != (pm = session->pending_messages)) | 802 | while (NULL != (pm = session->pending_messages)) |
@@ -923,7 +923,7 @@ try_connect_to_address (void *cls, | |||
923 | { | 923 | { |
924 | cc->welcome = create_welcome (addrlen, addr, cc->plugin); | 924 | cc->welcome = create_welcome (addrlen, addr, cc->plugin); |
925 | cc->sa = | 925 | cc->sa = |
926 | GNUNET_NETWORK_connection_create_from_sockaddr (cc->plugin->env->sched, | 926 | GNUNET_CONNECTION_create_from_sockaddr (cc->plugin->env->sched, |
927 | af, addr, addrlen, | 927 | af, addr, addrlen, |
928 | GNUNET_SERVER_MAX_MESSAGE_SIZE); | 928 | GNUNET_SERVER_MAX_MESSAGE_SIZE); |
929 | #if DEBUG_TCP | 929 | #if DEBUG_TCP |
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c index 93efcb4ba..451b66c12 100644 --- a/src/transport/transport_api.c +++ b/src/transport/transport_api.c | |||
@@ -1573,7 +1573,7 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
1573 | #endif | 1573 | #endif |
1574 | if (h->network_handle != NULL) | 1574 | if (h->network_handle != NULL) |
1575 | { | 1575 | { |
1576 | GNUNET_NETWORK_connection_notify_transmit_ready_cancel (h->network_handle); | 1576 | GNUNET_CONNECTION_notify_transmit_ready_cancel (h->network_handle); |
1577 | h->network_handle = NULL; | 1577 | h->network_handle = NULL; |
1578 | h->transmission_scheduled = GNUNET_NO; | 1578 | h->transmission_scheduled = GNUNET_NO; |
1579 | th = h->connect_ready_head; | 1579 | th = h->connect_ready_head; |
@@ -1964,7 +1964,7 @@ GNUNET_TRANSPORT_notify_transmit_ready_cancel (struct | |||
1964 | h = th->handle; | 1964 | h = th->handle; |
1965 | if ((h->connect_ready_head == NULL) && (h->network_handle != NULL)) | 1965 | if ((h->connect_ready_head == NULL) && (h->network_handle != NULL)) |
1966 | { | 1966 | { |
1967 | GNUNET_NETWORK_connection_notify_transmit_ready_cancel (h->network_handle); | 1967 | GNUNET_CONNECTION_notify_transmit_ready_cancel (h->network_handle); |
1968 | h->network_handle = NULL; | 1968 | h->network_handle = NULL; |
1969 | h->transmission_scheduled = GNUNET_NO; | 1969 | h->transmission_scheduled = GNUNET_NO; |
1970 | } | 1970 | } |
diff --git a/src/util/client.c b/src/util/client.c index 4e6e09066..9836b3e79 100644 --- a/src/util/client.c +++ b/src/util/client.c | |||
@@ -147,7 +147,7 @@ GNUNET_CLIENT_connect (struct GNUNET_SCHEDULER_Handle *sched, | |||
147 | service_name); | 147 | service_name); |
148 | return NULL; | 148 | return NULL; |
149 | } | 149 | } |
150 | sock = GNUNET_NETWORK_connection_create_from_connect (sched, | 150 | sock = GNUNET_CONNECTION_create_from_connect (sched, |
151 | hostname, | 151 | hostname, |
152 | port, | 152 | port, |
153 | GNUNET_SERVER_MAX_MESSAGE_SIZE); | 153 | GNUNET_SERVER_MAX_MESSAGE_SIZE); |
@@ -184,7 +184,7 @@ void | |||
184 | GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *sock) | 184 | GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *sock) |
185 | { | 185 | { |
186 | GNUNET_assert (sock->sock != NULL); | 186 | GNUNET_assert (sock->sock != NULL); |
187 | GNUNET_NETWORK_connection_destroy (sock->sock); | 187 | GNUNET_CONNECTION_destroy (sock->sock); |
188 | sock->sock = NULL; | 188 | sock->sock = NULL; |
189 | sock->receiver_handler = NULL; | 189 | sock->receiver_handler = NULL; |
190 | GNUNET_SCHEDULER_add_after (sock->sched, | 190 | GNUNET_SCHEDULER_add_after (sock->sched, |
@@ -331,7 +331,7 @@ GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *sock, | |||
331 | GNUNET_SCHEDULER_NO_TASK, | 331 | GNUNET_SCHEDULER_NO_TASK, |
332 | &receive_task, sock); | 332 | &receive_task, sock); |
333 | else | 333 | else |
334 | sock->receiver_task = GNUNET_NETWORK_connection_receive (sock->sock, | 334 | sock->receiver_task = GNUNET_CONNECTION_receive (sock->sock, |
335 | GNUNET_SERVER_MAX_MESSAGE_SIZE, | 335 | GNUNET_SERVER_MAX_MESSAGE_SIZE, |
336 | timeout, | 336 | timeout, |
337 | &receive_helper, sock); | 337 | &receive_helper, sock); |
@@ -362,7 +362,7 @@ write_shutdown (void *cls, size_t size, void *buf) | |||
362 | void | 362 | void |
363 | GNUNET_CLIENT_service_shutdown (struct GNUNET_CLIENT_Connection *sock) | 363 | GNUNET_CLIENT_service_shutdown (struct GNUNET_CLIENT_Connection *sock) |
364 | { | 364 | { |
365 | GNUNET_NETWORK_connection_notify_transmit_ready (sock->sock, | 365 | GNUNET_CONNECTION_notify_transmit_ready (sock->sock, |
366 | sizeof (struct GNUNET_MessageHeader), | 366 | sizeof (struct GNUNET_MessageHeader), |
367 | GNUNET_TIME_UNIT_FOREVER_REL, | 367 | GNUNET_TIME_UNIT_FOREVER_REL, |
368 | &write_shutdown, NULL); | 368 | &write_shutdown, NULL); |
@@ -478,7 +478,7 @@ GNUNET_CLIENT_service_test (struct GNUNET_SCHEDULER_Handle *sched, | |||
478 | conn->test_cb = task; | 478 | conn->test_cb = task; |
479 | conn->test_cb_cls = task_cls; | 479 | conn->test_cb_cls = task_cls; |
480 | if (NULL == | 480 | if (NULL == |
481 | GNUNET_NETWORK_connection_notify_transmit_ready (conn->sock, | 481 | GNUNET_CONNECTION_notify_transmit_ready (conn->sock, |
482 | sizeof (struct | 482 | sizeof (struct |
483 | GNUNET_MessageHeader), | 483 | GNUNET_MessageHeader), |
484 | timeout, &write_test, NULL)) | 484 | timeout, &write_test, NULL)) |
@@ -515,7 +515,7 @@ GNUNET_CLIENT_notify_transmit_ready (struct GNUNET_CLIENT_Connection *sock, | |||
515 | GNUNET_NETWORK_TransmitReadyNotify | 515 | GNUNET_NETWORK_TransmitReadyNotify |
516 | notify, void *notify_cls) | 516 | notify, void *notify_cls) |
517 | { | 517 | { |
518 | return GNUNET_NETWORK_connection_notify_transmit_ready (sock->sock, | 518 | return GNUNET_CONNECTION_notify_transmit_ready (sock->sock, |
519 | size, | 519 | size, |
520 | timeout, notify, notify_cls); | 520 | timeout, notify, notify_cls); |
521 | } | 521 | } |
diff --git a/src/util/network.c b/src/util/network.c index 6d8b9f938..02d9e5dfd 100644 --- a/src/util/network.c +++ b/src/util/network.c | |||
@@ -167,7 +167,7 @@ struct GNUNET_NETWORK_ConnectionHandle | |||
167 | GNUNET_SCHEDULER_TaskIdentifier write_task; | 167 | GNUNET_SCHEDULER_TaskIdentifier write_task; |
168 | 168 | ||
169 | /** | 169 | /** |
170 | * The handle we return for GNUNET_NETWORK_connection_notify_transmit_ready. | 170 | * The handle we return for GNUNET_CONNECTION_notify_transmit_ready. |
171 | */ | 171 | */ |
172 | struct GNUNET_NETWORK_TransmitHandle nth; | 172 | struct GNUNET_NETWORK_TransmitHandle nth; |
173 | 173 | ||
@@ -218,7 +218,7 @@ struct GNUNET_NETWORK_ConnectionHandle | |||
218 | * @return the boxed socket handle | 218 | * @return the boxed socket handle |
219 | */ | 219 | */ |
220 | struct GNUNET_NETWORK_ConnectionHandle * | 220 | struct GNUNET_NETWORK_ConnectionHandle * |
221 | GNUNET_NETWORK_connection_create_from_existing (struct GNUNET_SCHEDULER_Handle | 221 | GNUNET_CONNECTION_create_from_existing (struct GNUNET_SCHEDULER_Handle |
222 | *sched, struct GNUNET_NETWORK_Descriptor *osSocket, | 222 | *sched, struct GNUNET_NETWORK_Descriptor *osSocket, |
223 | size_t maxbuf) | 223 | size_t maxbuf) |
224 | { | 224 | { |
@@ -245,7 +245,7 @@ GNUNET_NETWORK_connection_create_from_existing (struct GNUNET_SCHEDULER_Handle | |||
245 | * @return the socket handle, NULL on error | 245 | * @return the socket handle, NULL on error |
246 | */ | 246 | */ |
247 | struct GNUNET_NETWORK_ConnectionHandle * | 247 | struct GNUNET_NETWORK_ConnectionHandle * |
248 | GNUNET_NETWORK_connection_create_from_accept (struct GNUNET_SCHEDULER_Handle | 248 | GNUNET_CONNECTION_create_from_accept (struct GNUNET_SCHEDULER_Handle |
249 | *sched, | 249 | *sched, |
250 | GNUNET_NETWORK_AccessCheck access, | 250 | GNUNET_NETWORK_AccessCheck access, |
251 | void *access_cls, struct GNUNET_NETWORK_Descriptor *lsock, | 251 | void *access_cls, struct GNUNET_NETWORK_Descriptor *lsock, |
@@ -338,7 +338,7 @@ GNUNET_NETWORK_connection_create_from_accept (struct GNUNET_SCHEDULER_Handle | |||
338 | * @return GNUNET_OK on success | 338 | * @return GNUNET_OK on success |
339 | */ | 339 | */ |
340 | int | 340 | int |
341 | GNUNET_NETWORK_connection_get_address (struct GNUNET_NETWORK_ConnectionHandle *sock, | 341 | GNUNET_CONNECTION_get_address (struct GNUNET_NETWORK_ConnectionHandle *sock, |
342 | void **addr, size_t * addrlen) | 342 | void **addr, size_t * addrlen) |
343 | { | 343 | { |
344 | if ((sock->addr == NULL) || (sock->addrlen == 0)) | 344 | if ((sock->addr == NULL) || (sock->addrlen == 0)) |
@@ -546,7 +546,7 @@ connect_continuation (void *cls, | |||
546 | * @return the socket handle | 546 | * @return the socket handle |
547 | */ | 547 | */ |
548 | struct GNUNET_NETWORK_ConnectionHandle * | 548 | struct GNUNET_NETWORK_ConnectionHandle * |
549 | GNUNET_NETWORK_connection_create_from_connect (struct GNUNET_SCHEDULER_Handle | 549 | GNUNET_CONNECTION_create_from_connect (struct GNUNET_SCHEDULER_Handle |
550 | *sched, const char *hostname, | 550 | *sched, const char *hostname, |
551 | uint16_t port, size_t maxbuf) | 551 | uint16_t port, size_t maxbuf) |
552 | { | 552 | { |
@@ -593,7 +593,7 @@ GNUNET_NETWORK_connection_create_from_connect (struct GNUNET_SCHEDULER_Handle | |||
593 | * @return the socket handle | 593 | * @return the socket handle |
594 | */ | 594 | */ |
595 | struct GNUNET_NETWORK_ConnectionHandle * | 595 | struct GNUNET_NETWORK_ConnectionHandle * |
596 | GNUNET_NETWORK_connection_create_from_sockaddr (struct GNUNET_SCHEDULER_Handle | 596 | GNUNET_CONNECTION_create_from_sockaddr (struct GNUNET_SCHEDULER_Handle |
597 | *sched, int af_family, | 597 | *sched, int af_family, |
598 | const struct sockaddr *serv_addr, | 598 | const struct sockaddr *serv_addr, |
599 | socklen_t addrlen, size_t maxbuf) | 599 | socklen_t addrlen, size_t maxbuf) |
@@ -634,7 +634,7 @@ GNUNET_NETWORK_connection_create_from_sockaddr (struct GNUNET_SCHEDULER_Handle | |||
634 | GNUNET_break (0 == GNUNET_NETWORK_socket_close (s)); | 634 | GNUNET_break (0 == GNUNET_NETWORK_socket_close (s)); |
635 | return NULL; | 635 | return NULL; |
636 | } | 636 | } |
637 | ret = GNUNET_NETWORK_connection_create_from_existing (sched, s, maxbuf); | 637 | ret = GNUNET_CONNECTION_create_from_existing (sched, s, maxbuf); |
638 | ret->addr = GNUNET_malloc (addrlen); | 638 | ret->addr = GNUNET_malloc (addrlen); |
639 | memcpy (ret->addr, serv_addr, addrlen); | 639 | memcpy (ret->addr, serv_addr, addrlen); |
640 | ret->addrlen = addrlen; | 640 | ret->addrlen = addrlen; |
@@ -651,7 +651,7 @@ GNUNET_NETWORK_connection_create_from_sockaddr (struct GNUNET_SCHEDULER_Handle | |||
651 | * @return GNUNET_YES if valid, GNUNET_NO otherwise | 651 | * @return GNUNET_YES if valid, GNUNET_NO otherwise |
652 | */ | 652 | */ |
653 | int | 653 | int |
654 | GNUNET_NETWORK_connection_check (struct GNUNET_NETWORK_ConnectionHandle *sock) | 654 | GNUNET_CONNECTION_check (struct GNUNET_NETWORK_ConnectionHandle *sock) |
655 | { | 655 | { |
656 | if (sock->ai != NULL) | 656 | if (sock->ai != NULL) |
657 | return GNUNET_YES; /* still trying to connect */ | 657 | return GNUNET_YES; /* still trying to connect */ |
@@ -723,7 +723,7 @@ destroy_continuation (void *cls, | |||
723 | * @param sock socket to destroy | 723 | * @param sock socket to destroy |
724 | */ | 724 | */ |
725 | void | 725 | void |
726 | GNUNET_NETWORK_connection_destroy (struct GNUNET_NETWORK_ConnectionHandle *sock) | 726 | GNUNET_CONNECTION_destroy (struct GNUNET_NETWORK_ConnectionHandle *sock) |
727 | { | 727 | { |
728 | if (sock->write_buffer_off == 0) | 728 | if (sock->write_buffer_off == 0) |
729 | sock->ai_pos = NULL; /* if we're still trying to connect and have | 729 | sock->ai_pos = NULL; /* if we're still trying to connect and have |
@@ -911,7 +911,7 @@ receive_again (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
911 | * @return scheduler task ID used for receiving, GNUNET_SCHEDULER_NO_TASK on error | 911 | * @return scheduler task ID used for receiving, GNUNET_SCHEDULER_NO_TASK on error |
912 | */ | 912 | */ |
913 | GNUNET_SCHEDULER_TaskIdentifier | 913 | GNUNET_SCHEDULER_TaskIdentifier |
914 | GNUNET_NETWORK_connection_receive (struct GNUNET_NETWORK_ConnectionHandle *sock, | 914 | GNUNET_CONNECTION_receive (struct GNUNET_NETWORK_ConnectionHandle *sock, |
915 | size_t max, | 915 | size_t max, |
916 | struct GNUNET_TIME_Relative timeout, | 916 | struct GNUNET_TIME_Relative timeout, |
917 | GNUNET_NETWORK_Receiver receiver, void *receiver_cls) | 917 | GNUNET_NETWORK_Receiver receiver, void *receiver_cls) |
@@ -942,7 +942,7 @@ GNUNET_NETWORK_connection_receive (struct GNUNET_NETWORK_ConnectionHandle *sock, | |||
942 | * @return closure of the original receiver callback | 942 | * @return closure of the original receiver callback |
943 | */ | 943 | */ |
944 | void * | 944 | void * |
945 | GNUNET_NETWORK_connection_receive_cancel (struct GNUNET_NETWORK_ConnectionHandle *sock, | 945 | GNUNET_CONNECTION_receive_cancel (struct GNUNET_NETWORK_ConnectionHandle *sock, |
946 | GNUNET_SCHEDULER_TaskIdentifier task) | 946 | GNUNET_SCHEDULER_TaskIdentifier task) |
947 | { | 947 | { |
948 | GNUNET_assert (sock->read_task == task); | 948 | GNUNET_assert (sock->read_task == task); |
@@ -1164,7 +1164,7 @@ SCHEDULE_WRITE: | |||
1164 | * NULL if we are already going to notify someone else (busy) | 1164 | * NULL if we are already going to notify someone else (busy) |
1165 | */ | 1165 | */ |
1166 | struct GNUNET_NETWORK_TransmitHandle * | 1166 | struct GNUNET_NETWORK_TransmitHandle * |
1167 | GNUNET_NETWORK_connection_notify_transmit_ready (struct GNUNET_NETWORK_ConnectionHandle | 1167 | GNUNET_CONNECTION_notify_transmit_ready (struct GNUNET_NETWORK_ConnectionHandle |
1168 | *sock, size_t size, | 1168 | *sock, size_t size, |
1169 | struct GNUNET_TIME_Relative timeout, | 1169 | struct GNUNET_TIME_Relative timeout, |
1170 | GNUNET_NETWORK_TransmitReadyNotify | 1170 | GNUNET_NETWORK_TransmitReadyNotify |
@@ -1228,7 +1228,7 @@ GNUNET_NETWORK_connection_notify_transmit_ready (struct GNUNET_NETWORK_Connectio | |||
1228 | * notification. | 1228 | * notification. |
1229 | */ | 1229 | */ |
1230 | void | 1230 | void |
1231 | GNUNET_NETWORK_connection_notify_transmit_ready_cancel (struct | 1231 | GNUNET_CONNECTION_notify_transmit_ready_cancel (struct |
1232 | GNUNET_NETWORK_TransmitHandle *h) | 1232 | GNUNET_NETWORK_TransmitHandle *h) |
1233 | { | 1233 | { |
1234 | GNUNET_assert (h->notify_ready != NULL); | 1234 | GNUNET_assert (h->notify_ready != NULL); |
diff --git a/src/util/server.c b/src/util/server.c index ff9ea993d..e8683dce8 100644 --- a/src/util/server.c +++ b/src/util/server.c | |||
@@ -331,7 +331,7 @@ process_listen_socket (void *cls, | |||
331 | shutpipe = GNUNET_DISK_pipe_handle (server->shutpipe, 0); | 331 | shutpipe = GNUNET_DISK_pipe_handle (server->shutpipe, 0); |
332 | GNUNET_assert (GNUNET_NETWORK_fdset_isset (tc->read_ready, server->listen_socket)); | 332 | GNUNET_assert (GNUNET_NETWORK_fdset_isset (tc->read_ready, server->listen_socket)); |
333 | GNUNET_assert (!GNUNET_NETWORK_fdset_handle_isset (tc->read_ready, shutpipe)); | 333 | GNUNET_assert (!GNUNET_NETWORK_fdset_handle_isset (tc->read_ready, shutpipe)); |
334 | sock = GNUNET_NETWORK_connection_create_from_accept (tc->sched, | 334 | sock = GNUNET_CONNECTION_create_from_accept (tc->sched, |
335 | server->access, | 335 | server->access, |
336 | server->access_cls, | 336 | server->access_cls, |
337 | server->listen_socket, | 337 | server->listen_socket, |
@@ -870,7 +870,7 @@ sock_receive (void *cls, | |||
870 | struct GNUNET_TIME_Relative timeout, | 870 | struct GNUNET_TIME_Relative timeout, |
871 | GNUNET_NETWORK_Receiver receiver, void *receiver_cls) | 871 | GNUNET_NETWORK_Receiver receiver, void *receiver_cls) |
872 | { | 872 | { |
873 | return GNUNET_NETWORK_connection_receive (cls, max, timeout, receiver, receiver_cls); | 873 | return GNUNET_CONNECTION_receive (cls, max, timeout, receiver, receiver_cls); |
874 | } | 874 | } |
875 | 875 | ||
876 | 876 | ||
@@ -878,12 +878,12 @@ sock_receive (void *cls, | |||
878 | * Wrapper to cancel receiving from a socket. | 878 | * Wrapper to cancel receiving from a socket. |
879 | * | 879 | * |
880 | * @param cls handle to the GNUNET_NETWORK_ConnectionHandle to cancel | 880 | * @param cls handle to the GNUNET_NETWORK_ConnectionHandle to cancel |
881 | * @param tc task ID that was returned by GNUNET_NETWORK_connection_receive | 881 | * @param tc task ID that was returned by GNUNET_CONNECTION_receive |
882 | */ | 882 | */ |
883 | static void | 883 | static void |
884 | sock_receive_cancel (void *cls, GNUNET_SCHEDULER_TaskIdentifier ti) | 884 | sock_receive_cancel (void *cls, GNUNET_SCHEDULER_TaskIdentifier ti) |
885 | { | 885 | { |
886 | GNUNET_NETWORK_connection_receive_cancel (cls, ti); | 886 | GNUNET_CONNECTION_receive_cancel (cls, ti); |
887 | } | 887 | } |
888 | 888 | ||
889 | 889 | ||
@@ -897,7 +897,7 @@ sock_notify_transmit_ready (void *cls, | |||
897 | GNUNET_NETWORK_TransmitReadyNotify notify, | 897 | GNUNET_NETWORK_TransmitReadyNotify notify, |
898 | void *notify_cls) | 898 | void *notify_cls) |
899 | { | 899 | { |
900 | return GNUNET_NETWORK_connection_notify_transmit_ready (cls, size, timeout, notify, | 900 | return GNUNET_CONNECTION_notify_transmit_ready (cls, size, timeout, notify, |
901 | notify_cls); | 901 | notify_cls); |
902 | } | 902 | } |
903 | 903 | ||
@@ -908,7 +908,7 @@ sock_notify_transmit_ready (void *cls, | |||
908 | static void | 908 | static void |
909 | sock_notify_transmit_ready_cancel (void *cls, void *h) | 909 | sock_notify_transmit_ready_cancel (void *cls, void *h) |
910 | { | 910 | { |
911 | GNUNET_NETWORK_connection_notify_transmit_ready_cancel (h); | 911 | GNUNET_CONNECTION_notify_transmit_ready_cancel (h); |
912 | } | 912 | } |
913 | 913 | ||
914 | 914 | ||
@@ -921,7 +921,7 @@ sock_notify_transmit_ready_cancel (void *cls, void *h) | |||
921 | static int | 921 | static int |
922 | sock_check (void *cls) | 922 | sock_check (void *cls) |
923 | { | 923 | { |
924 | return GNUNET_NETWORK_connection_check (cls); | 924 | return GNUNET_CONNECTION_check (cls); |
925 | } | 925 | } |
926 | 926 | ||
927 | 927 | ||
@@ -933,7 +933,7 @@ sock_check (void *cls) | |||
933 | static void | 933 | static void |
934 | sock_destroy (void *cls) | 934 | sock_destroy (void *cls) |
935 | { | 935 | { |
936 | GNUNET_NETWORK_connection_destroy (cls); | 936 | GNUNET_CONNECTION_destroy (cls); |
937 | } | 937 | } |
938 | 938 | ||
939 | 939 | ||
@@ -1067,7 +1067,7 @@ GNUNET_SERVER_client_get_address (struct GNUNET_SERVER_Client *client, | |||
1067 | { | 1067 | { |
1068 | if (client->receive != &sock_receive) | 1068 | if (client->receive != &sock_receive) |
1069 | return GNUNET_SYSERR; /* not a network client */ | 1069 | return GNUNET_SYSERR; /* not a network client */ |
1070 | return GNUNET_NETWORK_connection_get_address (client->client_closure, | 1070 | return GNUNET_CONNECTION_get_address (client->client_closure, |
1071 | addr, addrlen); | 1071 | addr, addrlen); |
1072 | } | 1072 | } |
1073 | 1073 | ||
@@ -1130,7 +1130,7 @@ GNUNET_SERVER_client_disconnect (struct GNUNET_SERVER_Client *client) | |||
1130 | * @param callback_cls closure for callback | 1130 | * @param callback_cls closure for callback |
1131 | * @return non-NULL if the notify callback was queued; can be used | 1131 | * @return non-NULL if the notify callback was queued; can be used |
1132 | * to cancel the request using | 1132 | * to cancel the request using |
1133 | * GNUNET_NETWORK_connection_notify_transmit_ready_cancel. | 1133 | * GNUNET_CONNECTION_notify_transmit_ready_cancel. |
1134 | * NULL if we are already going to notify someone else (busy) | 1134 | * NULL if we are already going to notify someone else (busy) |
1135 | */ | 1135 | */ |
1136 | struct GNUNET_NETWORK_TransmitHandle * | 1136 | struct GNUNET_NETWORK_TransmitHandle * |
diff --git a/src/util/test_network.c b/src/util/test_network.c index 6f09c4fce..b628a18db 100644 --- a/src/util/test_network.c +++ b/src/util/test_network.c | |||
@@ -88,7 +88,7 @@ receive_check (void *cls, | |||
88 | #if VERBOSE | 88 | #if VERBOSE |
89 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receive needs more data\n"); | 89 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receive needs more data\n"); |
90 | #endif | 90 | #endif |
91 | GNUNET_NETWORK_connection_receive (asock, | 91 | GNUNET_CONNECTION_receive (asock, |
92 | 1024, | 92 | 1024, |
93 | GNUNET_TIME_relative_multiply | 93 | GNUNET_TIME_relative_multiply |
94 | (GNUNET_TIME_UNIT_SECONDS, 5), &receive_check, | 94 | (GNUNET_TIME_UNIT_SECONDS, 5), &receive_check, |
@@ -101,7 +101,7 @@ receive_check (void *cls, | |||
101 | "Receive closes accepted socket\n"); | 101 | "Receive closes accepted socket\n"); |
102 | #endif | 102 | #endif |
103 | *ok = 0; | 103 | *ok = 0; |
104 | GNUNET_NETWORK_connection_destroy (asock); | 104 | GNUNET_CONNECTION_destroy (asock); |
105 | } | 105 | } |
106 | } | 106 | } |
107 | 107 | ||
@@ -112,19 +112,19 @@ run_accept (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
112 | #if VERBOSE | 112 | #if VERBOSE |
113 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test accepts connection\n"); | 113 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test accepts connection\n"); |
114 | #endif | 114 | #endif |
115 | asock = GNUNET_NETWORK_connection_create_from_accept (tc->sched, | 115 | asock = GNUNET_CONNECTION_create_from_accept (tc->sched, |
116 | NULL, NULL, ls, 1024); | 116 | NULL, NULL, ls, 1024); |
117 | GNUNET_assert (asock != NULL); | 117 | GNUNET_assert (asock != NULL); |
118 | GNUNET_assert (GNUNET_YES == GNUNET_NETWORK_connection_check (asock)); | 118 | GNUNET_assert (GNUNET_YES == GNUNET_CONNECTION_check (asock)); |
119 | #if VERBOSE | 119 | #if VERBOSE |
120 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test destroys listen socket\n"); | 120 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test destroys listen socket\n"); |
121 | #endif | 121 | #endif |
122 | GNUNET_NETWORK_connection_destroy (lsock); | 122 | GNUNET_CONNECTION_destroy (lsock); |
123 | #if VERBOSE | 123 | #if VERBOSE |
124 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 124 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
125 | "Test asks to receive on accepted socket\n"); | 125 | "Test asks to receive on accepted socket\n"); |
126 | #endif | 126 | #endif |
127 | GNUNET_NETWORK_connection_receive (asock, | 127 | GNUNET_CONNECTION_receive (asock, |
128 | 1024, | 128 | 1024, |
129 | GNUNET_TIME_relative_multiply | 129 | GNUNET_TIME_relative_multiply |
130 | (GNUNET_TIME_UNIT_SECONDS, 5), &receive_check, cls); | 130 | (GNUNET_TIME_UNIT_SECONDS, 5), &receive_check, cls); |
@@ -146,23 +146,23 @@ static void | |||
146 | task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 146 | task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
147 | { | 147 | { |
148 | ls = open_listen_socket (); | 148 | ls = open_listen_socket (); |
149 | lsock = GNUNET_NETWORK_connection_create_from_existing (tc->sched, ls, 0); | 149 | lsock = GNUNET_CONNECTION_create_from_existing (tc->sched, ls, 0); |
150 | GNUNET_assert (lsock != NULL); | 150 | GNUNET_assert (lsock != NULL); |
151 | csock = GNUNET_NETWORK_connection_create_from_connect (tc->sched, | 151 | csock = GNUNET_CONNECTION_create_from_connect (tc->sched, |
152 | "localhost", PORT, 1024); | 152 | "localhost", PORT, 1024); |
153 | GNUNET_assert (csock != NULL); | 153 | GNUNET_assert (csock != NULL); |
154 | #if VERBOSE | 154 | #if VERBOSE |
155 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test asks for write notification\n"); | 155 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test asks for write notification\n"); |
156 | #endif | 156 | #endif |
157 | GNUNET_assert (NULL != | 157 | GNUNET_assert (NULL != |
158 | GNUNET_NETWORK_connection_notify_transmit_ready (csock, | 158 | GNUNET_CONNECTION_notify_transmit_ready (csock, |
159 | 12, | 159 | 12, |
160 | GNUNET_TIME_UNIT_SECONDS, | 160 | GNUNET_TIME_UNIT_SECONDS, |
161 | &make_hello, NULL)); | 161 | &make_hello, NULL)); |
162 | #if VERBOSE | 162 | #if VERBOSE |
163 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test destroys client socket\n"); | 163 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test destroys client socket\n"); |
164 | #endif | 164 | #endif |
165 | GNUNET_NETWORK_connection_destroy (csock); | 165 | GNUNET_CONNECTION_destroy (csock); |
166 | #if VERBOSE | 166 | #if VERBOSE |
167 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test prepares to accept\n"); | 167 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test prepares to accept\n"); |
168 | #endif | 168 | #endif |
diff --git a/src/util/test_network_addressing.c b/src/util/test_network_addressing.c index a2682a733..177810eae 100644 --- a/src/util/test_network_addressing.c +++ b/src/util/test_network_addressing.c | |||
@@ -82,7 +82,7 @@ receive_check (void *cls, | |||
82 | sofar += available; | 82 | sofar += available; |
83 | if (sofar < 12) | 83 | if (sofar < 12) |
84 | { | 84 | { |
85 | GNUNET_NETWORK_connection_receive (asock, | 85 | GNUNET_CONNECTION_receive (asock, |
86 | 1024, | 86 | 1024, |
87 | GNUNET_TIME_relative_multiply | 87 | GNUNET_TIME_relative_multiply |
88 | (GNUNET_TIME_UNIT_SECONDS, 5), &receive_check, | 88 | (GNUNET_TIME_UNIT_SECONDS, 5), &receive_check, |
@@ -91,7 +91,7 @@ receive_check (void *cls, | |||
91 | else | 91 | else |
92 | { | 92 | { |
93 | *ok = 0; | 93 | *ok = 0; |
94 | GNUNET_NETWORK_connection_destroy (asock); | 94 | GNUNET_CONNECTION_destroy (asock); |
95 | } | 95 | } |
96 | } | 96 | } |
97 | 97 | ||
@@ -104,12 +104,12 @@ run_accept (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
104 | struct sockaddr_in *v4; | 104 | struct sockaddr_in *v4; |
105 | struct sockaddr_in expect; | 105 | struct sockaddr_in expect; |
106 | 106 | ||
107 | asock = GNUNET_NETWORK_connection_create_from_accept (tc->sched, | 107 | asock = GNUNET_CONNECTION_create_from_accept (tc->sched, |
108 | NULL, NULL, ls, 1024); | 108 | NULL, NULL, ls, 1024); |
109 | GNUNET_assert (asock != NULL); | 109 | GNUNET_assert (asock != NULL); |
110 | GNUNET_assert (GNUNET_YES == GNUNET_NETWORK_connection_check (asock)); | 110 | GNUNET_assert (GNUNET_YES == GNUNET_CONNECTION_check (asock)); |
111 | GNUNET_assert (GNUNET_OK == | 111 | GNUNET_assert (GNUNET_OK == |
112 | GNUNET_NETWORK_connection_get_address (asock, &addr, &alen)); | 112 | GNUNET_CONNECTION_get_address (asock, &addr, &alen)); |
113 | GNUNET_assert (alen == sizeof (struct sockaddr_in)); | 113 | GNUNET_assert (alen == sizeof (struct sockaddr_in)); |
114 | v4 = addr; | 114 | v4 = addr; |
115 | memset (&expect, 0, sizeof (expect)); | 115 | memset (&expect, 0, sizeof (expect)); |
@@ -118,8 +118,8 @@ run_accept (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
118 | expect.sin_addr.s_addr = htonl (INADDR_LOOPBACK); | 118 | expect.sin_addr.s_addr = htonl (INADDR_LOOPBACK); |
119 | GNUNET_assert (0 == memcmp (&expect, v4, alen)); | 119 | GNUNET_assert (0 == memcmp (&expect, v4, alen)); |
120 | GNUNET_free (addr); | 120 | GNUNET_free (addr); |
121 | GNUNET_NETWORK_connection_destroy (lsock); | 121 | GNUNET_CONNECTION_destroy (lsock); |
122 | GNUNET_NETWORK_connection_receive (asock, | 122 | GNUNET_CONNECTION_receive (asock, |
123 | 1024, | 123 | 1024, |
124 | GNUNET_TIME_relative_multiply | 124 | GNUNET_TIME_relative_multiply |
125 | (GNUNET_TIME_UNIT_SECONDS, 5), &receive_check, cls); | 125 | (GNUNET_TIME_UNIT_SECONDS, 5), &receive_check, cls); |
@@ -138,24 +138,24 @@ task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
138 | { | 138 | { |
139 | struct sockaddr_in v4; | 139 | struct sockaddr_in v4; |
140 | ls = open_listen_socket (); | 140 | ls = open_listen_socket (); |
141 | lsock = GNUNET_NETWORK_connection_create_from_existing (tc->sched, ls, 0); | 141 | lsock = GNUNET_CONNECTION_create_from_existing (tc->sched, ls, 0); |
142 | GNUNET_assert (lsock != NULL); | 142 | GNUNET_assert (lsock != NULL); |
143 | 143 | ||
144 | v4.sin_family = AF_INET; | 144 | v4.sin_family = AF_INET; |
145 | v4.sin_port = htons (PORT); | 145 | v4.sin_port = htons (PORT); |
146 | v4.sin_addr.s_addr = htonl (INADDR_LOOPBACK); | 146 | v4.sin_addr.s_addr = htonl (INADDR_LOOPBACK); |
147 | csock = GNUNET_NETWORK_connection_create_from_sockaddr (tc->sched, | 147 | csock = GNUNET_CONNECTION_create_from_sockaddr (tc->sched, |
148 | AF_INET, | 148 | AF_INET, |
149 | (const struct sockaddr | 149 | (const struct sockaddr |
150 | *) &v4, sizeof (v4), | 150 | *) &v4, sizeof (v4), |
151 | 1024); | 151 | 1024); |
152 | GNUNET_assert (csock != NULL); | 152 | GNUNET_assert (csock != NULL); |
153 | GNUNET_assert (NULL != | 153 | GNUNET_assert (NULL != |
154 | GNUNET_NETWORK_connection_notify_transmit_ready (csock, | 154 | GNUNET_CONNECTION_notify_transmit_ready (csock, |
155 | 12, | 155 | 12, |
156 | GNUNET_TIME_UNIT_SECONDS, | 156 | GNUNET_TIME_UNIT_SECONDS, |
157 | &make_hello, NULL)); | 157 | &make_hello, NULL)); |
158 | GNUNET_NETWORK_connection_destroy (csock); | 158 | GNUNET_CONNECTION_destroy (csock); |
159 | GNUNET_SCHEDULER_add_read_net (tc->sched, | 159 | GNUNET_SCHEDULER_add_read_net (tc->sched, |
160 | GNUNET_NO, | 160 | GNUNET_NO, |
161 | GNUNET_SCHEDULER_PRIORITY_HIGH, | 161 | GNUNET_SCHEDULER_PRIORITY_HIGH, |
diff --git a/src/util/test_network_receive_cancel.c b/src/util/test_network_receive_cancel.c index 1a3cb4866..a9834c0e2 100644 --- a/src/util/test_network_receive_cancel.c +++ b/src/util/test_network_receive_cancel.c | |||
@@ -85,13 +85,13 @@ static void | |||
85 | run_accept_cancel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 85 | run_accept_cancel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
86 | { | 86 | { |
87 | 87 | ||
88 | asock = GNUNET_NETWORK_connection_create_from_accept (tc->sched, | 88 | asock = GNUNET_CONNECTION_create_from_accept (tc->sched, |
89 | NULL, NULL, ls, 1024); | 89 | NULL, NULL, ls, 1024); |
90 | GNUNET_assert (asock != NULL); | 90 | GNUNET_assert (asock != NULL); |
91 | GNUNET_assert (GNUNET_YES == GNUNET_NETWORK_connection_check (asock)); | 91 | GNUNET_assert (GNUNET_YES == GNUNET_CONNECTION_check (asock)); |
92 | GNUNET_NETWORK_connection_destroy (lsock); | 92 | GNUNET_CONNECTION_destroy (lsock); |
93 | receive_task | 93 | receive_task |
94 | = GNUNET_NETWORK_connection_receive (asock, | 94 | = GNUNET_CONNECTION_receive (asock, |
95 | 1024, | 95 | 1024, |
96 | GNUNET_TIME_relative_multiply | 96 | GNUNET_TIME_relative_multiply |
97 | (GNUNET_TIME_UNIT_SECONDS, 5), &dead_receive, | 97 | (GNUNET_TIME_UNIT_SECONDS, 5), &dead_receive, |
@@ -103,9 +103,9 @@ static void | |||
103 | receive_cancel_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 103 | receive_cancel_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
104 | { | 104 | { |
105 | int *ok = cls; | 105 | int *ok = cls; |
106 | GNUNET_NETWORK_connection_receive_cancel (asock, receive_task); | 106 | GNUNET_CONNECTION_receive_cancel (asock, receive_task); |
107 | GNUNET_NETWORK_connection_destroy (csock); | 107 | GNUNET_CONNECTION_destroy (csock); |
108 | GNUNET_NETWORK_connection_destroy (asock); | 108 | GNUNET_CONNECTION_destroy (asock); |
109 | *ok = 0; | 109 | *ok = 0; |
110 | } | 110 | } |
111 | 111 | ||
@@ -115,9 +115,9 @@ static void | |||
115 | task_receive_cancel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 115 | task_receive_cancel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
116 | { | 116 | { |
117 | ls = open_listen_socket (); | 117 | ls = open_listen_socket (); |
118 | lsock = GNUNET_NETWORK_connection_create_from_existing (tc->sched, ls, 0); | 118 | lsock = GNUNET_CONNECTION_create_from_existing (tc->sched, ls, 0); |
119 | GNUNET_assert (lsock != NULL); | 119 | GNUNET_assert (lsock != NULL); |
120 | csock = GNUNET_NETWORK_connection_create_from_connect (tc->sched, | 120 | csock = GNUNET_CONNECTION_create_from_connect (tc->sched, |
121 | "localhost", PORT, 1024); | 121 | "localhost", PORT, 1024); |
122 | GNUNET_assert (csock != NULL); | 122 | GNUNET_assert (csock != NULL); |
123 | GNUNET_SCHEDULER_add_read_net (tc->sched, | 123 | GNUNET_SCHEDULER_add_read_net (tc->sched, |
diff --git a/src/util/test_network_timeout.c b/src/util/test_network_timeout.c index 442775463..ef39ac2a1 100644 --- a/src/util/test_network_timeout.c +++ b/src/util/test_network_timeout.c | |||
@@ -74,8 +74,8 @@ send_kilo (void *cls, size_t size, void *buf) | |||
74 | #endif | 74 | #endif |
75 | GNUNET_assert (buf == NULL); | 75 | GNUNET_assert (buf == NULL); |
76 | *ok = 0; | 76 | *ok = 0; |
77 | GNUNET_NETWORK_connection_destroy (lsock); | 77 | GNUNET_CONNECTION_destroy (lsock); |
78 | GNUNET_NETWORK_connection_destroy (csock); | 78 | GNUNET_CONNECTION_destroy (csock); |
79 | return 0; | 79 | return 0; |
80 | } | 80 | } |
81 | #if VERBOSE | 81 | #if VERBOSE |
@@ -85,7 +85,7 @@ send_kilo (void *cls, size_t size, void *buf) | |||
85 | memset (buf, 42, 1024); | 85 | memset (buf, 42, 1024); |
86 | 86 | ||
87 | GNUNET_assert (NULL != | 87 | GNUNET_assert (NULL != |
88 | GNUNET_NETWORK_connection_notify_transmit_ready (csock, | 88 | GNUNET_CONNECTION_notify_transmit_ready (csock, |
89 | 1024, | 89 | 1024, |
90 | GNUNET_TIME_UNIT_SECONDS, | 90 | GNUNET_TIME_UNIT_SECONDS, |
91 | &send_kilo, cls)); | 91 | &send_kilo, cls)); |
@@ -98,13 +98,13 @@ task_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
98 | { | 98 | { |
99 | 99 | ||
100 | ls = open_listen_socket (); | 100 | ls = open_listen_socket (); |
101 | lsock = GNUNET_NETWORK_connection_create_from_existing (tc->sched, ls, 0); | 101 | lsock = GNUNET_CONNECTION_create_from_existing (tc->sched, ls, 0); |
102 | GNUNET_assert (lsock != NULL); | 102 | GNUNET_assert (lsock != NULL); |
103 | csock = GNUNET_NETWORK_connection_create_from_connect (tc->sched, | 103 | csock = GNUNET_CONNECTION_create_from_connect (tc->sched, |
104 | "localhost", PORT, 1024); | 104 | "localhost", PORT, 1024); |
105 | GNUNET_assert (csock != NULL); | 105 | GNUNET_assert (csock != NULL); |
106 | GNUNET_assert (NULL != | 106 | GNUNET_assert (NULL != |
107 | GNUNET_NETWORK_connection_notify_transmit_ready (csock, | 107 | GNUNET_CONNECTION_notify_transmit_ready (csock, |
108 | 1024, | 108 | 1024, |
109 | GNUNET_TIME_UNIT_SECONDS, | 109 | GNUNET_TIME_UNIT_SECONDS, |
110 | &send_kilo, cls)); | 110 | &send_kilo, cls)); |
diff --git a/src/util/test_network_timeout_no_connect.c b/src/util/test_network_timeout_no_connect.c index 902edd2fa..823216104 100644 --- a/src/util/test_network_timeout_no_connect.c +++ b/src/util/test_network_timeout_no_connect.c | |||
@@ -51,11 +51,11 @@ handle_timeout (void *cls, size_t size, void *buf) | |||
51 | static void | 51 | static void |
52 | task_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 52 | task_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
53 | { | 53 | { |
54 | csock = GNUNET_NETWORK_connection_create_from_connect (tc->sched, | 54 | csock = GNUNET_CONNECTION_create_from_connect (tc->sched, |
55 | "localhost", PORT, 1024); | 55 | "localhost", PORT, 1024); |
56 | GNUNET_assert (csock != NULL); | 56 | GNUNET_assert (csock != NULL); |
57 | GNUNET_assert (NULL != | 57 | GNUNET_assert (NULL != |
58 | GNUNET_NETWORK_connection_notify_transmit_ready (csock, | 58 | GNUNET_CONNECTION_notify_transmit_ready (csock, |
59 | 1024, | 59 | 1024, |
60 | GNUNET_TIME_UNIT_SECONDS, | 60 | GNUNET_TIME_UNIT_SECONDS, |
61 | &handle_timeout, cls)); | 61 | &handle_timeout, cls)); |
diff --git a/src/util/test_network_transmit_cancel.c b/src/util/test_network_transmit_cancel.c index c46fecd22..edc45bb9f 100644 --- a/src/util/test_network_transmit_cancel.c +++ b/src/util/test_network_transmit_cancel.c | |||
@@ -48,15 +48,15 @@ task_transmit_cancel (void *cls, | |||
48 | struct GNUNET_NETWORK_TransmitHandle *th; | 48 | struct GNUNET_NETWORK_TransmitHandle *th; |
49 | struct GNUNET_NETWORK_ConnectionHandle *csock; | 49 | struct GNUNET_NETWORK_ConnectionHandle *csock; |
50 | 50 | ||
51 | csock = GNUNET_NETWORK_connection_create_from_connect (tc->sched, | 51 | csock = GNUNET_CONNECTION_create_from_connect (tc->sched, |
52 | "localhost", PORT, 1024); | 52 | "localhost", PORT, 1024); |
53 | GNUNET_assert (csock != NULL); | 53 | GNUNET_assert (csock != NULL); |
54 | th = GNUNET_NETWORK_connection_notify_transmit_ready (csock, | 54 | th = GNUNET_CONNECTION_notify_transmit_ready (csock, |
55 | 12, | 55 | 12, |
56 | GNUNET_TIME_UNIT_MINUTES, | 56 | GNUNET_TIME_UNIT_MINUTES, |
57 | ¬_run, cls); | 57 | ¬_run, cls); |
58 | GNUNET_NETWORK_connection_notify_transmit_ready_cancel (th); | 58 | GNUNET_CONNECTION_notify_transmit_ready_cancel (th); |
59 | GNUNET_NETWORK_connection_destroy (csock); | 59 | GNUNET_CONNECTION_destroy (csock); |
60 | *ok = 0; | 60 | *ok = 0; |
61 | } | 61 | } |
62 | 62 | ||