/*
* dnsutl - utilities to make DNS easier to configure
* Copyright (C) 1996, 1999, 2006, 2007 Peter Miller
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see
* .
*/
#include
srrf_list_ty *
srrf_reader(const char *filename, int verbose, int delete_foreign_names)
{
srrf_list_ty *rlp;
srrf_t *rp;
/*
* open the input file
*/
srrf_open(filename);
/*
* read the file contents
*/
rlp = srrf_list_alloc();
for (;;)
{
if (delete_foreign_names)
rp = srrf_read_dfn();
else
rp = srrf_read();
if (!rp)
break;
if (verbose)
srrf_print(stderr, rp);
srrf_list_append(rlp, rp);
}
/*
* close the input file
*/
srrf_close();
/*
* check for host and address duplicates
*/
srrf_check_for_duplicates(rlp->record, rlp->nrecords, filename);
/*
* return the list to the caller
*/
return rlp;
}