resconf.h revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
/*
* Copyright (C) 2009, 2014, 2016 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* $Id: resconf.h,v 1.3 2009/09/02 23:48:02 tbox Exp $ */
#ifndef IRS_RESCONF_H
#define IRS_RESCONF_H 1
/*! \file
*
* \brief
* The IRS resconf module parses the legacy "/etc/resolv.conf" file and
* creates the corresponding configuration objects for the DNS library
* modules.
*/
/*%
* A DNS search list specified in the 'domain' or 'search' statements
* in the "resolv.conf" file.
*/
typedef struct irs_resconf_search {
char *domain;
/*%<
* Load the resolver configuration file 'filename' in the "resolv.conf" format,
* and create a new irs_resconf_t object from the configuration. If the file
* is not found ISC_R_FILENOTFOUND is returned with the structure initialized
* as if file contained only:
*
* nameserver ::1
* nameserver 127.0.0.1
*
* Notes:
*
*\li Currently, only the following options are supported:
* nameserver, domain, search, sortlist, ndots, and options.
* In addition, 'sortlist' is not actually effective; it's parsed, but
* the application cannot use the configuration.
*
* Returns:
* \li ISC_R_SUCCESS on success
* \li ISC_R_FILENOTFOUND if the file was not found. *confp will be valid.
* \li other on error.
*
* Requires:
*
*\li 'mctx' is a valid memory context.
*
*\li 'filename' != NULL
*
*\li 'confp' != NULL && '*confp' == NULL
*/
void
/*%<
* Destroy the resconf object.
*
* Requires:
*
*\li '*confp' is a valid resconf object.
*
* Ensures:
*
*\li *confp == NULL
*/
/*%<
* Return a list of name server addresses stored in 'conf'.
*
* Requires:
*
*\li 'conf' is a valid resconf object.
*/
/*%<
* Return the search list stored in 'conf'.
*
* Requires:
*
*\li 'conf' is a valid resconf object.
*/
unsigned int
/*%<
* Return the 'ndots' value stored in 'conf'.
*
* Requires:
*
*\li 'conf' is a valid resconf object.
*/
#endif /* IRS_RESCONF_H */