lwresd.h File Reference

#include <isc/types.h>
#include <isc/sockaddr.h>
#include <isccfg/cfg.h>
#include <dns/types.h>

Go to the source code of this file.

Data Structures

struct  ns_lwresd
struct  ns_lwreslistener

Defines

#define NAMED_LWRESD_H   1

Functions

isc_result_t ns_lwresd_configure (isc_mem_t *mctx, const cfg_obj_t *config)
 Configure lwresd.
isc_result_t ns_lwresd_parseeresolvconf (isc_mem_t *mctx, cfg_parser_t *pctx, cfg_obj_t **configp)
void ns_lwresd_shutdown (void)
 Trigger shutdown.
isc_result_t ns_lwdmanager_create (isc_mem_t *mctx, const cfg_obj_t *lwres, ns_lwresd_t **lwresdp)
 create manager
void ns_lwdmanager_attach (ns_lwresd_t *source, ns_lwresd_t **targetp)
 attach to manager
void ns_lwdmanager_detach (ns_lwresd_t **lwresdp)
 detach from manager
void ns_lwreslistener_attach (ns_lwreslistener_t *source, ns_lwreslistener_t **targetp)
 attach to listener
void ns_lwreslistener_detach (ns_lwreslistener_t **listenerp)
 detach from lister
void ns_lwreslistener_unlinkcm (ns_lwreslistener_t *listener, ns_lwdclientmgr_t *cm)
 link client manager
void ns_lwreslistener_linkcm (ns_lwreslistener_t *listener, ns_lwdclientmgr_t *cm)
 unlink client manager
void * ns__lwresd_memalloc (void *arg, size_t size)
 Wrappers around our memory management stuff, for the lwres functions.
void ns__lwresd_memfree (void *arg, void *mem, size_t size)


Detailed Description

Definition in file lwresd.h.


Define Documentation

#define NAMED_LWRESD_H   1

Definition at line 21 of file lwresd.h.


Function Documentation

isc_result_t ns_lwresd_configure ( isc_mem_t mctx,
const cfg_obj_t config 
)

Configure lwresd.

Definition at line 778 of file lwresd.c.

References ns_lwreslistener::address, cfg_list_first(), cfg_list_next(), cfg_listelt_value(), cfg_map_get(), CHECK, cleanup(), configure_listener(), INADDR_LOOPBACK, ISC_LIST_APPENDLIST, ISC_LIST_EMPTY, ISC_LIST_HEAD, ISC_LIST_INIT, ISC_LIST_UNLINK, ISC_LOG_NOTICE, isc_log_write(), ISC_LOGCATEGORY_GENERAL, isc_once_do, ISC_R_SUCCESS, isc_sockaddr_format(), ISC_SOCKADDR_FORMATSIZE, isc_sockaddr_fromin(), listener_shutdown(), LOCK, ns_config_getiplist(), ns_config_putiplist(), NS_LOGMODULE_LWRESD, ns_lwdmanager_create(), ns_lwdmanager_detach(), ns_lwreslistener_detach(), once, port, REQUIRE, RUNTIME_CHECK, and UNLOCK.

Referenced by load_configuration().

isc_result_t ns_lwresd_parseeresolvconf ( isc_mem_t mctx,
cfg_parser_t pctx,
cfg_obj_t **  configp 
)

Definition at line 110 of file lwresd.c.

References buffer_putstr(), cfg_parse_buffer(), cfg_type_namedconf, CHECK, cleanup(), DNS_R_SYNTAX, INSIST, isc_buffer_base, isc_buffer_init, isc_buffer_usedlength, ISC_LOG_ERROR, isc_log_write(), isc_netaddr_format(), ISC_NETADDR_FORMATSIZE, isc_netaddr_fromsockaddr(), isc_netaddr_masktoprefixlen(), isc_netaddr_totext(), ISC_R_NOMEMORY, ISC_R_SUCCESS, lwaddr_sockaddr_fromlwresaddr(), lwctx, ns__lwresd_memalloc(), ns__lwresd_memfree(), NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_LWRESD, str, and text.

Referenced by load_configuration().

void ns_lwresd_shutdown ( void   ) 

Trigger shutdown.

Definition at line 883 of file lwresd.c.

References ISC_LIST_EMPTY, ISC_LIST_HEAD, ISC_LIST_UNLINK, isc_once_do, ISC_R_SUCCESS, ns_lwreslistener_detach(), once, and RUNTIME_CHECK.

Referenced by destroy_managers().

isc_result_t ns_lwdmanager_create ( isc_mem_t mctx,
const cfg_obj_t lwres,
ns_lwresd_t **  lwresdp 
)

create manager

Definition at line 285 of file lwresd.c.

