PageRenderTime 33ms CodeModel.GetById 15ms app.highlight 13ms RepoModel.GetById 1ms app.codeStats 0ms

/contrib/bind9/bin/named/include/named/lwresd.h

https://bitbucket.org/freebsd/freebsd-head/
C++ Header | 121 lines | 55 code | 26 blank | 40 comment | 0 complexity | f7b965244011bdb22f4f39f4d1c7bba0 MD5 | raw file
  1/*
  2 * Copyright (C) 2004-2007  Internet Systems Consortium, Inc. ("ISC")
  3 * Copyright (C) 2000, 2001  Internet Software Consortium.
  4 *
  5 * Permission to use, copy, modify, and/or distribute this software for any
  6 * purpose with or without fee is hereby granted, provided that the above
  7 * copyright notice and this permission notice appear in all copies.
  8 *
  9 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
 10 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
 11 * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
 12 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
 13 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
 14 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 15 * PERFORMANCE OF THIS SOFTWARE.
 16 */
 17
 18/* $Id: lwresd.h,v 1.19 2007/06/19 23:46:59 tbox Exp $ */
 19
 20#ifndef NAMED_LWRESD_H
 21#define NAMED_LWRESD_H 1
 22
 23/*! \file */
 24
 25#include <isc/types.h>
 26#include <isc/sockaddr.h>
 27
 28#include <isccfg/cfg.h>
 29
 30#include <dns/types.h>
 31
 32struct ns_lwresd {
 33	unsigned int magic;
 34
 35	isc_mutex_t lock;
 36	dns_view_t *view;
 37	ns_lwsearchlist_t *search;
 38	unsigned int ndots;
 39	isc_mem_t *mctx;
 40	isc_boolean_t shutting_down;
 41	unsigned int refs;
 42};
 43
 44struct ns_lwreslistener {
 45	unsigned int magic;
 46
 47	isc_mutex_t lock;
 48	isc_mem_t *mctx;
 49	isc_sockaddr_t address;
 50	ns_lwresd_t *manager;
 51	isc_socket_t *sock;
 52	unsigned int refs;
 53	ISC_LIST(ns_lwdclientmgr_t) cmgrs;
 54	ISC_LINK(ns_lwreslistener_t) link;
 55};
 56
 57/*%
 58 * Configure lwresd.
 59 */
 60isc_result_t
 61ns_lwresd_configure(isc_mem_t *mctx, const cfg_obj_t *config);
 62
 63isc_result_t
 64ns_lwresd_parseeresolvconf(isc_mem_t *mctx, cfg_parser_t *pctx,
 65			   cfg_obj_t **configp);
 66
 67/*%
 68 * Trigger shutdown.
 69 */
 70void
 71ns_lwresd_shutdown(void);
 72
 73/*
 74 * Manager functions
 75 */
 76/*% create manager */
 77isc_result_t
 78ns_lwdmanager_create(isc_mem_t *mctx, const cfg_obj_t *lwres,
 79		      ns_lwresd_t **lwresdp);
 80
 81/*% attach to manager */
 82void
 83ns_lwdmanager_attach(ns_lwresd_t *source, ns_lwresd_t **targetp);
 84
 85/*% detach from manager */
 86void
 87ns_lwdmanager_detach(ns_lwresd_t **lwresdp);
 88
 89/*
 90 * Listener functions
 91 */
 92/*% attach to listener */
 93void
 94ns_lwreslistener_attach(ns_lwreslistener_t *source,
 95			ns_lwreslistener_t **targetp);
 96
 97/*% detach from lister */
 98void
 99ns_lwreslistener_detach(ns_lwreslistener_t **listenerp);
100
101/*% link client manager */
102void
103ns_lwreslistener_unlinkcm(ns_lwreslistener_t *listener, ns_lwdclientmgr_t *cm);
104
105/*% unlink client manager */
106void
107ns_lwreslistener_linkcm(ns_lwreslistener_t *listener, ns_lwdclientmgr_t *cm);
108
109
110
111
112/*
113 * INTERNAL FUNCTIONS.
114 */
115void *
116ns__lwresd_memalloc(void *arg, size_t size);
117
118void
119ns__lwresd_memfree(void *arg, void *mem, size_t size);
120
121#endif /* NAMED_LWRESD_H */