/ylwrap
/doc/doxyxml
/doc/html
-/daemon/kresolved
+/daemon/kresd
/tests/test_array
/tests/test_map
/tests/test_module
The project builds a resolver library in the `lib` directory, and a daemon in the `daemon` directory.
```
-$ ./daemon/kresolved -h
-$ ./daemon/kresolved [working_directory]
+$ ./daemon/kresd -h
+$ ./daemon/kresd [working_directory]
```
See the documentation at [knot-resolver.readthedocs.org][doc].
# Project
MAJOR := 15
-MINOR := 04
+MINOR := 07
PATCH := 0
# Paths
.. code-block:: bash
- $ ./daemon/kresolved -h
+ $ ./daemon/kresd -h
Interacting with the daemon
---------------------------
.. code-block:: bash
- $ kresolved /var/run/knot-resolver
+ $ kresd /var/run/knot-resolver
[system] started in interactive mode, type 'help()'
> cache.count()
53
.. code-block:: sh
- $ kresolved /var/run/kresolved
+ $ kresd /var/run/kresd
And you're good to go for most use cases! If you want to use modules or configure daemon behavior, read on.
-kresolved_EMBED := \
+kresd_EMBED := \
contrib/ccan/json/json.c
-kresolved_SOURCES := \
- $(kresolved_EMBED) \
+kresd_SOURCES := \
+ $(kresd_EMBED) \
daemon/io.c \
daemon/network.c \
daemon/engine.c \
@$(call quiet,XXD,$<) $< > $@
# Dependencies
-kresolved_DEPEND := $(libkresolve)
-kresolved_LIBS := $(libkresolve_TARGET) $(libknot_LIBS) $(libuv_LIBS) $(lua_LIBS)
+kresd_DEPEND := $(libkres)
+kresd_LIBS := $(libkres_TARGET) $(libknot_LIBS) $(libuv_LIBS) $(lua_LIBS)
# Make binary
ifeq ($(HAS_lua)|$(HAS_libuv), yes|yes)
-$(eval $(call make_bin,kresolved,daemon))
+$(eval $(call make_bin,kresd,daemon))
endif
# Targets
-daemon: $(kresolved)
-daemon-install: kresolved-install
-daemon-clean: kresolved-clean
+daemon: $(kresd)
+daemon-install: kresd-install
+daemon-clean: kresd-clean
@$(RM) daemon/lua/*.inc
.PHONY: daemon daemon-install daemon-clean
extensions = ['sphinx.ext.todo', 'sphinx.ext.viewcode', 'breathe']
# Breathe configuration
-breathe_projects = { "libkresolve": "doxyxml" }
-breathe_default_project = "libkresolve"
+breathe_projects = { "libkres": "doxyxml" }
+breathe_default_project = "libkres"
breathe_domain_by_extension = {"h" : "c"}
# The suffix of source filenames.
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
- ('index', 'libkresolve', u'libkresolve documentation',
+ ('index', 'libkres', u'libkres documentation',
[u'CZ.NIC Labs'], 1)
]
---------------
.. doxygenfile:: resolve.h
- :project: libkresolve
+ :project: libkres
.. doxygenfile:: rplan.h
- :project: libkresolve
+ :project: libkres
.. _lib_api_cache:
-----
.. doxygenfile:: cache.h
- :project: libkresolve
+ :project: libkres
.. _lib_api_nameservers:
-----------
.. doxygenfile:: nsrep.h
- :project: libkresolve
+ :project: libkres
.. doxygenfile:: zonecut.h
- :project: libkresolve
+ :project: libkres
.. _lib_api_modules:
-------
.. doxygenfile:: module.h
- :project: libkresolve
+ :project: libkres
Utilities
---------
.. doxygenfile:: utils.h
- :project: libkresolve
+ :project: libkres
.. doxygenfile:: defines.h
- :project: libkresolve
+ :project: libkres
.. _lib_generics:
~~~~~
.. doxygenfile:: array.h
- :project: libkresolve
+ :project: libkres
map
~~~
.. doxygenfile:: map.h
- :project: libkresolve
+ :project: libkres
set
~~~
.. doxygenfile:: set.h
- :project: libkresolve
+ :project: libkres
pack
~~~~
.. doxygenfile:: pack.h
- :project: libkresolve
+ :project: libkres
lru
~~~
.. doxygenfile:: lru.h
- :project: libkresolve
+ :project: libkres
.. _`Crit-bit tree`: http://cr.yp.to/critbit.html
contrib/ccan/isaac/isaac.c \
contrib/murmurhash3/murmurhash3.c
-libkresolve_SOURCES := \
+libkres_SOURCES := \
$(ccan_EMBED) \
lib/generic/map.c \
lib/layer/iterate.c \
lib/rplan.c \
lib/cache.c
-libkresolve_HEADERS := \
+libkres_HEADERS := \
lib/generic/array.h \
lib/generic/map.h \
lib/generic/set.h \
lib/cache.h
# Dependencies
-libkresolve_DEPEND :=
-libkresolve_LIBS := $(libknot_LIBS)
-libkresolve_TARGET := -Wl,-rpath,lib -Llib -lkresolve
+libkres_DEPEND :=
+libkres_LIBS := $(libknot_LIBS)
+libkres_TARGET := -Wl,-rpath,lib -Llib -lkres
# Make library
-$(eval $(call make_static,libkresolve,lib))
+$(eval $(call make_static,libkres,lib))
# Targets
-lib: $(libkresolve)
-lib-install: libkresolve-install
-lib-clean: libkresolve-clean
+lib: $(libkres)
+lib-install: libkres-install
+lib-clean: libkres-clean
.PHONY: lib lib-install lib-clean
.. code-block:: bash
- $ kresolved
+ $ kresd
...
[system] started in interactive mode, type 'help()'
> modules.load('cached')
cachectl_SOURCES := modules/cachectl/cachectl.c
-cachectl_DEPEND := $(libkresolve)
-cachectl_LIBS := $(libkresolve_TARGET) $(libkresolve_LIBS)
+cachectl_DEPEND := $(libkres)
+cachectl_LIBS := $(libkres_TARGET) $(libkres_LIBS)
$(call make_c_module,cachectl)
\ No newline at end of file
gostats_SOURCES := modules/gostats/gostats.go
-gostats_DEPEND := $(libkresolve)
-gostats_LIBS := $(libkresolve_TARGET) $(libkresolve_LIBS)
+gostats_DEPEND := $(libkres)
+gostats_LIBS := $(libkres_TARGET) $(libkres_LIBS)
$(call make_go_module,gostats)
\ No newline at end of file
hints_SOURCES := modules/hints/hints.c contrib/ccan/json/json.c
-hints_DEPEND := $(libkresolve)
-hints_LIBS := $(libkresolve_TARGET) $(libkresolve_LIBS)
+hints_DEPEND := $(libkres)
+hints_LIBS := $(libkres_TARGET) $(libkres_LIBS)
$(call make_c_module,hints)
\ No newline at end of file
-----------
The module connects to Etcd peers and watches for configuration change.
-By default, the module looks for the subtree under ``/kresolved`` directory,
+By default, the module looks for the subtree under ``/kresd`` directory,
but you can change this `in the configuration <https://github.com/mah0x211/lua-etcd#cli-err--etcdnew-optiontable->`_.
The subtree structure corresponds to the configuration variables in the declarative style.
.. code-block:: bash
- $ etcdctl set /kresolved/net/127.0.0.1 53
- $ etcdctl set /kresolved/modules/cachectl true
- $ etcdctl set /kresolved/cache/size 10000000
+ $ etcdctl set /kresd/net/127.0.0.1 53
+ $ etcdctl set /kresd/modules/cachectl true
+ $ etcdctl set /kresd/cache/size 10000000
Configures all listening nodes to following configuration:
modules = {
ketcd = {
- prefix = '/kresolved',
+ prefix = '/kresd',
peer = 'http://127.0.0.1:7001'
}
}
function ketcd.init(module)
ketcd.Etcd = require('etcd.luasocket')
- ketcd.defaults = { prefix = '/kresolved' }
+ ketcd.defaults = { prefix = '/kresd' }
end
function ketcd.deinit(module)
kmemcached_SOURCES := modules/kmemcached/kmemcached.c modules/kmemcached/namedb_memcached.c
-kmemcached_LIBS := $(libkresolve_TARGET) $(libkresolve_LIBS) $(libmemcached_LIBS)
+kmemcached_LIBS := $(libkres_TARGET) $(libkres_LIBS) $(libmemcached_LIBS)
$(call make_c_module,kmemcached)
stats_SOURCES := modules/stats/stats.c contrib/ccan/json/json.c
-stats_DEPEND := $(libkresolve)
-stats_LIBS := $(libkresolve_TARGET) $(libkresolve_LIBS)
+stats_DEPEND := $(libkres)
+stats_LIBS := $(libkres_TARGET) $(libkres_LIBS)
$(call make_c_module,stats)
# Select entrypoint
WORKDIR /data
-CMD ["/usr/local/bin/kresolved"]
+CMD ["/usr/local/bin/kresd"]
# Install dependencies and sources
RUN \
# Mocked calls library
libmock_calls_SOURCES := tests/mock_calls.c
libmock_calls_LIBS := $(tests_LIBS) $(python_LIBS)
-libmock_calls_DEPEND := $(libkresolve)
+libmock_calls_DEPEND := $(libkres)
$(eval $(call make_lib,libmock_calls,tests))
# Python module for tests
$(eval $(call make_lib,mock_gomodule,tests))
# Dependencies
-tests_DEPEND := $(libkresolve) $(mock_cmodule) $(mock_gomodule)
-tests_LIBS := $(libkresolve_TARGET) $(libkresolve_LIBS) $(cmocka_LIBS)
+tests_DEPEND := $(libkres) $(mock_cmodule) $(mock_gomodule)
+tests_LIBS := $(libkres_TARGET) $(libkres_LIBS) $(cmocka_LIBS)
# Make test binaries
define make_test