00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef NAMED_LWRESD_H
00021 #define NAMED_LWRESD_H 1
00022
00023
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
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
00071
00072 void
00073 ns_lwresd_shutdown(void);
00074
00075
00076
00077
00078
00079 isc_result_t
00080 ns_lwdmanager_create(isc_mem_t *mctx, const cfg_obj_t *lwres,
00081 ns_lwresd_t **lwresdp);
00082
00083
00084 void
00085 ns_lwdmanager_attach(ns_lwresd_t *source, ns_lwresd_t **targetp);
00086
00087
00088 void
00089 ns_lwdmanager_detach(ns_lwresd_t **lwresdp);
00090
00091
00092
00093
00094
00095 void
00096 ns_lwreslistener_attach(ns_lwreslistener_t *source,
00097 ns_lwreslistener_t **targetp);
00098
00099
00100 void
00101 ns_lwreslistener_detach(ns_lwreslistener_t **listenerp);
00102
00103
00104 void
00105 ns_lwreslistener_unlinkcm(ns_lwreslistener_t *listener, ns_lwdclientmgr_t *cm);
00106
00107
00108 void
00109 ns_lwreslistener_linkcm(ns_lwreslistener_t *listener, ns_lwdclientmgr_t *cm);
00110
00111
00112
00113
00114
00115
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