aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_tcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/plugin_transport_tcp.c')
-rw-r--r--src/transport/plugin_transport_tcp.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c
index b1c68acdf..2a8ca2eb9 100644
--- a/src/transport/plugin_transport_tcp.c
+++ b/src/transport/plugin_transport_tcp.c
@@ -601,7 +601,7 @@ tcp_nat_port_map_callback (void *cls,
601 case AF_INET6: 601 case AF_INET6:
602 GNUNET_assert(addrlen == sizeof(struct sockaddr_in6)); 602 GNUNET_assert(addrlen == sizeof(struct sockaddr_in6));
603 memset (&t6, 0, sizeof(t6)); 603 memset (&t6, 0, sizeof(t6));
604 memcpy (&t6.ipv6_addr, &((struct sockaddr_in6 *) addr)->sin6_addr, 604 GNUNET_memcpy (&t6.ipv6_addr, &((struct sockaddr_in6 *) addr)->sin6_addr,
605 sizeof(struct in6_addr)); 605 sizeof(struct in6_addr));
606 t6.options = htonl (plugin->myoptions); 606 t6.options = htonl (plugin->myoptions);
607 t6.t6_port = ((struct sockaddr_in6 *) addr)->sin6_port; 607 t6.t6_port = ((struct sockaddr_in6 *) addr)->sin6_port;
@@ -656,7 +656,7 @@ tcp_plugin_address_to_string (void *cls,
656 af = AF_INET6; 656 af = AF_INET6;
657 port = ntohs (t6->t6_port); 657 port = ntohs (t6->t6_port);
658 options = ntohl (t6->options); 658 options = ntohl (t6->options);
659 memcpy (&a6, &t6->ipv6_addr, sizeof(a6)); 659 GNUNET_memcpy (&a6, &t6->ipv6_addr, sizeof(a6));
660 sb = &a6; 660 sb = &a6;
661 break; 661 break;
662 case sizeof(struct IPv4TcpAddress): 662 case sizeof(struct IPv4TcpAddress):
@@ -664,7 +664,7 @@ tcp_plugin_address_to_string (void *cls,
664 af = AF_INET; 664 af = AF_INET;
665 port = ntohs (t4->t4_port); 665 port = ntohs (t4->t4_port);
666 options = ntohl (t4->options); 666 options = ntohl (t4->options);
667 memcpy (&a4, &t4->ipv4_addr, sizeof(a4)); 667 GNUNET_memcpy (&a4, &t4->ipv4_addr, sizeof(a4));
668 sb = &a4; 668 sb = &a4;
669 break; 669 break;
670 default: 670 default:
@@ -1053,7 +1053,7 @@ create_session (struct Plugin *plugin,
1053 sizeof (struct WelcomeMessage)); 1053 sizeof (struct WelcomeMessage));
1054 pm->msg = (const char *) &pm[1]; 1054 pm->msg = (const char *) &pm[1];
1055 pm->message_size = sizeof(struct WelcomeMessage); 1055 pm->message_size = sizeof(struct WelcomeMessage);
1056 memcpy (&pm[1], 1056 GNUNET_memcpy (&pm[1],
1057 &plugin->my_welcome, 1057 &plugin->my_welcome,
1058 sizeof(struct WelcomeMessage)); 1058 sizeof(struct WelcomeMessage));
1059 pm->timeout = GNUNET_TIME_UNIT_FOREVER_ABS; 1059 pm->timeout = GNUNET_TIME_UNIT_FOREVER_ABS;
@@ -1219,8 +1219,8 @@ do_transmit (void *cls,
1219 tcp_plugin_address_to_string (session->plugin, 1219 tcp_plugin_address_to_string (session->plugin,
1220 session->address->address, 1220 session->address->address,
1221 session->address->address_length)); 1221 session->address->address_length));
1222 /* FIXME: this memcpy can be up to 7% of our total runtime */ 1222 /* FIXME: this GNUNET_memcpy can be up to 7% of our total runtime */
1223 memcpy (cbuf, 1223 GNUNET_memcpy (cbuf,
1224 pos->msg, 1224 pos->msg,
1225 pos->message_size); 1225 pos->message_size);
1226 cbuf += pos->message_size; 1226 cbuf += pos->message_size;
@@ -1335,7 +1335,7 @@ tcp_plugin_send (void *cls,
1335 /* create new message entry */ 1335 /* create new message entry */
1336 pm = GNUNET_malloc (sizeof (struct PendingMessage) + msgbuf_size); 1336 pm = GNUNET_malloc (sizeof (struct PendingMessage) + msgbuf_size);
1337 pm->msg = (const char *) &pm[1]; 1337 pm->msg = (const char *) &pm[1];
1338 memcpy (&pm[1], msgbuf, msgbuf_size); 1338 GNUNET_memcpy (&pm[1], msgbuf, msgbuf_size);
1339 pm->message_size = msgbuf_size; 1339 pm->message_size = msgbuf_size;
1340 pm->timeout = GNUNET_TIME_relative_to_absolute (to); 1340 pm->timeout = GNUNET_TIME_relative_to_absolute (to);
1341 pm->transmit_cont = cont; 1341 pm->transmit_cont = cont;
@@ -1625,7 +1625,7 @@ tcp_plugin_get_session (void *cls,
1625 a6.sin6_port = t6->t6_port; 1625 a6.sin6_port = t6->t6_port;
1626 if (t6->t6_port == 0) 1626 if (t6->t6_port == 0)
1627 is_natd = GNUNET_YES; 1627 is_natd = GNUNET_YES;
1628 memcpy (&a6.sin6_addr, &t6->ipv6_addr, sizeof(struct in6_addr)); 1628 GNUNET_memcpy (&a6.sin6_addr, &t6->ipv6_addr, sizeof(struct in6_addr));
1629 sb = &a6; 1629 sb = &a6;
1630 sbs = sizeof(a6); 1630 sbs = sizeof(a6);
1631 } 1631 }
@@ -1958,7 +1958,7 @@ tcp_plugin_address_pretty_printer (void *cls,
1958 memset (&a6, 0, sizeof(a6)); 1958 memset (&a6, 0, sizeof(a6));
1959 a6.sin6_family = AF_INET6; 1959 a6.sin6_family = AF_INET6;
1960 a6.sin6_port = t6->t6_port; 1960 a6.sin6_port = t6->t6_port;
1961 memcpy (&a6.sin6_addr, &t6->ipv6_addr, sizeof(struct in6_addr)); 1961 GNUNET_memcpy (&a6.sin6_addr, &t6->ipv6_addr, sizeof(struct in6_addr));
1962 port = ntohs (t6->t6_port); 1962 port = ntohs (t6->t6_port);
1963 options = ntohl (t6->options); 1963 options = ntohl (t6->options);
1964 sb = &a6; 1964 sb = &a6;
@@ -2228,7 +2228,7 @@ handle_tcp_nat_probe (void *cls,
2228 t6 = GNUNET_new (struct IPv6TcpAddress); 2228 t6 = GNUNET_new (struct IPv6TcpAddress);
2229 t6->options = htonl (TCP_OPTIONS_NONE); 2229 t6->options = htonl (TCP_OPTIONS_NONE);
2230 t6->t6_port = s6->sin6_port; 2230 t6->t6_port = s6->sin6_port;
2231 memcpy (&t6->ipv6_addr, &s6->sin6_addr, sizeof(struct in6_addr)); 2231 GNUNET_memcpy (&t6->ipv6_addr, &s6->sin6_addr, sizeof(struct in6_addr));
2232 session->address = GNUNET_HELLO_address_allocate (&tcp_nat_probe->clientIdentity, 2232 session->address = GNUNET_HELLO_address_allocate (&tcp_nat_probe->clientIdentity,
2233 PLUGIN_NAME, 2233 PLUGIN_NAME,
2234 &t6, 2234 &t6,
@@ -2349,7 +2349,7 @@ handle_tcp_welcome (void *cls,
2349 memset (&t6, '\0', sizeof (t6)); 2349 memset (&t6, '\0', sizeof (t6));
2350 t6.options = htonl (TCP_OPTIONS_NONE); 2350 t6.options = htonl (TCP_OPTIONS_NONE);
2351 t6.t6_port = s6->sin6_port; 2351 t6.t6_port = s6->sin6_port;
2352 memcpy (&t6.ipv6_addr, &s6->sin6_addr, sizeof(struct in6_addr)); 2352 GNUNET_memcpy (&t6.ipv6_addr, &s6->sin6_addr, sizeof(struct in6_addr));
2353 address = GNUNET_HELLO_address_allocate (&wm->clientIdentity, 2353 address = GNUNET_HELLO_address_allocate (&wm->clientIdentity,
2354 PLUGIN_NAME, 2354 PLUGIN_NAME,
2355 &t6, 2355 &t6,
@@ -2649,7 +2649,7 @@ notify_send_probe (void *cls,
2649 return 0; 2649 return 0;
2650 } 2650 }
2651 GNUNET_assert(size >= sizeof(tcp_probe_ctx->message)); 2651 GNUNET_assert(size >= sizeof(tcp_probe_ctx->message));
2652 memcpy (buf, 2652 GNUNET_memcpy (buf,
2653 &tcp_probe_ctx->message, 2653 &tcp_probe_ctx->message,
2654 sizeof(tcp_probe_ctx->message)); 2654 sizeof(tcp_probe_ctx->message));
2655 GNUNET_SERVER_connect_socket (tcp_probe_ctx->plugin->server, 2655 GNUNET_SERVER_connect_socket (tcp_probe_ctx->plugin->server,
@@ -2758,7 +2758,7 @@ tcp_plugin_get_network_for_address (void *cls,
2758#endif 2758#endif
2759 a6.sin6_family = AF_INET6; 2759 a6.sin6_family = AF_INET6;
2760 a6.sin6_port = t6->t6_port; 2760 a6.sin6_port = t6->t6_port;
2761 memcpy (&a6.sin6_addr, &t6->ipv6_addr, sizeof(struct in6_addr)); 2761 GNUNET_memcpy (&a6.sin6_addr, &t6->ipv6_addr, sizeof(struct in6_addr));
2762 sb = &a6; 2762 sb = &a6;
2763 sbs = sizeof(a6); 2763 sbs = sizeof(a6);
2764 } 2764 }
@@ -3075,7 +3075,7 @@ libgnunet_plugin_transport_tcp_init (void *cls)
3075 GNUNET_YES); 3075 GNUNET_YES);
3076 } 3076 }
3077 plugin->handlers = GNUNET_malloc (sizeof (my_handlers)); 3077 plugin->handlers = GNUNET_malloc (sizeof (my_handlers));
3078 memcpy (plugin->handlers, my_handlers, sizeof(my_handlers)); 3078 GNUNET_memcpy (plugin->handlers, my_handlers, sizeof(my_handlers));
3079 for (i = 0;i < sizeof(my_handlers) / sizeof(struct GNUNET_SERVER_MessageHandler);i++) 3079 for (i = 0;i < sizeof(my_handlers) / sizeof(struct GNUNET_SERVER_MessageHandler);i++)
3080 plugin->handlers[i].callback_cls = plugin; 3080 plugin->handlers[i].callback_cls = plugin;
3081 3081