2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-02 15:05:16 +00:00

improved build scripts, renamed kea-guide.rst to index.rst

This commit is contained in:
Michal Nowikowski
2019-07-16 18:40:50 +02:00
parent cc3cfee4fd
commit d1f24e1715
9 changed files with 582 additions and 366 deletions

View File

@@ -1440,25 +1440,56 @@ AC_ARG_ENABLE(generate_docs, [AC_HELP_STRING([--enable-generate-docs],
if test "x$enable_generate_docs" != xno ; then if test "x$enable_generate_docs" != xno ; then
# Check for xsltproc # Check for sphinx-build
AC_PATH_PROG([SPHINX], [sphinx-build]) AC_PATH_PROG([SPHINXBUILD], [sphinx-build])
if test -z "$SPHINX"; then if test -z "$SPHINXBUILD"; then
AC_MSG_ERROR([sphinx-build not found; it is required for --enable-generate-docs, please see http://www.sphinx-doc.org/en/master/usage/installation.html for details]) AC_MSG_ERROR([sphinx-build not found; it is required for --enable-generate-docs, please see http://www.sphinx-doc.org/en/master/usage/installation.html for details])
else else
AC_MSG_CHECKING([whether $SPHINX works]) AC_MSG_CHECKING([whether $SPHINXBUILD works])
# run sphinx to see if it works # run sphinx to see if it works
# We should probably do a more thorough checks # We should probably do a more thorough checks
$SPHINX --version $SPHINXBUILD --version
if test $? -ne 0 ; then if test $? -ne 0 ; then
AC_MSG_ERROR("Error with $SPHINX --version") AC_MSG_ERROR("Error with $SPHINXBUILD --version")
fi fi
AC_MSG_RESULT(yes (found in $SPHINX)) AC_MSG_RESULT(yes (found in $SPHINXBUILD))
fi
# xsltproc --nonet parameter
NONET="--nonet"
AC_ARG_VAR(XSLTPROC_NET, [xsltproc uses the Internet to fetch DTDs, entities or documents.])
if test "x$XSLTPROC_NET" != x ; then
NONET=
fi
AC_SUBST(NONET)
# Check for xsltproc
AC_PATH_PROG([XSLTPROC], [xsltproc])
if test -z "$XSLTPROC"; then
AC_MSG_ERROR("xsltproc not found; it is required for --enable-generate-docs")
else
AC_MSG_CHECKING([if $XSLTPROC works])
# run xsltproc to see if works
$XSLTPROC --novalid --xinclude $NONET http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
if test $? -ne 0 ; then
AC_MSG_ERROR("Error with $XSLTPROC using release/xsl/current/manpages/docbook.xsl")
fi
$XSLTPROC --novalid --xinclude $NONET http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl
if test $? -ne 0 ; then
AC_MSG_ERROR("Error with $XSLTPROC using release/xsl/current/html/docbook.xsl")
fi
AC_MSG_RESULT(yes)
fi
AC_PATH_PROG([ELINKS], [elinks])
if test -z "$ELINKS"; then
AC_MSG_ERROR("elinks not found; it is required for --enable-generate-docs")
fi fi
fi fi
# Don't fail here if not found, used to generate PDF documentation. # Don't fail here if not found, used to generate PDF documentation.
#AC_PATH_PROG([DBLATEX], [dblatex]) AC_PATH_PROG([DBLATEX], [dblatex])
#AM_CONDITIONAL(HAVE_DBLATEX, test "x$DBLATEX" != "x") AM_CONDITIONAL(HAVE_DBLATEX, test "x$DBLATEX" != "x")
AM_CONDITIONAL(GENERATE_DOCS, test x$enable_generate_docs != xno) AM_CONDITIONAL(GENERATE_DOCS, test x$enable_generate_docs != xno)

View File

@@ -182,15 +182,6 @@ devel:
(cat Doxyfile; echo PROJECT_NUMBER=$(PACKAGE_VERSION)) | doxygen - > html/doxygen.log 2> html/doxygen-error.log (cat Doxyfile; echo PROJECT_NUMBER=$(PACKAGE_VERSION)) | doxygen - > html/doxygen.log 2> html/doxygen-error.log
echo `grep -i ": warning:" html/doxygen-error.log | wc -l` warnings/errors detected. echo `grep -i ": warning:" html/doxygen-error.log | wc -l` warnings/errors detected.
guide:
$(MAKE) -C guide kea-guide.html
pdf:
$(MAKE) -C guide kea-guide.pdf
pages:
$(MAKE) -C guide pages
clean: clean:
rm -rf html rm -rf html

View File

@@ -1,5 +1,17 @@
if GENERATE_DOCS
# TODO
#HTMLDOCS = kea-guide.html kea-messages.html
#DOCS = kea-guide.txt
rst_sources=admin.rst #dist_doc_DATA = $(DOCS)
#dist_html_DATA = $(HTMLDOCS) kea-guide.css kea-logo-100x70.png
#dist_html_DATA = $(HTMLDOCS) _static/kea-logo-100x70.png
#doc_DATA = _build/singlehtml/kea-guide.html _build/singlehtml/_static/kea-logo-100x70.png
rst_sources=
rst_sources+=kea-messages.rst
rst_sources+=admin.rst
rst_sources+=agent.rst rst_sources+=agent.rst
rst_sources+=api.rst rst_sources+=api.rst
rst_sources+=classify.rst rst_sources+=classify.rst
@@ -20,9 +32,9 @@ rst_sources+=hooks-radius.rst
rst_sources+=hooks.rst rst_sources+=hooks.rst
rst_sources+=hooks-stat-cmds.rst rst_sources+=hooks-stat-cmds.rst
rst_sources+=install.rst rst_sources+=install.rst
rst_sources+=index.rst
rst_sources+=intro.rst rst_sources+=intro.rst
rst_sources+=keactrl.rst rst_sources+=keactrl.rst
rst_sources+=kea-guide.rst
rst_sources+=lease-expiration.rst rst_sources+=lease-expiration.rst
rst_sources+=lfc.rst rst_sources+=lfc.rst
rst_sources+=logging.rst rst_sources+=logging.rst
@@ -31,8 +43,50 @@ rst_sources+=quickstart.rst
rst_sources+=shell.rst rst_sources+=shell.rst
rst_sources+=stats.rst rst_sources+=stats.rst
static_sources=
static_sources+=_static/kea-imageonly-100bw.png
static_sources+=_static/kea-logo-200.png
static_sources+=_static/kea.css
all_sources=$(rst_sources) conf.py $(static_sources)
EXTRA_DIST = $(all_sources) $(top_srcdir)/tools/system_messages.py
DISTCLEANFILES = $(HTMLDOCS) $(DOCS) kea-messages.xml
CLEANFILES = kea-guide.pdf kea-messages.pdf
mes_files=
mes_files+=$(top_srcdir)/src/hooks/dhcp/mysql_cb/mysql_cb_messages.mes
mes_files+=$(top_srcdir)/src/hooks/dhcp/lease_cmds/lease_cmds_messages.mes
mes_files+=$(top_srcdir)/src/hooks/dhcp/high_availability/ha_messages.mes
mes_files+=$(top_srcdir)/src/hooks/dhcp/stat_cmds/stat_cmds_messages.mes
mes_files+=$(top_srcdir)/src/hooks/dhcp/user_chk/user_chk_messages.mes
mes_files+=$(top_srcdir)/src/lib/config/config_messages.mes
mes_files+=$(top_srcdir)/src/lib/hooks/hooks_messages.mes
mes_files+=$(top_srcdir)/src/lib/dhcpsrv/dhcpsrv_messages.mes
mes_files+=$(top_srcdir)/src/lib/dhcpsrv/alloc_engine_messages.mes
mes_files+=$(top_srcdir)/src/lib/dhcpsrv/hosts_messages.mes
mes_files+=$(top_srcdir)/src/lib/http/http_messages.mes
mes_files+=$(top_srcdir)/src/lib/dhcp_ddns/dhcp_ddns_messages.mes
mes_files+=$(top_srcdir)/src/lib/database/db_messages.mes
mes_files+=$(top_srcdir)/src/lib/log/log_messages.mes
mes_files+=$(top_srcdir)/src/lib/log/logimpl_messages.mes
mes_files+=$(top_srcdir)/src/lib/log/tests/log_test_messages.mes
mes_files+=$(top_srcdir)/src/lib/process/process_messages.mes
mes_files+=$(top_srcdir)/src/lib/asiodns/asiodns_messages.mes
mes_files+=$(top_srcdir)/src/lib/eval/eval_messages.mes
mes_files+=$(top_srcdir)/src/bin/dhcp4/dhcp4_messages.mes
mes_files+=$(top_srcdir)/src/bin/agent/ca_messages.mes
mes_files+=$(top_srcdir)/src/bin/d2/d2_messages.mes
mes_files+=$(top_srcdir)/src/bin/dhcp6/dhcp6_messages.mes
mes_files+=$(top_srcdir)/src/bin/lfc/lfc_messages.mes
mes_files+=$(top_srcdir)/src/bin/netconf/netconf_messages.mes
kea-messages.rst: $(mes_files) $(top_srcdir)/tools/system_messages.py
$(top_srcdir)/tools/system_messages.py -o $@ $(mes_files)
sphinxbuild = sphinx-build
sphinxopts= sphinxopts=
sphinxopts+=-v sphinxopts+=-v
@@ -44,21 +98,28 @@ sphinxopts+=-D version="@PACKAGE_VERSION@"
sphinxbuilddir=$(builddir)/_build sphinxbuilddir=$(builddir)/_build
all: pdf html singlehtml all: pdf html
pdf: $(rst_sources) pdf: $(all_sources)
$(sphinxbuild) -M latexpdf $(srcdir) $(sphinxbuilddir) $(sphinxopts) $(SPHINXBUILD) -M latexpdf $(srcdir) $(sphinxbuilddir) $(sphinxopts)
html singlehtml: $(rst_sources) html: $(all_sources)
$(sphinxbuild) -M $@ $(srcdir) $(sphinxbuilddir) $(sphinxopts) $(SPHINXBUILD) -M $@ $(srcdir) $(sphinxbuilddir) $(sphinxopts)
EXTRA_DIST = $(rst_sources) install-data-local:
mkdir -p $(DESTDIR)$(docdir)
cp -r $(sphinxbuilddir)/html $(DESTDIR)$(docdir)
cp -r $(sphinxbuilddir)/latex/KeaAdministratorReferenceManual.pdf $(DESTDIR)$(docdir)
# TODO: here should be added some stuff for DIST, etc to be consumed by automake/autoconf uninstall-local:
rm -rf $(DESTDIR)$(docdir)
clean:: clean::
-rm -rf $(sphinxbuilddir) -rm -rf $(sphinxbuilddir)
.PHONY: all pdf html singlehtml .PHONY: all pdf html
endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -46,7 +46,10 @@ templates_path = ['_templates']
source_suffix = '.rst' source_suffix = '.rst'
# The master toctree document. # The master toctree document.
master_doc = 'kea-guide' master_doc = 'index'
# Additional docs
messages_doc = 'kea-messages'
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.
@@ -71,14 +74,16 @@ pygments_style = None
# #
#html_theme = 'alabaster' #html_theme = 'alabaster'
html_theme = 'sphinx_rtd_theme' html_theme = 'sphinx_rtd_theme'
#html_logo = '_static/kea-logo-100x70.png'
html_logo = '_static/kea-imageonly-100bw.png'
# Theme options are theme-specific and customize the look and feel of a theme # Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the # further. For a list of options available for each theme, see the
# documentation. # documentation.
# #
html_theme_options = { #html_theme_options = {
"logo": "kea-logo-100x70.png", # "logo": "kea-logo-100x70.png",
} #}
# Add any paths that contain custom static files (such as style sheets) here, # Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files, # relative to this directory. They are copied after the builtin static files,
@@ -126,8 +131,8 @@ latex_elements = {
# (source start file, target name, title, # (source start file, target name, title,
# author, documentclass [howto, manual, or own class]). # author, documentclass [howto, manual, or own class]).
latex_documents = [ latex_documents = [
(master_doc, 'KeaAdministratorReferenceManual.tex', 'Kea Administrator Reference Manual Documentation', (master_doc, 'KeaAdministratorReferenceManual.tex', 'Kea Administrator Reference Manual Documentation', author, 'manual'),
'Kea Team', 'manual'), (messages_doc, 'KeaMessages.tex', 'Kea Messages Manual', author, 'manual'),
] ]

View File

@@ -1,3 +1,6 @@
.. figure:: _static/kea-logo-200.png
:align: right
################################## ##################################
Kea Administrator Reference Manual Kea Administrator Reference Manual
################################## ##################################

View File

@@ -124,337 +124,337 @@ libraries), or hooks libraries (open source or premium).
.. table:: List of Loggers Supported by Kea Servers and Hooks Libraries Shipped With Kea and Premium Packages .. table:: List of Loggers Supported by Kea Servers and Hooks Libraries Shipped With Kea and Premium Packages
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| Logger Name | Software Package | Description | | Logger Name | Software Package | Description |
+==================================+========================+=======================+ +==================================+========================+================================+
| ``kea-ctrl-agent`` | core | The root logger for | | ``kea-ctrl-agent`` | core | The root logger for |
| | | the Control Agent | | | | the Control Agent |
| | | exposing the RESTful | | | | exposing the RESTful |
| | | control API. All | | | | control API. All |
| | | components used by | | | | components used by |
| | | the Control Agent | | | | the Control Agent |
| | | inherit the settings | | | | inherit the settings |
| | | from this logger. | | | | from this logger. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-ctrl-agent.http`` | core | A logger which | | ``kea-ctrl-agent.http`` | core | A logger which |
| | | outputs log messages | | | | outputs log messages |
| | | related to receiving, | | | | related to receiving, |
| | | parsing, and sending | | | | parsing, and sending |
| | | HTTP messages. | | | | HTTP messages. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp4`` | core | The root logger for | | ``kea-dhcp4`` | core | The root logger for |
| | | the DHCPv4 server. | | | | the DHCPv4 server. |
| | | All components used | | | | All components used |
| | | by the DHCPv4 server | | | | by the DHCPv4 server |
| | | inherit the settings | | | | inherit the settings |
| | | from this logger. | | | | from this logger. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp6`` | core | The root logger for | | ``kea-dhcp6`` | core | The root logger for |
| | | the DHCPv6 server. | | | | the DHCPv6 server. |
| | | All components used | | | | All components used |
| | | by the DHCPv6 server | | | | by the DHCPv6 server |
| | | inherit the settings | | | | inherit the settings |
| | | from this logger. | | | | from this logger. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp4.alloc-engine``, | core | Used by the lease | | ``kea-dhcp4.alloc-engine``, | core | Used by the lease |
| ``kea-dhcp6.alloc-engine`` | | allocation engine, | | ``kea-dhcp6.alloc-engine`` | | allocation engine, |
| | | which is responsible | | | | which is responsible |
| | | for managing leases | | | | for managing leases |
| | | in the lease | | | | in the lease |
| | | database, i.e. | | | | database, i.e. |
| | | creating, modifying, | | | | creating, modifying, |
| | | and removing DHCP | | | | and removing DHCP |
| | | leases as a result of | | | | leases as a result of |
| | | processing messages | | | | processing messages |
| | | from clients. | | | | from clients. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp4.bad-packets``, | core | Used by the DHCP | | ``kea-dhcp4.bad-packets``, | core | Used by the DHCP |
| ``kea-dhcp6.bad-packets`` | | servers for logging | | ``kea-dhcp6.bad-packets`` | | servers for logging |
| | | inbound client | | | | inbound client |
| | | packets that were | | | | packets that were |
| | | dropped or to which | | | | dropped or to which |
| | | the server responded | | | | the server responded |
| | | with a DHCPNAK. It | | | | with a DHCPNAK. It |
| | | allows administrators | | | | allows administrators |
| | | to configure a | | | | to configure a |
| | | separate log output | | | | separate log output |
| | | that contains only | | | | that contains only |
| | | packet drop and | | | | packet drop and |
| | | reject entries. | | | | reject entries. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp4.callouts``, | core | Used to log messages | | ``kea-dhcp4.callouts``, | core | Used to log messages |
| ``kea-dhcp6.callouts`` | | pertaining to the | | ``kea-dhcp6.callouts`` | | pertaining to the |
| | | callouts registration | | | | callouts registration |
| | | and execution for the | | | | and execution for the |
| | | particular hook | | | | particular hook |
| | | point. | | | | point. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp4.commands``, | core | Used to log messages | | ``kea-dhcp4.commands``, | core | Used to log messages |
| ``kea-dhcp6.commands`` | | relating to the | | ``kea-dhcp6.commands`` | | relating to the |
| | | handling of commands | | | | handling of commands |
| | | received by the DHCP | | | | received by the DHCP |
| | | server over the | | | | server over the |
| | | command channel. | | | | command channel. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp4.database``, | core | Used to log messages | | ``kea-dhcp4.database``, | core | Used to log messages |
| ``kea-dhcp6.database`` | | relating to general | | ``kea-dhcp6.database`` | | relating to general |
| | | operations on the | | | | operations on the |
| | | relational databases | | | | relational databases |
| | | and Cassandra. | | | | and Cassandra. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp4.ddns``, | core | Used by the DHCP | | ``kea-dhcp4.ddns``, | core | Used by the DHCP |
| ``kea-dhcp6.ddns`` | | server to log | | ``kea-dhcp6.ddns`` | | server to log |
| | | messages related to | | | | messages related to |
| | | Client FQDN and | | | | Client FQDN and |
| | | Hostname option | | | | Hostname option |
| | | processing. It also | | | | processing. It also |
| | | includes log messages | | | | includes log messages |
| | | related to the | | | | related to the |
| | | relevant DNS updates. | | | | relevant DNS updates. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp4.dhcp4`` | core | Used by the DHCPv4 | | ``kea-dhcp4.dhcp4`` | core | Used by the DHCPv4 |
| | | server daemon to log | | | | server daemon to log |
| | | basic operations. | | | | basic operations. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp4.dhcpsrv``, | core | The base loggers for | | ``kea-dhcp4.dhcpsrv``, | core | The base loggers for |
| ``kea-dhcp6.dhcpsrv`` | | the libkea-dhcpsrv | | ``kea-dhcp6.dhcpsrv`` | | the libkea-dhcpsrv |
| | | library. | | | | library. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp4.eval``, | core | Used to log messages | | ``kea-dhcp4.eval``, | core | Used to log messages |
| ``kea-dhcp6.eval`` | | relating to the | | ``kea-dhcp6.eval`` | | relating to the |
| | | client classification | | | | client classification |
| | | expression evaluation | | | | expression evaluation |
| | | code. | | | | code. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp4.host-cache-hooks``, | libdhcp_host_cache | This logger is used | | ``kea-dhcp4.host-cache-hooks``, | libdhcp_host_cache | This logger is used |
| ``kea-dhcp6.host-cache-hooks`` | premium hook library | to log messages | | ``kea-dhcp6.host-cache-hooks`` | premium hook library | to log messages |
| | | related to the | | | | related to the |
| | | operation of the Host | | | | operation of the Host |
| | | Cache hooks library. | | | | Cache hooks library. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp4.flex-id-hooks``, | libdhcp_flex_id | This logger is used | | ``kea-dhcp4.flex-id-hooks``, | libdhcp_flex_id | This logger is used |
| ``kea-dhcp6.flex-id-hooks`` | premium hook library | to log messages | | ``kea-dhcp6.flex-id-hooks`` | premium hook library | to log messages |
| | | related to the | | | | related to the |
| | | operation of the | | | | operation of the |
| | | Flexible Identifiers | | | | Flexible Identifiers |
| | | hooks library. | | | | hooks library. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp4.ha-hooks``, | libdhcp_ha hook | This logger is used | | ``kea-dhcp4.ha-hooks``, | libdhcp_ha hook | This logger is used |
| ``kea-dhcp6.ha-hooks`` | library | to log messages | | ``kea-dhcp6.ha-hooks`` | library | to log messages |
| | | related to the | | | | related to the |
| | | operation of the High | | | | operation of the High |
| | | Availability hooks | | | | Availability hooks |
| | | library. | | | | library. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp4.hooks``, | core | Used to log messages | | ``kea-dhcp4.hooks``, | core | Used to log messages |
| ``kea-dhcp6.hooks`` | | related to the | | ``kea-dhcp6.hooks`` | | related to the |
| | | management of hooks | | | | management of hooks |
| | | libraries, e.g. | | | | libraries, e.g. |
| | | registration and | | | | registration and |
| | | deregistration of the | | | | deregistration of the |
| | | libraries, and to the | | | | libraries, and to the |
| | | initialization of the | | | | initialization of the |
| | | callouts execution | | | | callouts execution |
| | | for various hook | | | | for various hook |
| | | points within the | | | | points within the |
| | | DHCP server. | | | | DHCP server. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp4.host-cmds-hooks``, | libdhcp_host_cmds | This logger is used | | ``kea-dhcp4.host-cmds-hooks``, | libdhcp_host_cmds | This logger is used |
| ``kea-dhcp6.host-cmds-hooks`` | premium hook library | to log messages | | ``kea-dhcp6.host-cmds-hooks`` | premium hook library | to log messages |
| | | related to the | | | | related to the |
| | | operation of the Host | | | | operation of the Host |
| | | Commands hooks | | | | Commands hooks |
| | | library. In general, | | | | library. In general, |
| | | these will pertain to | | | | these will pertain to |
| | | the loading and | | | | the loading and |
| | | unloading of the | | | | unloading of the |
| | | library and the | | | | library and the |
| | | execution of commands | | | | execution of commands |
| | | by the library. | | | | by the library. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp4.hosts``, | core | Used within the | | ``kea-dhcp4.hosts``, | core | Used within the |
| ``kea-dhcp6.hosts`` | | libdhcpsrv, it logs | | ``kea-dhcp6.hosts`` | | libdhcpsrv, it logs |
| | | messages related to | | | | messages related to |
| | | the management of | | | | the management of |
| | | DHCP host | | | | DHCP host |
| | | reservations, i.e. | | | | reservations, i.e. |
| | | retrieving | | | | retrieving |
| | | reservations and | | | | reservations and |
| | | adding new | | | | adding new |
| | | reservations. | | | | reservations. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp4.lease-cmds-hooks``, | libdhcp_lease_cmds | This logger is used | | ``kea-dhcp4.lease-cmds-hooks``, | libdhcp_lease_cmds | This logger is used |
| ``kea-dhcp6.lease-cmds-hooks`` | hook library | to log messages | | ``kea-dhcp6.lease-cmds-hooks`` | hook library | to log messages |
| | | related to the | | | | related to the |
| | | operation of the | | | | operation of the |
| | | Lease Commands hooks | | | | Lease Commands hooks |
| | | library. In general, | | | | library. In general, |
| | | these will pertain to | | | | these will pertain to |
| | | the loading and | | | | the loading and |
| | | unloading of the | | | | unloading of the |
| | | library and the | | | | library and the |
| | | execution of commands | | | | execution of commands |
| | | by the library. | | | | by the library. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp4.leases``, | core | Used by the DHCP | | ``kea-dhcp4.leases``, | core | Used by the DHCP |
| ``kea-dhcp6.leases`` | | server to log | | ``kea-dhcp6.leases`` | | server to log |
| | | messages related to | | | | messages related to |
| | | lease allocation. The | | | | lease allocation. The |
| | | messages include | | | | messages include |
| | | detailed information | | | | detailed information |
| | | about the allocated | | | | about the allocated |
| | | or offered leases, | | | | or offered leases, |
| | | errors during the | | | | errors during the |
| | | lease allocation, | | | | lease allocation, |
| | | etc. | | | | etc. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp4.legal-log-hooks``, | libdhcp_legal_log | This logger is used | | ``kea-dhcp4.legal-log-hooks``, | libdhcp_legal_log | This logger is used |
| ``kea-dhcp6.legal-log-hooks`` | premium hook library | to log messages | | ``kea-dhcp6.legal-log-hooks`` | premium hook library | to log messages |
| | | related to the | | | | related to the |
| | | operation of the | | | | operation of the |
| | | Forensic Logging | | | | Forensic Logging |
| | | hooks library. | | | | hooks library. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp4.options``, | core | Used by the DHCP | | ``kea-dhcp4.options``, | core | Used by the DHCP |
| ``kea-dhcp4.options`` | | server to log | | ``kea-dhcp4.options`` | | server to log |
| | | messages related to | | | | messages related to |
| | | the processing of | | | | the processing of |
| | | options in the DHCP | | | | options in the DHCP |
| | | messages, i.e. | | | | messages, i.e. |
| | | parsing options, | | | | parsing options, |
| | | encoding options into | | | | encoding options into |
| | | on-wire format, and | | | | on-wire format, and |
| | | packet classification | | | | packet classification |
| | | using options | | | | using options |
| | | contained in the | | | | contained in the |
| | | received packets. | | | | received packets. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp4.packets``, | core | This logger is mostly | | ``kea-dhcp4.packets``, | core | This logger is mostly |
| ``kea-dhcp6.packets`` | | used to log messages | | ``kea-dhcp6.packets`` | | used to log messages |
| | | related to | | | | related to |
| | | transmission of the | | | | transmission of the |
| | | DHCP packets, i.e. | | | | DHCP packets, i.e. |
| | | packet reception and | | | | packet reception and |
| | | the sending of a | | | | the sending of a |
| | | response. Such | | | | response. Such |
| | | messages include | | | | messages include |
| | | information about the | | | | information about the |
| | | source and | | | | source and |
| | | destination IP | | | | destination IP |
| | | addresses and | | | | addresses and |
| | | interfaces used to | | | | interfaces used to |
| | | transmit packets. The | | | | transmit packets. The |
| | | logger is also used | | | | logger is also used |
| | | to log messages | | | | to log messages |
| | | related to subnet | | | | related to subnet |
| | | selection, as this | | | | selection, as this |
| | | selection is usually | | | | selection is usually |
| | | based on the IP | | | | based on the IP |
| | | addresses, relay | | | | addresses, relay |
| | | addresses, and/or | | | | addresses, and/or |
| | | interface names, | | | | interface names, |
| | | which can be | | | | which can be |
| | | retrieved from the | | | | retrieved from the |
| | | received packet even | | | | received packet even |
| | | before the DHCP | | | | before the DHCP |
| | | message carried in | | | | message carried in |
| | | the packet is parsed. | | | | the packet is parsed. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp4.radius-hooks``, | libdhcp_radius | This logger is used | | ``kea-dhcp4.radius-hooks``, | libdhcp_radius | This logger is used |
| ``kea-dhcp6.radius-hooks`` | premium hook library | to log messages | | ``kea-dhcp6.radius-hooks`` | premium hook library | to log messages |
| | | related to the | | | | related to the |
| | | operation of the | | | | operation of the |
| | | RADIUS hooks library. | | | | RADIUS hooks library. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp4.stat-cmds-hooks``, | libdhcp_stat_cmds | This logger is used | | ``kea-dhcp4.stat-cmds-hooks``, | libdhcp_stat_cmds | This logger is used |
| ``kea-dhcp6.stat-cmds-hooks`` | hook library | to log messages | | ``kea-dhcp6.stat-cmds-hooks`` | hook library | to log messages |
| | | related to the | | | | related to the |
| | | operation of the | | | | operation of the |
| | | Statistics Commands | | | | Statistics Commands |
| | | hooks library. In | | | | hooks library. In |
| | | general, these will | | | | general, these will |
| | | pertain to loading | | | | pertain to loading |
| | | and unloading the | | | | and unloading the |
| | | library and the | | | | library and the |
| | | execution of commands | | | | execution of commands |
| | | by the library. | | | | by the library. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp4.subnet-cmds-hooks``, | libdhcp_subnet_cmds | This logger is used | | ``kea-dhcp4.subnet-cmds-hooks``, | libdhcp_subnet_cmds | This logger is used |
| ``kea-dhcp6.subnet-cmds-hooks`` | hook library | to log messages | | ``kea-dhcp6.subnet-cmds-hooks`` | hook library | to log messages |
| | | related to the | | | | related to the |
| | | operation of the | | | | operation of the |
| | | Subnet Commands hooks | | | | Subnet Commands hooks |
| | | library. In general, | | | | library. In general, |
| | | these will pertain to | | | | these will pertain to |
| | | loading and unloading | | | | loading and unloading |
| | | the library and the | | | | the library and the |
| | | execution of commands | | | | execution of commands |
| | | by the library. | | | | by the library. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp4.mysql-cb-hooks``, | libdhcp_mysql_cb_hooks | This logger is used | | ``kea-dhcp4.mysql-cb-hooks``, | libdhcp_mysql_cb_hooks | This logger is used |
| ``kea-dhcp6.mysql-cb-hooks`` | hook library | to log messages | | ``kea-dhcp6.mysql-cb-hooks`` | hook library | to log messages |
| | | related to the | | | | related to the |
| | | operation of the | | | | operation of the |
| | | MySQL Configuration | | | | MySQL Configuration |
| | | Backend hooks | | | | Backend hooks |
| | | library. | | | | library. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp-ddns`` | core | The root logger for | | ``kea-dhcp-ddns`` | core | The root logger for |
| | | the kea-dhcp-ddns | | | | the kea-dhcp-ddns |
| | | daemon. All | | | | daemon. All |
| | | components used by | | | | components used by |
| | | this daemon inherit | | | | this daemon inherit |
| | | the settings from | | | | the settings from |
| | | this logger unless | | | | this logger unless |
| | | there are | | | | there are |
| | | configurations for | | | | configurations for |
| | | more specialized | | | | more specialized |
| | | loggers. | | | | loggers. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp-ddns.dctl`` | core | The logger used by | | ``kea-dhcp-ddns.dctl`` | core | The logger used by |
| | | the kea-dhcp-ddns | | | | the kea-dhcp-ddns |
| | | daemon for logging | | | | daemon for logging |
| | | basic information | | | | basic information |
| | | about the process, | | | | about the process, |
| | | received signals, and | | | | received signals, and |
| | | triggered | | | | triggered |
| | | reconfigurations. | | | | reconfigurations. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp-ddns.dhcpddns`` | core | The logger used by | | ``kea-dhcp-ddns.dhcpddns`` | core | The logger used by |
| | | the kea-dhcp-ddns | | | | the kea-dhcp-ddns |
| | | daemon for logging | | | | daemon for logging |
| | | events related to | | | | events related to |
| | | DDNS operations. | | | | DDNS operations. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp-ddns.dhcp-to-d2`` | core | Used by the | | ``kea-dhcp-ddns.dhcp-to-d2`` | core | Used by the |
| | | kea-dhcp-ddns daemon | | | | kea-dhcp-ddns daemon |
| | | for logging | | | | for logging |
| | | information about | | | | information about |
| | | events dealing with | | | | events dealing with |
| | | receiving messages | | | | receiving messages |
| | | from the DHCP servers | | | | from the DHCP servers |
| | | and adding them to | | | | and adding them to |
| | | the queue for | | | | the queue for |
| | | processing. | | | | processing. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-dhcp-ddns.d2-to-dns`` | core | Used by the | | ``kea-dhcp-ddns.d2-to-dns`` | core | Used by the |
| | | kea-dhcp-ddns daemon | | | | kea-dhcp-ddns daemon |
| | | for logging | | | | for logging |
| | | information about | | | | information about |
| | | events dealing with | | | | events dealing with |
| | | sending and receiving | | | | sending and receiving |
| | | messages to and from | | | | messages to and from |
| | | the DNS servers. | | | | the DNS servers. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
| ``kea-netconf`` | core | The root logger for | | ``kea-netconf`` | core | The root logger for |
| | | the NETCONF agent. | | | | the NETCONF agent. |
| | | All components used | | | | All components used |
| | | by NETCONF inherit | | | | by NETCONF inherit |
| | | the settings from | | | | the settings from |
| | | this logger if there | | | | this logger if there |
| | | is no specialized | | | | is no specialized |
| | | logger provided. | | | | logger provided. |
+----------------------------------+------------------------+-----------------------+ +----------------------------------+------------------------+--------------------------------+
Note that user-defined hook libraries should not use any of the loggers Note that user-defined hook libraries should not use any of the loggers
mentioned above, but should instead define new loggers with names that mentioned above, but should instead define new loggers with names that

125
tools/system_messages.py Executable file
View File

@@ -0,0 +1,125 @@
#!/usr/bin/env python3
# Copyright (C) 2015-2018 Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http:#mozilla.org/MPL/2.0/.
# Produce System Messages Manual
#
# This tool reads all the message files given on the command line.
# It pulls all the messages and description out, sorts them by
# message ID, and writes them out as a single (formatted) file.
#
# Invocation:
# The code is invoked using the command line:
#
# system_messages.py [-o <output-file>] <files>
#
# If no output file is specified, output is written to stdout.
# The produced format is ReStructuredText.
import re
import argparse
def parse_args():
parser = argparse.ArgumentParser(description='Convert set of *.mes files to .rst documentation format')
parser.add_argument('-o', '--output', help='Output file name (default to stdout).')
parser.add_argument('files', help='Input .mes files.', nargs='+') #, required=True)
args = parser.parse_args()
return args
def read_input_files(files):
messages = {}
for f in files:
with open(f) as fp:
namespace = None
msg_descr = None
msg_id = None
msg_text = None
for line in fp.readlines():
line = line.strip()
if not line or line.startswith('#'):
pass
elif line.startswith('$'):
pass
elif line.startswith('%'):
# end previous message
if msg_id is not None:
section = msg_id.split('_')[0]
messages[msg_id] = (section, msg_id, msg_text, msg_descr)
# start next message
m = re.search('^%\s?([A-Z0-9_]+)\s+(.*)', line);
msg_id, msg_text = m.groups()
msg_descr = []
else:
msg_descr.append(line)
return messages
def generate_rst(messages):
rst = '''
###################
Kea Messages Manual
###################
Kea is an open source implementation of the Dynamic Host Configuration
Protocol (DHCP) servers, developed and maintained by Internet Systems
Consortium (ISC).
This is the reference guide for Kea version |release|.
Links to the most up-to-date version of this document (in PDF, HTML,
and plain text formats), along with other documents for
Kea, can be found in ISC's `Knowledgebase <https://kb.isc.org/docs/kea-administrator-reference-manual>`_.
.. toctree::
:numbered:
:maxdepth: 5
'''
prev_section = None
for _, msg in sorted(messages.items()):
section, msg_id, msg_text, msg_descr = msg
if section != prev_section:
prev_section = section
rst += section + '\n'
rst += '~' * len(section) + '\n\n'
rst += '**' + msg_id + '**\n\n'
rst += msg_text + '\n\n'
rst += ''.join([' ' + l + '\n' for l in msg_descr])
rst += '\n'
return rst
def main():
args = parse_args()
messages = read_input_files(args.files)
rst = generate_rst(messages)
if args.output:
with open(args.output, 'w') as f:
f.write(rst)
else:
print(rst)
if __name__ == '__main__':
main()