config.c File Reference

#include <config.h>
#include <stdlib.h>
#include <isc/buffer.h>
#include <isc/log.h>
#include <isc/mem.h>
#include <isc/parseint.h>
#include <isc/region.h>
#include <isc/result.h>
#include <isc/sockaddr.h>
#include <isc/string.h>
#include <isc/util.h>
#include <isccfg/namedconf.h>
#include <dns/fixedname.h>
#include <dns/name.h>
#include <dns/rdataclass.h>
#include <dns/rdatatype.h>
#include <dns/tsig.h>
#include <dns/zone.h>
#include <dst/dst.h>
#include <named/globals.h>
#include <bind.keys.h>

Go to the source code of this file.

Data Structures

struct  keyalgorithms

Functions

isc_result_t ns_config_parsedefaults (cfg_parser_t *parser, cfg_obj_t **conf)
isc_result_t ns_config_get (cfg_obj_t const *const *maps, const char *name, const cfg_obj_t **obj)
isc_result_t ns_checknames_get (const cfg_obj_t **maps, const char *which, const cfg_obj_t **obj)
int ns_config_listcount (const cfg_obj_t *list)
isc_result_t ns_config_getclass (const cfg_obj_t *classobj, dns_rdataclass_t defclass, dns_rdataclass_t *classp)
isc_result_t ns_config_gettype (const cfg_obj_t *typeobj, dns_rdatatype_t deftype, dns_rdatatype_t *typep)
dns_zonetype_t ns_config_getzonetype (const cfg_obj_t *zonetypeobj)
isc_result_t ns_config_getiplist (const cfg_obj_t *config, const cfg_obj_t *list, in_port_t defport, isc_mem_t *mctx, isc_sockaddr_t **addrsp, isc_dscp_t **dscpsp, isc_uint32_t *countp)
void ns_config_putiplist (isc_mem_t *mctx, isc_sockaddr_t **addrsp, isc_dscp_t **dscpsp, isc_uint32_t count)
static isc_result_t get_masters_def (const cfg_obj_t *cctx, const char *name, const cfg_obj_t **ret)
isc_result_t ns_config_getipandkeylist (const cfg_obj_t *config, const cfg_obj_t *list, isc_mem_t *mctx, isc_sockaddr_t **addrsp, isc_dscp_t **dscpsp, dns_name_t ***keysp, isc_uint32_t *countp)
void ns_config_putipandkeylist (isc_mem_t *mctx, isc_sockaddr_t **addrsp, isc_dscp_t **dscpsp, dns_name_t ***keysp, isc_uint32_t count)
isc_result_t ns_config_getport (const cfg_obj_t *config, in_port_t *portp)
isc_result_t ns_config_getdscp (const cfg_obj_t *config, isc_dscp_t *dscpp)
isc_result_t ns_config_getkeyalgorithm (const char *str, dns_name_t **name, isc_uint16_t *digestbits)
isc_result_t ns_config_getkeyalgorithm2 (const char *str, dns_name_t **name, unsigned int *typep, isc_uint16_t *digestbits)

Variables

static char defaultconf []
 default configuration
struct keyalgorithms algorithms []


Detailed Description

Definition in file config.c.


Function Documentation

isc_result_t ns_config_parsedefaults ( cfg_parser_t parser,
cfg_obj_t **  conf 
)

Definition at line 297 of file config.c.

References cfg_parse_buffer(), cfg_type_namedconf, defaultconf, isc_buffer_add, and isc_buffer_init.

Referenced by load_configuration().

isc_result_t ns_config_get ( cfg_obj_t const *const *  maps,
const char *  name,
const cfg_obj_t **  obj 
)

Definition at line 306 of file config.c.

References cfg_map_get(), ISC_R_NOTFOUND, and ISC_R_SUCCESS.

Referenced by check_lockfile(), configure_server_quota(), configure_session_key(), configure_view(), configure_view_acl(), configure_view_dnsseckeys(), configure_view_nametable(), configure_view_sortlist(), configure_zone_acl(), get_view_querysource_dispatch(), load_configuration(), ns_config_getport(), ns_zone_configure(), set_limit(), and setup_newzones().

