2 This file is part of GNUnet.
3 (C) 2009 Christian Grothoff (and other contributing authors)
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 2, 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 util/resolver_api.c
23 * @brief resolver for writing a tool
24 * @author Christian Grothoff
27 #include "gnunet_getopt_lib.h"
28 #include "gnunet_os_lib.h"
29 #include "gnunet_client_lib.h"
30 #include "gnunet_container_lib.h"
31 #include "gnunet_protocols.h"
32 #include "gnunet_resolver_service.h"
33 #include "gnunet_server_lib.h"
37 * Maximum supported length for a hostname
39 #define MAX_HOSTNAME 1024
43 * Possible hostnames for "loopback".
45 static const char *loopback[] = {
55 static const struct GNUNET_CONFIGURATION_Handle *cfg;
58 * Our connection to the resolver service, created on-demand, but then
59 * persists until error or shutdown.
61 static struct GNUNET_CLIENT_Connection *client;
64 * Head of DLL of requests.
66 static struct GNUNET_RESOLVER_RequestHandle *req_head;
69 * Tail of DLL of requests.
71 static struct GNUNET_RESOLVER_RequestHandle *req_tail;
74 * How long should we wait to reconnect?
76 static struct GNUNET_TIME_Relative backoff;
79 * Task for reconnecting.
81 static GNUNET_SCHEDULER_TaskIdentifier r_task;
84 * Task ID of shutdown task; only present while we have a
85 * connection to the resolver service.
87 static GNUNET_SCHEDULER_TaskIdentifier s_task;
91 * Handle to a request given to the resolver. Can be used to cancel
92 * the request prior to the timeout or successful execution. Also
93 * used to track our internal state for the request.
95 struct GNUNET_RESOLVER_RequestHandle
99 * Next entry in DLL of requests.
101 struct GNUNET_RESOLVER_RequestHandle *next;
104 * Previous entry in DLL of requests.
106 struct GNUNET_RESOLVER_RequestHandle *prev;
109 * Callback if this is an name resolution request,
112 GNUNET_RESOLVER_AddressCallback addr_callback;
115 * Callback if this is a reverse lookup request,
118 GNUNET_RESOLVER_HostnameCallback name_callback;
121 * Closure for the respective "callback".
126 * When should this request time out?
128 struct GNUNET_TIME_Absolute timeout;
131 * Task handle for numeric lookups.
133 GNUNET_SCHEDULER_TaskIdentifier task;
136 * Desired address family.
141 * Has this request been transmitted to the service?
146 * Did we add this request to the queue?
151 * Desired direction (IP to name or name to IP)
156 * Length of the data that follows this struct.
163 * Check that the resolver service runs on localhost
167 check_config (const struct GNUNET_CONFIGURATION_Handle *cfg)
171 struct sockaddr_in v4;
172 struct sockaddr_in6 v6;
174 memset (&v4, 0, sizeof (v4));
175 v4.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
176 v4.sin_family = AF_INET;
177 #if HAVE_SOCKADDR_IN_SIN_LEN
178 v4.sin_len = sizeof (v4);
180 memset (&v6, 0, sizeof (v6));
181 v6.sin6_family = AF_INET6;
182 #if HAVE_SOCKADDR_IN_SIN_LEN
183 v6.sin6_len = sizeof (v6);
186 GNUNET_CONFIGURATION_get_value_string (cfg,
188 "HOSTNAME", &hostname))
190 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
191 _("Must specify `%s' for `%s' in configuration!\n"),
192 "HOSTNAME", "resolver");
195 if ((1 != inet_pton (AF_INET,
197 &v4)) || (1 != inet_pton (AF_INET6, hostname, &v6)))
199 GNUNET_free (hostname);
203 while (loopback[i] != NULL)
204 if (0 == strcasecmp (loopback[i++], hostname))
206 GNUNET_free (hostname);
209 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
211 ("Must specify `%s' or numeric IP address for `%s' of `%s' in configuration!\n"),
212 "localhost", "HOSTNAME", "resolver");
213 GNUNET_free (hostname);
219 * Create the connection to the resolver service.
221 * @param c configuration to use
224 GNUNET_RESOLVER_connect (const struct GNUNET_CONFIGURATION_Handle *c)
232 * Destroy the connection to the resolver service.
235 GNUNET_RESOLVER_disconnect ()
237 GNUNET_assert (NULL == req_head);
238 GNUNET_assert (NULL == req_tail);
242 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
243 "Disconnecting from DNS service\n");
245 GNUNET_CLIENT_disconnect (client, GNUNET_NO);
248 if (r_task != GNUNET_SCHEDULER_NO_TASK)
250 GNUNET_SCHEDULER_cancel (r_task);
251 r_task = GNUNET_SCHEDULER_NO_TASK;
253 if (s_task != GNUNET_SCHEDULER_NO_TASK)
255 GNUNET_SCHEDULER_cancel (s_task);
256 s_task = GNUNET_SCHEDULER_NO_TASK;
262 * Convert IP address to string without DNS resolution.
264 * @param sa the address
265 * @param salen number of bytes in sa
266 * @return address as a string, NULL on error
269 no_resolve (const struct sockaddr *sa, socklen_t salen)
272 char inet4[INET_ADDRSTRLEN];
273 char inet6[INET6_ADDRSTRLEN];
275 if (salen < sizeof (struct sockaddr))
277 switch (sa->sa_family)
280 if (salen != sizeof (struct sockaddr_in))
284 &((struct sockaddr_in *) sa)->sin_addr,
285 inet4, INET_ADDRSTRLEN))
287 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "inet_ntop");
290 ret = GNUNET_strdup (inet4);
293 if (salen != sizeof (struct sockaddr_in6))
297 &((struct sockaddr_in6 *) sa)->sin6_addr,
298 inet6, INET6_ADDRSTRLEN))
300 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "inet_ntop");
303 ret = GNUNET_strdup (inet6);
314 * Adjust exponential back-off and reconnect to the service.
321 * Process pending requests to the resolver.
323 * @param h handle to the resolver
330 * Process response with a hostname for a DNS lookup.
332 * @param cls our "struct GNUNET_RESOLVER_RequestHandle" context
333 * @param msg message with the hostname, NULL on error
336 handle_response (void *cls,
337 const struct GNUNET_MessageHeader *msg)
339 struct GNUNET_RESOLVER_RequestHandle *rh = cls;
341 const char *hostname;
342 const struct sockaddr *sa;
346 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
347 "Receiving response from DNS service\n");
351 if (NULL != rh->name_callback)
352 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
353 _("Timeout trying to resolve IP address `%s'.\n"),
354 GNUNET_a2s ((const void*) &rh[1], rh->data_len));
356 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
357 _("Timeout trying to resolve hostname `%s'.\n"),
358 (const char *) &rh[1]);
359 if (rh->was_transmitted != GNUNET_SYSERR)
361 if (NULL != rh->name_callback)
362 rh->name_callback (rh->cls, NULL);
363 if (NULL != rh->addr_callback)
364 rh->addr_callback (rh->cls, NULL, 0);
366 GNUNET_CONTAINER_DLL_remove (req_head,
370 GNUNET_CLIENT_disconnect (client, GNUNET_NO);
375 if (GNUNET_MESSAGE_TYPE_RESOLVER_RESPONSE != ntohs (msg->type))
378 GNUNET_CLIENT_disconnect (client, GNUNET_NO);
383 size = ntohs (msg->size);
384 if (size == sizeof (struct GNUNET_MessageHeader))
386 if (rh->was_transmitted != GNUNET_SYSERR)
388 if (NULL != rh->name_callback)
389 rh->name_callback (rh->cls, NULL);
390 if (NULL != rh->addr_callback)
391 rh->addr_callback (rh->cls, NULL, 0);
393 GNUNET_CONTAINER_DLL_remove (req_head,
400 if (NULL != rh->name_callback)
402 hostname = (const char *) &msg[1];
403 if (hostname[size - sizeof (struct GNUNET_MessageHeader) - 1] != '\0')
406 if (rh->was_transmitted != GNUNET_SYSERR)
407 rh->name_callback (rh->cls, NULL);
408 GNUNET_CONTAINER_DLL_remove (req_head,
412 GNUNET_CLIENT_disconnect (client, GNUNET_NO);
418 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
419 _("Resolver returns `%s' for IP `%s'.\n"),
421 GNUNET_a2s ((const void*) &rh[1], rh->data_len));
423 if (rh->was_transmitted != GNUNET_SYSERR)
424 rh->name_callback (rh->cls, hostname);
425 GNUNET_CLIENT_receive (client,
428 GNUNET_TIME_absolute_get_remaining (rh->timeout));
430 if (NULL != rh->addr_callback)
432 sa = (const struct sockaddr *) &msg[1];
433 salen = size - sizeof (struct GNUNET_MessageHeader);
434 if (salen < sizeof (struct sockaddr))
437 if (rh->was_transmitted != GNUNET_SYSERR)
438 rh->addr_callback (rh->cls, NULL, 0);
439 GNUNET_CONTAINER_DLL_remove (req_head,
443 GNUNET_CLIENT_disconnect (client, GNUNET_NO);
450 char *ips = no_resolve (sa, salen);
451 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
452 "Resolver returns `%s' for `%s'.\n",
454 (const char*) &rh[1]);
458 rh->addr_callback (rh->cls, sa, salen);
459 GNUNET_CLIENT_receive (client,
462 GNUNET_TIME_absolute_get_remaining (rh->timeout));
468 * We've been asked to lookup the address for a hostname and were
469 * given a valid numeric string. Perform the callbacks for the
472 * @param cls struct GNUNET_RESOLVER_RequestHandle for the request
473 * @param tc unused scheduler context
476 numeric_resolution (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
478 struct GNUNET_RESOLVER_RequestHandle *rh = cls;
479 struct sockaddr_in v4;
480 struct sockaddr_in6 v6;
481 const char *hostname;
483 memset (&v4, 0, sizeof (v4));
484 v4.sin_family = AF_INET;
485 #if HAVE_SOCKADDR_IN_SIN_LEN
486 v4.sin_len = sizeof (v4);
488 memset (&v6, 0, sizeof (v6));
489 v6.sin6_family = AF_INET6;
490 #if HAVE_SOCKADDR_IN_SIN_LEN
491 v6.sin6_len = sizeof (v6);
493 hostname = (const char*) &rh[1];
494 if (((rh->domain == AF_UNSPEC) || (rh->domain == AF_INET)) &&
495 (1 == inet_pton (AF_INET, hostname, &v4.sin_addr)))
497 rh->addr_callback (rh->cls, (const struct sockaddr *) &v4, sizeof (v4));
498 if ((rh->domain == AF_UNSPEC) &&
499 (1 == inet_pton (AF_INET6, hostname, &v6.sin6_addr)))
501 /* this can happen on some systems IF "hostname" is "localhost" */
502 rh->addr_callback (rh->cls,
503 (const struct sockaddr *) &v6, sizeof (v6));
505 rh->addr_callback (rh->cls, NULL, 0);
509 if (((rh->domain == AF_UNSPEC) || (rh->domain == AF_INET6)) &&
510 (1 == inet_pton (AF_INET6, hostname, &v6.sin6_addr)))
512 rh->addr_callback (rh->cls, (const struct sockaddr *) &v6, sizeof (v6));
513 rh->addr_callback (rh->cls, NULL, 0);
517 /* why are we here? this task should not have been scheduled! */
524 * We've been asked to lookup the address for a hostname and were
525 * given a variant of "loopback". Perform the callbacks for the
526 * respective loopback numeric addresses.
528 * @param cls struct GNUNET_RESOLVER_RequestHandle for the request
529 * @param tc unused scheduler context
532 loopback_resolution (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
534 struct GNUNET_RESOLVER_RequestHandle *rh = cls;
535 struct sockaddr_in v4;
536 struct sockaddr_in6 v6;
538 memset (&v4, 0, sizeof (v4));
539 v4.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
540 v4.sin_family = AF_INET;
541 #if HAVE_SOCKADDR_IN_SIN_LEN
542 v4.sin_len = sizeof (v4);
544 memset (&v6, 0, sizeof (v6));
545 v6.sin6_family = AF_INET6;
546 #if HAVE_SOCKADDR_IN_SIN_LEN
547 v6.sin6_len = sizeof (v6);
549 v6.sin6_addr = in6addr_loopback;
553 rh->addr_callback (rh->cls, (const struct sockaddr *) &v4, sizeof (v4));
556 rh->addr_callback (rh->cls, (const struct sockaddr *) &v6, sizeof (v6));
559 rh->addr_callback (rh->cls, (const struct sockaddr *) &v6, sizeof (v6));
560 rh->addr_callback (rh->cls, (const struct sockaddr *) &v4, sizeof (v4));
566 rh->addr_callback (rh->cls, NULL, 0);
572 * Task executed on system shutdown.
575 shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
577 s_task = GNUNET_SCHEDULER_NO_TASK;
578 GNUNET_RESOLVER_disconnect ();
583 * Process pending requests to the resolver.
585 * @param h handle to the resolver
590 struct GNUNET_RESOLVER_GetMessage *msg;
591 char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1];
592 struct GNUNET_RESOLVER_RequestHandle *rh;
602 /* nothing to do, release socket really soon if there is nothing
604 s_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MILLISECONDS,
605 &shutdown_task, NULL);
608 if (GNUNET_YES == rh->was_transmitted)
609 return; /* waiting for reply */
610 msg = (struct GNUNET_RESOLVER_GetMessage *) buf;
612 htons (sizeof (struct GNUNET_RESOLVER_GetMessage) + rh->data_len);
613 msg->header.type = htons (GNUNET_MESSAGE_TYPE_RESOLVER_REQUEST);
614 msg->direction = htonl (rh->direction);
615 msg->domain = htonl (rh->domain);
616 memcpy (&msg[1], &rh[1], rh->data_len);
618 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
619 "Transmitting DNS resolution request to DNS service\n");
622 GNUNET_CLIENT_transmit_and_get_response (client,
624 GNUNET_TIME_absolute_get_remaining (rh->timeout),
626 &handle_response, rh))
628 GNUNET_CLIENT_disconnect (client, GNUNET_NO);
633 rh->was_transmitted = GNUNET_YES;
638 * Now try to reconnect to the resolver service.
641 * @param tc scheduler context
644 reconnect_task (void *cls,
645 const struct GNUNET_SCHEDULER_TaskContext *tc)
647 r_task = GNUNET_SCHEDULER_NO_TASK;
648 if (NULL == req_head)
649 return; /* no work pending */
650 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
653 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
654 "Trying to connect to DNS service\n");
656 client = GNUNET_CLIENT_connect ("resolver", cfg);
659 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
660 "Failed to connect, will try again later\n");
669 * Adjust exponential back-off and reconnect to the service.
674 struct GNUNET_RESOLVER_RequestHandle *rh;
676 if (GNUNET_SCHEDULER_NO_TASK != r_task)
678 GNUNET_assert (NULL == client);
679 if (NULL != (rh = req_head))
681 switch (rh->was_transmitted)
684 /* nothing more to do */
687 /* disconnected, transmit again! */
688 rh->was_transmitted = GNUNET_NO;
691 /* request was cancelled, remove entirely */
692 GNUNET_CONTAINER_DLL_remove (req_head,
703 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
704 "Will try to connect to DNS service in %llu ms\n",
705 (unsigned long long) backoff.rel_value);
707 r_task = GNUNET_SCHEDULER_add_delayed (backoff,
710 backoff = GNUNET_TIME_relative_max (GNUNET_TIME_UNIT_SECONDS,
711 GNUNET_TIME_relative_multiply (backoff, 2));
716 * Convert a string to one or more IP addresses.
718 * @param hostname the hostname to resolve
719 * @param domain AF_INET or AF_INET6; use AF_UNSPEC for "any"
720 * @param callback function to call with addresses
721 * @param callback_cls closure for callback
722 * @param timeout how long to try resolving
723 * @return handle that can be used to cancel the request, NULL on error
725 struct GNUNET_RESOLVER_RequestHandle *
726 GNUNET_RESOLVER_ip_get (const char *hostname,
728 struct GNUNET_TIME_Relative timeout,
729 GNUNET_RESOLVER_AddressCallback callback,
732 struct GNUNET_RESOLVER_RequestHandle *rh;
738 slen = strlen (hostname) + 1;
739 if (slen + sizeof (struct GNUNET_RESOLVER_GetMessage) >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
744 rh = GNUNET_malloc (sizeof (struct GNUNET_RESOLVER_RequestHandle) + slen);
746 rh->addr_callback = callback;
747 rh->cls = callback_cls;
748 memcpy (&rh[1], hostname, slen);
750 rh->timeout = GNUNET_TIME_relative_to_absolute (timeout);
751 rh->direction = GNUNET_NO;
752 /* first, check if this is a numeric address */
753 if (((1 == inet_pton (AF_INET,
756 ((domain == AF_INET) || (domain == AF_UNSPEC))) ||
757 ((1 == inet_pton (AF_INET6,
760 ((domain == AF_INET6) || (domain == AF_UNSPEC))))
762 rh->task = GNUNET_SCHEDULER_add_now (&numeric_resolution, rh);
765 /* then, check if this is a loopback address */
767 while (loopback[i] != NULL)
768 if (0 == strcasecmp (loopback[i++], hostname))
770 rh->task = GNUNET_SCHEDULER_add_now (&loopback_resolution, rh);
773 GNUNET_CONTAINER_DLL_insert_tail (req_head,
776 rh->was_queued = GNUNET_YES;
777 if (s_task != GNUNET_SCHEDULER_NO_TASK)
779 GNUNET_SCHEDULER_cancel (s_task);
780 s_task = GNUNET_SCHEDULER_NO_TASK;
788 * We've been asked to convert an address to a string without
789 * a reverse lookup. Do it.
791 * @param cls struct GNUNET_RESOLVER_RequestHandle for the request
792 * @param tc unused scheduler context
795 numeric_reverse (void *cls,
796 const struct GNUNET_SCHEDULER_TaskContext *tc)
798 struct GNUNET_RESOLVER_RequestHandle *rh = cls;
801 result = no_resolve ((const struct sockaddr *) &rh[1], rh->data_len);
803 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("Resolver returns `%s'.\n"), result);
807 rh->name_callback (rh->cls, result);
808 GNUNET_free (result);
810 rh->name_callback (rh->cls, NULL);
816 * Get an IP address as a string.
818 * @param sa host address
819 * @param salen length of host address
820 * @param do_resolve use GNUNET_NO to return numeric hostname
821 * @param timeout how long to try resolving
822 * @param callback function to call with hostnames
823 * @param cls closure for callback
824 * @return handle that can be used to cancel the request
826 struct GNUNET_RESOLVER_RequestHandle *
827 GNUNET_RESOLVER_hostname_get (const struct sockaddr *sa,
830 struct GNUNET_TIME_Relative timeout,
831 GNUNET_RESOLVER_HostnameCallback callback,
834 struct GNUNET_RESOLVER_RequestHandle *rh;
837 rh = GNUNET_malloc (sizeof (struct GNUNET_RESOLVER_RequestHandle) + salen);
838 rh->name_callback = callback;
840 rh->timeout = GNUNET_TIME_relative_to_absolute (timeout);
841 memcpy (&rh[1], sa, salen);
842 rh->data_len = salen;
843 rh->direction = GNUNET_YES;
844 if (GNUNET_NO == do_resolve)
846 rh->task = GNUNET_SCHEDULER_add_now (&numeric_reverse, rh);
849 if (salen + sizeof (struct GNUNET_RESOLVER_GetMessage) >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
855 GNUNET_CONTAINER_DLL_insert_tail (req_head,
858 rh->was_queued = GNUNET_YES;
859 if (s_task != GNUNET_SCHEDULER_NO_TASK)
861 GNUNET_SCHEDULER_cancel (s_task);
862 s_task = GNUNET_SCHEDULER_NO_TASK;
870 * Get local fully qualified domain name
875 GNUNET_RESOLVER_local_fqdn_get ()
877 struct hostent *host;
878 char hostname[GNUNET_OS_get_hostname_max_length() + 1];
880 if (0 != gethostname (hostname, sizeof (hostname) - 1))
882 GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR |
883 GNUNET_ERROR_TYPE_BULK, "gethostname");
887 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
888 _("Resolving our FQDN `%s'\n"), hostname);
890 host = gethostbyname (hostname);
893 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
894 _("Could not resolve our FQDN : %s\n"),
895 hstrerror (h_errno));
898 return GNUNET_strdup (host->h_name);
903 * Looking our own hostname.
905 * @param domain AF_INET or AF_INET6; use AF_UNSPEC for "any"
906 * @param callback function to call with addresses
907 * @param cls closure for callback
908 * @param timeout how long to try resolving
909 * @return handle that can be used to cancel the request, NULL on error
911 struct GNUNET_RESOLVER_RequestHandle *
912 GNUNET_RESOLVER_hostname_resolve (int domain,
913 struct GNUNET_TIME_Relative timeout,
914 GNUNET_RESOLVER_AddressCallback callback,
917 char hostname[GNUNET_OS_get_hostname_max_length() + 1];
919 if (0 != gethostname (hostname, sizeof (hostname) - 1))
921 GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR |
922 GNUNET_ERROR_TYPE_BULK, "gethostname");
926 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
927 _("Resolving our hostname `%s'\n"), hostname);
929 return GNUNET_RESOLVER_ip_get (hostname,
937 * Cancel a request that is still pending with the resolver.
938 * Note that a client MUST NOT cancel a request that has
939 * been completed (i.e, the callback has been called to
940 * signal timeout or the final result).
942 * @param rh handle of request to cancel
945 GNUNET_RESOLVER_request_cancel (struct GNUNET_RESOLVER_RequestHandle *rh)
947 if (rh->task != GNUNET_SCHEDULER_NO_TASK)
949 GNUNET_SCHEDULER_cancel (rh->task);
950 rh->task = GNUNET_SCHEDULER_NO_TASK;
952 if (rh->was_transmitted == GNUNET_NO)
954 if (rh->was_queued == GNUNET_YES)
955 GNUNET_CONTAINER_DLL_remove (req_head,
961 GNUNET_assert (rh->was_transmitted == GNUNET_YES);
962 rh->was_transmitted = GNUNET_SYSERR; /* mark as cancelled */
966 /* end of resolver_api.c */