diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-10-22 21:59:27 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-10-22 21:59:27 +0000 |
commit | f44c0036572d5557d2496748a4190a61e40e61ff (patch) | |
tree | bceb908e8542883ed246f96b4c619c0c49a06782 /src/vpn | |
parent | 9d87d51965287d83ee332b8c50baff95bd62649a (diff) | |
download | gnunet-f44c0036572d5557d2496748a4190a61e40e61ff.tar.gz gnunet-f44c0036572d5557d2496748a4190a61e40e61ff.zip |
replacing 0-terminated atsi-array with array+length in core API (and the core-connect IPC)
Diffstat (limited to 'src/vpn')
-rw-r--r-- | src/vpn/gnunet-daemon-exit.c | 16 | ||||
-rw-r--r-- | src/vpn/gnunet-daemon-vpn-helper.c | 8 | ||||
-rw-r--r-- | src/vpn/gnunet-daemon-vpn.c | 12 | ||||
-rw-r--r-- | src/vpn/gnunet-daemon-vpn.h | 3 | ||||
-rw-r--r-- | src/vpn/gnunet-service-dns.c | 12 |
5 files changed, 36 insertions, 15 deletions
diff --git a/src/vpn/gnunet-daemon-exit.c b/src/vpn/gnunet-daemon-exit.c index b88dd0f08..8b7a8cff3 100644 --- a/src/vpn/gnunet-daemon-exit.c +++ b/src/vpn/gnunet-daemon-exit.c | |||
@@ -1025,7 +1025,9 @@ receive_tcp_service (void *cls | |||
1025 | __attribute__ ((unused)), | 1025 | __attribute__ ((unused)), |
1026 | const struct GNUNET_MessageHeader *message, | 1026 | const struct GNUNET_MessageHeader *message, |
1027 | const struct GNUNET_ATS_Information *atsi | 1027 | const struct GNUNET_ATS_Information *atsi |
1028 | __attribute__ ((unused))) | 1028 | __attribute__ ((unused)), |
1029 | unsigned int atsi_count | ||
1030 | __attribute__ ((unused))) | ||
1029 | { | 1031 | { |
1030 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received TCP-Packet\n"); | 1032 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received TCP-Packet\n"); |
1031 | GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1); | 1033 | GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1); |
@@ -1133,7 +1135,9 @@ receive_tcp_remote (void *cls | |||
1133 | __attribute__ ((unused)), | 1135 | __attribute__ ((unused)), |
1134 | const struct GNUNET_MessageHeader *message, | 1136 | const struct GNUNET_MessageHeader *message, |
1135 | const struct GNUNET_ATS_Information *atsi | 1137 | const struct GNUNET_ATS_Information *atsi |
1136 | __attribute__ ((unused))) | 1138 | __attribute__ ((unused)), |
1139 | unsigned int atsi_count | ||
1140 | __attribute__ ((unused))) | ||
1137 | { | 1141 | { |
1138 | GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1); | 1142 | GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1); |
1139 | struct tcp_pkt *pkt = (struct tcp_pkt *) (desc + 1); | 1143 | struct tcp_pkt *pkt = (struct tcp_pkt *) (desc + 1); |
@@ -1209,7 +1213,9 @@ receive_udp_remote (void *cls | |||
1209 | __attribute__ ((unused)), | 1213 | __attribute__ ((unused)), |
1210 | const struct GNUNET_MessageHeader *message, | 1214 | const struct GNUNET_MessageHeader *message, |
1211 | const struct GNUNET_ATS_Information *atsi | 1215 | const struct GNUNET_ATS_Information *atsi |
1212 | __attribute__ ((unused))) | 1216 | __attribute__ ((unused)), |
1217 | unsigned int atsi_count | ||
1218 | __attribute__ ((unused))) | ||
1213 | { | 1219 | { |
1214 | GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1); | 1220 | GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1); |
1215 | struct udp_pkt *pkt = (struct udp_pkt *) (desc + 1); | 1221 | struct udp_pkt *pkt = (struct udp_pkt *) (desc + 1); |
@@ -1289,7 +1295,9 @@ receive_udp_service (void *cls | |||
1289 | __attribute__ ((unused)), | 1295 | __attribute__ ((unused)), |
1290 | const struct GNUNET_MessageHeader *message, | 1296 | const struct GNUNET_MessageHeader *message, |
1291 | const struct GNUNET_ATS_Information *atsi | 1297 | const struct GNUNET_ATS_Information *atsi |
1292 | __attribute__ ((unused))) | 1298 | __attribute__ ((unused)), |
1299 | unsigned int atsi_count | ||
1300 | __attribute__ ((unused))) | ||
1293 | { | 1301 | { |
1294 | GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1); | 1302 | GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1); |
1295 | struct udp_pkt *pkt = (struct udp_pkt *) (desc + 1); | 1303 | struct udp_pkt *pkt = (struct udp_pkt *) (desc + 1); |
diff --git a/src/vpn/gnunet-daemon-vpn-helper.c b/src/vpn/gnunet-daemon-vpn-helper.c index d91b00416..4d2bbf819 100644 --- a/src/vpn/gnunet-daemon-vpn-helper.c +++ b/src/vpn/gnunet-daemon-vpn-helper.c | |||
@@ -333,7 +333,7 @@ message_token (void *cls __attribute__ ((unused)), void *client | |||
333 | else if (NULL != cls) | 333 | else if (NULL != cls) |
334 | { | 334 | { |
335 | *cls = me->tunnel; | 335 | *cls = me->tunnel; |
336 | send_pkt_to_peer (cls, (struct GNUNET_PeerIdentity *) 1, NULL); | 336 | send_pkt_to_peer (cls, (struct GNUNET_PeerIdentity *) 1, NULL, 0); |
337 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 337 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
338 | "Queued to send IPv6 to peer %x, type %d\n", | 338 | "Queued to send IPv6 to peer %x, type %d\n", |
339 | *((unsigned int *) &me->desc.peer), ntohs (hdr->type)); | 339 | *((unsigned int *) &me->desc.peer), ntohs (hdr->type)); |
@@ -384,7 +384,7 @@ message_token (void *cls __attribute__ ((unused)), void *client | |||
384 | else if (NULL != cls) | 384 | else if (NULL != cls) |
385 | { | 385 | { |
386 | *cls = me->tunnel; | 386 | *cls = me->tunnel; |
387 | send_pkt_to_peer (cls, (struct GNUNET_PeerIdentity *) 1, NULL); | 387 | send_pkt_to_peer (cls, (struct GNUNET_PeerIdentity *) 1, NULL, 0); |
388 | } | 388 | } |
389 | } | 389 | } |
390 | } | 390 | } |
@@ -535,7 +535,7 @@ message_token (void *cls __attribute__ ((unused)), void *client | |||
535 | else if (NULL != cls) | 535 | else if (NULL != cls) |
536 | { | 536 | { |
537 | *cls = me->tunnel; | 537 | *cls = me->tunnel; |
538 | send_pkt_to_peer (cls, (struct GNUNET_PeerIdentity *) 1, NULL); | 538 | send_pkt_to_peer (cls, (struct GNUNET_PeerIdentity *) 1, NULL, 0); |
539 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 539 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
540 | "Queued to send IPv4 to peer %x, type %d\n", | 540 | "Queued to send IPv4 to peer %x, type %d\n", |
541 | *((unsigned int *) &me->desc.peer), | 541 | *((unsigned int *) &me->desc.peer), |
@@ -577,7 +577,7 @@ message_token (void *cls __attribute__ ((unused)), void *client | |||
577 | else if (NULL != cls) | 577 | else if (NULL != cls) |
578 | { | 578 | { |
579 | *cls = me->tunnel; | 579 | *cls = me->tunnel; |
580 | send_pkt_to_peer (cls, (struct GNUNET_PeerIdentity *) 1, NULL); | 580 | send_pkt_to_peer (cls, (struct GNUNET_PeerIdentity *) 1, NULL, 0); |
581 | } | 581 | } |
582 | } | 582 | } |
583 | } | 583 | } |
diff --git a/src/vpn/gnunet-daemon-vpn.c b/src/vpn/gnunet-daemon-vpn.c index 0f7bdff70..a6d051e9c 100644 --- a/src/vpn/gnunet-daemon-vpn.c +++ b/src/vpn/gnunet-daemon-vpn.c | |||
@@ -341,7 +341,9 @@ port_in_ports (uint64_t ports, uint16_t port) | |||
341 | void | 341 | void |
342 | send_pkt_to_peer (void *cls, const struct GNUNET_PeerIdentity *peer, | 342 | send_pkt_to_peer (void *cls, const struct GNUNET_PeerIdentity *peer, |
343 | const struct GNUNET_ATS_Information *atsi | 343 | const struct GNUNET_ATS_Information *atsi |
344 | __attribute__ ((unused))) | 344 | __attribute__ ((unused)), |
345 | unsigned int atsi_count | ||
346 | __attribute__ ((unused))) | ||
345 | { | 347 | { |
346 | /* peer == NULL means that all peers in this request are connected */ | 348 | /* peer == NULL means that all peers in this request are connected */ |
347 | if (peer == NULL) | 349 | if (peer == NULL) |
@@ -872,7 +874,9 @@ receive_udp_back (void *cls | |||
872 | __attribute__ ((unused)), | 874 | __attribute__ ((unused)), |
873 | const struct GNUNET_MessageHeader *message, | 875 | const struct GNUNET_MessageHeader *message, |
874 | const struct GNUNET_ATS_Information *atsi | 876 | const struct GNUNET_ATS_Information *atsi |
875 | __attribute__ ((unused))) | 877 | __attribute__ ((unused)), |
878 | unsigned int atsi_count | ||
879 | __attribute__ ((unused))) | ||
876 | { | 880 | { |
877 | GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1); | 881 | GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1); |
878 | struct remote_addr *s = (struct remote_addr *) desc; | 882 | struct remote_addr *s = (struct remote_addr *) desc; |
@@ -1051,7 +1055,9 @@ receive_tcp_back (void *cls | |||
1051 | __attribute__ ((unused)), | 1055 | __attribute__ ((unused)), |
1052 | const struct GNUNET_MessageHeader *message, | 1056 | const struct GNUNET_MessageHeader *message, |
1053 | const struct GNUNET_ATS_Information *atsi | 1057 | const struct GNUNET_ATS_Information *atsi |
1054 | __attribute__ ((unused))) | 1058 | __attribute__ ((unused)), |
1059 | unsigned int atsi_count | ||
1060 | __attribute__ ((unused))) | ||
1055 | { | 1061 | { |
1056 | GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1); | 1062 | GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1); |
1057 | struct remote_addr *s = (struct remote_addr *) desc; | 1063 | struct remote_addr *s = (struct remote_addr *) desc; |
diff --git a/src/vpn/gnunet-daemon-vpn.h b/src/vpn/gnunet-daemon-vpn.h index c0dba360e..7d3b0e68a 100644 --- a/src/vpn/gnunet-daemon-vpn.h +++ b/src/vpn/gnunet-daemon-vpn.h | |||
@@ -56,7 +56,8 @@ port_in_ports (uint64_t ports, uint16_t port); | |||
56 | 56 | ||
57 | void | 57 | void |
58 | send_pkt_to_peer (void *cls, const struct GNUNET_PeerIdentity *peer, | 58 | send_pkt_to_peer (void *cls, const struct GNUNET_PeerIdentity *peer, |
59 | const struct GNUNET_ATS_Information *atsi); | 59 | const struct GNUNET_ATS_Information *atsi, |
60 | unsigned int atsi_count); | ||
60 | 61 | ||
61 | /** | 62 | /** |
62 | * The configuration to use | 63 | * The configuration to use |
diff --git a/src/vpn/gnunet-service-dns.c b/src/vpn/gnunet-service-dns.c index 49e774dc2..4aa04ddfa 100644 --- a/src/vpn/gnunet-service-dns.c +++ b/src/vpn/gnunet-service-dns.c | |||
@@ -325,7 +325,9 @@ mesh_send (void *cls, size_t size, void *buf) | |||
325 | void | 325 | void |
326 | mesh_connect (void *cls, const struct GNUNET_PeerIdentity *peer, | 326 | mesh_connect (void *cls, const struct GNUNET_PeerIdentity *peer, |
327 | const struct GNUNET_ATS_Information *atsi | 327 | const struct GNUNET_ATS_Information *atsi |
328 | __attribute__ ((unused))) | 328 | __attribute__ ((unused)), |
329 | unsigned int atsi_count | ||
330 | __attribute__ ((unused))) | ||
329 | { | 331 | { |
330 | if (NULL == peer) | 332 | if (NULL == peer) |
331 | return; | 333 | return; |
@@ -395,7 +397,9 @@ receive_mesh_query (void *cls | |||
395 | __attribute__ ((unused)), | 397 | __attribute__ ((unused)), |
396 | const struct GNUNET_MessageHeader *message, | 398 | const struct GNUNET_MessageHeader *message, |
397 | const struct GNUNET_ATS_Information *atsi | 399 | const struct GNUNET_ATS_Information *atsi |
398 | __attribute__ ((unused))) | 400 | __attribute__ ((unused)), |
401 | unsigned int atsi_count | ||
402 | __attribute__ ((unused))) | ||
399 | { | 403 | { |
400 | struct dns_pkt *dns = (struct dns_pkt *) (message + 1); | 404 | struct dns_pkt *dns = (struct dns_pkt *) (message + 1); |
401 | 405 | ||
@@ -429,7 +433,9 @@ receive_mesh_answer (void *cls | |||
429 | const struct GNUNET_PeerIdentity *sender, | 433 | const struct GNUNET_PeerIdentity *sender, |
430 | const struct GNUNET_MessageHeader *message, | 434 | const struct GNUNET_MessageHeader *message, |
431 | const struct GNUNET_ATS_Information *atsi | 435 | const struct GNUNET_ATS_Information *atsi |
432 | __attribute__ ((unused))) | 436 | __attribute__ ((unused)), |
437 | unsigned int atsi_count | ||
438 | __attribute__ ((unused))) | ||
433 | { | 439 | { |
434 | /* TODo: size check */ | 440 | /* TODo: size check */ |
435 | struct dns_pkt *dns = (struct dns_pkt *) (message + 1); | 441 | struct dns_pkt *dns = (struct dns_pkt *) (message + 1); |