References cfg_list_first(), cfg_list_next(), cfg_listelt_value(), cfg_map_get(), cfg_obj_asstring(), cfg_obj_asuint32(), cfg_tuple_get(), dns_fixedname_init, dns_fixedname_name, dns_name_fromtext(), dns_rootname, dns_view_detach(), dns_viewlist_find(), INSIST, isc_buffer_add, isc_buffer_constinit, ISC_FALSE, ISC_LOG_WARNING, isc_log_write(), isc_mem_attach(), isc_mem_detach(), isc_mem_get, isc_mem_put, isc_mutex_init, ISC_R_NOMEMORY, ISC_R_SUCCESS, ns_lwresd::lock, LWRESD_MAGIC, LWRESD_NCLIENTS_MAX, ns_lwresd::magic, ns_lwresd::mctx, name, namebuf, ns_lwresd::nclients, ns_lwresd::ndots, ns_config_getclass(), NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_LWRESD, ns_lwsearchlist_append(), ns_lwsearchlist_create(), ns_lwsearchlist_detach(), ns_lwresd::ntasks, ns_lwresd::refs, RUNTIME_CHECK, search(), ns_lwresd::search, ns_lwresd::shutting_down, and ns_lwresd::view.

Referenced by ns_lwresd_configure().

void ns_lwdmanager_attach ( ns_lwresd_t source,
ns_lwresd_t **  targetp 
)

attach to manager

Definition at line 429 of file lwresd.c.

References INSIST, ns_lwresd::lock, LOCK, ns_lwresd::refs, UNLOCK, and VALID_LWRESD.

Referenced by listener_create().

void ns_lwdmanager_detach ( ns_lwresd_t **  lwresdp  ) 

detach from manager

Definition at line 441 of file lwresd.c.

References dns_view_detach(), INSIST, ISC_FALSE, isc_mem_detach(), isc_mem_put, ISC_TRUE, ns_lwresd::lock, LOCK, ns_lwresd::magic, ns_lwresd::mctx, mctx, ns_lwsearchlist_detach(), ns_lwresd::refs, ns_lwresd::search, UNLOCK, VALID_LWRESD, and ns_lwresd::view.

Referenced by ns_lwresd_configure(), and ns_lwreslistener_detach().

void ns_lwreslistener_attach ( ns_lwreslistener_t source,
ns_lwreslistener_t **  targetp 
)

attach to listener

Definition at line 476 of file lwresd.c.

References INSIST, ns_lwreslistener::lock, LOCK, ns_lwreslistener::refs, UNLOCK, and VALID_LWRESLISTENER.

Referenced by ns_lwdclientmgr_create().

void ns_lwreslistener_detach ( ns_lwreslistener_t **  listenerp  ) 

detach from lister

Definition at line 490 of file lwresd.c.

References INSIST, ISC_FALSE, isc_mem_detach(), isc_mem_put, isc_socket_detach(), ISC_TRUE, ns_lwreslistener::lock, LOCK, ns_lwreslistener::magic, ns_lwreslistener::manager, ns_lwreslistener::mctx, mctx, ns_lwdmanager_detach(), ns_lwreslistener::refs, ns_lwreslistener::sock, UNLOCK, and VALID_LWRESLISTENER.

Referenced by configure_listener(), lwdclientmgr_destroy(), ns_lwresd_configure(), and ns_lwresd_shutdown().

void ns_lwreslistener_unlinkcm ( ns_lwreslistener_t listener,
ns_lwdclientmgr_t cm 
)

link client manager

Definition at line 696 of file lwresd.c.

References ISC_LIST_UNLINK, ns_lwreslistener::lock, LOCK, REQUIRE, UNLOCK, and VALID_LWRESLISTENER.

Referenced by lwdclientmgr_destroy().

void ns_lwreslistener_linkcm ( ns_lwreslistener_t listener,
ns_lwdclientmgr_t cm 
)

unlink client manager

Definition at line 706 of file lwresd.c.

References ISC_LIST_APPEND, REQUIRE, and VALID_LWRESLISTENER.

Referenced by ns_lwdclientmgr_create().

void* ns__lwresd_memalloc ( void *  arg,
size_t  size 
)

Wrappers around our memory management stuff, for the lwres functions.

Definition at line 82 of file lwresd.c.

References isc_mem_get.

Referenced by ns_lwdclientmgr_create(), and ns_lwresd_parseeresolvconf().

void ns__lwresd_memfree ( void *  arg,
void *  mem,
size_t  size 
)

Definition at line 87 of file lwresd.c.

References isc_mem_put.

Referenced by ns_lwdclientmgr_create(), and ns_lwresd_parseeresolvconf().


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