bind  9.16.7
About: BIND 9.16 implements the Domain Name System (DNS) protocols for the Internet (see the Release Notes). Source code distribution.
  Fossies Dox: bind-9.16.7.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

named-checkconf.c File Reference
#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <isc/commandline.h>
#include <isc/dir.h>
#include <isc/hash.h>
#include <isc/log.h>
#include <isc/mem.h>
#include <isc/print.h>
#include <isc/result.h>
#include <isc/string.h>
#include <isc/util.h>
#include <dns/db.h>
#include <dns/fixedname.h>
#include <dns/log.h>
#include <dns/name.h>
#include <dns/rdataclass.h>
#include <dns/result.h>
#include <dns/rootns.h>
#include <dns/zone.h>
#include <isccfg/grammar.h>
#include <isccfg/namedconf.h>
#include <bind9/check.h>
#include "check-tool.h"
Include dependency graph for named-checkconf.c:

Go to the source code of this file.

Macros

#define CHECK(r)
 
#define CMDLINE_FLAGS   "cdhijlm:t:pvxz"
 

Functions

static ISC_PLATFORM_NORETURN_PRE void usage (void)
 
static isc_result_t directory_callback (const char *clausename, const cfg_obj_t *obj, void *arg)
 
static bool get_maps (const cfg_obj_t **maps, const char *name, const cfg_obj_t **obj)
 
static bool get_checknames (const cfg_obj_t **maps, const cfg_obj_t **obj)
 
static isc_result_t configure_hint (const char *zfile, const char *zclass, isc_mem_t *mctx)
 
static isc_result_t configure_zone (const char *vclass, const char *view, const cfg_obj_t *zconfig, const cfg_obj_t *vconfig, const cfg_obj_t *config, isc_mem_t *mctx, bool list)
 
static isc_result_t configure_view (const char *vclass, const char *view, const cfg_obj_t *config, const cfg_obj_t *vconfig, isc_mem_t *mctx, bool list)
 
static isc_result_t config_getclass (const cfg_obj_t *classobj, dns_rdataclass_t defclass, dns_rdataclass_t *classp)
 
static isc_result_t load_zones_fromconfig (const cfg_obj_t *config, isc_mem_t *mctx, bool list_zones)
 
static void output (void *closure, const char *text, int textlen)
 
int main (int argc, char **argv)
 

Variables

static const char * program = "named-checkconf"
 
static bool loadplugins = true
 
isc_log_tlogc = NULL
 

Macro Definition Documentation

◆ CHECK

#define CHECK (   r)
Value:
do { \
result = (r); \
if (result != ISC_R_SUCCESS) \
goto cleanup; \
} while (0)

Definition at line 51 of file named-checkconf.c.

◆ CMDLINE_FLAGS

#define CMDLINE_FLAGS   "cdhijlm:t:pvxz"

Function Documentation

◆ config_getclass()

static isc_result_t config_getclass ( const cfg_obj_t classobj,
dns_rdataclass_t  defclass,
dns_rdataclass_t classp 
)
static

Definition at line 492 of file named-checkconf.c.

References isc_region::base, cfg_obj_asstring(), cfg_obj_isstring(), DE_CONST, defclass, dns_rdataclass_fromtext(), ISC_R_SUCCESS, isc_region::length, and r.

Referenced by load_zones_fromconfig().

Here is the caller graph for this function:

◆ configure_hint()

static isc_result_t configure_hint ( const char *  zfile,
const char *  zclass,
isc_mem_t mctx 
)
static

Definition at line 150 of file named-checkconf.c.

References isc_region::base, DE_CONST, dns_db_detach(), dns_rdataclass_fromtext(), dns_rootns_create(), ISC_R_FAILURE, ISC_R_SUCCESS, isc_region::length, mctx, r, and rdclass.

Referenced by configure_zone().

Here is the caller graph for this function:

◆ configure_view()

