diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-14 20:05:17 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-14 20:05:17 +0000 |
commit | 89975a4c15ba6829bcf10e3287aac013d2f58973 (patch) | |
tree | c06477a31ff8dead4cf88d6fd8ca73520206cfda | |
parent | 7884866ee7cf796384342d104944256192d774a0 (diff) | |
download | gnunet-89975a4c15ba6829bcf10e3287aac013d2f58973.tar.gz gnunet-89975a4c15ba6829bcf10e3287aac013d2f58973.zip |
stuff
-rw-r--r-- | src/core/test_core_api_send_to_self.c | 4 | ||||
-rw-r--r-- | src/include/gnunet_protocols.h | 31 | ||||
-rw-r--r-- | src/vpn/gnunet-daemon-exit.c | 12 | ||||
-rw-r--r-- | src/vpn/gnunet-daemon-vpn-dns.c | 2 | ||||
-rw-r--r-- | src/vpn/gnunet-daemon-vpn-helper.c | 18 | ||||
-rw-r--r-- | src/vpn/gnunet-daemon-vpn.c | 20 | ||||
-rw-r--r-- | src/vpn/gnunet-service-dns.c | 18 |
7 files changed, 55 insertions, 50 deletions
diff --git a/src/core/test_core_api_send_to_self.c b/src/core/test_core_api_send_to_self.c index b287ecf05..f2ddeb9fe 100644 --- a/src/core/test_core_api_send_to_self.c +++ b/src/core/test_core_api_send_to_self.c | |||
@@ -110,7 +110,7 @@ send_message (void* cls, size_t size, void* buf) | |||
110 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Sending!\n"); | 110 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Sending!\n"); |
111 | struct GNUNET_MessageHeader *hdr = buf; | 111 | struct GNUNET_MessageHeader *hdr = buf; |
112 | hdr->size = htons(sizeof(struct GNUNET_MessageHeader)); | 112 | hdr->size = htons(sizeof(struct GNUNET_MessageHeader)); |
113 | hdr->type = htons(GNUNET_MESSAGE_TYPE_SERVICE_UDP); | 113 | hdr->type = htons(GNUNET_MESSAGE_TYPE_VPN_SERVICE_UDP); |
114 | return ntohs(hdr->size); | 114 | return ntohs(hdr->size); |
115 | } | 115 | } |
116 | 116 | ||
@@ -165,7 +165,7 @@ run (void *cls, | |||
165 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 165 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
166 | { | 166 | { |
167 | const static struct GNUNET_CORE_MessageHandler handlers[] = { | 167 | const static struct GNUNET_CORE_MessageHandler handlers[] = { |
168 | {&receive, GNUNET_MESSAGE_TYPE_SERVICE_UDP, 0}, | 168 | {&receive, GNUNET_MESSAGE_TYPE_VPN_SERVICE_UDP, 0}, |
169 | {NULL, 0, 0} | 169 | {NULL, 0, 0} |
170 | }; | 170 | }; |
171 | 171 | ||
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h index 59db0cd78..b37c92091 100644 --- a/src/include/gnunet_protocols.h +++ b/src/include/gnunet_protocols.h | |||
@@ -759,42 +759,42 @@ extern "C" | |||
759 | /** | 759 | /** |
760 | * Type of messages containing an UDP packet for a service | 760 | * Type of messages containing an UDP packet for a service |
761 | */ | 761 | */ |
762 | #define GNUNET_MESSAGE_TYPE_SERVICE_UDP 186 | 762 | #define GNUNET_MESSAGE_TYPE_VPN_SERVICE_UDP 186 |
763 | 763 | ||
764 | /** | 764 | /** |
765 | * Type of messages containing an UDP packet from a service | 765 | * Type of messages containing an UDP packet from a service |
766 | */ | 766 | */ |
767 | #define GNUNET_MESSAGE_TYPE_SERVICE_UDP_BACK 187 | 767 | #define GNUNET_MESSAGE_TYPE_VPN_SERVICE_UDP_BACK 187 |
768 | 768 | ||
769 | /** | 769 | /** |
770 | * Type of messages containing an TCP packet for a service | 770 | * Type of messages containing an TCP packet for a service |
771 | */ | 771 | */ |
772 | #define GNUNET_MESSAGE_TYPE_SERVICE_TCP 188 | 772 | #define GNUNET_MESSAGE_TYPE_VPN_SERVICE_TCP 188 |
773 | 773 | ||
774 | /** | 774 | /** |
775 | * Type of messages containing an TCP packet from a service | 775 | * Type of messages containing an TCP packet from a service |
776 | */ | 776 | */ |
777 | #define GNUNET_MESSAGE_TYPE_SERVICE_TCP_BACK 189 | 777 | #define GNUNET_MESSAGE_TYPE_VPN_SERVICE_TCP_BACK 189 |
778 | 778 | ||
779 | /** | 779 | /** |
780 | * Type of messages containing an UDP packet for a remote host | 780 | * Type of messages containing an UDP packet for a remote host |
781 | */ | 781 | */ |
782 | #define GNUNET_MESSAGE_TYPE_REMOTE_UDP 190 | 782 | #define GNUNET_MESSAGE_TYPE_VPN_REMOTE_UDP 190 |
783 | 783 | ||
784 | /** | 784 | /** |
785 | * Type of messages containing an UDP packet from a remote host | 785 | * Type of messages containing an UDP packet from a remote host |
786 | */ | 786 | */ |
787 | #define GNUNET_MESSAGE_TYPE_REMOTE_UDP_BACK 191 | 787 | #define GNUNET_MESSAGE_TYPE_VPN_REMOTE_UDP_BACK 191 |
788 | 788 | ||
789 | /** | 789 | /** |
790 | * Type of messages containing an TCP packet for a remote host | 790 | * Type of messages containing an TCP packet for a remote host |
791 | */ | 791 | */ |
792 | #define GNUNET_MESSAGE_TYPE_REMOTE_TCP 192 | 792 | #define GNUNET_MESSAGE_TYPE_VPN_REMOTE_TCP 192 |
793 | 793 | ||
794 | /** | 794 | /** |
795 | * Type of messages containing an TCP packet from a remote host | 795 | * Type of messages containing an TCP packet from a remote host |
796 | */ | 796 | */ |
797 | #define GNUNET_MESSAGE_TYPE_REMOTE_TCP_BACK 193 | 797 | #define GNUNET_MESSAGE_TYPE_VPN_REMOTE_TCP_BACK 193 |
798 | 798 | ||
799 | 799 | ||
800 | /******************************************************************************* | 800 | /******************************************************************************* |
@@ -804,11 +804,11 @@ extern "C" | |||
804 | /** | 804 | /** |
805 | * Type of messages to query the local service-dns | 805 | * Type of messages to query the local service-dns |
806 | */ | 806 | */ |
807 | #define GNUNET_MESSAGE_TYPE_LOCAL_QUERY_DNS 205 | 807 | #define GNUNET_MESSAGE_TYPE_VPN_DNS_LOCAL_QUERY_DNS 205 |
808 | /** | 808 | /** |
809 | * Type of messages the local service-dns responds with | 809 | * Type of messages the local service-dns responds with |
810 | */ | 810 | */ |
811 | #define GNUNET_MESSAGE_TYPE_LOCAL_RESPONSE_DNS 206 | 811 | #define GNUNET_MESSAGE_TYPE_VPN_DNS_LOCAL_RESPONSE_DNS 206 |
812 | /** | 812 | /** |
813 | * Type of messages to instruct the local service-dns to rehijack the dns | 813 | * Type of messages to instruct the local service-dns to rehijack the dns |
814 | */ | 814 | */ |
@@ -816,11 +816,11 @@ extern "C" | |||
816 | /** | 816 | /** |
817 | * Type of messages to send a DNS-query to another peer | 817 | * Type of messages to send a DNS-query to another peer |
818 | */ | 818 | */ |
819 | #define GNUNET_MESSAGE_TYPE_REMOTE_QUERY_DNS 208 | 819 | #define GNUNET_MESSAGE_TYPE_VPN_REMOTE_QUERY_DNS 208 |
820 | /** | 820 | /** |
821 | * Type of messages to send a DNS-answer to another peer | 821 | * Type of messages to send a DNS-answer to another peer |
822 | */ | 822 | */ |
823 | #define GNUNET_MESSAGE_TYPE_REMOTE_ANSWER_DNS 209 | 823 | #define GNUNET_MESSAGE_TYPE_VPN_REMOTE_ANSWER_DNS 209 |
824 | 824 | ||
825 | 825 | ||
826 | 826 | ||
@@ -1059,7 +1059,12 @@ extern "C" | |||
1059 | */ | 1059 | */ |
1060 | #define GNUNET_MESSAGE_TYPE_PEERINFO_NOTIFY 334 | 1060 | #define GNUNET_MESSAGE_TYPE_PEERINFO_NOTIFY 334 |
1061 | 1061 | ||
1062 | 1062 | /******************************************************************************* | |
1063 | * TODO: we need a way to register message types centrally (via some webpage). | ||
1064 | * For now: unofficial extensions should start at 48k, internal extensions | ||
1065 | * define here should leave some room (4-10 additional messages to the previous | ||
1066 | * extension). | ||
1067 | ******************************************************************************/ | ||
1063 | 1068 | ||
1064 | /** | 1069 | /** |
1065 | * Type used to match 'all' message types. | 1070 | * Type used to match 'all' message types. |
diff --git a/src/vpn/gnunet-daemon-exit.c b/src/vpn/gnunet-daemon-exit.c index 19101e6e1..ac07dd4d5 100644 --- a/src/vpn/gnunet-daemon-exit.c +++ b/src/vpn/gnunet-daemon-exit.c | |||
@@ -341,7 +341,7 @@ udp_from_helper (struct udp_pkt *udp, unsigned char *dadr, size_t addrlen) | |||
341 | *ctunnel = tunnel; | 341 | *ctunnel = tunnel; |
342 | msg = (struct GNUNET_MessageHeader*)(ctunnel + 1); | 342 | msg = (struct GNUNET_MessageHeader*)(ctunnel + 1); |
343 | msg->size = htons (len); | 343 | msg->size = htons (len); |
344 | msg->type = htons (state->type == SERVICE ? GNUNET_MESSAGE_TYPE_SERVICE_UDP_BACK : GNUNET_MESSAGE_TYPE_REMOTE_UDP_BACK); | 344 | msg->type = htons (state->type == SERVICE ? GNUNET_MESSAGE_TYPE_VPN_SERVICE_UDP_BACK : GNUNET_MESSAGE_TYPE_VPN_REMOTE_UDP_BACK); |
345 | GNUNET_HashCode *desc = (GNUNET_HashCode *) (msg + 1); | 345 | GNUNET_HashCode *desc = (GNUNET_HashCode *) (msg + 1); |
346 | if (state->type == SERVICE) | 346 | if (state->type == SERVICE) |
347 | memcpy (desc, &state->desc, sizeof (GNUNET_HashCode)); | 347 | memcpy (desc, &state->desc, sizeof (GNUNET_HashCode)); |
@@ -443,7 +443,7 @@ tcp_from_helper (struct tcp_pkt *tcp, unsigned char *dadr, size_t addrlen, | |||
443 | *ctunnel = tunnel; | 443 | *ctunnel = tunnel; |
444 | msg = (struct GNUNET_MessageHeader*)(ctunnel + 1); | 444 | msg = (struct GNUNET_MessageHeader*)(ctunnel + 1); |
445 | msg->size = htons (len); | 445 | msg->size = htons (len); |
446 | msg->type = htons (state->type == SERVICE ? GNUNET_MESSAGE_TYPE_SERVICE_TCP_BACK : GNUNET_MESSAGE_TYPE_REMOTE_TCP_BACK); | 446 | msg->type = htons (state->type == SERVICE ? GNUNET_MESSAGE_TYPE_VPN_SERVICE_TCP_BACK : GNUNET_MESSAGE_TYPE_VPN_REMOTE_TCP_BACK); |
447 | GNUNET_HashCode *desc = (GNUNET_HashCode *) (msg + 1); | 447 | GNUNET_HashCode *desc = (GNUNET_HashCode *) (msg + 1); |
448 | if (state->type == SERVICE) | 448 | if (state->type == SERVICE) |
449 | memcpy (desc, &state->desc, sizeof (GNUNET_HashCode)); | 449 | memcpy (desc, &state->desc, sizeof (GNUNET_HashCode)); |
@@ -1265,8 +1265,8 @@ connect_to_mesh() | |||
1265 | tcp = GNUNET_CONFIGURATION_get_value_yesno(cfg, "exit", "ENABLE_TCP"); | 1265 | tcp = GNUNET_CONFIGURATION_get_value_yesno(cfg, "exit", "ENABLE_TCP"); |
1266 | 1266 | ||
1267 | static struct GNUNET_MESH_MessageHandler handlers[] = { | 1267 | static struct GNUNET_MESH_MessageHandler handlers[] = { |
1268 | {receive_udp_service, GNUNET_MESSAGE_TYPE_SERVICE_UDP, 0}, | 1268 | {receive_udp_service, GNUNET_MESSAGE_TYPE_VPN_SERVICE_UDP, 0}, |
1269 | {receive_tcp_service, GNUNET_MESSAGE_TYPE_SERVICE_TCP, 0}, | 1269 | {receive_tcp_service, GNUNET_MESSAGE_TYPE_VPN_SERVICE_TCP, 0}, |
1270 | {NULL, 0, 0}, | 1270 | {NULL, 0, 0}, |
1271 | {NULL, 0, 0}, | 1271 | {NULL, 0, 0}, |
1272 | {NULL, 0, 0} | 1272 | {NULL, 0, 0} |
@@ -1286,7 +1286,7 @@ connect_to_mesh() | |||
1286 | { | 1286 | { |
1287 | handlers[handler_idx].callback = receive_udp_remote; | 1287 | handlers[handler_idx].callback = receive_udp_remote; |
1288 | handlers[handler_idx].expected_size = 0; | 1288 | handlers[handler_idx].expected_size = 0; |
1289 | handlers[handler_idx].type = GNUNET_MESSAGE_TYPE_REMOTE_UDP; | 1289 | handlers[handler_idx].type = GNUNET_MESSAGE_TYPE_VPN_REMOTE_UDP; |
1290 | apptypes[app_idx] = GNUNET_APPLICATION_TYPE_INTERNET_UDP_GATEWAY; | 1290 | apptypes[app_idx] = GNUNET_APPLICATION_TYPE_INTERNET_UDP_GATEWAY; |
1291 | handler_idx++; | 1291 | handler_idx++; |
1292 | app_idx++; | 1292 | app_idx++; |
@@ -1296,7 +1296,7 @@ connect_to_mesh() | |||
1296 | { | 1296 | { |
1297 | handlers[handler_idx].callback = receive_tcp_remote; | 1297 | handlers[handler_idx].callback = receive_tcp_remote; |
1298 | handlers[handler_idx].expected_size = 0; | 1298 | handlers[handler_idx].expected_size = 0; |
1299 | handlers[handler_idx].type = GNUNET_MESSAGE_TYPE_REMOTE_TCP; | 1299 | handlers[handler_idx].type = GNUNET_MESSAGE_TYPE_VPN_REMOTE_TCP; |
1300 | apptypes[app_idx] = GNUNET_APPLICATION_TYPE_INTERNET_TCP_GATEWAY; | 1300 | apptypes[app_idx] = GNUNET_APPLICATION_TYPE_INTERNET_TCP_GATEWAY; |
1301 | handler_idx++; | 1301 | handler_idx++; |
1302 | app_idx++; | 1302 | app_idx++; |
diff --git a/src/vpn/gnunet-daemon-vpn-dns.c b/src/vpn/gnunet-daemon-vpn-dns.c index 6f319c0f6..6ccef5869 100644 --- a/src/vpn/gnunet-daemon-vpn-dns.c +++ b/src/vpn/gnunet-daemon-vpn-dns.c | |||
@@ -156,7 +156,7 @@ dns_answer_handler(void* cls __attribute__((unused)), const struct GNUNET_Messag | |||
156 | } | 156 | } |
157 | 157 | ||
158 | /* the service did something strange, reconnect immediately */ | 158 | /* the service did something strange, reconnect immediately */ |
159 | if (msg->type != htons(GNUNET_MESSAGE_TYPE_LOCAL_RESPONSE_DNS)) | 159 | if (msg->type != htons(GNUNET_MESSAGE_TYPE_VPN_DNS_LOCAL_RESPONSE_DNS)) |
160 | { | 160 | { |
161 | GNUNET_break (0); | 161 | GNUNET_break (0); |
162 | GNUNET_CLIENT_disconnect(dns_connection, GNUNET_NO); | 162 | GNUNET_CLIENT_disconnect(dns_connection, GNUNET_NO); |
diff --git a/src/vpn/gnunet-daemon-vpn-helper.c b/src/vpn/gnunet-daemon-vpn-helper.c index f99e38ce0..05e2bd081 100644 --- a/src/vpn/gnunet-daemon-vpn-helper.c +++ b/src/vpn/gnunet-daemon-vpn-helper.c | |||
@@ -277,7 +277,7 @@ message_token (void *cls __attribute__((unused)), | |||
277 | || testBit (me->additional_ports, | 277 | || testBit (me->additional_ports, |
278 | ntohs (pkt6_udp->udp_hdr.dpt)))) | 278 | ntohs (pkt6_udp->udp_hdr.dpt)))) |
279 | { | 279 | { |
280 | hdr->type = ntohs (GNUNET_MESSAGE_TYPE_SERVICE_UDP); | 280 | hdr->type = ntohs (GNUNET_MESSAGE_TYPE_VPN_SERVICE_UDP); |
281 | 281 | ||
282 | memcpy (hc + 1, &pkt6_udp->udp_hdr, | 282 | memcpy (hc + 1, &pkt6_udp->udp_hdr, |
283 | ntohs (pkt6_udp->udp_hdr.len)); | 283 | ntohs (pkt6_udp->udp_hdr.len)); |
@@ -289,7 +289,7 @@ message_token (void *cls __attribute__((unused)), | |||
289 | && | 289 | && |
290 | (port_in_ports (me->desc.ports, pkt6_tcp->tcp_hdr.dpt))) | 290 | (port_in_ports (me->desc.ports, pkt6_tcp->tcp_hdr.dpt))) |
291 | { | 291 | { |
292 | hdr->type = ntohs (GNUNET_MESSAGE_TYPE_SERVICE_TCP); | 292 | hdr->type = ntohs (GNUNET_MESSAGE_TYPE_VPN_SERVICE_TCP); |
293 | 293 | ||
294 | memcpy (hc + 1, &pkt6_tcp->tcp_hdr, | 294 | memcpy (hc + 1, &pkt6_tcp->tcp_hdr, |
295 | ntohs (pkt6->ip6_hdr.paylgth)); | 295 | ntohs (pkt6->ip6_hdr.paylgth)); |
@@ -327,7 +327,7 @@ message_token (void *cls __attribute__((unused)), | |||
327 | s->proto= pkt6->ip6_hdr.nxthdr; | 327 | s->proto= pkt6->ip6_hdr.nxthdr; |
328 | if (s->proto == 0x11) | 328 | if (s->proto == 0x11) |
329 | { | 329 | { |
330 | hdr->type = htons(GNUNET_MESSAGE_TYPE_REMOTE_UDP); | 330 | hdr->type = htons(GNUNET_MESSAGE_TYPE_VPN_REMOTE_UDP); |
331 | memcpy (hc + 1, &pkt6_udp->udp_hdr, | 331 | memcpy (hc + 1, &pkt6_udp->udp_hdr, |
332 | ntohs (pkt6_udp->udp_hdr.len)); | 332 | ntohs (pkt6_udp->udp_hdr.len)); |
333 | app_type = GNUNET_APPLICATION_TYPE_INTERNET_UDP_GATEWAY; | 333 | app_type = GNUNET_APPLICATION_TYPE_INTERNET_UDP_GATEWAY; |
@@ -336,7 +336,7 @@ message_token (void *cls __attribute__((unused)), | |||
336 | } | 336 | } |
337 | else if (s->proto == 0x06) | 337 | else if (s->proto == 0x06) |
338 | { | 338 | { |
339 | hdr->type = htons(GNUNET_MESSAGE_TYPE_REMOTE_TCP); | 339 | hdr->type = htons(GNUNET_MESSAGE_TYPE_VPN_REMOTE_TCP); |
340 | memcpy (hc + 1, &pkt6_tcp->tcp_hdr, | 340 | memcpy (hc + 1, &pkt6_tcp->tcp_hdr, |
341 | ntohs (pkt6->ip6_hdr.paylgth)); | 341 | ntohs (pkt6->ip6_hdr.paylgth)); |
342 | app_type = GNUNET_APPLICATION_TYPE_INTERNET_TCP_GATEWAY; | 342 | app_type = GNUNET_APPLICATION_TYPE_INTERNET_TCP_GATEWAY; |
@@ -418,7 +418,7 @@ message_token (void *cls __attribute__((unused)), | |||
418 | 418 | ||
419 | struct query_packet_list *query = | 419 | struct query_packet_list *query = |
420 | GNUNET_malloc (len + 2 * sizeof (struct query_packet_list *)); | 420 | GNUNET_malloc (len + 2 * sizeof (struct query_packet_list *)); |
421 | query->pkt.hdr.type = htons (GNUNET_MESSAGE_TYPE_LOCAL_QUERY_DNS); | 421 | query->pkt.hdr.type = htons (GNUNET_MESSAGE_TYPE_VPN_DNS_LOCAL_QUERY_DNS); |
422 | query->pkt.hdr.size = htons (len); | 422 | query->pkt.hdr.size = htons (len); |
423 | query->pkt.orig_to = pkt->ip_hdr.dadr; | 423 | query->pkt.orig_to = pkt->ip_hdr.dadr; |
424 | query->pkt.orig_from = pkt->ip_hdr.sadr; | 424 | query->pkt.orig_from = pkt->ip_hdr.sadr; |
@@ -487,7 +487,7 @@ message_token (void *cls __attribute__((unused)), | |||
487 | || testBit (me->additional_ports, | 487 | || testBit (me->additional_ports, |
488 | ntohs (pkt_udp->udp_hdr.dpt)))) | 488 | ntohs (pkt_udp->udp_hdr.dpt)))) |
489 | { | 489 | { |
490 | hdr->type = ntohs (GNUNET_MESSAGE_TYPE_SERVICE_UDP); | 490 | hdr->type = ntohs (GNUNET_MESSAGE_TYPE_VPN_SERVICE_UDP); |
491 | 491 | ||
492 | memcpy (hc + 1, &pkt_udp->udp_hdr, | 492 | memcpy (hc + 1, &pkt_udp->udp_hdr, |
493 | ntohs (pkt_udp->udp_hdr.len)); | 493 | ntohs (pkt_udp->udp_hdr.len)); |
@@ -499,7 +499,7 @@ message_token (void *cls __attribute__((unused)), | |||
499 | && | 499 | && |
500 | (port_in_ports (me->desc.ports, pkt_tcp->tcp_hdr.dpt))) | 500 | (port_in_ports (me->desc.ports, pkt_tcp->tcp_hdr.dpt))) |
501 | { | 501 | { |
502 | hdr->type = ntohs (GNUNET_MESSAGE_TYPE_SERVICE_TCP); | 502 | hdr->type = ntohs (GNUNET_MESSAGE_TYPE_VPN_SERVICE_TCP); |
503 | 503 | ||
504 | memcpy (hc + 1, &pkt_tcp->tcp_hdr, | 504 | memcpy (hc + 1, &pkt_tcp->tcp_hdr, |
505 | ntohs (pkt->ip_hdr.tot_lngth) - 4*pkt->ip_hdr.hdr_lngth); | 505 | ntohs (pkt->ip_hdr.tot_lngth) - 4*pkt->ip_hdr.hdr_lngth); |
@@ -537,14 +537,14 @@ message_token (void *cls __attribute__((unused)), | |||
537 | s->proto= pkt->ip_hdr.proto; | 537 | s->proto= pkt->ip_hdr.proto; |
538 | if (s->proto == 0x11) | 538 | if (s->proto == 0x11) |
539 | { | 539 | { |
540 | hdr->type = htons(GNUNET_MESSAGE_TYPE_REMOTE_UDP); | 540 | hdr->type = htons(GNUNET_MESSAGE_TYPE_VPN_REMOTE_UDP); |
541 | memcpy (hc + 1, &pkt_udp->udp_hdr, | 541 | memcpy (hc + 1, &pkt_udp->udp_hdr, |
542 | ntohs (pkt_udp->udp_hdr.len)); | 542 | ntohs (pkt_udp->udp_hdr.len)); |
543 | app_type = GNUNET_APPLICATION_TYPE_INTERNET_UDP_GATEWAY; | 543 | app_type = GNUNET_APPLICATION_TYPE_INTERNET_UDP_GATEWAY; |
544 | } | 544 | } |
545 | else if (s->proto == 0x06) | 545 | else if (s->proto == 0x06) |
546 | { | 546 | { |
547 | hdr->type = htons(GNUNET_MESSAGE_TYPE_REMOTE_TCP); | 547 | hdr->type = htons(GNUNET_MESSAGE_TYPE_VPN_REMOTE_TCP); |
548 | memcpy (hc + 1, &pkt_tcp->tcp_hdr, | 548 | memcpy (hc + 1, &pkt_tcp->tcp_hdr, |
549 | ntohs (pkt->ip_hdr.tot_lngth) - 4*pkt->ip_hdr.hdr_lngth); | 549 | ntohs (pkt->ip_hdr.tot_lngth) - 4*pkt->ip_hdr.hdr_lngth); |
550 | app_type = GNUNET_APPLICATION_TYPE_INTERNET_TCP_GATEWAY; | 550 | app_type = GNUNET_APPLICATION_TYPE_INTERNET_TCP_GATEWAY; |
diff --git a/src/vpn/gnunet-daemon-vpn.c b/src/vpn/gnunet-daemon-vpn.c index 1e1e957d8..15ed379df 100644 --- a/src/vpn/gnunet-daemon-vpn.c +++ b/src/vpn/gnunet-daemon-vpn.c | |||
@@ -812,7 +812,7 @@ receive_udp_back (void *cls | |||
812 | 812 | ||
813 | GNUNET_assert (pkt6 != NULL); | 813 | GNUNET_assert (pkt6 != NULL); |
814 | 814 | ||
815 | if (ntohs (message->type) == GNUNET_MESSAGE_TYPE_SERVICE_UDP_BACK) | 815 | if (ntohs (message->type) == GNUNET_MESSAGE_TYPE_VPN_SERVICE_UDP_BACK) |
816 | new_ip6addr (pkt6->ip6_hdr.sadr, &other->hashPubKey, desc); | 816 | new_ip6addr (pkt6->ip6_hdr.sadr, &other->hashPubKey, desc); |
817 | else | 817 | else |
818 | new_ip6addr_remote (pkt6->ip6_hdr.sadr, s->addr, s->addrlen); | 818 | new_ip6addr_remote (pkt6->ip6_hdr.sadr, s->addr, s->addrlen); |
@@ -857,7 +857,7 @@ receive_udp_back (void *cls | |||
857 | GNUNET_free (key); | 857 | GNUNET_free (key); |
858 | 858 | ||
859 | GNUNET_assert (me != NULL); | 859 | GNUNET_assert (me != NULL); |
860 | if (ntohs (message->type) == GNUNET_MESSAGE_TYPE_SERVICE_UDP_BACK) | 860 | if (ntohs (message->type) == GNUNET_MESSAGE_TYPE_VPN_SERVICE_UDP_BACK) |
861 | { | 861 | { |
862 | GNUNET_assert (me->desc. | 862 | GNUNET_assert (me->desc. |
863 | service_type & htonl (GNUNET_DNS_SERVICE_TYPE_UDP)); | 863 | service_type & htonl (GNUNET_DNS_SERVICE_TYPE_UDP)); |
@@ -897,7 +897,7 @@ receive_udp_back (void *cls | |||
897 | 897 | ||
898 | GNUNET_assert (pkt4 != NULL); | 898 | GNUNET_assert (pkt4 != NULL); |
899 | 899 | ||
900 | GNUNET_assert (ntohs (message->type) == GNUNET_MESSAGE_TYPE_REMOTE_UDP_BACK); | 900 | GNUNET_assert (ntohs (message->type) == GNUNET_MESSAGE_TYPE_VPN_REMOTE_UDP_BACK); |
901 | uint32_t sadr; | 901 | uint32_t sadr; |
902 | new_ip4addr_remote ((unsigned char*)&sadr, s->addr, s->addrlen); | 902 | new_ip4addr_remote ((unsigned char*)&sadr, s->addr, s->addrlen); |
903 | pkt4->ip_hdr.sadr = sadr; | 903 | pkt4->ip_hdr.sadr = sadr; |
@@ -984,7 +984,7 @@ receive_tcp_back (void *cls __attribute__((unused)), struct GNUNET_MESH_Tunnel* | |||
984 | 984 | ||
985 | GNUNET_assert (pkt6 != NULL); | 985 | GNUNET_assert (pkt6 != NULL); |
986 | 986 | ||
987 | if (ntohs (message->type) == GNUNET_MESSAGE_TYPE_SERVICE_TCP_BACK) | 987 | if (ntohs (message->type) == GNUNET_MESSAGE_TYPE_VPN_SERVICE_TCP_BACK) |
988 | new_ip6addr (pkt6->ip6_hdr.sadr, &other->hashPubKey, desc); | 988 | new_ip6addr (pkt6->ip6_hdr.sadr, &other->hashPubKey, desc); |
989 | else | 989 | else |
990 | new_ip6addr_remote (pkt6->ip6_hdr.sadr, s->addr, s->addrlen); | 990 | new_ip6addr_remote (pkt6->ip6_hdr.sadr, s->addr, s->addrlen); |
@@ -1025,7 +1025,7 @@ receive_tcp_back (void *cls __attribute__((unused)), struct GNUNET_MESH_Tunnel* | |||
1025 | GNUNET_free (key); | 1025 | GNUNET_free (key); |
1026 | 1026 | ||
1027 | GNUNET_assert (me != NULL); | 1027 | GNUNET_assert (me != NULL); |
1028 | if (ntohs (message->type) == GNUNET_MESSAGE_TYPE_SERVICE_UDP_BACK) | 1028 | if (ntohs (message->type) == GNUNET_MESSAGE_TYPE_VPN_SERVICE_UDP_BACK) |
1029 | GNUNET_assert (me->desc. | 1029 | GNUNET_assert (me->desc. |
1030 | service_type & htonl (GNUNET_DNS_SERVICE_TYPE_TCP)); | 1030 | service_type & htonl (GNUNET_DNS_SERVICE_TYPE_TCP)); |
1031 | 1031 | ||
@@ -1058,7 +1058,7 @@ receive_tcp_back (void *cls __attribute__((unused)), struct GNUNET_MESH_Tunnel* | |||
1058 | GNUNET_assert (pkt4 != NULL); | 1058 | GNUNET_assert (pkt4 != NULL); |
1059 | memset (pkt4, 0, size); | 1059 | memset (pkt4, 0, size); |
1060 | 1060 | ||
1061 | GNUNET_assert (ntohs (message->type) == GNUNET_MESSAGE_TYPE_REMOTE_TCP_BACK); | 1061 | GNUNET_assert (ntohs (message->type) == GNUNET_MESSAGE_TYPE_VPN_REMOTE_TCP_BACK); |
1062 | uint32_t sadr; | 1062 | uint32_t sadr; |
1063 | new_ip4addr_remote ((unsigned char*)&sadr, s->addr, s->addrlen); | 1063 | new_ip4addr_remote ((unsigned char*)&sadr, s->addr, s->addrlen); |
1064 | pkt4->ip_hdr.sadr = sadr; | 1064 | pkt4->ip_hdr.sadr = sadr; |
@@ -1149,10 +1149,10 @@ run (void *cls, | |||
1149 | const struct GNUNET_CONFIGURATION_Handle *cfg_) | 1149 | const struct GNUNET_CONFIGURATION_Handle *cfg_) |
1150 | { | 1150 | { |
1151 | static const struct GNUNET_MESH_MessageHandler handlers[] = { | 1151 | static const struct GNUNET_MESH_MessageHandler handlers[] = { |
1152 | {receive_udp_back, GNUNET_MESSAGE_TYPE_SERVICE_UDP_BACK, 0}, | 1152 | {receive_udp_back, GNUNET_MESSAGE_TYPE_VPN_SERVICE_UDP_BACK, 0}, |
1153 | {receive_tcp_back, GNUNET_MESSAGE_TYPE_SERVICE_TCP_BACK, 0}, | 1153 | {receive_tcp_back, GNUNET_MESSAGE_TYPE_VPN_SERVICE_TCP_BACK, 0}, |
1154 | {receive_udp_back, GNUNET_MESSAGE_TYPE_REMOTE_UDP_BACK, 0}, | 1154 | {receive_udp_back, GNUNET_MESSAGE_TYPE_VPN_REMOTE_UDP_BACK, 0}, |
1155 | {receive_tcp_back, GNUNET_MESSAGE_TYPE_REMOTE_TCP_BACK, 0}, | 1155 | {receive_tcp_back, GNUNET_MESSAGE_TYPE_VPN_REMOTE_TCP_BACK, 0}, |
1156 | {NULL, 0, 0} | 1156 | {NULL, 0, 0} |
1157 | }; | 1157 | }; |
1158 | 1158 | ||
diff --git a/src/vpn/gnunet-service-dns.c b/src/vpn/gnunet-service-dns.c index 351e6671a..fca21ee4d 100644 --- a/src/vpn/gnunet-service-dns.c +++ b/src/vpn/gnunet-service-dns.c | |||
@@ -226,7 +226,7 @@ mesh_send_response (void *cls, size_t size, void *buf) | |||
226 | uint32_t *sz = cls; | 226 | uint32_t *sz = cls; |
227 | struct GNUNET_MESH_Tunnel **tunnel = (struct GNUNET_MESH_Tunnel**)(sz+1); | 227 | struct GNUNET_MESH_Tunnel **tunnel = (struct GNUNET_MESH_Tunnel**)(sz+1); |
228 | struct dns_pkt *dns = (struct dns_pkt *) (tunnel + 1); | 228 | struct dns_pkt *dns = (struct dns_pkt *) (tunnel + 1); |
229 | hdr->type = htons (GNUNET_MESSAGE_TYPE_REMOTE_ANSWER_DNS); | 229 | hdr->type = htons (GNUNET_MESSAGE_TYPE_VPN_REMOTE_ANSWER_DNS); |
230 | hdr->size = htons (*sz + sizeof (struct GNUNET_MessageHeader)); | 230 | hdr->size = htons (*sz + sizeof (struct GNUNET_MessageHeader)); |
231 | 231 | ||
232 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 232 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -426,7 +426,7 @@ receive_mesh_answer (void *cls __attribute__((unused)), | |||
426 | GNUNET_malloc (len + 2 * sizeof (struct answer_packet_list *)); | 426 | GNUNET_malloc (len + 2 * sizeof (struct answer_packet_list *)); |
427 | memset (answer, 0, len + 2 * sizeof (struct answer_packet_list *)); | 427 | memset (answer, 0, len + 2 * sizeof (struct answer_packet_list *)); |
428 | 428 | ||
429 | answer->pkt.hdr.type = htons (GNUNET_MESSAGE_TYPE_LOCAL_RESPONSE_DNS); | 429 | answer->pkt.hdr.type = htons (GNUNET_MESSAGE_TYPE_VPN_DNS_LOCAL_RESPONSE_DNS); |
430 | answer->pkt.hdr.size = htons (len); | 430 | answer->pkt.hdr.size = htons (len); |
431 | 431 | ||
432 | struct dns_pkt_parsed* pdns = parse_dns_packet(dns); | 432 | struct dns_pkt_parsed* pdns = parse_dns_packet(dns); |
@@ -541,7 +541,7 @@ send_rev_query(void * cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { | |||
541 | struct answer_packet_list* answer = GNUNET_malloc(len + 2*sizeof(struct answer_packet_list*)); | 541 | struct answer_packet_list* answer = GNUNET_malloc(len + 2*sizeof(struct answer_packet_list*)); |
542 | memset(answer, 0, len + 2*sizeof(struct answer_packet_list*)); | 542 | memset(answer, 0, len + 2*sizeof(struct answer_packet_list*)); |
543 | 543 | ||
544 | answer->pkt.hdr.type = htons(GNUNET_MESSAGE_TYPE_LOCAL_RESPONSE_DNS); | 544 | answer->pkt.hdr.type = htons(GNUNET_MESSAGE_TYPE_VPN_DNS_LOCAL_RESPONSE_DNS); |
545 | answer->pkt.hdr.size = htons(len); | 545 | answer->pkt.hdr.size = htons(len); |
546 | answer->pkt.subtype = GNUNET_DNS_ANSWER_TYPE_REV; | 546 | answer->pkt.subtype = GNUNET_DNS_ANSWER_TYPE_REV; |
547 | 547 | ||
@@ -633,7 +633,7 @@ receive_dht(void *cls, | |||
633 | struct answer_packet_list* answer = GNUNET_malloc(len + 2*sizeof(struct answer_packet_list*)); | 633 | struct answer_packet_list* answer = GNUNET_malloc(len + 2*sizeof(struct answer_packet_list*)); |
634 | memset(answer, 0, len + 2*sizeof(struct answer_packet_list*)); | 634 | memset(answer, 0, len + 2*sizeof(struct answer_packet_list*)); |
635 | 635 | ||
636 | answer->pkt.hdr.type = htons(GNUNET_MESSAGE_TYPE_LOCAL_RESPONSE_DNS); | 636 | answer->pkt.hdr.type = htons(GNUNET_MESSAGE_TYPE_VPN_DNS_LOCAL_RESPONSE_DNS); |
637 | answer->pkt.hdr.size = htons(len); | 637 | answer->pkt.hdr.size = htons(len); |
638 | answer->pkt.subtype = GNUNET_DNS_ANSWER_TYPE_SERVICE; | 638 | answer->pkt.subtype = GNUNET_DNS_ANSWER_TYPE_SERVICE; |
639 | 639 | ||
@@ -851,7 +851,7 @@ receive_query(void *cls __attribute__((unused)), | |||
851 | struct tunnel_cls *cls_ = GNUNET_malloc(size); | 851 | struct tunnel_cls *cls_ = GNUNET_malloc(size); |
852 | cls_->hdr.size = size - sizeof(struct GNUNET_MESH_Tunnel*); | 852 | cls_->hdr.size = size - sizeof(struct GNUNET_MESH_Tunnel*); |
853 | 853 | ||
854 | cls_->hdr.type = ntohs(GNUNET_MESSAGE_TYPE_REMOTE_QUERY_DNS); | 854 | cls_->hdr.type = ntohs(GNUNET_MESSAGE_TYPE_VPN_REMOTE_QUERY_DNS); |
855 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "size: %d\n", size); | 855 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "size: %d\n", size); |
856 | 856 | ||
857 | memcpy(&cls_->dns, dns, cls_->hdr.size - sizeof(struct GNUNET_MessageHeader)); | 857 | memcpy(&cls_->dns, dns, cls_->hdr.size - sizeof(struct GNUNET_MessageHeader)); |
@@ -1020,7 +1020,7 @@ read_response (void *cls | |||
1020 | struct answer_packet_list *answer = | 1020 | struct answer_packet_list *answer = |
1021 | GNUNET_malloc (len + 2 * sizeof (struct answer_packet_list *)); | 1021 | GNUNET_malloc (len + 2 * sizeof (struct answer_packet_list *)); |
1022 | answer->pkt.hdr.type = | 1022 | answer->pkt.hdr.type = |
1023 | htons (GNUNET_MESSAGE_TYPE_LOCAL_RESPONSE_DNS); | 1023 | htons (GNUNET_MESSAGE_TYPE_VPN_DNS_LOCAL_RESPONSE_DNS); |
1024 | answer->pkt.hdr.size = htons (len); | 1024 | answer->pkt.hdr.size = htons (len); |
1025 | answer->pkt.subtype = GNUNET_DNS_ANSWER_TYPE_IP; | 1025 | answer->pkt.subtype = GNUNET_DNS_ANSWER_TYPE_IP; |
1026 | answer->pkt.from = addr.sin_addr.s_addr; | 1026 | answer->pkt.from = addr.sin_addr.s_addr; |
@@ -1287,15 +1287,15 @@ run (void *cls, | |||
1287 | { | 1287 | { |
1288 | static const struct GNUNET_SERVER_MessageHandler handlers[] = { | 1288 | static const struct GNUNET_SERVER_MessageHandler handlers[] = { |
1289 | /* callback, cls, type, size */ | 1289 | /* callback, cls, type, size */ |
1290 | {&receive_query, NULL, GNUNET_MESSAGE_TYPE_LOCAL_QUERY_DNS, 0}, | 1290 | {&receive_query, NULL, GNUNET_MESSAGE_TYPE_VPN_DNS_LOCAL_QUERY_DNS, 0}, |
1291 | {&rehijack, NULL, GNUNET_MESSAGE_TYPE_REHIJACK, | 1291 | {&rehijack, NULL, GNUNET_MESSAGE_TYPE_REHIJACK, |
1292 | sizeof (struct GNUNET_MessageHeader)}, | 1292 | sizeof (struct GNUNET_MessageHeader)}, |
1293 | {NULL, NULL, 0, 0} | 1293 | {NULL, NULL, 0, 0} |
1294 | }; | 1294 | }; |
1295 | 1295 | ||
1296 | static const struct GNUNET_MESH_MessageHandler mesh_handlers[] = { | 1296 | static const struct GNUNET_MESH_MessageHandler mesh_handlers[] = { |
1297 | {receive_mesh_query, GNUNET_MESSAGE_TYPE_REMOTE_QUERY_DNS, 0}, | 1297 | {receive_mesh_query, GNUNET_MESSAGE_TYPE_VPN_REMOTE_QUERY_DNS, 0}, |
1298 | {receive_mesh_answer, GNUNET_MESSAGE_TYPE_REMOTE_ANSWER_DNS, 0}, | 1298 | {receive_mesh_answer, GNUNET_MESSAGE_TYPE_VPN_REMOTE_ANSWER_DNS, 0}, |
1299 | {NULL, 0, 0} | 1299 | {NULL, 0, 0} |
1300 | }; | 1300 | }; |
1301 | 1301 | ||