case GNUNET_DNSPARSER_TYPE_MX: return "MX";
case GNUNET_DNSPARSER_TYPE_TXT: return "TXT";
case GNUNET_DNSPARSER_TYPE_AAAA: return "AAAA";
+ case GNUNET_DNSPARSER_TYPE_SRV: return "SRV";
}
GNUNET_snprintf (buf, sizeof (buf), "%u", (unsigned int) type);
return buf;
format = record->data.hostname;
break;
case GNUNET_DNSPARSER_TYPE_SOA:
- if (record->data.soa == NULL)
+ if (NULL == record->data.soa)
format = "<invalid>";
else
{
format = tmp;
}
break;
+ case GNUNET_DNSPARSER_TYPE_SRV:
+ if (NULL == record->data.srv)
+ format = "<invalid>";
+ else
+ {
+ GNUNET_asprintf (&tmp,
+ "service: %s, protocol: %s, domain_name = %s, priority %u, weight = %s, port = %u, target = %s",
+ record->data.srv->service,
+ record->data.srv->proto,
+ record->data.srv->domain_name,
+ (unsigned int) record->data.srv->priority,
+ (unsigned int) record->data.srv->weight,
+ (unsigned int) record->data.srv->port,
+ record->data.srv->target);
+ format = tmp;
+ }
+ break;
case GNUNET_DNSPARSER_TYPE_TXT:
GNUNET_asprintf (&tmp,
"%.*s",
if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
return 2;
-
- return (GNUNET_OK ==
- GNUNET_PROGRAM_run (argc, argv, "gnunet-dns-monitor",
- gettext_noop
- ("Monitor DNS queries."), options,
- &run, NULL)) ? ret : 1;
+ ret = (GNUNET_OK ==
+ GNUNET_PROGRAM_run (argc, argv, "gnunet-dns-monitor",
+ gettext_noop
+ ("Monitor DNS queries."), options,
+ &run, NULL)) ? ret : 1;
+ GNUNET_free ((void*) argv);
+ return ret;
}