static isc_result_t configure_view ( const char *  vclass,
const char *  view,
const cfg_obj_t config,
const cfg_obj_t vconfig,
isc_mem_t mctx,
bool  list 
)
static

Definition at line 458 of file named-checkconf.c.

References cfg_list_first(), cfg_list_next(), cfg_listelt_value(), cfg_map_get(), cfg_tuple_get(), configure_zone(), ISC_R_SUCCESS, and mctx.

Referenced by load_zones_fromconfig().

Here is the caller graph for this function:

◆ configure_zone()

◆ directory_callback()

static isc_result_t directory_callback ( const char *  clausename,
const cfg_obj_t obj,
void *  arg 
)
static

Definition at line 73 of file named-checkconf.c.

References arg, cfg_obj_asstring(), cfg_obj_log(), directory, isc_dir_chdir(), ISC_LOG_ERROR, ISC_R_SUCCESS, isc_result_totext(), logc, REQUIRE, and UNUSED.

Referenced by main().

Here is the caller graph for this function:

◆ get_checknames()

static bool get_checknames ( const cfg_obj_t **  maps,
const cfg_obj_t **  obj 
)
static

Definition at line 111 of file named-checkconf.c.

References cfg_list_first(), cfg_list_next(), cfg_listelt_value(), cfg_map_get(), cfg_obj_asstring(), cfg_obj_islist(), cfg_tuple_get(), checknames, ISC_R_SUCCESS, and value.

Referenced by configure_zone().

Here is the caller graph for this function:

◆ get_maps()

static bool get_maps ( const cfg_obj_t **  maps,
const char *  name,
const cfg_obj_t **  obj 
)
static

Definition at line 98 of file named-checkconf.c.

References cfg_map_get(), ISC_R_SUCCESS, and name.

Referenced by configure_zone().

Here is the caller graph for this function:

◆ load_zones_fromconfig()

static isc_result_t load_zones_fromconfig ( const cfg_obj_t config,
isc_mem_t mctx,
bool  list_zones 
)
static

Definition at line 507 of file named-checkconf.c.

References cfg_list_first(), cfg_list_next(), cfg_listelt_value(), cfg_map_get(), cfg_obj_asstring(), cfg_tuple_get(), CHECK, cleanup(), config_getclass(), configure_view(), dns_rdataclass_format(), dns_rdataclass_ismeta(), ISC_R_FAILURE, ISC_R_SUCCESS, and mctx.

Referenced by main().

Here is the caller graph for this function:

◆ main()

◆ output()

static void output ( void *  closure,
const char *  text,
int  textlen 
)
static

Definition at line 564 of file named-checkconf.c.

References exit(), text, and UNUSED.

Referenced by dump_zone(), dumpmessage(), main(), named_server_dnssec(), named_server_signing(), and printtime().

Here is the caller graph for this function:

◆ usage()

static ISC_PLATFORM_NORETURN_PRE void usage ( void  )
static

Definition at line 60 of file named-checkconf.c.

References exit(), program, and stderr.

Referenced by dash_option(), dst_gssapi_acquirecred(), isoptarg(), main(), and plus_option().

Here is the caller graph for this function:

Variable Documentation

◆ loadplugins

bool loadplugins = true
static

Definition at line 47 of file named-checkconf.c.

Referenced by main().

◆ logc

isc_log_t* logc = NULL

Definition at line 49 of file named-checkconf.c.

Referenced by directory_callback(), load_configuration(), and main().

◆ program

const char* program = "named-checkconf"
static

Definition at line 45 of file named-checkconf.c.

Referenced by fatal(), isoptarg(), main(), setup_logging(), usage(), and vbprintf().

cleanup
static void cleanup(void)
Definition: main.c:1349
ISC_R_SUCCESS
#define ISC_R_SUCCESS
Definition: dlz_minimal.h:59
r
static isc_result_t digest_ isc_region_t r
Definition: proforma.c:113