rootns.c revision dafcb997e390efa4423883dafd100c975c4095d6
/*
* Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rootns.c,v 1.26 2004/03/05 05:09:24 marka Exp $ */
#include <config.h>
#include <dns/callbacks.h>
#include <dns/dbiterator.h>
#include <dns/fixedname.h>
#include <dns/rdatasetiter.h>
#include <dns/rdataset.h>
#include <dns/rdatastruct.h>
static char root_ns[] =
";\n"
"; Internet Root Nameservers\n"
";\n"
"; Thu Sep 23 17:57:37 PDT 1999\n"
";\n"
"$TTL 518400\n"
". 518400 IN NS A.ROOT-SERVERS.NET.\n"
". 518400 IN NS B.ROOT-SERVERS.NET.\n"
". 518400 IN NS C.ROOT-SERVERS.NET.\n"
". 518400 IN NS D.ROOT-SERVERS.NET.\n"
". 518400 IN NS E.ROOT-SERVERS.NET.\n"
". 518400 IN NS F.ROOT-SERVERS.NET.\n"
". 518400 IN NS G.ROOT-SERVERS.NET.\n"
". 518400 IN NS H.ROOT-SERVERS.NET.\n"
". 518400 IN NS I.ROOT-SERVERS.NET.\n"
". 518400 IN NS J.ROOT-SERVERS.NET.\n"
". 518400 IN NS K.ROOT-SERVERS.NET.\n"
". 518400 IN NS L.ROOT-SERVERS.NET.\n"
". 518400 IN NS M.ROOT-SERVERS.NET.\n"
"A.ROOT-SERVERS.NET. 3600000 IN A 198.41.0.4\n"
"B.ROOT-SERVERS.NET. 3600000 IN A 192.228.79.201\n"
"C.ROOT-SERVERS.NET. 3600000 IN A 192.33.4.12\n"
"D.ROOT-SERVERS.NET. 3600000 IN A 128.8.10.90\n"
"E.ROOT-SERVERS.NET. 3600000 IN A 192.203.230.10\n"
"F.ROOT-SERVERS.NET. 3600000 IN A 192.5.5.241\n"
"G.ROOT-SERVERS.NET. 3600000 IN A 192.112.36.4\n"
"H.ROOT-SERVERS.NET. 3600000 IN A 128.63.2.53\n"
"I.ROOT-SERVERS.NET. 3600000 IN A 192.36.148.17\n"
"J.ROOT-SERVERS.NET. 3600000 IN A 192.58.128.30\n"
"K.ROOT-SERVERS.NET. 3600000 IN A 193.0.14.129\n"
"L.ROOT-SERVERS.NET. 3600000 IN A 198.32.64.12\n"
"M.ROOT-SERVERS.NET. 3600000 IN A 202.12.27.33\n";
static isc_result_t
if (!dns_rdataset_isassociated(rootns))
return (ISC_R_NOTFOUND);
while (result == ISC_R_SUCCESS) {
if (result != ISC_R_SUCCESS)
return (result);
return (ISC_R_SUCCESS);
}
if (result == ISC_R_NOMORE)
return (result);
}
static isc_result_t
while (result == ISC_R_SUCCESS) {
case dns_rdatatype_a:
case dns_rdatatype_aaaa:
if (result != ISC_R_SUCCESS)
goto cleanup;
break;
case dns_rdatatype_ns:
break;
/*FALLTHROUGH*/
default:
goto cleanup;
}
}
if (result == ISC_R_NOMORE)
return (result);
}
static isc_result_t
if (result != ISC_R_SUCCESS)
goto cleanup;
while (result == ISC_R_SUCCESS) {
if (result != ISC_R_SUCCESS)
goto cleanup;
if (result != ISC_R_SUCCESS)
goto cleanup;
if (result != ISC_R_SUCCESS)
goto cleanup;
}
if (result == ISC_R_NOMORE)
if (dns_rdataset_isassociated(&rootns))
return (result);
}
{
if (result != ISC_R_SUCCESS)
return (result);
if (result != ISC_R_SUCCESS)
return (result);
/*
* Load the hints from the specified filename.
*/
} else if (rdclass == dns_rdataclass_in) {
/*
* Default to using the Internet root servers.
*/
} else
goto db_detach;
"extra data in root hints '%s'",
return (ISC_R_SUCCESS);
dns_db_detach(&db);
return (result);
}