isc_result_t ns_checknames_get ( const cfg_obj_t **  maps,
const char *  which,
const cfg_obj_t **  obj 
)

Definition at line 320 of file config.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_NOTFOUND, and ISC_R_SUCCESS.

Referenced by checknames(), and configure_view().

int ns_config_listcount ( const cfg_obj_t list  ) 

Definition at line 359 of file config.c.

References cfg_list_first(), and cfg_list_next().

Referenced by configure_zone_ssutable(), and ns_config_getiplist().

isc_result_t ns_config_getclass ( const cfg_obj_t classobj,
dns_rdataclass_t  defclass,
dns_rdataclass_t classp 
)

Definition at line 370 of file config.c.

References isc_textregion::base, cfg_obj_asstring(), cfg_obj_isstring(), cfg_obj_log(), DE_CONST, dns_rdataclass_fromtext(), ISC_LOG_ERROR, ISC_R_SUCCESS, isc_textregion::length, and r.

Referenced by configure_order(), configure_zone(), dstkey_fromconfig(), get_viewinfo(), newzone_parse(), ns_lwdmanager_create(), and ns_zone_configure().

isc_result_t ns_config_gettype ( const cfg_obj_t typeobj,
dns_rdatatype_t  deftype,
dns_rdatatype_t typep 
)

Definition at line 389 of file config.c.

References isc_textregion::base, cfg_obj_asstring(), cfg_obj_isstring(), cfg_obj_log(), DE_CONST, dns_rdatatype_fromtext(), ISC_LOG_ERROR, ISC_R_SUCCESS, isc_textregion::length, and r.

Referenced by configure_order().

dns_zonetype_t ns_config_getzonetype ( const cfg_obj_t zonetypeobj  ) 

Definition at line 408 of file config.c.

References cfg_obj_asstring(), dns_zone_master, dns_zone_none, dns_zone_redirect, dns_zone_slave, dns_zone_staticstub, dns_zone_stub, INSIST, and str.

Referenced by zonetype_fromconfig().

isc_result_t ns_config_getiplist ( const cfg_obj_t config,
const cfg_obj_t list,
in_port_t  defport,
isc_mem_t mctx,
isc_sockaddr_t **  addrsp,
isc_dscp_t **  dscpsp,
isc_uint32_t countp 
)

Definition at line 429 of file config.c.

References cfg_list_first(), cfg_list_next(), cfg_listelt_value(), cfg_obj_assockaddr(), cfg_obj_asuint32(), cfg_obj_getdscp(), cfg_obj_isuint32(), cfg_obj_log(), cfg_tuple_get(), INSIST, ISC_LOG_ERROR, isc_mem_get, isc_mem_put, ISC_R_NOMEMORY, ISC_R_RANGE, ISC_R_SUCCESS, isc_sockaddr_getport(), isc_sockaddr_setport(), ISC_UINT16_MAX, ns_config_getport(), ns_config_listcount(), and port.

Referenced by ns_lwresd_configure().

void ns_config_putiplist ( isc_mem_t mctx,
isc_sockaddr_t **  addrsp,
isc_dscp_t **  dscpsp,
isc_uint32_t  count 
)

Definition at line 521 of file config.c.

References INSIST, and isc_mem_put.

Referenced by ns_lwresd_configure().

static isc_result_t get_masters_def ( const cfg_obj_t cctx,
const char *  name,
const cfg_obj_t **  ret 
) [static]

Definition at line 537 of file config.c.

References cfg_list_first(), cfg_list_next(), cfg_listelt_value(), cfg_map_get(), cfg_obj_asstring(), cfg_tuple_get(), ISC_R_NOTFOUND, and ISC_R_SUCCESS.

isc_result_t ns_config_getipandkeylist ( const cfg_obj_t config,
const cfg_obj_t list,
isc_mem_t mctx,
isc_sockaddr_t **  addrsp,
isc_dscp_t **  dscpsp,
dns_name_t ***  keysp,
isc_uint32_t countp 
)

Definition at line 565 of file config.c.

