2 This file is part of GNUnet.
3 (C) 2010, 2012 Christian Grothoff
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
22 * @file pt/gnunet-daemon-pt.c
23 * @brief tool to manipulate DNS and VPN services to perform protocol translation (IPvX over GNUnet)
24 * @author Christian Grothoff
27 #include "gnunet_util_lib.h"
28 #include "gnunet_dns_service.h"
29 #include "gnunet_dnsparser_lib.h"
30 #include "gnunet_mesh_service.h"
31 #include "gnunet_tun_lib.h"
32 #include "gnunet_dht_service.h"
33 #include "gnunet_vpn_service.h"
34 #include "gnunet_statistics_service.h"
35 #include "gnunet_applications.h"
36 #include "block_dns.h"
38 #define PORT_PT 4242 // FIXME
42 * After how long do we time out if we could not get an IP from VPN or MESH?
44 #define TIMEOUT GNUNET_TIME_UNIT_MINUTES
48 * How many bytes of payload do we allow at most for a DNS reply?
49 * Given that this is pretty much limited to loopback, we can be
50 * pretty high (Linux loopback defaults to 16k, most local UDP packets
51 * should survive up to 9k (NFS), so 8k should be pretty safe in
54 #define MAX_DNS_SIZE (8 * 1024)
58 * Which group of DNS records are we currently processing?
68 * DNS authority records
70 AUTHORITY_RECORDS = 1,
73 * DNS additional records
75 ADDITIONAL_RECORDS = 2,
78 * We're done processing.
85 * Information tracked per DNS reply that we are processing.
90 * Handle to submit the final result.
92 struct GNUNET_DNS_RequestHandle *rh;
95 * DNS packet that is being modified.
97 struct GNUNET_DNSPARSER_Packet *dns;
100 * Active redirection request with the VPN.
102 struct GNUNET_VPN_RedirectionRequest *rr;
105 * Record for which we have an active redirection request.
107 struct GNUNET_DNSPARSER_Record *rec;
110 * Offset in the current record group that is being modified.
115 * Group that is being modified
117 enum RequestGroup group;
123 * State we keep for a request that is going out via MESH.
125 struct RequestContext
128 * We keep these in a DLL.
130 struct RequestContext *next;
133 * We keep these in a DLL.
135 struct RequestContext *prev;
138 * Handle for interaction with DNS service.
140 struct GNUNET_DNS_RequestHandle *rh;
143 * Message we're sending out via MESH, allocated at the
144 * end of this struct.
146 const struct GNUNET_MessageHeader *mesh_message;
149 * Task used to abort this operation with timeout.
151 GNUNET_SCHEDULER_TaskIdentifier timeout_task;
154 * ID of the original DNS request (used to match the reply).
159 * #GNUNET_NO if this request is still in the transmit_queue,
160 * #GNUNET_YES if we are in the receive_queue.
162 int16_t was_transmitted;
168 * The handle to the configuration used throughout the process
170 static const struct GNUNET_CONFIGURATION_Handle *cfg;
173 * The handle to the VPN
175 static struct GNUNET_VPN_Handle *vpn_handle;
178 * The handle to the MESH service
180 static struct GNUNET_MESH_Handle *mesh_handle;
183 * Tunnel we use for DNS requests over MESH.
184 * FIXME: we might want to keep multiple tunnels open
187 static struct GNUNET_MESH_Tunnel *mesh_tunnel;
190 * Active transmission request with MESH (or NULL).
192 static struct GNUNET_MESH_TransmitHandle *mesh_th;
195 * Head of DLL of requests to be transmitted to mesh_tunnel.
197 static struct RequestContext *transmit_queue_head;
200 * Tail of DLL of requests to be transmitted to mesh_tunnel.
202 static struct RequestContext *transmit_queue_tail;
205 * Head of DLL of requests waiting for a response.
207 static struct RequestContext *receive_queue_head;
210 * Tail of DLL of requests waiting for a response.
212 static struct RequestContext *receive_queue_tail;
217 static struct GNUNET_STATISTICS_Handle *stats;
220 * The handle to DNS post-resolution modifications.
222 static struct GNUNET_DNS_Handle *dns_post_handle;
225 * The handle to DNS pre-resolution modifications.
227 static struct GNUNET_DNS_Handle *dns_pre_handle;
230 * Handle to access the DHT.
232 static struct GNUNET_DHT_Handle *dht;
235 * Our DHT GET operation to find DNS exits.
237 static struct GNUNET_DHT_GetHandle *dht_get;
240 * Are we doing IPv4-pt?
245 * Are we doing IPv6-pt?
250 * Are we tunneling DNS queries?
252 static int dns_tunnel;
255 * Number of DNS exit peers we currently have in the mesh tunnel.
256 * Used to see if using the mesh tunnel makes any sense right now.
258 static unsigned int dns_exit_available;
262 * We're done modifying all records in the response. Submit the reply
263 * and free the resources of the rc.
265 * @param rc context to process
268 finish_request (struct ReplyContext *rc)
274 GNUNET_DNSPARSER_pack (rc->dns,
279 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
280 _("Failed to pack DNS request. Dropping.\n"));
281 GNUNET_DNS_request_drop (rc->rh);
285 GNUNET_STATISTICS_update (stats,
286 gettext_noop ("# DNS requests mapped to VPN"),
288 GNUNET_DNS_request_answer (rc->rh,
292 GNUNET_DNSPARSER_free_packet (rc->dns);
298 * Process the next record of the given request context.
299 * When done, submit the reply and free the resources of
302 * @param rc context to process
305 submit_request (struct ReplyContext *rc);
309 * Callback invoked from the VPN service once a redirection is
310 * available. Provides the IP address that can now be used to
311 * reach the requested destination. We substitute the active
312 * record and then continue with 'submit_request' to look at
315 * @param cls our 'struct ReplyContext'
316 * @param af address family, AF_INET or AF_INET6; AF_UNSPEC on error;
317 * will match 'result_af' from the request
318 * @param address IP address (struct in_addr or struct in_addr6, depending on 'af')
319 * that the VPN allocated for the redirection;
320 * traffic to this IP will now be redirected to the
321 * specified target peer; NULL on error
324 vpn_allocation_callback (void *cls,
328 struct ReplyContext *rc = cls;
333 GNUNET_DNS_request_drop (rc->rh);
334 GNUNET_DNSPARSER_free_packet (rc->dns);
338 GNUNET_STATISTICS_update (stats,
339 gettext_noop ("# DNS records modified"),
341 switch (rc->rec->type)
343 case GNUNET_DNSPARSER_TYPE_A:
344 GNUNET_assert (AF_INET == af);
345 memcpy (rc->rec->data.raw.data, address, sizeof (struct in_addr));
347 case GNUNET_DNSPARSER_TYPE_AAAA:
348 GNUNET_assert (AF_INET6 == af);
349 memcpy (rc->rec->data.raw.data, address, sizeof (struct in6_addr));
361 * Modify the given DNS record by asking VPN to create a tunnel
362 * to the given address. When done, continue with submitting
363 * other records from the request context ('submit_request' is
366 * @param rc context to process
367 * @param rec record to modify
370 modify_address (struct ReplyContext *rc,
371 struct GNUNET_DNSPARSER_Record *rec)
377 case GNUNET_DNSPARSER_TYPE_A:
379 GNUNET_assert (rec->data.raw.data_len == sizeof (struct in_addr));
381 case GNUNET_DNSPARSER_TYPE_AAAA:
383 GNUNET_assert (rec->data.raw.data_len == sizeof (struct in6_addr));
390 rc->rr = GNUNET_VPN_redirect_to_ip (vpn_handle,
394 GNUNET_TIME_relative_to_absolute (TIMEOUT),
395 &vpn_allocation_callback,
401 * Process the next record of the given request context.
402 * When done, submit the reply and free the resources of
405 * @param rc context to process
408 submit_request (struct ReplyContext *rc)
410 struct GNUNET_DNSPARSER_Record *ra;
419 ra = rc->dns->answers;
420 ra_len = rc->dns->num_answers;
422 case AUTHORITY_RECORDS:
423 ra = rc->dns->authority_records;
424 ra_len = rc->dns->num_authority_records;
426 case ADDITIONAL_RECORDS:
427 ra = rc->dns->additional_records;
428 ra_len = rc->dns->num_additional_records;
436 for (i=rc->offset;i<ra_len;i++)
440 case GNUNET_DNSPARSER_TYPE_A:
444 modify_address (rc, &ra[i]);
448 case GNUNET_DNSPARSER_TYPE_AAAA:
452 modify_address (rc, &ra[i]);
464 * Test if any of the given records need protocol-translation work.
466 * @param ra array of records
467 * @param ra_len number of entries in ra
468 * @return GNUNET_YES if any of the given records require protocol-translation
471 work_test (const struct GNUNET_DNSPARSER_Record *ra,
476 for (i=0;i<ra_len;i++)
480 case GNUNET_DNSPARSER_TYPE_A:
484 case GNUNET_DNSPARSER_TYPE_AAAA:
495 * This function is called AFTER we got an IP address for a
496 * DNS request. Now, the PT daemon has the chance to substitute
497 * the IP address with one from the VPN range to tunnel requests
498 * destined for this IP address via VPN and MESH.
501 * @param rh request handle to user for reply
502 * @param request_length number of bytes in request
503 * @param request udp payload of the DNS request
506 dns_post_request_handler (void *cls,
507 struct GNUNET_DNS_RequestHandle *rh,
508 size_t request_length,
511 struct GNUNET_DNSPARSER_Packet *dns;
512 struct ReplyContext *rc;
515 GNUNET_STATISTICS_update (stats,
516 gettext_noop ("# DNS replies intercepted"),
518 dns = GNUNET_DNSPARSER_parse (request, request_length);
521 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
522 _("Failed to parse DNS request. Dropping.\n"));
523 GNUNET_DNS_request_drop (rh);
527 work |= work_test (dns->answers, dns->num_answers);
528 work |= work_test (dns->authority_records, dns->num_authority_records);
529 work |= work_test (dns->additional_records, dns->num_additional_records);
532 GNUNET_DNS_request_forward (rh);
533 GNUNET_DNSPARSER_free_packet (dns);
536 rc = GNUNET_new (struct ReplyContext);
546 * Transmit a DNS request via MESH and move the request
547 * handle to the receive queue.
550 * @param size number of bytes available in buf
551 * @param buf where to copy the message
552 * @return number of bytes written to buf
555 transmit_dns_request_to_mesh (void *cls,
559 struct RequestContext *rc;
563 if (NULL == (rc = transmit_queue_head))
565 mlen = ntohs (rc->mesh_message->size);
568 mesh_th = GNUNET_MESH_notify_transmit_ready (mesh_tunnel,
572 &transmit_dns_request_to_mesh,
576 GNUNET_assert (GNUNET_NO == rc->was_transmitted);
577 memcpy (buf, rc->mesh_message, mlen);
578 GNUNET_CONTAINER_DLL_remove (transmit_queue_head,
581 rc->was_transmitted = GNUNET_YES;
582 GNUNET_CONTAINER_DLL_insert (receive_queue_head,
585 rc = transmit_queue_head;
587 mesh_th = GNUNET_MESH_notify_transmit_ready (mesh_tunnel,
590 ntohs (rc->mesh_message->size),
591 &transmit_dns_request_to_mesh,
598 * Task run if the time to answer a DNS request via MESH is over.
600 * @param cls the 'struct RequestContext' to abort
601 * @param tc scheduler context
604 timeout_request (void *cls,
605 const struct GNUNET_SCHEDULER_TaskContext *tc)
607 struct RequestContext *rc = cls;
609 if (rc->was_transmitted)
610 GNUNET_CONTAINER_DLL_remove (receive_queue_head,
614 GNUNET_CONTAINER_DLL_remove (transmit_queue_head,
617 GNUNET_STATISTICS_update (stats,
618 gettext_noop ("# DNS requests dropped (timeout)"),
620 GNUNET_DNS_request_drop (rc->rh);
626 * This function is called *before* the DNS request has been
627 * given to a "local" DNS resolver. Tunneling for DNS requests
628 * was enabled, so we now need to send the request via some MESH
629 * tunnel to a DNS EXIT for resolution.
632 * @param rh request handle to user for reply
633 * @param request_length number of bytes in request
634 * @param request udp payload of the DNS request
637 dns_pre_request_handler (void *cls,
638 struct GNUNET_DNS_RequestHandle *rh,
639 size_t request_length,
642 struct RequestContext *rc;
644 struct GNUNET_MessageHeader hdr;
645 struct GNUNET_TUN_DnsHeader dns;
647 GNUNET_STATISTICS_update (stats,
648 gettext_noop ("# DNS requests intercepted"),
650 if (0 == dns_exit_available)
652 GNUNET_STATISTICS_update (stats,
653 gettext_noop ("# DNS requests dropped (DNS mesh tunnel down)"),
655 GNUNET_DNS_request_drop (rh);
658 if (request_length < sizeof (dns))
660 GNUNET_STATISTICS_update (stats,
661 gettext_noop ("# DNS requests dropped (malformed)"),
663 GNUNET_DNS_request_drop (rh);
666 memcpy (&dns, request, sizeof (dns));
667 GNUNET_assert (NULL != mesh_tunnel);
668 mlen = sizeof (struct GNUNET_MessageHeader) + request_length;
669 rc = GNUNET_malloc (sizeof (struct RequestContext) + mlen);
671 rc->mesh_message = (const struct GNUNET_MessageHeader*) &rc[1];
672 rc->timeout_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
676 hdr.type = htons (GNUNET_MESSAGE_TYPE_VPN_DNS_TO_INTERNET);
677 hdr.size = htons (mlen);
678 memcpy (&rc[1], &hdr, sizeof (struct GNUNET_MessageHeader));
679 memcpy (&(((char*)&rc[1])[sizeof (struct GNUNET_MessageHeader)]),
682 GNUNET_CONTAINER_DLL_insert_tail (transmit_queue_head,
686 mesh_th = GNUNET_MESH_notify_transmit_ready (mesh_tunnel,
690 &transmit_dns_request_to_mesh,
696 * Process a request via mesh to perform a DNS query.
698 * @param cls closure, NULL
699 * @param tunnel connection to the other end
700 * @param tunnel_ctx pointer to our 'struct TunnelState *'
701 * @param message the actual message
703 * @return GNUNET_OK to keep the connection open,
704 * GNUNET_SYSERR to close it (signal serious error)
707 receive_dns_response (void *cls GNUNET_UNUSED, struct GNUNET_MESH_Tunnel *tunnel,
709 const struct GNUNET_MessageHeader *message)
711 struct GNUNET_TUN_DnsHeader dns;
713 struct RequestContext *rc;
715 mlen = ntohs (message->size);
716 mlen -= sizeof (struct GNUNET_MessageHeader);
717 if (mlen < sizeof (struct GNUNET_TUN_DnsHeader))
720 return GNUNET_SYSERR;
722 memcpy (&dns, &message[1], sizeof (dns));
723 for (rc = receive_queue_head; NULL != rc; rc = rc->next)
725 GNUNET_assert (GNUNET_YES == rc->was_transmitted);
726 if (dns.id == rc->dns_id)
728 GNUNET_STATISTICS_update (stats,
729 gettext_noop ("# DNS replies received"),
731 GNUNET_DNS_request_answer (rc->rh,
733 (const void*) &message[1]);
734 GNUNET_CONTAINER_DLL_remove (receive_queue_head,
737 GNUNET_SCHEDULER_cancel (rc->timeout_task);
742 GNUNET_STATISTICS_update (stats,
743 gettext_noop ("# DNS replies dropped (too late?)"),
750 * The MESH DNS tunnel went down. Abort all pending DNS
751 * requests (we're unlikely to get an answer in time).
754 abort_all_requests ()
756 struct RequestContext *rc;
758 while (NULL != (rc = receive_queue_head))
760 GNUNET_STATISTICS_update (stats,
761 gettext_noop ("# DNS requests aborted (tunnel down)"),
763 GNUNET_CONTAINER_DLL_remove (receive_queue_head,
766 GNUNET_DNS_request_drop (rc->rh);
767 GNUNET_SCHEDULER_cancel (rc->timeout_task);
770 while (NULL != (rc = transmit_queue_head))
772 GNUNET_STATISTICS_update (stats,
773 gettext_noop ("# DNS requests aborted (tunnel down)"),
775 GNUNET_CONTAINER_DLL_remove (transmit_queue_head,
778 GNUNET_DNS_request_drop (rc->rh);
779 GNUNET_SCHEDULER_cancel (rc->timeout_task);
786 * Function scheduled as very last function, cleans up after us
788 * @param cls closure, NULL
789 * @param tskctx scheduler context, unused
793 const struct GNUNET_SCHEDULER_TaskContext *tskctx)
795 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
796 "Protocol translation daemon is shutting down now\n");
797 if (NULL != vpn_handle)
799 GNUNET_VPN_disconnect (vpn_handle);
804 GNUNET_MESH_notify_transmit_ready_cancel (mesh_th);
807 if (NULL != mesh_tunnel)
809 GNUNET_MESH_tunnel_destroy (mesh_tunnel);
812 if (NULL != mesh_handle)
814 GNUNET_MESH_disconnect (mesh_handle);
817 abort_all_requests ();
818 if (NULL != dns_post_handle)
820 GNUNET_DNS_disconnect (dns_post_handle);
821 dns_post_handle = NULL;
823 if (NULL != dns_pre_handle)
825 GNUNET_DNS_disconnect (dns_pre_handle);
826 dns_pre_handle = NULL;
830 GNUNET_STATISTICS_destroy (stats, GNUNET_YES);
835 GNUNET_DHT_get_stop (dht_get);
840 GNUNET_DHT_disconnect (dht);
848 * Function called whenever a tunnel is destroyed. Should clean up
849 * the associated state and attempt to build a new one.
851 * It must NOT call #GNUNET_MESH_tunnel_destroy on the tunnel.
853 * @param cls closure (set from #GNUNET_MESH_connect)
854 * @param tunnel connection to the other end (henceforth invalid)
855 * @param tunnel_ctx place where local state associated
856 * with the tunnel is stored
859 mesh_tunnel_end_cb (void *cls,
860 const struct GNUNET_MESH_Tunnel *tunnel,
863 // FIXME: do cleanup here!
868 * Function called whenever we find an advertisement for a
869 * DNS exit in the DHT. If we don't have a mesh tunnel,
870 * we should build one; otherwise, we should save the
871 * advertisement for later use.
874 * @param exp when will this value expire
875 * @param key key of the result
876 * @param get_path peers on reply path (or NULL if not recorded)
877 * [0] = datastore's first neighbor, [length - 1] = local peer
878 * @param get_path_length number of entries in @a get_path
879 * @param put_path peers on the PUT path (or NULL if not recorded)
880 * [0] = origin, [length - 1] = datastore
881 * @param put_path_length number of entries in @a put_path
882 * @param type type of the result
883 * @param size number of bytes in @a data
884 * @param data pointer to the result data
887 handle_dht_result (void *cls,
888 struct GNUNET_TIME_Absolute exp,
889 const struct GNUNET_HashCode *key,
890 const struct GNUNET_PeerIdentity *get_path,
891 unsigned int get_path_length,
892 const struct GNUNET_PeerIdentity *put_path,
893 unsigned int put_path_length,
894 enum GNUNET_BLOCK_Type type,
895 size_t size, const void *data)
897 const struct GNUNET_DNS_Advertisement *ad;
898 struct GNUNET_PeerIdentity pid;
900 if (sizeof (struct GNUNET_DNS_Advertisement) != size)
906 GNUNET_CRYPTO_hash (&ad->peer,
907 sizeof (struct GNUNET_CRYPTO_EccPublicSignKey),
909 /* FIXME: decide between creating more mesh tunnels and
910 just remembering the peer ID */
911 mesh_tunnel = GNUNET_MESH_tunnel_create (mesh_handle,
912 NULL /* FIXME: tunnel ctx */,
914 PORT_PT, /* FIXME: DNS port, right? */
915 GNUNET_YES /* no buffer */,
916 GNUNET_NO /* reliable */);
922 * @brief Main function that will be run by the scheduler.
925 * @param args remaining command-line arguments
926 * @param cfgfile name of the configuration file used (for saving, can be NULL!)
927 * @param cfg_ configuration
930 run (void *cls, char *const *args GNUNET_UNUSED,
931 const char *cfgfile GNUNET_UNUSED,
932 const struct GNUNET_CONFIGURATION_Handle *cfg_)
934 struct GNUNET_HashCode dns_key;
937 stats = GNUNET_STATISTICS_create ("pt", cfg);
938 ipv4_pt = GNUNET_CONFIGURATION_get_value_yesno (cfg, "pt", "TUNNEL_IPV4");
939 ipv6_pt = GNUNET_CONFIGURATION_get_value_yesno (cfg, "pt", "TUNNEL_IPV6");
940 dns_tunnel = GNUNET_CONFIGURATION_get_value_yesno (cfg, "pt", "TUNNEL_DNS");
941 if (! (ipv4_pt || ipv6_pt || dns_tunnel))
943 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
944 _("No useful service enabled. Exiting.\n"));
945 GNUNET_SCHEDULER_shutdown ();
948 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &cleanup, cls);
949 if (ipv4_pt || ipv6_pt)
952 = GNUNET_DNS_connect (cfg,
953 GNUNET_DNS_FLAG_POST_RESOLUTION,
954 &dns_post_request_handler, NULL);
955 if (NULL == dns_post_handle)
957 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
958 _("Failed to connect to %s service. Exiting.\n"),
960 GNUNET_SCHEDULER_shutdown ();
963 vpn_handle = GNUNET_VPN_connect (cfg);
964 if (NULL == vpn_handle)
966 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
967 _("Failed to connect to %s service. Exiting.\n"),
969 GNUNET_SCHEDULER_shutdown ();
975 static struct GNUNET_MESH_MessageHandler mesh_handlers[] = {
976 {&receive_dns_response, GNUNET_MESSAGE_TYPE_VPN_DNS_FROM_INTERNET, 0},
981 = GNUNET_DNS_connect (cfg,
982 GNUNET_DNS_FLAG_PRE_RESOLUTION,
983 &dns_pre_request_handler, NULL);
984 if (NULL == dns_pre_handle)
986 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
987 _("Failed to connect to %s service. Exiting.\n"),
989 GNUNET_SCHEDULER_shutdown ();
992 mesh_handle = GNUNET_MESH_connect (cfg, NULL, NULL,
994 mesh_handlers, NULL);
995 if (NULL == mesh_handle)
997 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
998 _("Failed to connect to %s service. Exiting.\n"),
1000 GNUNET_SCHEDULER_shutdown ();
1003 dht = GNUNET_DHT_connect (cfg, 1);
1006 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1007 _("Failed to connect to %s service. Exiting.\n"),
1009 GNUNET_SCHEDULER_shutdown ();
1012 GNUNET_CRYPTO_hash ("dns", strlen ("dns"), &dns_key);
1013 dht_get = GNUNET_DHT_get_start (dht,
1014 GNUNET_BLOCK_TYPE_DNS,
1017 GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE,
1019 &handle_dht_result, NULL);
1027 * @param argc number of arguments from the command line
1028 * @param argv command line arguments
1029 * @return 0 ok, 1 on error
1032 main (int argc, char *const *argv)
1034 static const struct GNUNET_GETOPT_CommandLineOption options[] = {
1035 GNUNET_GETOPT_OPTION_END
1039 if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
1042 GNUNET_PROGRAM_run (argc, argv, "gnunet-daemon-pt",
1044 ("Daemon to run to perform IP protocol translation to GNUnet"),
1045 options, &run, NULL)) ? 0 : 1;
1046 GNUNET_free ((void*) argv);
1051 /* end of gnunet-daemon-pt.c */