lwresd.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2004-2007, 2014  Internet Systems Consortium, Inc. ("ISC")
00003  * Copyright (C) 2000, 2001  Internet Software Consortium.
00004  *
00005  * Permission to use, copy, modify, and/or distribute this software for any
00006  * purpose with or without fee is hereby granted, provided that the above
00007  * copyright notice and this permission notice appear in all copies.
00008  *
00009  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
00010  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
00011  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
00012  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
00013  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
00014  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
00015  * PERFORMANCE OF THIS SOFTWARE.
00016  */
00017 
00018 /* $Id: lwresd.h,v 1.19 2007/06/19 23:46:59 tbox Exp $ */
00019 
00020 #ifndef NAMED_LWRESD_H
00021 #define NAMED_LWRESD_H 1
00022 
00023 /*! \file */
00024 
00025 #include <isc/types.h>
00026 #include <isc/sockaddr.h>
00027 
00028 #include <isccfg/cfg.h>
00029 
00030 #include <dns/types.h>
00031 
00032 struct ns_lwresd {
00033         unsigned int magic;
00034 
00035         isc_mutex_t lock;
00036         dns_view_t *view;
00037         ns_lwsearchlist_t *search;
00038         unsigned int ndots;
00039         unsigned int ntasks;
00040         unsigned int nclients;
00041         isc_mem_t *mctx;
00042         isc_boolean_t shutting_down;
00043         unsigned int refs;
00044 };
00045 
00046 struct ns_lwreslistener {
00047         unsigned int magic;
00048 
00049         isc_mutex_t lock;
00050         isc_mem_t *mctx;
00051         isc_sockaddr_t address;
00052         ns_lwresd_t *manager;
00053         isc_socket_t *sock;
00054         unsigned int refs;
00055         ISC_LIST(ns_lwdclientmgr_t) cmgrs;
00056         ISC_LINK(ns_lwreslistener_t) link;
00057 };
00058 
00059 /*%
00060  * Configure lwresd.
00061  */
00062 isc_result_t
00063 ns_lwresd_configure(isc_mem_t *mctx, const cfg_obj_t *config);
00064 
00065 isc_result_t
00066 ns_lwresd_parseeresolvconf(isc_mem_t *mctx, cfg_parser_t *pctx,
00067                            cfg_obj_t **configp);
00068 
00069 /*%
00070  * Trigger shutdown.
00071  */
00072 void
00073 ns_lwresd_shutdown(void);
00074 
00075 /*
00076  * Manager functions
00077  */
00078 /*% create manager */
00079 isc_result_t
00080 ns_lwdmanager_create(isc_mem_t *mctx, const cfg_obj_t *lwres,
00081                       ns_lwresd_t **lwresdp);
00082 
00083 /*% attach to manager */
00084 void
00085 ns_lwdmanager_attach(ns_lwresd_t *source, ns_lwresd_t **targetp);
00086 
00087 /*% detach from manager */
00088 void
00089 ns_lwdmanager_detach(ns_lwresd_t **lwresdp);
00090 
00091 /*
00092  * Listener functions
00093  */
00094 /*% attach to listener */
00095 void
00096 ns_lwreslistener_attach(ns_lwreslistener_t *source,
00097                         ns_lwreslistener_t **targetp);
00098 
00099 /*% detach from lister */
00100 void
00101 ns_lwreslistener_detach(ns_lwreslistener_t **listenerp);
00102 
00103 /*% link client manager */
00104 void
00105 ns_lwreslistener_unlinkcm(ns_lwreslistener_t *listener, ns_lwdclientmgr_t *cm);
00106 
00107 /*% unlink client manager */
00108 void
00109 ns_lwreslistener_linkcm(ns_lwreslistener_t *listener, ns_lwdclientmgr_t *cm);
00110 
00111 
00112 
00113 
00114 /*
00115  * INTERNAL FUNCTIONS.
00116  */
00117 void *
00118 ns__lwresd_memalloc(void *arg, size_t size);
00119 
00120 void
00121 ns__lwresd_memfree(void *arg, void *mem, size_t size);
00122 
00123 #endif /* NAMED_LWRESD_H */

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