References cfg_list_first(), cfg_list_next(), cfg_listelt_value(), cfg_obj_assockaddr(), cfg_obj_asstring(), cfg_obj_asuint32(), cfg_obj_getdscp(), cfg_obj_issockaddr(), cfg_obj_isstring(), cfg_obj_isuint32(), cfg_obj_log(), cfg_tuple_get(), cleanup(), dns_fixedname_init, dns_fixedname_name, dns_name_dup(), dns_name_dynamic(), dns_name_free(), dns_name_fromtext(), dns_name_init(), dns_rootname, get_masters_def(), INSIST, isc_buffer_add, isc_buffer_constinit, ISC_LOG_ERROR, isc_mem_get, isc_mem_put, ISC_R_NOMEMORY, ISC_R_NOTFOUND, ISC_R_RANGE, ISC_R_SUCCESS, isc_sockaddr_getport(), isc_sockaddr_setport(), ISC_UINT16_MAX, key, keycount, keystr, name, ns_config_getdscp(), ns_config_getport(), port, and REQUIRE.

Referenced by ns_zone_configure().

void ns_config_putipandkeylist ( isc_mem_t mctx,
isc_sockaddr_t **  addrsp,
isc_dscp_t **  dscpsp,
dns_name_t ***  keysp,
isc_uint32_t  count 
)

Definition at line 877 of file config.c.

References dns_name_dynamic(), dns_name_free(), isc_mem_put, and REQUIRE.

Referenced by ns_zone_configure().

isc_result_t ns_config_getport ( const cfg_obj_t config,
in_port_t *  portp 
)

Definition at line 908 of file config.c.

References cfg_map_get(), cfg_obj_asuint32(), cfg_obj_log(), INSIST, ISC_LOG_ERROR, ISC_R_RANGE, ISC_R_SUCCESS, ISC_UINT16_MAX, and ns_config_get().

Referenced by configure_alternates(), configure_forward(), configure_view(), load_configuration(), ns_config_getipandkeylist(), ns_config_getiplist(), and ns_listenelt_fromconfig().

isc_result_t ns_config_getdscp ( const cfg_obj_t config,
isc_dscp_t dscpp 
)

Definition at line 935 of file config.c.

References cfg_map_get(), cfg_obj_asuint32(), cfg_obj_log(), ISC_LOG_ERROR, ISC_R_RANGE, and ISC_R_SUCCESS.

Referenced by load_configuration(), and ns_config_getipandkeylist().

isc_result_t ns_config_getkeyalgorithm ( const char *  str,
dns_name_t **  name,
isc_uint16_t digestbits 
)

Definition at line 978 of file config.c.

References ns_config_getkeyalgorithm2().

Referenced by add_initial_keys().

isc_result_t ns_config_getkeyalgorithm2 ( const char *  str,
dns_name_t **  name,
unsigned int *  typep,
isc_uint16_t digestbits 
)

Definition at line 985 of file config.c.

References algorithms, dns_tsig_hmacmd5_name, dns_tsig_hmacsha1_name, dns_tsig_hmacsha224_name, dns_tsig_hmacsha256_name, dns_tsig_hmacsha384_name, dns_tsig_hmacsha512_name, hmacmd5, hmacsha1, hmacsha224, hmacsha256, hmacsha384, hmacsha512, INSIST, isc_parse_uint16(), ISC_R_NOTFOUND, ISC_R_RANGE, ISC_R_SUCCESS, keyalgorithms::size, keyalgorithms::str, and keyalgorithms::type.

Referenced by configure_session_key(), get_rndckey(), ns_config_getkeyalgorithm(), and register_keys().


Variable Documentation

char defaultconf[] [static]

default configuration

Definition at line 51 of file config.c.

Referenced by ns_config_parsedefaults().

struct keyalgorithms algorithms[]

Referenced by bind9_check_key(), disable_algorithms(), dns_resolver_algorithm_supported(), dns_resolver_disable_algorithm(), free_algorithm(), and ns_config_getkeyalgorithm2().


Generated on Tue Apr 28 17:41:06 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha