mirror of
https://github.com/isc-projects/bind9.git
synced 2026-02-23 18:04:10 -05:00
A qp-trie is a kind of radix tree that is particularly well-suited to DNS servers. I invented the qp-trie in 2015, based on Dan Bernstein's crit-bit trees and Phil Bagwell's HAMT. https://dotat.at/prog/qp/ This code incorporates some new ideas that I prototyped using NLnet Labs NSD in 2020 (optimizations for DNS names as keys) and 2021 (custom allocator and garbage collector). https://dotat.at/cgi/git/nsd.git The BIND version of my qp-trie code has a number of improvements compared to the prototype developed for NSD. * The main omission in the prototype was the very sketchy outline of how locking might work. Now the locking has been implemented, using a reader/writer lock and a mutex. However, it is designed to benefit from liburcu if that is available. * The prototype was designed for two-version concurrency, one version for readers and one for the writer. The new code supports multiversion concurrency, to provide a basis for BIND's dbversion machinery, so that updates are not blocked by long-running zone transfers. * There are now two kinds of transaction that modify the trie: an `update` aims to support many very small zones without wasting memory; a `write` avoids unnecessary allocation to help the performance of many small changes to the cache. * There is also a single-threaded interface for situations where concurrent access is not necessary. * The API makes better use of types to make it more clear which operations are permitted when. * The lookup table used to convert a DNS name to a qp-trie key is now initialized by a run-time constructor instead of a programmer using copy-and-paste. Key conversion is more flexible, so the qp-trie can be used with keys other than DNS names. * There has been much refactoring and re-arranging things to improve the terminology and order of presentation in the code, and the internal documentation has been moved from a comment into a file of its own. Some of the required functionality has been stripped out, to be brought back later after the basics are known to work. * Garbage collector performance statistics are missing. * Fancy searches are missing, such as longest match and nearest match. * Iteration is missing. * Search for update is missing, for cases where the caller needs to know if the value object is mutable or not.
328 lines
6.1 KiB
Makefile
328 lines
6.1 KiB
Makefile
include $(top_srcdir)/Makefile.top
|
|
|
|
lib_LTLIBRARIES = libdns.la
|
|
|
|
nodist_libdns_ladir = $(includedir)/dns
|
|
nodist_libdns_la_HEADERS = \
|
|
include/dns/enumclass.h \
|
|
include/dns/enumtype.h \
|
|
include/dns/rdatastruct.h
|
|
|
|
nodist_libdns_la_SOURCES = \
|
|
$(nodist_libdns_la_HEADERS) \
|
|
code.h
|
|
|
|
BUILT_SOURCES = \
|
|
$(nodist_libdns_la_SOURCES)
|
|
|
|
CLEANFILES = \
|
|
$(nodist_libdns_la_SOURCES) \
|
|
gen$(BUILD_EXEEXT)
|
|
|
|
gen$(BUILD_EXEEXT): gen.c
|
|
$(CC_FOR_BUILD) -g -I. $(srcdir)/gen.c -o $@
|
|
|
|
EXTRA_DIST = \
|
|
dnstap.proto \
|
|
gen.c \
|
|
rdata/*
|
|
|
|
include/dns/enumtype.h: gen Makefile
|
|
mkdir -p include/dns
|
|
$(builddir)/gen -s $(srcdir) -t > $@
|
|
|
|
include/dns/enumclass.h: gen Makefile
|
|
mkdir -p include/dns
|
|
$(builddir)/gen -s $(srcdir) -c > $@
|
|
|
|
include/dns/rdatastruct.h: gen rdata/rdatastructpre.h rdata/rdatastructsuf.h Makefile
|
|
mkdir -p include/dns
|
|
$(builddir)/gen -s $(srcdir) -i \
|
|
-P $(srcdir)/rdata/rdatastructpre.h \
|
|
-S $(srcdir)/rdata/rdatastructsuf.h > $@
|
|
|
|
code.h: gen Makefile
|
|
$(builddir)/gen -s $(srcdir) > $@
|
|
|
|
libdns_ladir = $(includedir)/dns
|
|
libdns_la_HEADERS = \
|
|
include/dns/acl.h \
|
|
include/dns/adb.h \
|
|
include/dns/badcache.h \
|
|
include/dns/bit.h \
|
|
include/dns/byaddr.h \
|
|
include/dns/cache.h \
|
|
include/dns/callbacks.h \
|
|
include/dns/catz.h \
|
|
include/dns/cert.h \
|
|
include/dns/client.h \
|
|
include/dns/clientinfo.h \
|
|
include/dns/compress.h \
|
|
include/dns/db.h \
|
|
include/dns/dbiterator.h \
|
|
include/dns/diff.h \
|
|
include/dns/dispatch.h \
|
|
include/dns/dlz.h \
|
|
include/dns/dlz_dlopen.h \
|
|
include/dns/dns64.h \
|
|
include/dns/dnsrps.h \
|
|
include/dns/dnssec.h \
|
|
include/dns/ds.h \
|
|
include/dns/dsdigest.h \
|
|
include/dns/dnstap.h \
|
|
include/dns/dyndb.h \
|
|
include/dns/ecs.h \
|
|
include/dns/edns.h \
|
|
include/dns/fixedname.h \
|
|
include/dns/forward.h \
|
|
include/dns/geoip.h \
|
|
include/dns/ipkeylist.h \
|
|
include/dns/iptable.h \
|
|
include/dns/journal.h \
|
|
include/dns/kasp.h \
|
|
include/dns/keydata.h \
|
|
include/dns/keyflags.h \
|
|
include/dns/keymgr.h \
|
|
include/dns/keytable.h \
|
|
include/dns/keyvalues.h \
|
|
include/dns/librpz.h \
|
|
include/dns/log.h \
|
|
include/dns/master.h \
|
|
include/dns/masterdump.h \
|
|
include/dns/message.h \
|
|
include/dns/name.h \
|
|
include/dns/ncache.h \
|
|
include/dns/nsec.h \
|
|
include/dns/nsec3.h \
|
|
include/dns/nta.h \
|
|
include/dns/opcode.h \
|
|
include/dns/order.h \
|
|
include/dns/peer.h \
|
|
include/dns/private.h \
|
|
include/dns/qp.h \
|
|
include/dns/rbt.h \
|
|
include/dns/rcode.h \
|
|
include/dns/rdata.h \
|
|
include/dns/rdataclass.h \
|
|
include/dns/rdatalist.h \
|
|
include/dns/rdataset.h \
|
|
include/dns/rdatasetiter.h \
|
|
include/dns/rdataslab.h \
|
|
include/dns/rdatatype.h \
|
|
include/dns/remote.h \
|
|
include/dns/request.h \
|
|
include/dns/resolver.h \
|
|
include/dns/result.h \
|
|
include/dns/rootns.h \
|
|
include/dns/rpz.h \
|
|
include/dns/rriterator.h \
|
|
include/dns/rrl.h \
|
|
include/dns/sdlz.h \
|
|
include/dns/secalg.h \
|
|
include/dns/secproto.h \
|
|
include/dns/soa.h \
|
|
include/dns/ssu.h \
|
|
include/dns/stats.h \
|
|
include/dns/time.h \
|
|
include/dns/transport.h \
|
|
include/dns/tkey.h \
|
|
include/dns/tsig.h \
|
|
include/dns/ttl.h \
|
|
include/dns/types.h \
|
|
include/dns/update.h \
|
|
include/dns/validator.h \
|
|
include/dns/view.h \
|
|
include/dns/xfrin.h \
|
|
include/dns/zone.h \
|
|
include/dns/zonekey.h \
|
|
include/dns/zoneverify.h \
|
|
include/dns/zt.h
|
|
|
|
dstdir = $(includedir)/dst
|
|
dst_HEADERS = \
|
|
include/dst/dst.h \
|
|
include/dst/gssapi.h
|
|
|
|
irsdir = $(includedir)/irs
|
|
irs_HEADERS = \
|
|
include/irs/resconf.h
|
|
|
|
libdns_la_SOURCES = \
|
|
$(libdns_la_HEADERS) \
|
|
$(dst_HEADERS) \
|
|
$(irs_HEADERS) \
|
|
acl.c \
|
|
adb.c \
|
|
badcache.c \
|
|
byaddr.c \
|
|
cache.c \
|
|
callbacks.c \
|
|
catz.c \
|
|
client.c \
|
|
clientinfo.c \
|
|
compress.c \
|
|
db.c \
|
|
dbiterator.c \
|
|
diff.c \
|
|
dispatch.c \
|
|
dlz.c \
|
|
dns64.c \
|
|
dnsrps.c \
|
|
dnssec.c \
|
|
ds.c \
|
|
dst_api.c \
|
|
dst_internal.h \
|
|
dst_openssl.h \
|
|
dst_parse.c \
|
|
dst_parse.h \
|
|
dyndb.c \
|
|
ecs.c \
|
|
fixedname.c \
|
|
forward.c \
|
|
gssapictx.c \
|
|
hmac_link.c \
|
|
ipkeylist.c \
|
|
iptable.c \
|
|
journal.c \
|
|
kasp.c \
|
|
key.c \
|
|
keydata.c \
|
|
keymgr.c \
|
|
keytable.c \
|
|
log.c \
|
|
master.c \
|
|
masterdump.c \
|
|
message.c \
|
|
name.c \
|
|
ncache.c \
|
|
nsec.c \
|
|
nsec3.c \
|
|
nta.c \
|
|
openssl_link.c \
|
|
openssl_shim.c \
|
|
openssl_shim.h \
|
|
openssldh_link.c \
|
|
opensslecdsa_link.c \
|
|
openssleddsa_link.c \
|
|
opensslrsa_link.c \
|
|
order.c \
|
|
peer.c \
|
|
private.c \
|
|
qp.c \
|
|
qp_p.h \
|
|
rbt.c \
|
|
rbtdb.h \
|
|
rbtdb.c \
|
|
rcode.c \
|
|
rdata.c \
|
|
rdatalist.c \
|
|
rdataset.c \
|
|
rdatasetiter.c \
|
|
rdataslab.c \
|
|
remote.c \
|
|
request.c \
|
|
resconf.c \
|
|
resolver.c \
|
|
result.c \
|
|
rootns.c \
|
|
rpz.c \
|
|
rrl.c \
|
|
rriterator.c \
|
|
sdlz.c \
|
|
soa.c \
|
|
ssu.c \
|
|
ssu_external.c \
|
|
stats.c \
|
|
time.c \
|
|
transport.c \
|
|
tkey.c \
|
|
tsig.c \
|
|
tsig_p.h \
|
|
ttl.c \
|
|
update.c \
|
|
validator.c \
|
|
view.c \
|
|
xfrin.c \
|
|
zone.c \
|
|
zone_p.h \
|
|
zoneverify.c \
|
|
zonekey.c \
|
|
zt.c
|
|
|
|
if HAVE_GSSAPI
|
|
libdns_la_SOURCES += \
|
|
gssapi_link.c
|
|
endif
|
|
|
|
if HAVE_GEOIP2
|
|
libdns_la_SOURCES += \
|
|
geoip2.c
|
|
endif
|
|
|
|
libdns_la_CPPFLAGS = \
|
|
$(AM_CPPFLAGS) \
|
|
$(LIBDNS_CFLAGS) \
|
|
$(LIBISC_CFLAGS) \
|
|
$(LIBUV_CFLAGS) \
|
|
$(OPENSSL_CFLAGS)
|
|
|
|
libdns_la_LDFLAGS = \
|
|
$(AM_LDFLAGS) \
|
|
-release "$(PACKAGE_VERSION)"
|
|
|
|
libdns_la_LIBADD = \
|
|
$(LIBISC_LIBS) \
|
|
$(LIBUV_LIBS) \
|
|
$(OPENSSL_LIBS)
|
|
|
|
if HAVE_JSON_C
|
|
libdns_la_CPPFLAGS += \
|
|
$(JSON_C_CFLAGS)
|
|
|
|
libdns_la_LIBADD += \
|
|
$(JSON_C_LIBS)
|
|
endif HAVE_JSON_C
|
|
|
|
if HAVE_LIBXML2
|
|
libdns_la_CPPFLAGS += \
|
|
$(LIBXML2_CFLAGS)
|
|
|
|
libdns_la_LIBADD += \
|
|
$(LIBXML2_LIBS)
|
|
endif HAVE_LIBXML2
|
|
|
|
if HAVE_GSSAPI
|
|
libdns_la_CPPFLAGS += \
|
|
$(GSSAPI_CFLAGS) \
|
|
$(KRB5_CFLAGS)
|
|
libdns_la_LIBADD += \
|
|
$(GSSAPI_LIBS) \
|
|
$(KRB5_LIBS)
|
|
endif
|
|
|
|
if HAVE_GEOIP2
|
|
libdns_la_CPPFLAGS += \
|
|
$(MAXMINDDB_CFLAGS)
|
|
libdns_la_LIBADD += \
|
|
$(MAXMINDDB_LIBS)
|
|
endif
|
|
|
|
if HAVE_DNSTAP
|
|
nodist_libdns_la_SOURCES += \
|
|
dnstap.pb-c.h \
|
|
dnstap.pb-c.c
|
|
|
|
libdns_la_SOURCES += \
|
|
dnstap.c
|
|
|
|
dnstap.pb-c.h dnstap.pb-c.c: dnstap.proto
|
|
$(PROTOC_C) --proto_path=$(srcdir) --c_out=. dnstap.proto
|
|
|
|
libdns_la_CPPFLAGS += $(DNSTAP_CFLAGS)
|
|
libdns_la_LIBADD += $(DNSTAP_LIBS)
|
|
endif
|
|
|
|
if HAVE_LMDB
|
|
libdns_la_CPPFLAGS += $(LMDB_CFLAGS)
|
|
libdns_la_LIBADD += $(LMDB_LIBS)
|
|
endif
|