diff --git a/ChangeLog b/ChangeLog index 8036119b55..dfcfa606f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,28 @@ +474. [func] stephen + DHCP servers now use the BIND 10 logging system for messages. + (Trac #1545, git de69a92613b36bd3944cb061e1b7c611c3c85506) + +473. [bug] jelte + TCP connections now time out in b10-auth if no (or not all) query + data is sent by the client. The timeout value defaults to 5000 + milliseconds, but is configurable in Auth/tcp_recv_timeout. + (Trac #357, git cdf3f04442f8f131542bd1d4a2228a9d0bed12ff) + +472. [build] jreed + All generated documentation is removed from the git repository. + The ./configure --enable-man option is removed. A new option + -enable-generate-docs is added; it checks for required + documentation building dependencies. Dummy documentation is + built and installed if not used. Distributed tarballs will + contain the generated documentation. + (Trac #1687, git 2d4063b1a354f5048ca9dfb195e8e169650f43d0) + +471. [bug] vorner + Fixed a problem when b10-loadzone tried to tread semicolon + in string data as start of comment, which caused invalid + data being loaded. + (Trac #2188, git 12efec3477feb62d7cbe36bdcfbfc7aa28a36f57) + 470. [func] naokikambe The stats module now supports partial statistics updates. Each module can return only statistics data which have been updated since diff --git a/Makefile.am b/Makefile.am index 99b5d46745..0fbb78244f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -113,8 +113,12 @@ systest: cd tests/system; \ sh $(abs_srcdir)/tests/system/runall.sh +### include tool to generate documentation from log message specifications +### in the distributed tarball: +EXTRA_DIST = tools/system_messages.py + #### include external sources in the distributed tarball: -EXTRA_DIST = ext/asio/README +EXTRA_DIST += ext/asio/README EXTRA_DIST += ext/asio/README EXTRA_DIST += ext/asio/asio.hpp EXTRA_DIST += ext/asio/asio/basic_socket.hpp diff --git a/configure.ac b/configure.ac index 0bfa627161..9d7b7ae713 100644 --- a/configure.ac +++ b/configure.ac @@ -1027,10 +1027,32 @@ AC_SUBST(PERL) AC_PATH_PROGS(AWK, gawk awk) AC_SUBST(AWK) -AC_ARG_ENABLE(man, [AC_HELP_STRING([--enable-man], - [regenerate man pages [default=no]])], enable_man=$enableval, enable_man=no) +AC_ARG_ENABLE(generate_docs, [AC_HELP_STRING([--enable-generate-docs], + [regenerate documentation using Docbook [default=no]])], + enable_generate_docs=$enableval, enable_generate_docs=no) -AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno) +# Check for xsltproc +if test "x$enable_generate_docs" != xno ; then + 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 +fi + + +AM_CONDITIONAL(GENERATE_DOCS, test x$enable_generate_docs != xno) AC_ARG_ENABLE(install-configurations, [AC_HELP_STRING([--disable-install-configurations], @@ -1202,6 +1224,7 @@ AC_CONFIG_FILES([Makefile tests/tools/badpacket/tests/Makefile tests/tools/perfdhcp/Makefile tests/tools/perfdhcp/tests/Makefile + tests/tools/perfdhcp/templates/Makefile dns++.pc ]) AC_OUTPUT([doc/version.ent @@ -1377,7 +1400,7 @@ Developer: C++ Code Coverage: $USE_LCOV Python Code Coverage: $USE_PYCOVERAGE Logger checks: $enable_logger_checks - Generate Manuals: $enable_man + Generate Documentation: $enable_generate_docs END diff --git a/doc/guide/.gitignore b/doc/guide/.gitignore new file mode 100644 index 0000000000..168d4ed49e --- /dev/null +++ b/doc/guide/.gitignore @@ -0,0 +1,3 @@ +/bind10-guide.html +/bind10-guide.txt +/bind10-messages.html diff --git a/doc/guide/Makefile.am b/doc/guide/Makefile.am index 7d90d37b6b..1d63c04b31 100644 --- a/doc/guide/Makefile.am +++ b/doc/guide/Makefile.am @@ -1,15 +1,18 @@ -dist_doc_DATA = bind10-guide.txt -dist_html_DATA = bind10-guide.css bind10-guide.html bind10-messages.html +# generated documentation +HTMLDOCS = bind10-guide.html bind10-messages.html +DOCS = bind10-guide.txt -EXTRA_DIST = bind10-guide.xml bind10-messages.xml +dist_doc_DATA = $(DOCS) +dist_html_DATA = $(HTMLDOCS) bind10-guide.css + +EXTRA_DIST = bind10-guide.xml +DISTCLEANFILES = $(HTMLDOCS) $(DOCS) bind10-messages.xml # This is not a "man" manual, but reuse this for now for docbook. -if ENABLE_MAN - -.PHONY: bind10-messages.xml +if GENERATE_DOCS bind10-guide.html: bind10-guide.xml - xsltproc --novalid --xinclude --nonet \ + @XSLTPROC@ --novalid --xinclude --nonet \ --path $(top_builddir)/doc \ -o $@ \ --stringparam section.autolabel 1 \ @@ -21,18 +24,23 @@ bind10-guide.html: bind10-guide.xml HTML2TXT = elinks -dump -no-numbering -no-references bind10-guide.txt: bind10-guide.html - $(HTML2TXT) $(srcdir)/bind10-guide.html > $@ + $(HTML2TXT) bind10-guide.html > $@ bind10-messages.html: bind10-messages.xml - xsltproc --novalid --xinclude --nonet \ + @XSLTPROC@ --novalid --xinclude --nonet \ --path $(top_builddir)/doc \ -o $@ \ --stringparam html.stylesheet $(srcdir)/bind10-guide.css \ http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl \ - $(srcdir)/bind10-messages.xml + bind10-messages.xml -# So many dependencies that it's easiest just to regenerate it every time bind10-messages.xml: $(PYTHON) $(top_srcdir)/tools/system_messages.py -o $@ $(top_srcdir) +else + +$(HTMLDOCS) $(DOCS): + @echo Doc generation disabled. Creating dummy $@. Configure with --enable-generate-docs to enable it. + @echo Doc generation disabled. Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@ + endif diff --git a/doc/guide/bind10-guide.html b/doc/guide/bind10-guide.html deleted file mode 100644 index a53271c8cc..0000000000 --- a/doc/guide/bind10-guide.html +++ /dev/null @@ -1,2070 +0,0 @@ -BIND 10 Guide

BIND 10 Guide

Administrator Reference for BIND 10

This is the reference guide for BIND 10 version - 20120712.

Abstract

BIND 10 is a framework that features Domain Name System - (DNS) suite and Dynamic Host Configuration Protocol (DHCP) - servers with development managed by Internet Systems Consortium (ISC). - It includes DNS libraries, modular components for controlling - authoritative and recursive DNS servers, and experimental DHCPv4 - and DHCPv6 servers. -

- This is the reference guide for BIND 10 version 20120712. - The most up-to-date version of this document (in PDF, HTML, - and plain text formats), along with other documents for - BIND 10, can be found at http://bind10.isc.org/docs. -


Table of Contents

Preface
1. Acknowledgements
1. Introduction
1.1. Supported Platforms
1.2. Required Software at Run-time
1.3. Starting and Stopping the Server
1.4. Managing BIND 10
2. Installation
2.1. Packages
2.2. Install Hierarchy
2.3. Building Requirements
2.4. Quick start
2.5. Installation from source
2.5.1. Download Tar File
2.5.2. Retrieve from Git
2.5.3. Configure before the build
2.5.4. Build
2.5.5. Install
3. Starting BIND10 with bind10
3.1. Starting BIND 10
3.2. Configuration to start processes
4. Command channel
5. Configuration manager
6. Remote control daemon
6.1. Configuration specification for b10-cmdctl
7. Control and configure user interface
8. Authoritative Server
8.1. Server Configurations
8.2. Data Source Backends
8.2.1. Data source types
8.2.2. Examples
8.3. Loading Master Zones Files
9. Incoming Zone Transfers
9.1. Configuration for Incoming Zone Transfers
9.2. Enabling IXFR
9.3. Secondary Manager
9.4. Trigger an Incoming Zone Transfer Manually
9.5. Incoming Transfers with In-memory Datasource
10. Outbound Zone Transfers
11. Dynamic DNS Update
11.1. Enabling Dynamic Update
11.2. Access Control
11.3. Miscellaneous Operational Issues
12. Recursive Name Server
12.1. Access Control
12.2. Forwarding
13. DHCPv4 Server
13.1. DHCPv4 Server Usage
13.2. DHCPv4 Server Configuration
13.3. Supported standards
13.4. DHCPv4 Server Limitations
14. DHCPv6 Server
14.1. DHCPv6 Server Usage
14.2. DHCPv6 Server Configuration
14.3. Supported DHCPv6 Standards
14.4. DHCPv6 Server Limitations
15. libdhcp++ library
15.1. Interface detection
15.2. DHCPv4/DHCPv6 packet handling
16. Statistics
17. Logging
17.1. Logging configuration
17.1.1. Loggers
17.1.2. Output Options
17.1.3. Example session
17.2. Logging Message Format

List of Tables

3.1. Special startup components

Preface

Table of Contents

1. Acknowledgements

1. Acknowledgements

ISC would like to acknowledge generous support for - BIND 10 development of DHCPv4 and DHCPv6 components provided - by Comcast.

Chapter 1. Introduction

- BIND is the popular implementation of a DNS server, developer - interfaces, and DNS tools. - BIND 10 is a rewrite of BIND 9 and ISC DHCP. - BIND 10 is written in C++ and Python and provides a modular - environment for serving, maintaining, and developing DNS and DHCP. - BIND 10 provides a EDNS0- and DNSSEC-capable authoritative - DNS server and a caching recursive name server which also - provides forwarding. - It also provides experimental DHCPv4 and DHCPv6 servers. -

- This guide covers the experimental prototype of - BIND 10 version 20120712. -

1.1. Supported Platforms

- BIND 10 builds have been tested on (in no particular order) - Debian GNU/Linux 6 and unstable, Ubuntu 9.10, NetBSD 5, - Solaris 10 and 11, FreeBSD 7 and 8, CentOS Linux 5.3, - MacOS 10.6 and 10.7, and OpenBSD 5.1. - - It has been tested on Sparc, i386, and amd64 hardware - platforms. - - It is planned for BIND 10 to build, install and run on - Windows and standard Unix-type platforms. -

1.2. Required Software at Run-time

- Running BIND 10 uses various extra software which may - not be provided in some operating systems' default - installations nor standard packages collections. You may - need to install this required software separately. - (For the build requirements, also see - Section 2.3, “Building Requirements”.) -

- BIND 10 requires at least Python 3.1 - (http://www.python.org/). - It also works with Python 3.2. -

- BIND 10 uses the Botan crypto library for C++ - (http://botan.randombit.net/). - It requires at least Botan version 1.8. -

- BIND 10 uses the log4cplus C++ logging library - (http://log4cplus.sourceforge.net/). - It requires at least log4cplus version 1.0.3. - -

- The authoritative DNS server uses SQLite3 - (http://www.sqlite.org/). - - It needs at least SQLite version 3.3.9. -

- The b10-ddns, b10-xfrin, - b10-xfrout, and b10-zonemgr - components require the libpython3 library and the Python - _sqlite3.so module (which is included with Python). - Python modules need to be built for the corresponding Python 3. -

1.3. Starting and Stopping the Server

- BIND 10 is modular. Part of this modularity is - accomplished using multiple cooperating processes which, together, - provide the server functionality. This is a change from - the previous generation of BIND software, which used a - single process. -

- At first, running many different processes may seem confusing. - However, these processes are started, stopped, and maintained - by a single command, bind10. - This command starts a master process which will start other - processes as needed. - The processes started by the bind10 - command have names starting with "b10-", including: -

- -

  • - b10-auth — - Authoritative DNS server. - This process serves DNS requests. -
  • - b10-cfgmgr — - Configuration manager. - This process maintains all of the configuration for BIND 10. -
  • - b10-cmdctl — - Command and control service. - This process allows external control of the BIND 10 system. -
  • - b10-ddns — - Dynamic DNS update service. - This process is used to handle incoming DNS update - requests to allow granted clients to update zones - for which BIND 10 is serving as a primary server. -
  • - b10-msgq — - Message bus daemon. - This process coordinates communication between all of the other - BIND 10 processes. -
  • - b10-resolver — - Recursive name server. - This process handles incoming DNS queries and provides - answers from its cache or by recursively doing remote lookups. -
  • - b10-sockcreator — - Socket creator daemon. - This process creates sockets used by - network-listening BIND 10 processes. -
  • - b10-stats — - Statistics collection daemon. - This process collects and reports statistics data. -
  • - b10-stats-httpd — - HTTP server for statistics reporting. - This process reports statistics data in XML format over HTTP. -
  • - b10-xfrin — - Incoming zone transfer service. - This process is used to transfer a new copy - of a zone into BIND 10, when acting as a secondary server. -
  • - b10-xfrout — - Outgoing zone transfer service. - This process is used to handle transfer requests to - send a local zone to a remote secondary server. -
  • - b10-zonemgr — - Secondary zone manager. - This process keeps track of timers and other - necessary information for BIND 10 to act as a slave server. -

-

- These are ran by bind10 - and do not need to be manually started independently. -

1.4. Managing BIND 10

- Once BIND 10 is running, a few commands are used to interact - directly with the system: -

  • - bindctl — - Interactive administration interface. - This is a low-level command-line tool which allows - a developer or an experienced administrator to control - BIND 10. -
  • - b10-loadzone — - Zone file loader. - This tool will load standard masterfile-format zone files into - BIND 10. -
  • - b10-cmdctl-usermgr — - User access control. - This tool allows an administrator to authorize additional users - to manage BIND 10. -

-

- The tools and modules are covered in full detail in this guide. - - In addition, manual pages are also provided in the default installation. -

- BIND 10 also provides libraries and programmer interfaces - for C++ and Python for the message bus, configuration backend, - and, of course, DNS. These include detailed developer - documentation and code examples. - - -

Chapter 2. Installation

2.1. Packages

- Some operating systems or softare package vendors may - provide ready-to-use, pre-built software packages for - the BIND 10 suite. - Installing a pre-built package means you do not need to - install build-only prerequisites and do not need to - make the software. -

- FreeBSD ports, NetBSD pkgsrc, and Debian - testing package collections provide - all the prerequisite packages. -

2.2. Install Hierarchy

- The following is the standard, common layout of the - complete BIND 10 installation: -

  • - bin/ — - general tools and diagnostic clients. -
  • - etc/bind10-devel/ — - configuration files. -
  • - lib/ — - libraries and python modules. -
  • - libexec/bind10-devel/ — - executables that a user wouldn't normally run directly and - are not run independently. - These are the BIND 10 modules which are daemons started by - the bind10 tool. -
  • - sbin/ — - commands used by the system administrator. -
  • - share/bind10-devel/ — - configuration specifications. -
  • - share/doc/bind10-devel/ — - this guide and other supplementary documentation. -
  • - share/man/ — - manual pages (online documentation). -
  • - var/bind10-devel/ — - data source and configuration databases. -

-

2.3. Building Requirements

- In addition to the run-time requirements (listed in - Section 1.2, “Required Software at Run-time”), building BIND 10 - from source code requires various development include headers and - program development tools. -

Note

- Some operating systems have split their distribution packages into - a run-time and a development package. You will need to install - the development package versions, which include header files and - libraries, to build BIND 10 from source code. -

- Building from source code requires the Boost - build-time headers - (http://www.boost.org/). - At least Boost version 1.35 is required. - - -

- To build BIND 10, also install the Botan (at least version - 1.8) and the log4cplus (at least version 1.0.3) - development include headers. -

- Building BIND 10 also requires a C++ compiler and - standard development headers, make, and pkg-config. - BIND 10 builds have been tested with GCC g++ 3.4.3, 4.1.2, - 4.1.3, 4.2.1, 4.3.2, and 4.4.1; Clang++ 2.8; and Sun C++ 5.10. -

- Visit the user-contributed wiki at http://bind10.isc.org/wiki/SystemSpecificNotes - for system-specific installation tips. -

2.4. Quick start

Note

- This quickly covers the standard steps for installing - and deploying BIND 10 as an authoritative name server using - its defaults. For troubleshooting, full customizations and further - details, see the respective chapters in the BIND 10 guide. -

- To quickly get started with BIND 10, follow these steps. -

  1. - Install required run-time and build dependencies. -
  2. - Download the BIND 10 source tar file from - ftp://ftp.isc.org/isc/bind10/. -
  3. Extract the tar file: -

    $ gzcat bind10-VERSION.tar.gz | tar -xvf -

    -

  4. Go into the source and run configure: -

    $ cd bind10-VERSION
    -  $ ./configure

    -

  5. Build it: -

    $ make

    -

  6. Install it (to default /usr/local): -

    $ make install

    -

  7. Start the server: -

    $ /usr/local/sbin/bind10

    -

  8. Test it; for example: -

    $ dig @127.0.0.1 -c CH -t TXT authors.bind

    -

  9. Load desired zone file(s), for example: -

    $ b10-loadzone your.zone.example.org

    -

  10. - Test the new zone. -

2.5. Installation from source

- BIND 10 is open source software written in C++ and Python. - It is freely available in source code form from ISC as a - downloadable tar file or via BIND 10's Git code revision control - service. (It may also be available in pre-compiled ready-to-use - packages from operating system vendors.) -

2.5.1. Download Tar File

- Downloading a release tar file is the recommended method to - obtain the source code. -

- The BIND 10 releases are available as tar file downloads from - ftp://ftp.isc.org/isc/bind10/. - Periodic development snapshots may also be available. -

2.5.2. Retrieve from Git

- Downloading this "bleeding edge" code is recommended only for - developers or advanced users. Using development code in a production - environment is not recommended. -

Note

- When using source code retrieved via Git, additional - software will be required: automake (v1.11 or newer), - libtoolize, and autoconf (2.59 or newer). - These may need to be installed. -

- The latest development code (and temporary experiments - and un-reviewed code) is available via the BIND 10 code revision - control system. This is powered by Git and all the BIND 10 - development is public. - The leading development is done in the master - branch. -

- The code can be checked out from - git://git.bind10.isc.org/bind10; - for example: - -

$ git clone git://git.bind10.isc.org/bind10

-

- When checking out the code from - the code version control system, it doesn't include the - generated configure script, Makefile.in files, nor their - related build files. - They can be created by running autoreconf - with the --install switch. - This will run autoconf, - aclocal, - libtoolize, - autoheader, - automake, - and related commands. -

2.5.3. Configure before the build

- BIND 10 uses the GNU Build System to discover build environment - details. - To generate the makefiles using the defaults, simply run: -

$ ./configure

-

- Run ./configure with the --help - switch to view the different options. Some commonly-used options are: - -

--prefix
Define the installation location (the - default is /usr/local/). -
--with-boost-include
Define the path to find the Boost headers. -
--with-pythonpath
Define the path to Python 3.1 if it is not in the - standard execution path. -
--with-gtest
Enable building the C++ Unit Tests using the - Google Tests framework. Optionally this can define the - path to the gtest header files and library. -

- -

- For example, the following configures it to - find the Boost headers, find the - Python interpreter, and sets the installation location: - -

$ ./configure \
-      --with-boost-include=/usr/pkg/include \
-      --with-pythonpath=/usr/pkg/bin/python3.1 \
-      --prefix=/opt/bind10

-

- If the configure fails, it may be due to missing or old - dependencies. -

2.5.4. Build

- After the configure step is complete, to build the executables - from the C++ code and prepare the Python scripts, run: - -

$ make

-

2.5.5. Install

- To install the BIND 10 executables, support files, - and documentation, run: -

$ make install

-

Note

The install step may require superuser privileges.

Chapter 3. Starting BIND10 with bind10

- BIND 10 provides the bind10 command which - starts up the required processes. - bind10 - will also restart some processes that exit unexpectedly. - This is the only command needed to start the BIND 10 system. -

- After starting the b10-msgq communications channel, - bind10 connects to it, - runs the configuration manager, and reads its own configuration. - Then it starts the other modules. -

- The b10-sockcreator, b10-msgq and - b10-cfgmgr - services make up the core. The b10-msgq daemon - provides the communication channel between every part of the system. - The b10-cfgmgr daemon is always needed by every - module, if only to send information about themselves somewhere, - but more importantly to ask about their own settings, and - about other modules. The b10-sockcreator daemon - helps allocate Internet addresses and ports as needed for BIND 10 - network services. -

- In its default configuration, the bind10 - master process will also start up - b10-cmdctl for administration tools to - communicate with the system, and - b10-stats for statistics collection. -

3.1. Starting BIND 10

- To start the BIND 10 service, simply run bind10. - Run it with the --verbose switch to - get additional debugging or diagnostic output. -

Note

- If the setproctitle Python module is detected at start up, - the process names for the Python-based daemons will be renamed - to better identify them instead of just python. - This is not needed on some operating systems. -

3.2. Configuration to start processes

- The processes to be used can be configured for - bind10 to start, with the exception - of the required b10-sockcreator, - b10-msgq and b10-cfgmgr - components. - The configuration is in the Boss/components - section. Each element represents one component, which is - an abstraction of a process. -

- To add a process to the set, let's say the resolver (which - is not started by default), you would do this: -

> config add Boss/components b10-resolver
-> config set Boss/components/b10-resolver/special resolver
-> config set Boss/components/b10-resolver/kind needed
-> config set Boss/components/b10-resolver/priority 10
-> config commit

- Now, what it means. We add an entry called - b10-resolver. It is both a name used to - reference this component in the configuration and the name - of the process to start. Then we set some parameters on - how to start it. -

- The special setting is for components - that need some kind of special care during startup or - shutdown. Unless specified, the component is started in a - usual way. This is the list of components that need to be - started in a special way, with the value of special used - for them: - -

Table 3.1. Special startup components

ComponentSpecialDescription
b10-authauthAuthoritative DNS server
b10-resolverresolverDNS resolver
b10-cmdctlcmdctlCommand control (remote control interface)


-

- The kind specifies how a failure of the - component should be handled. If it is set to - dispensable (the default unless you set - something else), it will get started again if it fails. If - it is set to needed and it fails at startup, - the whole bind10 shuts down and exits - with an error exit code. But if it fails some time later, it - is just started again. If you set it to core, - you indicate that the system is not usable without the - component and if such component fails, the system shuts - down no matter when the failure happened. This is the - behaviour of the core components (the ones you can't turn - off), but you can declare any other components as core as - well if you wish (but you can turn these off, they just - can't fail). -

- The priority defines order in which the - components should start. The ones with higher numbers are - started sooner than the ones with lower ones. If you don't - set it, 0 (zero) is used as the priority. Usually, leaving - it at the default is enough. -

- There are other parameters we didn't use in our example. - One of them is address. It is the address - used by the component on the b10-msgq - message bus. The special components already know their - address, but the usual ones don't. The address is by - convention the thing after b10-, with - the first letter capitalized (eg. b10-stats - would have Stats as its address). - -

- The last one is process. It is the name - of the process to be started. It defaults to the name of - the component if not set, but you can use this to override - it. (The special components also already know their - executable name.) -

Note

- The configuration is quite powerful, but that includes - a lot of space for mistakes. You could turn off the - b10-cmdctl, but then you couldn't - change it back the usual way, as it would require it to - be running (you would have to find and edit the configuration - directly). Also, some modules might have dependencies: - b10-stats-httpd needs - b10-stats, b10-xfrout - needs b10-auth to be running, etc. - - - -

- In short, you should think twice before disabling something here. -

- It is possible to start some components multiple times (currently - b10-auth and b10-resolver). - You might want to do that to gain more performance (each one uses only - single core). Just put multiple entries under different names, like - this, with the same config: -

> config add Boss/components b10-resolver-2
-> config set Boss/components/b10-resolver-2/special resolver
-> config set Boss/components/b10-resolver-2/kind needed
-> config commit

-

- However, this is work in progress and the support is not yet complete. - For example, each resolver will have its own cache, each authoritative - server will keep its own copy of in-memory data and there could be - problems with locking the sqlite database, if used. The configuration - might be changed to something more convenient in future. - Other components don't expect such a situation, so it would - probably not do what you want. Such support is yet to be - implemented. -

Chapter 4. Command channel

- The BIND 10 components use the b10-msgq - message routing daemon to communicate with other BIND 10 components. - The b10-msgq implements what is called the - Command Channel. - Processes intercommunicate by sending messages on the command - channel. - Example messages include shutdown, get configurations, and set - configurations. - This Command Channel is not used for DNS message passing. - It is used only to control and monitor the BIND 10 system. -

- Administrators do not communicate directly with the - b10-msgq daemon. - By default, BIND 10 uses a UNIX domain socket file named - /usr/local/var/bind10-devel/msg_socket - for this interprocess communication. -

Chapter 5. Configuration manager

- The configuration manager, b10-cfgmgr, - handles all BIND 10 system configuration. It provides - persistent storage for configuration, and notifies running - modules of configuration changes. -

- The b10-auth and b10-xfrin - daemons and other components receive their configurations - from the configuration manager over the b10-msgq - command channel. -

The administrator doesn't connect to it directly, but - uses a user interface to communicate with the configuration - manager via b10-cmdctl's REST-ful interface. - b10-cmdctl is covered in Chapter 6, Remote control daemon. -

Note

- The development prototype release only provides - bindctl as a user interface to - b10-cmdctl. - Upcoming releases will provide another interactive command-line - interface and a web-based interface. -

- The b10-cfgmgr daemon can send all - specifications and all current settings to the - bindctl client (via - b10-cmdctl). - b10-cfgmgr relays configurations received - from b10-cmdctl to the appropriate modules. -

- The stored configuration file is at - /usr/local/var/bind10-devel/b10-config.db. - (The directory is what was defined at build configure time for - --localstatedir. - The default is /usr/local/var/.) - The format is loosely based on JSON and is directly parseable - python, but this may change in a future version. - This configuration data file is not manually edited by the - administrator. -

- The configuration manager does not have any command line arguments. - Normally it is not started manually, but is automatically - started using the bind10 master process - (as covered in Chapter 3, Starting BIND10 with bind10). -

Chapter 6. Remote control daemon

- b10-cmdctl is the gateway between - administrators and the BIND 10 system. - It is a HTTPS server that uses standard HTTP Digest - Authentication for username and password validation. - It provides a REST-ful interface for accessing and controlling - BIND 10. -

- When b10-cmdctl starts, it firsts - asks b10-cfgmgr about what modules are - running and what their configuration is (over the - b10-msgq channel). Then it will start listening - on HTTPS for clients — the user interface — such - as bindctl. -

- b10-cmdctl directly sends commands - (received from the user interface) to the specified component. - Configuration changes are actually commands to - b10-cfgmgr so are sent there. -

The HTTPS server requires a private key, - such as a RSA PRIVATE KEY. - The default location is at - /usr/local/etc/bind10-devel/cmdctl-keyfile.pem. - (A sample key is at - /usr/local/share/bind10-devel/cmdctl-keyfile.pem.) - It also uses a certificate located at - /usr/local/etc/bind10-devel/cmdctl-certfile.pem. - (A sample certificate is at - /usr/local/share/bind10-devel/cmdctl-certfile.pem.) - This may be a self-signed certificate or purchased from a - certification authority. -

Note

- The HTTPS server doesn't support a certificate request from a - client (at this time). - - The b10-cmdctl daemon does not provide a - public service. If any client wants to control BIND 10, then - a certificate needs to be first received from the BIND 10 - administrator. - The BIND 10 installation provides a sample PEM bundle that matches - the sample key and certificate. -

- The b10-cmdctl daemon also requires - the user account file located at - /usr/local/etc/bind10-devel/cmdctl-accounts.csv. - This comma-delimited file lists the accounts with a user name, - hashed password, and salt. - (A sample file is at - /usr/local/share/bind10-devel/cmdctl-accounts.csv. - It contains the user named root with the password - bind10.) -

- The administrator may create a user account with the - b10-cmdctl-usermgr tool. -

- By default the HTTPS server listens on the localhost port 8080. - The port can be set by using the --port command line option. - The address to listen on can be set using the --address command - line argument. - Each HTTPS connection is stateless and times out in 1200 seconds - by default. This can be - redefined by using the --idle-timeout command line argument. -

6.1. Configuration specification for b10-cmdctl

- The configuration items for b10-cmdctl are: - accounts_file which defines the path to the - user accounts database (the default is - /usr/local/etc/bind10-devel/cmdctl-accounts.csv); - cert_file which defines the path to the - PEM certificate file (the default is - /usr/local/etc/bind10-devel/cmdctl-certfile.pem); - and - key_file which defines the path to the - PEM private key file (the default is - /usr/local/etc/bind10-devel/cmdctl-keyfile.pem). -

Chapter 7. Control and configure user interface

Note

- For this development prototype release, bindctl - is the only user interface. It is expected that upcoming - releases will provide another interactive command-line - interface and a web-based interface for controlling and - configuring BIND 10. -

- The bindctl tool provides an interactive - prompt for configuring, controlling, and querying the BIND 10 - components. - It communicates directly with a REST-ful interface over HTTPS - provided by b10-cmdctl. It doesn't - communicate to any other components directly. -

- Configuration changes are actually commands to - b10-cfgmgr. So when bindctl - sends a configuration, it is sent to b10-cmdctl - (over a HTTPS connection); then b10-cmdctl - sends the command (over a b10-msgq command - channel) to b10-cfgmgr which then stores - the details and relays (over a b10-msgq command - channel) the configuration on to the specified module. -

-

Chapter 8. Authoritative Server

- The b10-auth is the authoritative DNS server. - It supports EDNS0, DNSSEC, IPv6, and SQLite3 and in-memory zone - data backends. - Normally it is started by the bind10 master - process. -

8.1. Server Configurations

- b10-auth is configured via the - b10-cfgmgr configuration manager. - The module name is Auth. - The configuration data items are: - -

database_file
This is an optional string to define the path to find - the SQLite3 database file. - -Note: This may be a temporary setting because the DNS server -can use various data source backends. -
datasources
- datasources configures data sources. - The list items include: - type to define the required data source type - (such as memory); - class to optionally select the class - (it defaults to IN); - and - zones to define - the file path name, - the filetype (sqlite3 to load - from a SQLite3 database file or text to - load from a master text file), - and the origin (default domain). - - By default, this is empty. - -

Note

- In this development version, currently this is only used for the - memory data source. - Only the IN class is supported at this time. - By default, the memory data source is disabled. - Also, currently the zone file must be canonical such as - generated by named-compilezone -D, or - must be an SQLite3 database. -

- -
listen_on
- listen_on is a list of addresses and ports for - b10-auth to listen on. - The list items are the address string - and port number. - By default, b10-auth listens on port 53 - on the IPv6 (::) and IPv4 (0.0.0.0) wildcard addresses. -

Note

- The default configuration is currently not appropriate for a multi-homed host. - In case you have multiple public IP addresses, it is possible the - query UDP packet comes through one interface and the answer goes out - through another. The answer will probably be dropped by the client, as it - has a different source address than the one it sent the query to. The - client would fallback on TCP after several attempts, which works - well in this situation, but is clearly not ideal. -

- There are plans to solve the problem such that the server handles - it by itself. But until it is actually implemented, it is recommended to - alter the configuration — remove the wildcard addresses and list all - addresses explicitly. Then the server will answer on the same - interface the request came on, preserving the correct address. -

-
statistics-interval
- statistics-interval is the timer interval - in seconds for b10-auth to share its - statistics information to - b10-stats(8). - Statistics updates can be disabled by setting this to 0. - The default is 60. -

- -

- - The configuration commands are: - -

loadzone
- loadzone tells b10-auth - to load or reload a zone file. The arguments include: - class which optionally defines the class - (it defaults to IN); - origin is the domain name of the zone; - and - datasrc optionally defines the type of datasource - (it defaults to memory). - -

Note

- In this development version, currently this only supports the - IN class and the memory data source. -

-
sendstats
- sendstats tells b10-auth - to send its statistics data to - b10-stats(8) - immediately. -
shutdown
Stop the authoritative DNS server. - This has an optional pid argument to - select the process ID to stop. - (Note that the BIND 10 boss process may restart this service - if configured.) -

- -

8.2. Data Source Backends

- Bind 10 has the concept of data sources. A data source is a place - where authoritative zone data reside and where they can be served - from. This can be a master file, a database or something completely - different. -

- Once a query arrives, b10-auth goes through a - configured list of data sources and finds the one containing a best - matching zone. From the equally good ones, the first one is taken. - This data source is then used to answer the query. -

Note

- In the development prototype release, b10-auth - can serve data from a SQLite3 data source backend and from master - files. - Upcoming versions will be able to use multiple different - data sources, such as MySQL and Berkeley DB. -

- The configuration is located in data_sources/classes. Each item there - represents one RR class and a list used to answer queries for that - class. The default contains two classes. The CH class contains a static - data source — one that serves things like - AUTHORS.BIND.. The IN class contains single SQLite3 - data source with database file located at - /usr/local/var/bind10-devel/zone.sqlite3. -

- Each data source has several options. The first one is - type, which specifies the type of data source to - use. Valid types include the ones listed below, but bind10 uses - dynamically loaded modules for them, so there may be more in your - case. This option is mandatory. -

- Another option is params. This option is type - specific; it holds different data depending on the type - above. Also, depending on the type, it could be possible to omit it. -

- There are two options related to the so-called cache. If you enable - cache, zone data from the data source are loaded into memory. - Then, when answering a query, b10-auth looks - into the memory only instead of the data source, which speeds - answering up. The first option is cache-enable, - a boolean value turning the cache on and off (off is the default). - The second one, cache-zones, is a list of zone - origins to load into in-memory. Remember that zones in the data source - not listed here will not be loaded and will not be available at all. -

8.2.1. Data source types

- As mentioned, the type used by default is sqlite3. - It has single configuration option inside params - — database_file, which contains the path - to the sqlite3 file containing the data. -

- Another type is called MasterFiles. This one is - slightly special. The data are stored in RFC1034 master files. - Because answering directly from them would be impractical, - this type mandates the cache to be enabled. Also, the list of - zones (cache-zones) should be omitted. The - params is a dictionary mapping from zone - origins to the files they reside in. -

8.2.2. Examples

- As this is one of the more complex configurations of Bind10, - we show some examples. They all assume they start with default - configuration. -

- First, let's disable the static data source - (VERSION.BIND and friends). As it is the only - data source in the CH class, we can remove the whole class. - -

> config remove data_sources/classes CH
-> config commit

-

- Another one, let's say our default data source contains zones - example.org. and example.net.. - We want them to be served from memory to make the answering - faster. - -

> config set data_sources/classes/IN[0]/cache-enable true
-> config add data_sources/classes/IN[0]/cache-zones example.org.
-> config add data_sources/classes/IN[0]/cache-zones example.net.
-> config commit

- - Now every time the zone in the data source is changed by the - operator, Bind10 needs to be told to reload it, by -

> Auth loadzone example.org

- You don't need to do this when the zone is modified by - XfrIn, it does so automatically. -

- Now, the last example is when there are master files we want to - serve in addition to whatever is inside the sqlite3 database. - -

> config add data_sources/classes/IN
-> config set data_sources/classes/IN[1]/type MasterFiles
-> config set data_sources/classes/IN[1]/cache-enable true
-> config set data_sources/classes/IN[1]/params { "example.org": "/path/to/example.org", "example.com": "/path/to/example.com" }
-> config commit

- - Initially, a map value has to be set, but this value may be an - empty map. After that, key/value pairs can be added with 'config - add' and keys can be removed with 'config remove'. The initial - value may be an empty map, but it has to be set before zones are - added or removed. - -

-> config set data_sources/classes/IN[1]/params {}
-> config add data_sources/classes/IN[1]/params another.example.org /path/to/another.example.org
-> config add data_sources/classes/IN[1]/params another.example.com /path/to/another.example.com
-> config remove data_sources/classes/IN[1]/params another.example.org
-          

- - bindctl. To reload a zone, you the same command - as above. -

Note

- There's also Auth/database_file configuration - variable, pointing to a sqlite3 database file. This is no longer - used by b10-auth, but it is left in place for - now, since other modules use it. Once b10-xfrin, - b10-xfrout and b10-ddns - are ported to the new configuration, this will disappear. But for - now, make sure that if you use any of these modules, the new - and old configuration correspond. The defaults are consistent, so - unless you tweaked either the new or the old configuration, you're - good. -

8.3. Loading Master Zones Files

- RFC 1035 style DNS master zone files may imported - into a BIND 10 SQLite3 data source by using the - b10-loadzone utility. -

- b10-loadzone supports the following - special directives (control entries): - -

$INCLUDE
Loads an additional zone file. This may be recursive. -
$ORIGIN
Defines the relative domain name. -
$TTL
Defines the time-to-live value used for following - records that don't include a TTL. -

- -

- The -o argument may be used to define the - default origin for loaded zone file records. -

Note

- In the development prototype release, only the SQLite3 back - end is used by b10-loadzone. - By default, it stores the zone data in - /usr/local/var/bind10-devel/zone.sqlite3 - unless the -d switch is used to set the - database filename. - Multiple zones are stored in a single SQLite3 zone database. -

- If you reload a zone already existing in the database, - all records from that prior zone disappear and a whole new set - appears. -

Chapter 9. Incoming Zone Transfers

- Incoming zones are transferred using the b10-xfrin - process which is started by bind10. - When received, the zone is stored in the corresponding BIND 10 - data source, and its records can be served by - b10-auth. - In combination with b10-zonemgr (for - automated SOA checks), this allows the BIND 10 server to - provide secondary service. -

- The b10-xfrin process supports both AXFR and - IXFR. Due to some implementation limitations of the current - development release, however, it only tries AXFR by default, - and care should be taken to enable IXFR. -

9.1. Configuration for Incoming Zone Transfers

- In practice, you need to specify a list of secondary zones to - enable incoming zone transfers for these zones (you can still - trigger a zone transfer manually, without a prior configuration - (see below)). -

- For example, to enable zone transfers for a zone named "example.com" - (whose master address is assumed to be 2001:db8::53 here), - run the following at the bindctl prompt: - -

> config add Xfrin/zones
-> config set Xfrin/zones[0]/name "example.com"
-> config set Xfrin/zones[0]/master_addr "2001:db8::53"
-> config commit

- - (We assume there has been no zone configuration before). -

9.2. Enabling IXFR

- As noted above, b10-xfrin uses AXFR for - zone transfers by default. To enable IXFR for zone transfers - for a particular zone, set the use_ixfr - configuration parameter to true. - In the above example of configuration sequence, you'll need - to add the following before performing commit: -

> config set Xfrin/zones[0]/use_ixfr true

-

Note

- One reason why IXFR is disabled by default in the current - release is because it does not support automatic fallback from IXFR to - AXFR when it encounters a primary server that doesn't support - outbound IXFR (and, not many existing implementations support - it). Another, related reason is that it does not use AXFR even - if it has no knowledge about the zone (like at the very first - time the secondary server is set up). IXFR requires the - "current version" of the zone, so obviously it doesn't work - in this situation and AXFR is the only workable choice. - The current release of b10-xfrin does not - make this selection automatically. - These features will be implemented in a near future - version, at which point we will enable IXFR by default. -

9.3. Secondary Manager

- The b10-zonemgr process is started by - bind10. - It keeps track of SOA refresh, retry, and expire timers - and other details for BIND 10 to perform as a slave. - When the b10-auth authoritative DNS server - receives a NOTIFY message, b10-zonemgr - may tell b10-xfrin to do a refresh - to start an inbound zone transfer. - The secondary manager resets its counters when a new zone is - transferred in. -

Note

- Access control (such as allowing notifies) is not yet provided. - The primary/secondary service is not yet complete. -

- The following example shows using bindctl - to configure the server to be a secondary for the example zone: - -

> config add Zonemgr/secondary_zones
-> config set Zonemgr/secondary_zones[0]/name "example.com"
-> config commit

- -

- If the zone does not exist in the data source already - (i.e. no SOA record for it), b10-zonemgr - will automatically tell b10-xfrin - to transfer the zone in. -

9.4. Trigger an Incoming Zone Transfer Manually

- To manually trigger a zone transfer to retrieve a remote zone, - you may use the bindctl utility. - For example, at the bindctl prompt run: - -

> Xfrin retransfer zone_name="foo.example.org" master=192.0.2.99

-

9.5. Incoming Transfers with In-memory Datasource

- In the case of an incoming zone transfer, the received zone is - first stored in the corresponding BIND 10 datasource. In - case the secondary zone is served by an in-memory datasource - with an SQLite3 backend, b10-auth is - automatically sent a loadzone command to - reload the corresponding zone into memory from the backend. -

- The administrator doesn't have to do anything for - b10-auth to serve the new version of the - zone, except for the configuration such as the one described in - Section 8.2, “Data Source Backends”. -

Chapter 10. Outbound Zone Transfers

- The b10-xfrout process is started by - bind10. - When the b10-auth authoritative DNS server - receives an AXFR or IXFR request, b10-auth - internally forwards the request to b10-xfrout, - which handles the rest of this request processing. - This is used to provide primary DNS service to share zones - to secondary name servers. - The b10-xfrout is also used to send - NOTIFY messages to secondary servers. -

- A global or per zone transfer_acl configuration - can be used to control accessibility of the outbound zone - transfer service. - By default, b10-xfrout allows any clients to - perform zone transfers for any zones: -

> config show Xfrout/transfer_acl
-Xfrout/transfer_acl[0]	{"action": "ACCEPT"}	any	(default)

- You can change this to, for example, rejecting all transfer - requests by default while allowing requests for the transfer - of zone "example.com" from 192.0.2.1 and 2001:db8::1 as follows: -

> config set Xfrout/transfer_acl[0] {"action": "REJECT"}
-> config add Xfrout/zone_config
-> config set Xfrout/zone_config[0]/origin "example.com"
-> config set Xfrout/zone_config[0]/transfer_acl [{"action": "ACCEPT", "from": "192.0.2.1"},
-                                                 {"action": "ACCEPT", "from": "2001:db8::1"}]
-> config commit

Note

- In the above example the lines - for transfer_acl were divided for - readability. In the actual input it must be in a single line. -

- If you want to require TSIG in access control, a system wide TSIG - "key ring" must be configured. - For example, to change the previous example to allowing requests - from 192.0.2.1 signed by a TSIG with a key name of - "key.example", you'll need to do this: -

> config set tsig_keys/keys ["key.example:<base64-key>"]
-> config set Xfrout/zone_config[0]/transfer_acl [{"action": "ACCEPT", "from": "192.0.2.1", "key": "key.example"}]
-> config commit

Both b10-xfrout and b10-auth - will use the system wide keyring to check - TSIGs in the incoming messages and to sign responses.

Note

- The way to specify zone specific configuration (ACLs, etc) is - likely to be changed. -

Chapter 11. Dynamic DNS Update

- BIND 10 supports the server side of the Dynamic DNS Update - (DDNS) protocol as defined in RFC 2136. - This service is provided by the b10-ddns - component, which is started by the bind10 - process if configured so. -

- When the b10-auth authoritative DNS server - receives an UPDATE request, it internally forwards the request - to b10-ddns, which handles the rest of - this request processing. - When the processing is completed, b10-ddns - will send a response to the client as specified in RFC 2136 - (NOERROR for successful update, REFUSED if rejected due to - ACL check, etc). - If the zone has been changed as a result, it will internally - notify b10-xfrout so that other secondary - servers will be notified via the DNS NOTIFY protocol. - In addition, if b10-auth serves the updated - zone (as described in - Section 8.2, “Data Source Backends”), - b10-ddns will also - notify b10-auth so that b10-auth - will re-cache the updated zone content if necessary. -

- The b10-ddns component supports requests over - both UDP and TCP, and both IPv6 and IPv4; for TCP requests, - however, it terminates the TCP connection immediately after - each single request has been processed. Clients cannot reuse the - same TCP connection for multiple requests. (This is a current - implementation limitation of b10-ddns. - While RFC 2136 doesn't specify anything about such reuse of TCP - connection, there is no reason for disallowing it as RFC 1035 - generally allows multiple requests sent over a single TCP - connection. BIND 9 supports such reuse.) -

- As of this writing b10-ddns does not support - update forwarding for secondary zones. - If it receives an update request for a secondary zone, it will - immediately return a not implemented response. -

Note

- For feature completeness, update forwarding should be - eventually supported. But currently it's considered a lower - priority task and there is no specific plan of implementing - this feature. - -

-

11.1. Enabling Dynamic Update

- First off, it must be made sure that a few components on which - b10-ddns depends are configured to run, - which are b10-auth - and b10-zonemgr. - In addition, b10-xfrout should also be - configured to run; otherwise the notification after an update - (see above) will fail with a timeout, suspending the DDNS - service while b10-ddns waits for the - response (see the description of the DDNS_UPDATE_NOTIFY_FAIL - log message for further details). - If BIND 10 is already configured to provide authoritative DNS - service they should normally be configured to run already. -

- Second, for the obvious reason dynamic update requires that the - underlying data source storing the zone data be writable. - In the current implementation this means the zone must be stored - in an SQLite3-based data source. - Also, in this development version, the b10-ddns - component configures itself with the data source referring to the - database_file configuration parameter of - b10-auth. - So this information must be configured correctly before starting - b10-ddns. - -

Note

- The way to configure data sources is now being revised. - Configuration on the data source for DDNS will be very - likely to be changed in a backward incompatible manner in - a near future version. -

-

- In general, if something goes wrong regarding the dependency - described above, b10-ddns will log the - related event at the warning or error level. - It's advisable to check the log message when you first enable - DDNS or if it doesn't work as you expect to see if there's any - warning or error log message. -

- Next, to enable the DDNS service, b10-ddns - needs to be explicitly configured to run. - It can be done by using the bindctl - utility. For example: -

-> config add Boss/components b10-ddns
-> config set Boss/components/b10-ddns/address DDNS
-> config set Boss/components/b10-ddns/kind dispensable
-> config commit
-

-

Note

- In theory kind could be omitted because - "dispensable" is its default. - But there's some peculiar behavior (which should be a - bug and should be fixed eventually; see Trac ticket #2064) - with bindctl and you'll still need to - specify that explicitly. Likewise, address - may look unnecessary because b10-ddns - would start and work without specifying it. But for it - to shutdown gracefully this parameter should also be - specified. -

-

11.2. Access Control

- By default, b10-ddns rejects any update - requests from any clients by returning a REFUSED response. - To allow updates to take effect, an access control rule - (called update ACL) with a policy allowing updates must explicitly be - configured. - Update ACL must be configured per zone basis in the - zones configuration parameter of - b10-ddns. - This is a list of per-zone configurations regarding DDNS. - Each list element consists of the following parameters: -

origin
The zone's origin name
class
The RR class of the zone - (normally IN, and in that case - can be omitted in configuration)
update_acl
List of access control rules (ACL) for the zone

- The syntax of the ACL is the same as ACLs for other - components. - Specific examples are given below. -

- In general, an update ACL rule that allows an update request - should be configured with a TSIG key. - This is an example update ACL that allows updates to the zone - named example.org (of default RR class IN) - from clients that send requests signed with a TSIG whose - key name is "key.example.org" (and refuses all others): -

-> config add DDNS/zones
-> config set DDNS/zones[0]/origin example.org
-> config add DDNS/zones[0]/update_acl {"action": "ACCEPT", "key": "key.example.org"}
-> config commit
-

- The TSIG key must be configured system wide - (see Chapter 10, Outbound Zone Transfers.) -

- Multiple rules can be specified in the ACL, and an ACL rule - can consist of multiple constraints, such as a combination of - IP address and TSIG. - The following configuration sequence will add a new rule to - the ACL created in the above example. This additional rule - allows update requests sent from a client - using TSIG key name of "key.example" (different from the - key used in the previous example) and has an IPv6 address of ::1. -

-> config add DDNS/zones[0]/update_acl {"action": "ACCEPT", "from": "::1", "key": "key.example"}
-> config show DDNS/zones[0]/update_acl
-DDNS/zones[0]/update_acl[0]     {"action": "ACCEPT", "key": "key.example.org"} any (modified)
-DDNS/zones[0]/update_acl[1]     {"action": "ACCEPT", "from": "::1", "key": "key.example"} any (modified)
-> config commit
-

- (Note the "add" in the first line. Before this sequence, we - have had only entry in zones[0]/update_acl. - The add command with a value (rule) adds - a new entry and sets it to the given rule. - - Due to a limitation of the current implementation, it doesn't - work if you first try to just add a new entry and then set it to - a given rule.) -

Note

- The b10-ddns component accepts an ACL - rule that just allows updates from a specific IP address - (i.e., without requiring TSIG), but this is highly - discouraged (remember that requests can be made over UDP and - spoofing the source address of a UDP packet is often pretty - easy). - Unless you know what you are doing and that you can accept - its consequence, any update ACL rule that allows updates - should have a TSIG key in its constraints. -

- The ACL rules will be checked in the listed order, and the - first matching one will apply. - If none of the rules matches, the default rule will apply, - which is rejecting any requests in the case of - b10-ddns. -

- Other actions than "ACCEPT", namely "REJECT" and "DROP", can be - used, too. - See Chapter 12, Recursive Name Server about their effects. -

- Currently update ACL can only control updates per zone basis; - it's not possible to specify access control with higher - granularity such as for particular domain names or specific - types of RRs. - -

Note

- Contrary to what RFC 2136 (literally) specifies, - b10-ddns checks the update ACL before - checking the prerequisites of the update request. - This is a deliberate implementation decision. - This counter intuitive specification has been repeatedly - discussed among implementers and in the IETF, and it is now - widely agreed that it does not make sense to strictly follow - that part of RFC. - One known specific bad result of following the RFC is that it - could leak information about which name or record exists or does not - exist in the zone as a result of prerequisite checks even if a - zone is somehow configured to reject normal queries from - arbitrary clients. - There have been other troubles that could have been avoided if - the ACL could be checked before the prerequisite check. -

11.3. Miscellaneous Operational Issues

- Unlike BIND 9, BIND 10 currently does not support automatic - re-signing of DNSSEC-signed zone when it's updated via DDNS. - It could be possible to re-sign the updated zone afterwards - or make sure the update request also updates related DNSSEC - records, but that will be pretty error-prone operation. - In general, it's not advisable to allow DDNS for a signed zone - at this moment. -

- Also unlike BIND 9, it's currently not possible - to freeze a zone temporarily in order to - suspend DDNS while you manually update the zone. - If you need to make manual updates to a dynamic zone, - you'll need to temporarily reject any updates to the zone via - the update ACLs. -

- Dynamic updates are only applicable to primary zones. - In order to avoid updating secondary zones via DDNS requests, - b10-ddns refers to the - secondary_zones configuration of - b10-zonemgr. Zones listed in - secondary_zones will never be updated via DDNS - regardless of the update ACL configuration; - b10-ddns will return a NOTAUTH (server - not authoritative for the zone) response. - If you have a "conceptual" secondary zone whose content is a - copy of some external source but is not updated via the - standard zone transfers and therefore not listed in - secondary_zones, be careful not to allow DDNS - for the zone; it would be quite likely to lead to inconsistent - state between different servers. - Normally this should not be a problem because the default - update ACL rejects any update requests, but you may want to - take an extra care about the configuration if you have such - type of secondary zones. -

- The difference of two versions of a zone, before and after a - DDNS transaction, is automatically recorded in the underlying - data source, and can be retrieved in the form of outbound - IXFR. - This is done automatically; it does not require specific - configuration to make this possible. -

Chapter 12. Recursive Name Server

- The b10-resolver process is started by - bind10. - -

- The main bind10 process can be configured - to select to run either the authoritative or resolver or both. - By default, it doesn't start either one. You may change this using - bindctl, for example: - -

-> config add Boss/components b10-resolver
-> config set Boss/components/b10-resolver/special resolver
-> config set Boss/components/b10-resolver/kind needed
-> config set Boss/components/b10-resolver/priority 10
-> config commit
-

- -

- The master bind10 will stop and start - the desired services. -

- By default, the resolver listens on port 53 for 127.0.0.1 and ::1. - The following example shows how it can be configured to - listen on an additional address (and port): - -

-> config add Resolver/listen_on
-> config set Resolver/listen_on[2]/address "192.168.1.1"
-> config set Resolver/listen_on[2]/port 53
-> config commit
-

-

(Replace the 2 - as needed; run config show - Resolver/listen_on if needed.)

12.1. Access Control

- By default, the b10-resolver daemon only accepts - DNS queries from the localhost (127.0.0.1 and ::1). - The Resolver/query_acl configuration may - be used to reject, drop, or allow specific IPs or networks. - This configuration list is first match. -

- The configuration's action item may be - set to ACCEPT to allow the incoming query, - REJECT to respond with a DNS REFUSED return - code, or DROP to ignore the query without - any response (such as a blackhole). For more information, - see the respective debugging messages: RESOLVER_QUERY_ACCEPTED, - RESOLVER_QUERY_REJECTED, - and RESOLVER_QUERY_DROPPED. -

- The required configuration's from item is set - to an IPv4 or IPv6 address, addresses with an network mask, or to - the special lowercase keywords any6 (for - any IPv6 address) or any4 (for any IPv4 - address). -

- For example to allow the 192.168.1.0/24 - network to use your recursive name server, at the - bindctl prompt run: -

-> config add Resolver/query_acl
-> config set Resolver/query_acl[2]/action "ACCEPT"
-> config set Resolver/query_acl[2]/from "192.168.1.0/24"
-> config commit
-

(Replace the 2 - as needed; run config show - Resolver/query_acl if needed.)

Note

This prototype access control configuration - syntax may be changed.

12.2. Forwarding

- - To enable forwarding, the upstream address and port must be - configured to forward queries to, such as: - -

-> config set Resolver/forward_addresses [{ "address": "192.168.1.1", "port": 53 }]
-> config commit
-

- - (Replace 192.168.1.1 to point to your - full resolver.) -

- Normal iterative name service can be re-enabled by clearing the - forwarding address(es); for example: - -

-> config set Resolver/forward_addresses []
-> config commit
-

-

Chapter 13. DHCPv4 Server

Dynamic Host Configuration Protocol for IPv4 (DHCP or - DHCPv4) and Dynamic Host Configuration Protocol for IPv6 (DHCPv6) - are protocols that allow one node (server) to provision - configuration parameters to many hosts and devices (clients). To - ease deployment in larger networks, additional nodes (relays) may - be deployed that facilitate communication between servers and - clients. Even though principles of both DHCPv4 and DHCPv6 are - somewhat similar, these are two radically different - protocols. BIND10 offers server implementations for both DHCPv4 - and DHCPv6. This chapter is about DHCP for IPv4. For a description - of the DHCPv6 server, see Chapter 14, DHCPv6 Server.

The DHCPv4 server component is currently under intense - development. You may want to check out BIND10 DHCP (Kea) wiki - and recent posts on BIND10 - developers mailing list.

The DHCPv4 and DHCPv6 components in BIND10 architecture are - internally code named Kea.

Note

- As of December 2011, both DHCPv4 and DHCPv6 components are - skeleton servers. That means that while they are capable of - performing DHCP configuration, they are not fully functional - yet. In particular, neither has functional lease - databases. This means that they will assign the same, fixed, - hardcoded addresses to any client that will ask. See Section 13.4, “DHCPv4 Server Limitations” and Section 14.4, “DHCPv6 Server Limitations” for - detailed description. -

13.1. DHCPv4 Server Usage

BIND10 provides the DHCPv4 server component since December - 2011. It is a skeleton server and can be described as an early - prototype that is not fully functional yet. It is mature enough - to conduct first tests in lab environment, but it has - significant limitations. See Section 13.4, “DHCPv4 Server Limitations” for - details. -

- b10-dhcp4 is a BIND10 component and is being - run under BIND10 framework. To add a DHCPv4 process to the set of running - BIND10 services, you can use following commands in bindctl: -

> config add Boss/components b10-dhcp4
-> config set Boss/components/b10-dhcp4/kind dispensable
-> config commit

- To shutdown running b10-dhcp4, please use the - following command: -

> Dhcp4 shutdown

- or -

> config remove Boss/components b10-dhcp4
-> config commit

- During start-up the server will detect available network interfaces - and will attempt to open UDP sockets on all interfaces that - are up, running, are not loopback, and have IPv4 address - assigned. - - The server will then listen to incoming traffic. Currently - supported client messages are DISCOVER and REQUEST. The server - will respond to them with OFFER and ACK, respectively. - - Since the DHCPv4 server opens privileged ports, it requires root - access. Make sure you run this daemon as root. -

13.2. DHCPv4 Server Configuration

- The DHCPv4 server does not have a lease database implemented yet - nor any support for configuration, so every time the same set - of configuration options (including the same fixed address) - will be assigned every time. -

- At this stage of development, the only way to alter the server - configuration is to tweak its source code. To do so, please - edit src/bin/dhcp4/dhcp4_srv.cc file and modify following - parameters and recompile: -

-const std::string HARDCODED_LEASE = "192.0.2.222"; // assigned lease
-const std::string HARDCODED_NETMASK = "255.255.255.0";
-const uint32_t    HARDCODED_LEASE_TIME = 60; // in seconds
-const std::string HARDCODED_GATEWAY = "192.0.2.1";
-const std::string HARDCODED_DNS_SERVER = "192.0.2.2";
-const std::string HARDCODED_DOMAIN_NAME = "isc.example.com";
-const std::string HARDCODED_SERVER_ID = "192.0.2.1";

- - Lease database and configuration support is planned for 2012. -

13.3. Supported standards

The following standards and draft standards are currently - supported:

  • RFC2131: Supported messages are DISCOVER, OFFER, - REQUEST, and ACK.
  • RFC2132: Supported options are: PAD (0), - END(255), Message Type(53), DHCP Server Identifier (54), - Domain Name (15), DNS Servers (6), IP Address Lease Time - (51), Subnet mask (1), and Routers (3).

13.4. DHCPv4 Server Limitations

These are the current limitations of the DHCPv4 server - software. Most of them are reflections of the early stage of - development and should be treated as not implemented - yet, rather than actual limitations.

  • During initial IPv4 node configuration, the - server is expected to send packets to a node that does not - have IPv4 address assigned yet. The server requires - certain tricks (or hacks) to transmit such packets. This - is not implemented yet, therefore DHCPv4 server supports - relayed traffic only (that is, normal point to point - communication).
  • b10-dhcp4 provides a single, - fixed, hardcoded lease to any client that asks. There is - no lease manager implemented. If two clients request - addresses, they will both get the same fixed - address.
  • b10-dhcp4 does not support any - configuration mechanisms yet. The whole configuration is - currently hardcoded. The only way to tweak configuration - is to directly modify source code. See see Section 13.2, “DHCPv4 Server Configuration” for details.
  • Upon start, the server will open sockets on all - interfaces that are not loopback, are up and running and - have IPv4 address.
  • PRL (Parameter Request List, a list of options - requested by a client) is currently ignored and server - assigns DNS SERVER and DOMAIN NAME options.
  • b10-dhcp4 does not support - BOOTP. That is a design choice. This limitation is - permanent. If you have legacy nodes that can't use DHCP and - require BOOTP support, please use latest version of ISC DHCP - http://www.isc.org/software/dhcp.
  • Interface detection is currently working on Linux - only. See Section 15.1, “Interface detection” for details.
  • b10-dhcp4 does not verify that - assigned address is unused. According to RFC2131, the - allocating server should verify that address is no used by - sending ICMP echo request.
  • Address renewal (RENEW), rebinding (REBIND), - confirmation (CONFIRM), duplication report (DECLINE) and - release (RELEASE) are not supported yet.
  • DNS Update is not supported yet.
  • -v (verbose) command line option is currently - the default, and cannot be disabled.

Chapter 14. DHCPv6 Server

Dynamic Host Configuration Protocol for IPv6 (DHCPv6) is - specified in RFC3315. BIND10 provides DHCPv6 server implementation - that is described in this chapter. For a description of the DHCPv4 - server implementation, see Chapter 13, DHCPv4 Server. -

The DHCPv6 server component is currently under intense - development. You may want to check out BIND10 DHCP (Kea) wiki - and recent posts on BIND10 - developers mailing list.

The DHCPv4 and DHCPv6 components in BIND10 architecture are - internally code named Kea.

Note

- As of December 2011, both DHCPv4 and DHCPv6 components are - skeleton servers. That means that while they are capable of - performing DHCP configuration, they are not fully functional - yet. In particular, neither has functional lease - databases. This means that they will assign the same, fixed, - hardcoded addresses to any client that will ask. See Section 13.4, “DHCPv4 Server Limitations” and Section 14.4, “DHCPv6 Server Limitations” for - detailed description. -

14.1. DHCPv6 Server Usage

- BIND10 provides the DHCPv6 server component since September - 2011. It is a skeleton server and can be described as an early - prototype that is not fully functional yet. It is mature - enough to conduct first tests in lab environment, but it has - significant limitations. See Section 14.4, “DHCPv6 Server Limitations” for - details. -

- b10-dhcp6 is a BIND10 component and is being - run under BIND10 framework. To add a DHCPv6 process to the set of running - BIND10 services, you can use following commands in bindctl: -

> config add Boss/components b10-dhcp6
-> config set Boss/components/b10-dhcp6/kind dispensable
-> config commit

-

- To shutdown running b10-dhcp6, please use the - following command: -

> Dhcp6 shutdown

- or -

> config remove Boss/components b10-dhcp6
-> config commit

-

- During start-up the server will detect available network interfaces - and will attempt to open UDP sockets on all interfaces that - are up, running, are not loopback, are multicast-capable, and - have IPv6 address assigned. - - The server will then listen to incoming traffic. Currently - supported client messages are SOLICIT and REQUEST. The server - will respond to them with ADVERTISE and REPLY, respectively. - - Since the DHCPv6 server opens privileged ports, it requires root - access. Make sure you run this daemon as root. -

14.2. DHCPv6 Server Configuration

- The DHCPv6 server does not have lease database implemented yet - or any support for configuration, so every time the same set - of configuration options (including the same fixed address) - will be assigned every time. -

- At this stage of development, the only way to alter server - configuration is to tweak its source code. To do so, please - edit src/bin/dhcp6/dhcp6_srv.cc file, modify the following - parameters and recompile: -

-const std::string HARDCODED_LEASE = "2001:db8:1::1234:abcd";
-const uint32_t HARDCODED_T1 = 1500; // in seconds
-const uint32_t HARDCODED_T2 = 2600; // in seconds
-const uint32_t HARDCODED_PREFERRED_LIFETIME = 3600; // in seconds
-const uint32_t HARDCODED_VALID_LIFETIME = 7200; // in seconds
-const std::string HARDCODED_DNS_SERVER = "2001:db8:1::1";

- - Lease database and configuration support is planned for 2012. -

14.3. Supported DHCPv6 Standards

The following standards and draft standards are currently - supported:

  • RFC3315: Supported messages are SOLICIT, - ADVERTISE, REQUEST, and REPLY. Supported options are - SERVER_ID, CLIENT_ID, IA_NA, and IAADDRESS.
  • RFC3646: Supported option is DNS_SERVERS.

14.4. DHCPv6 Server Limitations

These are the current limitations of the DHCPv6 server - software. Most of them are reflections of the early stage of - development and should be treated as not implemented - yet, rather than actual limitations.

-

  • Relayed traffic is not supported.
  • b10-dhcp6 provides a single, - fixed, hardcoded lease to any client that asks. There is no - lease manager implemented. If two clients request addresses, - they will both get the same fixed address.
  • b10-dhcp6 does not support any - configuration mechanisms yet. The whole configuration is - currently hardcoded. The only way to tweak configuration - is to directly modify source code. See see Section 14.2, “DHCPv6 Server Configuration” for details.
  • Upon start, the server will open sockets on all - interfaces that are not loopback, are up, running and are - multicast capable and have IPv6 address. Support for - multiple interfaces is not coded in reception routines yet, - so if you are running this code on a machine that has many - interfaces and b10-dhcp6 happens to - listen on wrong interface, the easiest way to work around - this problem is to turn down other interfaces. This - limitation will be fixed shortly.
  • ORO (Option Request Option, a list of options - requested by a client) is currently ignored and server - assigns DNS SERVER option.
  • Temporary addresses are not supported yet.
  • Prefix delegation is not supported yet.
  • Address renewal (RENEW), rebinding (REBIND), - confirmation (CONFIRM), duplication report (DECLINE) and - release (RELEASE) are not supported yet.
  • DNS Update is not supported yet.
  • Interface detection is currently working on Linux - only. See Section 15.1, “Interface detection” for details.
  • -v (verbose) command line option is currently the - default, and cannot be disabled.

-

Chapter 15. libdhcp++ library

libdhcp++ is a common library written in C++ that handles - many DHCP-related tasks, like DHCPv4 and DHCPv6 packets parsing, - manipulation and assembly, option parsing, manipulation and - assembly, network interface detection and socket operations, like - socket creations, data transmission and reception and socket - closing. -

- While this library is currently used by - b10-dhcp4 and b10-dhcp6 - only, it is designed to be portable, universal library useful for - any kind of DHCP-related software. -

15.1. Interface detection

Both DHCPv4 and DHCPv6 components share network - interface detection routines. Interface detection is - currently only supported on Linux systems.

For non-Linux systems, there is currently stub - implementation provided. Interface manager detects loopback - interfaces only as their name (lo or lo0) can be easily predicted. - Please contact BIND10 development team if you are interested - in running DHCP components on systems other than Linux.

15.2. DHCPv4/DHCPv6 packet handling

TODO: Describe packet handling here, with pointers to wiki

Chapter 16. Statistics

- The b10-stats process is started by - bind10. - It periodically collects statistics data from various modules - and aggregates it. - -

- - This stats daemon provides commands to identify if it is - running, show specified or all statistics data, and show specified - or all statistics data schema. - - For example, using bindctl: - -

-> Stats show
-{
-    "Auth": {
-        "opcode.iquery": 0,
-        "opcode.notify": 10,
-        "opcode.query": 869617,
-        ...
-        "queries.tcp": 1749,
-        "queries.udp": 867868
-    },
-    "Boss": {
-        "boot_time": "2011-01-20T16:59:03Z"
-    },
-    "Stats": {
-        "boot_time": "2011-01-20T16:59:05Z",
-        "last_update_time": "2011-01-20T17:04:05Z",
-        "lname": "4d3869d9_a@jreed.example.net",
-        "report_time": "2011-01-20T17:04:06Z",
-        "timestamp": 1295543046.823504
-    }
-}
-       

-

Chapter 17. Logging

17.1. Logging configuration

- - The logging system in BIND 10 is configured through the - Logging module. All BIND 10 modules will look at the - configuration in Logging to see what should be logged and - to where. - - - -

17.1.1. Loggers

- - Within BIND 10, a message is logged through a component - called a "logger". Different parts of BIND 10 log messages - through different loggers, and each logger can be configured - independently of one another. - -

- - In the Logging module, you can specify the configuration - for zero or more loggers; any that are not specified will - take appropriate default values. - -

- - The three most important elements of a logger configuration - are the name (the component that is - generating the messages), the severity - (what to log), and the output_options - (where to log). - -

17.1.1.1. name (string)

- Each logger in the system has a name, the name being that - of the component using it to log messages. For instance, - if you want to configure logging for the resolver module, - you add an entry for a logger named Resolver. This - configuration will then be used by the loggers in the - Resolver module, and all the libraries used by it. -

- - If you want to specify logging for one specific library - within the module, you set the name to - module.library. For example, the - logger used by the nameserver address store component - has the full name of Resolver.nsas. If - there is no entry in Logging for a particular library, - it will use the configuration given for the module. - - - -

- - - - To illustrate this, suppose you want the cache library - to log messages of severity DEBUG, and the rest of the - resolver code to log messages of severity INFO. To achieve - this you specify two loggers, one with the name - Resolver and severity INFO, and one with - the name Resolver.cache with severity - DEBUG. As there are no entries for other libraries (e.g. - the nsas), they will use the configuration for the module - (Resolver), so giving the desired behavior. - -

- - One special case is that of a module name of * - (asterisks), which is interpreted as any - module. You can set global logging options by using this, - including setting the logging configuration for a library - that is used by multiple modules (e.g. *.config - specifies the configuration library code in whatever - module is using it). - -

- - If there are multiple logger specifications in the - configuration that might match a particular logger, the - specification with the more specific logger name takes - precedence. For example, if there are entries for for - both * and Resolver, the - resolver module — and all libraries it uses — - will log messages according to the configuration in the - second entry (Resolver). All other modules - will use the configuration of the first entry - (*). If there was also a configuration - entry for Resolver.cache, the cache library - within the resolver would use that in preference to the - entry for Resolver. - -

- - One final note about the naming. When specifying the - module name within a logger, use the name of the module - as specified in bindctl, e.g. - Resolver for the resolver module, - Xfrout for the xfrout module, etc. When - the message is logged, the message will include the name - of the logger generating the message, but with the module - name replaced by the name of the process implementing - the module (so for example, a message generated by the - Auth.cache logger will appear in the output - with a logger name of b10-auth.cache). - -

17.1.1.2. severity (string)

- - This specifies the category of messages logged. - Each message is logged with an associated severity which - may be one of the following (in descending order of - severity): -

  • FATAL
  • ERROR
  • WARN
  • INFO
  • DEBUG

- - When the severity of a logger is set to one of these - values, it will only log messages of that severity, and - the severities above it. The severity may also be set to - NONE, in which case all messages from that logger are - inhibited. - - - -

17.1.1.3. output_options (list)

- - Each logger can have zero or more - output_options. These specify where log - messages are sent to. These are explained in detail below. - -

- - The other options for a logger are: - -

17.1.1.4. debuglevel (integer)

- - When a logger's severity is set to DEBUG, this value - specifies what debug messages should be printed. It ranges - from 0 (least verbose) to 99 (most verbose). -

- - If severity for the logger is not DEBUG, this value is ignored. - -

17.1.1.5. additive (true or false)

- - If this is true, the output_options from - the parent will be used. For example, if there are two - loggers configured; Resolver and - Resolver.cache, and additive - is true in the second, it will write the log messages - not only to the destinations specified for - Resolver.cache, but also to the destinations - as specified in the output_options in - the logger named Resolver. - - - -

17.1.2. Output Options

- - The main settings for an output option are the - destination and a value called - output, the meaning of which depends on - the destination that is set. - -

17.1.2.1. destination (string)

- - The destination is the type of output. It can be one of: - -

  • console
  • file
  • syslog

17.1.2.2. output (string)

- - Depending on what is set as the output destination, this - value is interpreted as follows: - -

destination is console

- The value of output must be one of stdout - (messages printed to standard output) or - stderr (messages printed to standard - error). -

- Note: if output is set to stderr and a lot of - messages are produced in a short time (e.g. if the logging - level is set to DEBUG), you may occasionally see some messages - jumbled up together. This is due to a combination of the way - that messages are written to the screen and the unbuffered - nature of the standard error stream. If this occurs, it is - recommended that output be set to stdout. -

destination is file

- The value of output is interpreted as a file name; - log messages will be appended to this file. -

destination is syslog

- The value of output is interpreted as the - syslog facility (e.g. - local0) that should be used - for log messages. -

- - The other options for output_options are: - -

17.1.2.2.1. flush (true of false)

- Flush buffers after each log message. Doing this will - reduce performance but will ensure that if the program - terminates abnormally, all messages up to the point of - termination are output. -

17.1.2.2.2. maxsize (integer)

- Only relevant when destination is file, this is maximum - file size of output files in bytes. When the maximum - size is reached, the file is renamed and a new file opened. - (For example, a ".1" is appended to the name — - if a ".1" file exists, it is renamed ".2", - etc.) -

- If this is 0, no maximum file size is used. -

17.1.2.2.3. maxver (integer)

- Maximum number of old log files to keep around when - rolling the output file. Only relevant when - destination is file. -

17.1.3. Example session

- - In this example we want to set the global logging to - write to the file /var/log/my_bind10.log, - at severity WARN. We want the authoritative server to - log at DEBUG with debuglevel 40, to a different file - (/tmp/debug_messages). - -

- - Start bindctl. - -

- -

["login success "]
-> config show Logging
-Logging/loggers	[]	list
-

- -

- - By default, no specific loggers are configured, in which - case the severity defaults to INFO and the output is - written to stderr. - -

- - Let's first add a default logger: - -

- -

> config add Logging/loggers
-> config show Logging
-Logging/loggers/	list	(modified)
-

- -

- - The loggers value line changed to indicate that it is no - longer an empty list: - -

- -

> config show Logging/loggers
-Logging/loggers[0]/name	""	string	(default)
-Logging/loggers[0]/severity	"INFO"	string	(default)
-Logging/loggers[0]/debuglevel	0	integer	(default)
-Logging/loggers[0]/additive	false	boolean	(default)
-Logging/loggers[0]/output_options	[]	list	(default)
-

- -

- - The name is mandatory, so we must set it. We will also - change the severity as well. Let's start with the global - logger. - -

- -

> config set Logging/loggers[0]/name *
-> config set Logging/loggers[0]/severity WARN
-> config show Logging/loggers
-Logging/loggers[0]/name	"*"	string	(modified)
-Logging/loggers[0]/severity	"WARN"	string	(modified)
-Logging/loggers[0]/debuglevel	0	integer	(default)
-Logging/loggers[0]/additive	false	boolean	(default)
-Logging/loggers[0]/output_options	[]	list	(default)
-

- -

- - Of course, we need to specify where we want the log - messages to go, so we add an entry for an output option. - -

- -

>  config add Logging/loggers[0]/output_options
->  config show Logging/loggers[0]/output_options
-Logging/loggers[0]/output_options[0]/destination	"console"	string	(default)
-Logging/loggers[0]/output_options[0]/output	"stdout"	string	(default)
-Logging/loggers[0]/output_options[0]/flush	false	boolean	(default)
-Logging/loggers[0]/output_options[0]/maxsize	0	integer	(default)
-Logging/loggers[0]/output_options[0]/maxver	0	integer	(default)
-

- - -

- - These aren't the values we are looking for. - -

- -

>  config set Logging/loggers[0]/output_options[0]/destination file
->  config set Logging/loggers[0]/output_options[0]/output /var/log/bind10.log
->  config set Logging/loggers[0]/output_options[0]/maxsize 204800
->  config set Logging/loggers[0]/output_options[0]/maxver 8
-

- -

- - Which would make the entire configuration for this logger - look like: - -

- -

>  config show all Logging/loggers
-Logging/loggers[0]/name	"*"	string	(modified)
-Logging/loggers[0]/severity	"WARN"	string	(modified)
-Logging/loggers[0]/debuglevel	0	integer	(default)
-Logging/loggers[0]/additive	false	boolean	(default)
-Logging/loggers[0]/output_options[0]/destination	"file"	string	(modified)
-Logging/loggers[0]/output_options[0]/output	"/var/log/bind10.log"	string	(modified)
-Logging/loggers[0]/output_options[0]/flush	false	boolean	(default)
-Logging/loggers[0]/output_options[0]/maxsize	204800	integer	(modified)
-Logging/loggers[0]/output_options[0]/maxver	8	integer	(modified)
-

- -

- - That looks OK, so let's commit it before we add the - configuration for the authoritative server's logger. - -

- -

>  config commit

- -

- - Now that we have set it, and checked each value along - the way, adding a second entry is quite similar. - -

- -

>  config add Logging/loggers
->  config set Logging/loggers[1]/name Auth
->  config set Logging/loggers[1]/severity DEBUG
->  config set Logging/loggers[1]/debuglevel 40
->  config add Logging/loggers[1]/output_options
->  config set Logging/loggers[1]/output_options[0]/destination file
->  config set Logging/loggers[1]/output_options[0]/output /tmp/auth_debug.log
->  config commit
-

- -

- - And that's it. Once we have found whatever it was we - needed the debug messages for, we can simply remove the - second logger to let the authoritative server use the - same settings as the rest. - -

- -

>  config remove Logging/loggers[1]
->  config commit
-

- -

- - And every module will now be using the values from the - logger named *. - -

17.2. Logging Message Format

- Each message written by BIND 10 to the configured logging - destinations comprises a number of components that identify - the origin of the message and, if the message indicates - a problem, information about the problem that may be - useful in fixing it. -

- Consider the message below logged to a file: -

2011-06-15 13:48:22.034 ERROR [b10-resolver.asiolink]
-    ASIODNS_OPENSOCK error 111 opening TCP socket to 127.0.0.1(53)

-

- Note: the layout of messages written to the system logging - file (syslog) may be slightly different. This message has - been split across two lines here for display reasons; in the - logging file, it will appear on one line.) -

- The log message comprises a number of components: - -

2011-06-15 13:48:22.034

- The date and time at which the message was generated. -

ERROR

- The severity of the message. -

[b10-resolver.asiolink]

- The source of the message. This comprises two components: - the BIND 10 process generating the message (in this - case, b10-resolver) and the module - within the program from which the message originated - (which in the example is the asynchronous I/O link - module, asiolink). -

ASIODNS_OPENSOCK

- The message identification. Every message in BIND 10 - has a unique identification, which can be used as an - index into the BIND 10 Messages - Manual (http://bind10.isc.org/docs/bind10-messages.html) from which more information can be obtained. -

error 111 opening TCP socket to 127.0.0.1(53)

- A brief description of the cause of the problem. - Within this text, information relating to the condition - that caused the message to be logged will be included. - In this example, error number 111 (an operating - system-specific error number) was encountered when - trying to open a TCP connection to port 53 on the - local system (address 127.0.0.1). The next step - would be to find out the reason for the failure by - consulting your system's documentation to identify - what error number 111 means. -

-

diff --git a/doc/guide/bind10-guide.txt b/doc/guide/bind10-guide.txt deleted file mode 100644 index fb0f307a69..0000000000 --- a/doc/guide/bind10-guide.txt +++ /dev/null @@ -1,2156 +0,0 @@ - BIND 10 Guide - -Administrator Reference for BIND 10 - - This is the reference guide for BIND 10 version 20120712. - - Copyright © 2010-2012 Internet Systems Consortium, Inc. - - Abstract - - BIND 10 is a framework that features Domain Name System (DNS) suite and - Dynamic Host Configuration Protocol (DHCP) servers with development - managed by Internet Systems Consortium (ISC). It includes DNS libraries, - modular components for controlling authoritative and recursive DNS - servers, and experimental DHCPv4 and DHCPv6 servers. - - This is the reference guide for BIND 10 version 20120712. The most - up-to-date version of this document (in PDF, HTML, and plain text - formats), along with other documents for BIND 10, can be found at - http://bind10.isc.org/docs. - - -------------------------------------------------------------------------- - - Table of Contents - - Preface - - 1. Acknowledgements - - 1. Introduction - - 1.1. Supported Platforms - - 1.2. Required Software at Run-time - - 1.3. Starting and Stopping the Server - - 1.4. Managing BIND 10 - - 2. Installation - - 2.1. Packages - - 2.2. Install Hierarchy - - 2.3. Building Requirements - - 2.4. Quick start - - 2.5. Installation from source - - 2.5.1. Download Tar File - - 2.5.2. Retrieve from Git - - 2.5.3. Configure before the build - - 2.5.4. Build - - 2.5.5. Install - - 3. Starting BIND10 with bind10 - - 3.1. Starting BIND 10 - - 3.2. Configuration to start processes - - 4. Command channel - - 5. Configuration manager - - 6. Remote control daemon - - 6.1. Configuration specification for b10-cmdctl - - 7. Control and configure user interface - - 8. Authoritative Server - - 8.1. Server Configurations - - 8.2. Data Source Backends - - 8.2.1. Data source types - - 8.2.2. Examples - - 8.3. Loading Master Zones Files - - 9. Incoming Zone Transfers - - 9.1. Configuration for Incoming Zone Transfers - - 9.2. Enabling IXFR - - 9.3. Secondary Manager - - 9.4. Trigger an Incoming Zone Transfer Manually - - 9.5. Incoming Transfers with In-memory Datasource - - 10. Outbound Zone Transfers - - 11. Dynamic DNS Update - - 11.1. Enabling Dynamic Update - - 11.2. Access Control - - 11.3. Miscellaneous Operational Issues - - 12. Recursive Name Server - - 12.1. Access Control - - 12.2. Forwarding - - 13. DHCPv4 Server - - 13.1. DHCPv4 Server Usage - - 13.2. DHCPv4 Server Configuration - - 13.3. Supported standards - - 13.4. DHCPv4 Server Limitations - - 14. DHCPv6 Server - - 14.1. DHCPv6 Server Usage - - 14.2. DHCPv6 Server Configuration - - 14.3. Supported DHCPv6 Standards - - 14.4. DHCPv6 Server Limitations - - 15. libdhcp++ library - - 15.1. Interface detection - - 15.2. DHCPv4/DHCPv6 packet handling - - 16. Statistics - - 17. Logging - - 17.1. Logging configuration - - 17.1.1. Loggers - - 17.1.2. Output Options - - 17.1.3. Example session - - 17.2. Logging Message Format - - List of Tables - - 3.1. Special startup components - -Preface - - Table of Contents - - 1. Acknowledgements - -1. Acknowledgements - - ISC would like to acknowledge generous support for BIND 10 development of - DHCPv4 and DHCPv6 components provided by Comcast. - -Chapter 1. Introduction - - Table of Contents - - 1.1. Supported Platforms - - 1.2. Required Software at Run-time - - 1.3. Starting and Stopping the Server - - 1.4. Managing BIND 10 - - BIND is the popular implementation of a DNS server, developer interfaces, - and DNS tools. BIND 10 is a rewrite of BIND 9 and ISC DHCP. BIND 10 is - written in C++ and Python and provides a modular environment for serving, - maintaining, and developing DNS and DHCP. BIND 10 provides a EDNS0- and - DNSSEC-capable authoritative DNS server and a caching recursive name - server which also provides forwarding. It also provides experimental - DHCPv4 and DHCPv6 servers. - - This guide covers the experimental prototype of BIND 10 version 20120712. - -1.1. Supported Platforms - - BIND 10 builds have been tested on (in no particular order) Debian - GNU/Linux 6 and unstable, Ubuntu 9.10, NetBSD 5, Solaris 10 and 11, - FreeBSD 7 and 8, CentOS Linux 5.3, MacOS 10.6 and 10.7, and OpenBSD 5.1. - It has been tested on Sparc, i386, and amd64 hardware platforms. It is - planned for BIND 10 to build, install and run on Windows and standard - Unix-type platforms. - -1.2. Required Software at Run-time - - Running BIND 10 uses various extra software which may not be provided in - some operating systems' default installations nor standard packages - collections. You may need to install this required software separately. - (For the build requirements, also see Section 2.3, “Building - Requirementsâ€.) - - BIND 10 requires at least Python 3.1 (http://www.python.org/). It also - works with Python 3.2. - - BIND 10 uses the Botan crypto library for C++ - (http://botan.randombit.net/). It requires at least Botan version 1.8. - - BIND 10 uses the log4cplus C++ logging library - (http://log4cplus.sourceforge.net/). It requires at least log4cplus - version 1.0.3. - - The authoritative DNS server uses SQLite3 (http://www.sqlite.org/). It - needs at least SQLite version 3.3.9. - - The b10-ddns, b10-xfrin, b10-xfrout, and b10-zonemgr components require - the libpython3 library and the Python _sqlite3.so module (which is - included with Python). Python modules need to be built for the - corresponding Python 3. - -1.3. Starting and Stopping the Server - - BIND 10 is modular. Part of this modularity is accomplished using multiple - cooperating processes which, together, provide the server functionality. - This is a change from the previous generation of BIND software, which used - a single process. - - At first, running many different processes may seem confusing. However, - these processes are started, stopped, and maintained by a single command, - bind10. This command starts a master process which will start other - processes as needed. The processes started by the bind10 command have - names starting with "b10-", including: - - o b10-auth — Authoritative DNS server. This process serves DNS requests. - o b10-cfgmgr — Configuration manager. This process maintains all of the - configuration for BIND 10. - o b10-cmdctl — Command and control service. This process allows external - control of the BIND 10 system. - o b10-ddns — Dynamic DNS update service. This process is used to handle - incoming DNS update requests to allow granted clients to update zones - for which BIND 10 is serving as a primary server. - o b10-msgq — Message bus daemon. This process coordinates communication - between all of the other BIND 10 processes. - o b10-resolver — Recursive name server. This process handles incoming - DNS queries and provides answers from its cache or by recursively - doing remote lookups. - o b10-sockcreator — Socket creator daemon. This process creates sockets - used by network-listening BIND 10 processes. - o b10-stats — Statistics collection daemon. This process collects and - reports statistics data. - o b10-stats-httpd — HTTP server for statistics reporting. This process - reports statistics data in XML format over HTTP. - o b10-xfrin — Incoming zone transfer service. This process is used to - transfer a new copy of a zone into BIND 10, when acting as a secondary - server. - o b10-xfrout — Outgoing zone transfer service. This process is used to - handle transfer requests to send a local zone to a remote secondary - server. - o b10-zonemgr — Secondary zone manager. This process keeps track of - timers and other necessary information for BIND 10 to act as a slave - server. - - These are ran by bind10 and do not need to be manually started - independently. - -1.4. Managing BIND 10 - - Once BIND 10 is running, a few commands are used to interact directly with - the system: - - o bindctl — Interactive administration interface. This is a low-level - command-line tool which allows a developer or an experienced - administrator to control BIND 10. - o b10-loadzone — Zone file loader. This tool will load standard - masterfile-format zone files into BIND 10. - o b10-cmdctl-usermgr — User access control. This tool allows an - administrator to authorize additional users to manage BIND 10. - - The tools and modules are covered in full detail in this guide. In - addition, manual pages are also provided in the default installation. - - BIND 10 also provides libraries and programmer interfaces for C++ and - Python for the message bus, configuration backend, and, of course, DNS. - These include detailed developer documentation and code examples. - -Chapter 2. Installation - - Table of Contents - - 2.1. Packages - - 2.2. Install Hierarchy - - 2.3. Building Requirements - - 2.4. Quick start - - 2.5. Installation from source - - 2.5.1. Download Tar File - - 2.5.2. Retrieve from Git - - 2.5.3. Configure before the build - - 2.5.4. Build - - 2.5.5. Install - -2.1. Packages - - Some operating systems or softare package vendors may provide - ready-to-use, pre-built software packages for the BIND 10 suite. - Installing a pre-built package means you do not need to install build-only - prerequisites and do not need to make the software. - - FreeBSD ports, NetBSD pkgsrc, and Debian testing package collections - provide all the prerequisite packages. - -2.2. Install Hierarchy - - The following is the standard, common layout of the complete BIND 10 - installation: - - o bin/ — general tools and diagnostic clients. - o etc/bind10-devel/ — configuration files. - o lib/ — libraries and python modules. - o libexec/bind10-devel/ — executables that a user wouldn't normally run - directly and are not run independently. These are the BIND 10 modules - which are daemons started by the bind10 tool. - o sbin/ — commands used by the system administrator. - o share/bind10-devel/ — configuration specifications. - o share/doc/bind10-devel/ — this guide and other supplementary - documentation. - o share/man/ — manual pages (online documentation). - o var/bind10-devel/ — data source and configuration databases. - -2.3. Building Requirements - - In addition to the run-time requirements (listed in Section 1.2, “Required - Software at Run-timeâ€), building BIND 10 from source code requires various - development include headers and program development tools. - - Note - - Some operating systems have split their distribution packages into a - run-time and a development package. You will need to install the - development package versions, which include header files and libraries, to - build BIND 10 from source code. - - Building from source code requires the Boost build-time headers - (http://www.boost.org/). At least Boost version 1.35 is required. - - To build BIND 10, also install the Botan (at least version 1.8) and the - log4cplus (at least version 1.0.3) development include headers. - - Building BIND 10 also requires a C++ compiler and standard development - headers, make, and pkg-config. BIND 10 builds have been tested with GCC - g++ 3.4.3, 4.1.2, 4.1.3, 4.2.1, 4.3.2, and 4.4.1; Clang++ 2.8; and Sun C++ - 5.10. - - Visit the user-contributed wiki at - http://bind10.isc.org/wiki/SystemSpecificNotes for system-specific - installation tips. - -2.4. Quick start - - Note - - This quickly covers the standard steps for installing and deploying BIND - 10 as an authoritative name server using its defaults. For - troubleshooting, full customizations and further details, see the - respective chapters in the BIND 10 guide. - - To quickly get started with BIND 10, follow these steps. - -  1. Install required run-time and build dependencies. -  2. Download the BIND 10 source tar file from - ftp://ftp.isc.org/isc/bind10/. -  3. Extract the tar file: - - $ gzcat bind10-VERSION.tar.gz | tar -xvf - - -  4. Go into the source and run configure: - - $ cd bind10-VERSION - $ ./configure - -  5. Build it: - - $ make - -  6. Install it (to default /usr/local): - - $ make install - -  7. Start the server: - - $ /usr/local/sbin/bind10 - -  8. Test it; for example: - - $ dig @127.0.0.1 -c CH -t TXT authors.bind - -  9. Load desired zone file(s), for example: - - $ b10-loadzone your.zone.example.org - - 10. Test the new zone. - -2.5. Installation from source - - BIND 10 is open source software written in C++ and Python. It is freely - available in source code form from ISC as a downloadable tar file or via - BIND 10's Git code revision control service. (It may also be available in - pre-compiled ready-to-use packages from operating system vendors.) - - 2.5.1. Download Tar File - - Downloading a release tar file is the recommended method to obtain the - source code. - - The BIND 10 releases are available as tar file downloads from - ftp://ftp.isc.org/isc/bind10/. Periodic development snapshots may also be - available. - - 2.5.2. Retrieve from Git - - Downloading this "bleeding edge" code is recommended only for developers - or advanced users. Using development code in a production environment is - not recommended. - - Note - - When using source code retrieved via Git, additional software will be - required: automake (v1.11 or newer), libtoolize, and autoconf (2.59 or - newer). These may need to be installed. - - The latest development code (and temporary experiments and un-reviewed - code) is available via the BIND 10 code revision control system. This is - powered by Git and all the BIND 10 development is public. The leading - development is done in the “master†branch. - - The code can be checked out from git://git.bind10.isc.org/bind10; for - example: - - $ git clone git://git.bind10.isc.org/bind10 - - When checking out the code from the code version control system, it - doesn't include the generated configure script, Makefile.in files, nor - their related build files. They can be created by running autoreconf with - the --install switch. This will run autoconf, aclocal, libtoolize, - autoheader, automake, and related commands. - - 2.5.3. Configure before the build - - BIND 10 uses the GNU Build System to discover build environment details. - To generate the makefiles using the defaults, simply run: - - $ ./configure - - Run ./configure with the --help switch to view the different options. Some - commonly-used options are: - - --prefix - Define the installation location (the default is /usr/local/). - - --with-boost-include - Define the path to find the Boost headers. - - --with-pythonpath - Define the path to Python 3.1 if it is not in the standard - execution path. - - --with-gtest - Enable building the C++ Unit Tests using the Google Tests - framework. Optionally this can define the path to the gtest header - files and library. - - For example, the following configures it to find the Boost headers, find - the Python interpreter, and sets the installation location: - - $ ./configure \ - --with-boost-include=/usr/pkg/include \ - --with-pythonpath=/usr/pkg/bin/python3.1 \ - --prefix=/opt/bind10 - - If the configure fails, it may be due to missing or old dependencies. - - 2.5.4. Build - - After the configure step is complete, to build the executables from the - C++ code and prepare the Python scripts, run: - - $ make - - 2.5.5. Install - - To install the BIND 10 executables, support files, and documentation, run: - - $ make install - - Note - - The install step may require superuser privileges. - -Chapter 3. Starting BIND10 with bind10 - - Table of Contents - - 3.1. Starting BIND 10 - - 3.2. Configuration to start processes - - BIND 10 provides the bind10 command which starts up the required - processes. bind10 will also restart some processes that exit unexpectedly. - This is the only command needed to start the BIND 10 system. - - After starting the b10-msgq communications channel, bind10 connects to it, - runs the configuration manager, and reads its own configuration. Then it - starts the other modules. - - The b10-sockcreator, b10-msgq and b10-cfgmgr services make up the core. - The b10-msgq daemon provides the communication channel between every part - of the system. The b10-cfgmgr daemon is always needed by every module, if - only to send information about themselves somewhere, but more importantly - to ask about their own settings, and about other modules. The - b10-sockcreator daemon helps allocate Internet addresses and ports as - needed for BIND 10 network services. - - In its default configuration, the bind10 master process will also start up - b10-cmdctl for administration tools to communicate with the system, and - b10-stats for statistics collection. - -3.1. Starting BIND 10 - - To start the BIND 10 service, simply run bind10. Run it with the --verbose - switch to get additional debugging or diagnostic output. - - Note - - If the setproctitle Python module is detected at start up, the process - names for the Python-based daemons will be renamed to better identify them - instead of just “pythonâ€. This is not needed on some operating systems. - -3.2. Configuration to start processes - - The processes to be used can be configured for bind10 to start, with the - exception of the required b10-sockcreator, b10-msgq and b10-cfgmgr - components. The configuration is in the Boss/components section. Each - element represents one component, which is an abstraction of a process. - - To add a process to the set, let's say the resolver (which is not started - by default), you would do this: - - > config add Boss/components b10-resolver - > config set Boss/components/b10-resolver/special resolver - > config set Boss/components/b10-resolver/kind needed - > config set Boss/components/b10-resolver/priority 10 - > config commit - - Now, what it means. We add an entry called “b10-resolverâ€. It is both a - name used to reference this component in the configuration and the name of - the process to start. Then we set some parameters on how to start it. - - The special setting is for components that need some kind of special care - during startup or shutdown. Unless specified, the component is started in - a usual way. This is the list of components that need to be started in a - special way, with the value of special used for them: - - Table 3.1. Special startup components - - +----------------------------------------------------------------------+ - | Component | Special | Description | - |--------------+----------+--------------------------------------------| - | b10-auth | auth | Authoritative DNS server | - |--------------+----------+--------------------------------------------| - | b10-resolver | resolver | DNS resolver | - |--------------+----------+--------------------------------------------| - | b10-cmdctl | cmdctl | Command control (remote control interface) | - +----------------------------------------------------------------------+ - - The kind specifies how a failure of the component should be handled. If it - is set to “dispensable†(the default unless you set something else), it - will get started again if it fails. If it is set to “needed†and it fails - at startup, the whole bind10 shuts down and exits with an error exit code. - But if it fails some time later, it is just started again. If you set it - to “coreâ€, you indicate that the system is not usable without the - component and if such component fails, the system shuts down no matter - when the failure happened. This is the behaviour of the core components - (the ones you can't turn off), but you can declare any other components as - core as well if you wish (but you can turn these off, they just can't - fail). - - The priority defines order in which the components should start. The ones - with higher numbers are started sooner than the ones with lower ones. If - you don't set it, 0 (zero) is used as the priority. Usually, leaving it at - the default is enough. - - There are other parameters we didn't use in our example. One of them is - address. It is the address used by the component on the b10-msgq message - bus. The special components already know their address, but the usual ones - don't. The address is by convention the thing after b10-, with the first - letter capitalized (eg. b10-stats would have “Stats†as its address). - - The last one is process. It is the name of the process to be started. It - defaults to the name of the component if not set, but you can use this to - override it. (The special components also already know their executable - name.) - - Note - - The configuration is quite powerful, but that includes a lot of space for - mistakes. You could turn off the b10-cmdctl, but then you couldn't change - it back the usual way, as it would require it to be running (you would - have to find and edit the configuration directly). Also, some modules - might have dependencies: b10-stats-httpd needs b10-stats, b10-xfrout needs - b10-auth to be running, etc. - - In short, you should think twice before disabling something here. - - It is possible to start some components multiple times (currently b10-auth - and b10-resolver). You might want to do that to gain more performance - (each one uses only single core). Just put multiple entries under - different names, like this, with the same config: - - > config add Boss/components b10-resolver-2 - > config set Boss/components/b10-resolver-2/special resolver - > config set Boss/components/b10-resolver-2/kind needed - > config commit - - However, this is work in progress and the support is not yet complete. For - example, each resolver will have its own cache, each authoritative server - will keep its own copy of in-memory data and there could be problems with - locking the sqlite database, if used. The configuration might be changed - to something more convenient in future. Other components don't expect such - a situation, so it would probably not do what you want. Such support is - yet to be implemented. - -Chapter 4. Command channel - - The BIND 10 components use the b10-msgq message routing daemon to - communicate with other BIND 10 components. The b10-msgq implements what is - called the “Command Channelâ€. Processes intercommunicate by sending - messages on the command channel. Example messages include shutdown, get - configurations, and set configurations. This Command Channel is not used - for DNS message passing. It is used only to control and monitor the BIND - 10 system. - - Administrators do not communicate directly with the b10-msgq daemon. By - default, BIND 10 uses a UNIX domain socket file named - /usr/local/var/bind10-devel/msg_socket for this interprocess - communication. - -Chapter 5. Configuration manager - - The configuration manager, b10-cfgmgr, handles all BIND 10 system - configuration. It provides persistent storage for configuration, and - notifies running modules of configuration changes. - - The b10-auth and b10-xfrin daemons and other components receive their - configurations from the configuration manager over the b10-msgq command - channel. - - The administrator doesn't connect to it directly, but uses a user - interface to communicate with the configuration manager via b10-cmdctl's - REST-ful interface. b10-cmdctl is covered in Chapter 6, Remote control - daemon. - - Note - - The development prototype release only provides bindctl as a user - interface to b10-cmdctl. Upcoming releases will provide another - interactive command-line interface and a web-based interface. - - The b10-cfgmgr daemon can send all specifications and all current settings - to the bindctl client (via b10-cmdctl). b10-cfgmgr relays configurations - received from b10-cmdctl to the appropriate modules. - - The stored configuration file is at - /usr/local/var/bind10-devel/b10-config.db. (The directory is what was - defined at build configure time for --localstatedir. The default is - /usr/local/var/.) The format is loosely based on JSON and is directly - parseable python, but this may change in a future version. This - configuration data file is not manually edited by the administrator. - - The configuration manager does not have any command line arguments. - Normally it is not started manually, but is automatically started using - the bind10 master process (as covered in Chapter 3, Starting BIND10 with - bind10). - -Chapter 6. Remote control daemon - - Table of Contents - - 6.1. Configuration specification for b10-cmdctl - - b10-cmdctl is the gateway between administrators and the BIND 10 system. - It is a HTTPS server that uses standard HTTP Digest Authentication for - username and password validation. It provides a REST-ful interface for - accessing and controlling BIND 10. - - When b10-cmdctl starts, it firsts asks b10-cfgmgr about what modules are - running and what their configuration is (over the b10-msgq channel). Then - it will start listening on HTTPS for clients — the user interface — such - as bindctl. - - b10-cmdctl directly sends commands (received from the user interface) to - the specified component. Configuration changes are actually commands to - b10-cfgmgr so are sent there. - - The HTTPS server requires a private key, such as a RSA PRIVATE KEY. The - default location is at /usr/local/etc/bind10-devel/cmdctl-keyfile.pem. (A - sample key is at /usr/local/share/bind10-devel/cmdctl-keyfile.pem.) It - also uses a certificate located at - /usr/local/etc/bind10-devel/cmdctl-certfile.pem. (A sample certificate is - at /usr/local/share/bind10-devel/cmdctl-certfile.pem.) This may be a - self-signed certificate or purchased from a certification authority. - - Note - - The HTTPS server doesn't support a certificate request from a client (at - this time). The b10-cmdctl daemon does not provide a public service. If - any client wants to control BIND 10, then a certificate needs to be first - received from the BIND 10 administrator. The BIND 10 installation provides - a sample PEM bundle that matches the sample key and certificate. - - The b10-cmdctl daemon also requires the user account file located at - /usr/local/etc/bind10-devel/cmdctl-accounts.csv. This comma-delimited file - lists the accounts with a user name, hashed password, and salt. (A sample - file is at /usr/local/share/bind10-devel/cmdctl-accounts.csv. It contains - the user named “root†with the password “bind10â€.) - - The administrator may create a user account with the b10-cmdctl-usermgr - tool. - - By default the HTTPS server listens on the localhost port 8080. The port - can be set by using the --port command line option. The address to listen - on can be set using the --address command line argument. Each HTTPS - connection is stateless and times out in 1200 seconds by default. This can - be redefined by using the --idle-timeout command line argument. - -6.1. Configuration specification for b10-cmdctl - - The configuration items for b10-cmdctl are: accounts_file which defines - the path to the user accounts database (the default is - /usr/local/etc/bind10-devel/cmdctl-accounts.csv); cert_file which defines - the path to the PEM certificate file (the default is - /usr/local/etc/bind10-devel/cmdctl-certfile.pem); and key_file which - defines the path to the PEM private key file (the default is - /usr/local/etc/bind10-devel/cmdctl-keyfile.pem). - -Chapter 7. Control and configure user interface - - Note - - For this development prototype release, bindctl is the only user - interface. It is expected that upcoming releases will provide another - interactive command-line interface and a web-based interface for - controlling and configuring BIND 10. - - The bindctl tool provides an interactive prompt for configuring, - controlling, and querying the BIND 10 components. It communicates directly - with a REST-ful interface over HTTPS provided by b10-cmdctl. It doesn't - communicate to any other components directly. - - Configuration changes are actually commands to b10-cfgmgr. So when bindctl - sends a configuration, it is sent to b10-cmdctl (over a HTTPS connection); - then b10-cmdctl sends the command (over a b10-msgq command channel) to - b10-cfgmgr which then stores the details and relays (over a b10-msgq - command channel) the configuration on to the specified module. - -Chapter 8. Authoritative Server - - Table of Contents - - 8.1. Server Configurations - - 8.2. Data Source Backends - - 8.2.1. Data source types - - 8.2.2. Examples - - 8.3. Loading Master Zones Files - - The b10-auth is the authoritative DNS server. It supports EDNS0, DNSSEC, - IPv6, and SQLite3 and in-memory zone data backends. Normally it is started - by the bind10 master process. - -8.1. Server Configurations - - b10-auth is configured via the b10-cfgmgr configuration manager. The - module name is “Authâ€. The configuration data items are: - - database_file - This is an optional string to define the path to find the SQLite3 - database file. Note: This may be a temporary setting because the - DNS server can use various data source backends. - - datasources - datasources configures data sources. The list items include: type - to define the required data source type (such as “memoryâ€); class - to optionally select the class (it defaults to “INâ€); and zones to - define the file path name, the filetype (“sqlite3†to load from a - SQLite3 database file or “text†to load from a master text file), - and the origin (default domain). By default, this is empty. - - Note - - In this development version, currently this is only used for the - memory data source. Only the IN class is supported at this time. - By default, the memory data source is disabled. Also, currently - the zone file must be canonical such as generated by - named-compilezone -D, or must be an SQLite3 database. - - listen_on - listen_on is a list of addresses and ports for b10-auth to listen - on. The list items are the address string and port number. By - default, b10-auth listens on port 53 on the IPv6 (::) and IPv4 - (0.0.0.0) wildcard addresses. - - Note - - The default configuration is currently not appropriate for a - multi-homed host. In case you have multiple public IP addresses, - it is possible the query UDP packet comes through one interface - and the answer goes out through another. The answer will probably - be dropped by the client, as it has a different source address - than the one it sent the query to. The client would fallback on - TCP after several attempts, which works well in this situation, - but is clearly not ideal. - - There are plans to solve the problem such that the server handles - it by itself. But until it is actually implemented, it is - recommended to alter the configuration — remove the wildcard - addresses and list all addresses explicitly. Then the server will - answer on the same interface the request came on, preserving the - correct address. - - statistics-interval - statistics-interval is the timer interval in seconds for b10-auth - to share its statistics information to b10-stats(8). Statistics - updates can be disabled by setting this to 0. The default is 60. - - The configuration commands are: - - loadzone - loadzone tells b10-auth to load or reload a zone file. The - arguments include: class which optionally defines the class (it - defaults to “INâ€); origin is the domain name of the zone; and - datasrc optionally defines the type of datasource (it defaults to - “memoryâ€). - - Note - - In this development version, currently this only supports the IN - class and the memory data source. - - sendstats - sendstats tells b10-auth to send its statistics data to - b10-stats(8) immediately. - - shutdown - Stop the authoritative DNS server. This has an optional pid - argument to select the process ID to stop. (Note that the BIND 10 - boss process may restart this service if configured.) - -8.2. Data Source Backends - - Bind 10 has the concept of data sources. A data source is a place where - authoritative zone data reside and where they can be served from. This can - be a master file, a database or something completely different. - - Once a query arrives, b10-auth goes through a configured list of data - sources and finds the one containing a best matching zone. From the - equally good ones, the first one is taken. This data source is then used - to answer the query. - - Note - - In the development prototype release, b10-auth can serve data from a - SQLite3 data source backend and from master files. Upcoming versions will - be able to use multiple different data sources, such as MySQL and Berkeley - DB. - - The configuration is located in data_sources/classes. Each item there - represents one RR class and a list used to answer queries for that class. - The default contains two classes. The CH class contains a static data - source — one that serves things like “AUTHORS.BIND.â€. The IN class - contains single SQLite3 data source with database file located at - /usr/local/var/bind10-devel/zone.sqlite3. - - Each data source has several options. The first one is type, which - specifies the type of data source to use. Valid types include the ones - listed below, but bind10 uses dynamically loaded modules for them, so - there may be more in your case. This option is mandatory. - - Another option is params. This option is type specific; it holds different - data depending on the type above. Also, depending on the type, it could be - possible to omit it. - - There are two options related to the so-called cache. If you enable cache, - zone data from the data source are loaded into memory. Then, when - answering a query, b10-auth looks into the memory only instead of the data - source, which speeds answering up. The first option is cache-enable, a - boolean value turning the cache on and off (off is the default). The - second one, cache-zones, is a list of zone origins to load into in-memory. - Remember that zones in the data source not listed here will not be loaded - and will not be available at all. - - 8.2.1. Data source types - - As mentioned, the type used by default is “sqlite3â€. It has single - configuration option inside params — database_file, which contains the - path to the sqlite3 file containing the data. - - Another type is called “MasterFilesâ€. This one is slightly special. The - data are stored in RFC1034 master files. Because answering directly from - them would be impractical, this type mandates the cache to be enabled. - Also, the list of zones (cache-zones) should be omitted. The params is a - dictionary mapping from zone origins to the files they reside in. - - 8.2.2. Examples - - As this is one of the more complex configurations of Bind10, we show some - examples. They all assume they start with default configuration. - - First, let's disable the static data source (“VERSION.BIND†and friends). - As it is the only data source in the CH class, we can remove the whole - class. - - > config remove data_sources/classes CH - > config commit - - Another one, let's say our default data source contains zones - “example.org.†and “example.net.â€. We want them to be served from memory - to make the answering faster. - - > config set data_sources/classes/IN[0]/cache-enable true - > config add data_sources/classes/IN[0]/cache-zones example.org. - > config add data_sources/classes/IN[0]/cache-zones example.net. - > config commit - - Now every time the zone in the data source is changed by the operator, - Bind10 needs to be told to reload it, by - - > Auth loadzone example.org - - You don't need to do this when the zone is modified by XfrIn, it does so - automatically. - - Now, the last example is when there are master files we want to serve in - addition to whatever is inside the sqlite3 database. - - > config add data_sources/classes/IN - > config set data_sources/classes/IN[1]/type MasterFiles - > config set data_sources/classes/IN[1]/cache-enable true - > config set data_sources/classes/IN[1]/params { "example.org": "/path/to/example.org", "example.com": "/path/to/example.com" } - > config commit - - Initially, a map value has to be set, but this value may be an empty map. - After that, key/value pairs can be added with 'config add' and keys can be - removed with 'config remove'. The initial value may be an empty map, but - it has to be set before zones are added or removed. - - > config set data_sources/classes/IN[1]/params {} - > config add data_sources/classes/IN[1]/params another.example.org /path/to/another.example.org - > config add data_sources/classes/IN[1]/params another.example.com /path/to/another.example.com - > config remove data_sources/classes/IN[1]/params another.example.org - - - bindctl. To reload a zone, you the same command as above. - - Note - - There's also Auth/database_file configuration variable, pointing to a - sqlite3 database file. This is no longer used by b10-auth, but it is left - in place for now, since other modules use it. Once b10-xfrin, b10-xfrout - and b10-ddns are ported to the new configuration, this will disappear. But - for now, make sure that if you use any of these modules, the new and old - configuration correspond. The defaults are consistent, so unless you - tweaked either the new or the old configuration, you're good. - -8.3. Loading Master Zones Files - - RFC 1035 style DNS master zone files may imported into a BIND 10 SQLite3 - data source by using the b10-loadzone utility. - - b10-loadzone supports the following special directives (control entries): - - $INCLUDE - Loads an additional zone file. This may be recursive. - - $ORIGIN - Defines the relative domain name. - - $TTL - Defines the time-to-live value used for following records that - don't include a TTL. - - The -o argument may be used to define the default origin for loaded zone - file records. - - Note - - In the development prototype release, only the SQLite3 back end is used by - b10-loadzone. By default, it stores the zone data in - /usr/local/var/bind10-devel/zone.sqlite3 unless the -d switch is used to - set the database filename. Multiple zones are stored in a single SQLite3 - zone database. - - If you reload a zone already existing in the database, all records from - that prior zone disappear and a whole new set appears. - -Chapter 9. Incoming Zone Transfers - - Table of Contents - - 9.1. Configuration for Incoming Zone Transfers - - 9.2. Enabling IXFR - - 9.3. Secondary Manager - - 9.4. Trigger an Incoming Zone Transfer Manually - - 9.5. Incoming Transfers with In-memory Datasource - - Incoming zones are transferred using the b10-xfrin process which is - started by bind10. When received, the zone is stored in the corresponding - BIND 10 data source, and its records can be served by b10-auth. In - combination with b10-zonemgr (for automated SOA checks), this allows the - BIND 10 server to provide secondary service. - - The b10-xfrin process supports both AXFR and IXFR. Due to some - implementation limitations of the current development release, however, it - only tries AXFR by default, and care should be taken to enable IXFR. - -9.1. Configuration for Incoming Zone Transfers - - In practice, you need to specify a list of secondary zones to enable - incoming zone transfers for these zones (you can still trigger a zone - transfer manually, without a prior configuration (see below)). - - For example, to enable zone transfers for a zone named "example.com" - (whose master address is assumed to be 2001:db8::53 here), run the - following at the bindctl prompt: - - > config add Xfrin/zones - > config set Xfrin/zones[0]/name "example.com" - > config set Xfrin/zones[0]/master_addr "2001:db8::53" - > config commit - - (We assume there has been no zone configuration before). - -9.2. Enabling IXFR - - As noted above, b10-xfrin uses AXFR for zone transfers by default. To - enable IXFR for zone transfers for a particular zone, set the use_ixfr - configuration parameter to true. In the above example of configuration - sequence, you'll need to add the following before performing commit: - - > config set Xfrin/zones[0]/use_ixfr true - - Note - - One reason why IXFR is disabled by default in the current release is - because it does not support automatic fallback from IXFR to AXFR when it - encounters a primary server that doesn't support outbound IXFR (and, not - many existing implementations support it). Another, related reason is that - it does not use AXFR even if it has no knowledge about the zone (like at - the very first time the secondary server is set up). IXFR requires the - "current version" of the zone, so obviously it doesn't work in this - situation and AXFR is the only workable choice. The current release of - b10-xfrin does not make this selection automatically. These features will - be implemented in a near future version, at which point we will enable - IXFR by default. - -9.3. Secondary Manager - - The b10-zonemgr process is started by bind10. It keeps track of SOA - refresh, retry, and expire timers and other details for BIND 10 to perform - as a slave. When the b10-auth authoritative DNS server receives a NOTIFY - message, b10-zonemgr may tell b10-xfrin to do a refresh to start an - inbound zone transfer. The secondary manager resets its counters when a - new zone is transferred in. - - Note - - Access control (such as allowing notifies) is not yet provided. The - primary/secondary service is not yet complete. - - The following example shows using bindctl to configure the server to be a - secondary for the example zone: - - > config add Zonemgr/secondary_zones - > config set Zonemgr/secondary_zones[0]/name "example.com" - > config commit - - If the zone does not exist in the data source already (i.e. no SOA record - for it), b10-zonemgr will automatically tell b10-xfrin to transfer the - zone in. - -9.4. Trigger an Incoming Zone Transfer Manually - - To manually trigger a zone transfer to retrieve a remote zone, you may use - the bindctl utility. For example, at the bindctl prompt run: - - > Xfrin retransfer zone_name="foo.example.org" master=192.0.2.99 - -9.5. Incoming Transfers with In-memory Datasource - - In the case of an incoming zone transfer, the received zone is first - stored in the corresponding BIND 10 datasource. In case the secondary zone - is served by an in-memory datasource with an SQLite3 backend, b10-auth is - automatically sent a loadzone command to reload the corresponding zone - into memory from the backend. - - The administrator doesn't have to do anything for b10-auth to serve the - new version of the zone, except for the configuration such as the one - described in Section 8.2, “Data Source Backendsâ€. - -Chapter 10. Outbound Zone Transfers - - The b10-xfrout process is started by bind10. When the b10-auth - authoritative DNS server receives an AXFR or IXFR request, b10-auth - internally forwards the request to b10-xfrout, which handles the rest of - this request processing. This is used to provide primary DNS service to - share zones to secondary name servers. The b10-xfrout is also used to send - NOTIFY messages to secondary servers. - - A global or per zone transfer_acl configuration can be used to control - accessibility of the outbound zone transfer service. By default, - b10-xfrout allows any clients to perform zone transfers for any zones: - - > config show Xfrout/transfer_acl - Xfrout/transfer_acl[0] {"action": "ACCEPT"} any (default) - - You can change this to, for example, rejecting all transfer requests by - default while allowing requests for the transfer of zone "example.com" - from 192.0.2.1 and 2001:db8::1 as follows: - - > config set Xfrout/transfer_acl[0] {"action": "REJECT"} - > config add Xfrout/zone_config - > config set Xfrout/zone_config[0]/origin "example.com" - > config set Xfrout/zone_config[0]/transfer_acl [{"action": "ACCEPT", "from": "192.0.2.1"}, - {"action": "ACCEPT", "from": "2001:db8::1"}] - > config commit - - Note - - In the above example the lines for transfer_acl were divided for - readability. In the actual input it must be in a single line. - - If you want to require TSIG in access control, a system wide TSIG "key - ring" must be configured. For example, to change the previous example to - allowing requests from 192.0.2.1 signed by a TSIG with a key name of - "key.example", you'll need to do this: - - > config set tsig_keys/keys ["key.example:"] - > config set Xfrout/zone_config[0]/transfer_acl [{"action": "ACCEPT", "from": "192.0.2.1", "key": "key.example"}] - > config commit - - Both b10-xfrout and b10-auth will use the system wide keyring to check - TSIGs in the incoming messages and to sign responses. - - Note - - The way to specify zone specific configuration (ACLs, etc) is likely to be - changed. - -Chapter 11. Dynamic DNS Update - - Table of Contents - - 11.1. Enabling Dynamic Update - - 11.2. Access Control - - 11.3. Miscellaneous Operational Issues - - BIND 10 supports the server side of the Dynamic DNS Update (DDNS) protocol - as defined in RFC 2136. This service is provided by the b10-ddns - component, which is started by the bind10 process if configured so. - - When the b10-auth authoritative DNS server receives an UPDATE request, it - internally forwards the request to b10-ddns, which handles the rest of - this request processing. When the processing is completed, b10-ddns will - send a response to the client as specified in RFC 2136 (NOERROR for - successful update, REFUSED if rejected due to ACL check, etc). If the zone - has been changed as a result, it will internally notify b10-xfrout so that - other secondary servers will be notified via the DNS NOTIFY protocol. In - addition, if b10-auth serves the updated zone (as described in - Section 8.2, “Data Source Backendsâ€), b10-ddns will also notify b10-auth - so that b10-auth will re-cache the updated zone content if necessary. - - The b10-ddns component supports requests over both UDP and TCP, and both - IPv6 and IPv4; for TCP requests, however, it terminates the TCP connection - immediately after each single request has been processed. Clients cannot - reuse the same TCP connection for multiple requests. (This is a current - implementation limitation of b10-ddns. While RFC 2136 doesn't specify - anything about such reuse of TCP connection, there is no reason for - disallowing it as RFC 1035 generally allows multiple requests sent over a - single TCP connection. BIND 9 supports such reuse.) - - As of this writing b10-ddns does not support update forwarding for - secondary zones. If it receives an update request for a secondary zone, it - will immediately return a “not implemented†response. - - Note - - For feature completeness, update forwarding should be eventually - supported. But currently it's considered a lower priority task and there - is no specific plan of implementing this feature. - -11.1. Enabling Dynamic Update - - First off, it must be made sure that a few components on which b10-ddns - depends are configured to run, which are b10-auth and b10-zonemgr. In - addition, b10-xfrout should also be configured to run; otherwise the - notification after an update (see above) will fail with a timeout, - suspending the DDNS service while b10-ddns waits for the response (see the - description of the DDNS_UPDATE_NOTIFY_FAIL log message for further - details). If BIND 10 is already configured to provide authoritative DNS - service they should normally be configured to run already. - - Second, for the obvious reason dynamic update requires that the underlying - data source storing the zone data be writable. In the current - implementation this means the zone must be stored in an SQLite3-based data - source. Also, in this development version, the b10-ddns component - configures itself with the data source referring to the database_file - configuration parameter of b10-auth. So this information must be - configured correctly before starting b10-ddns. - - Note - - The way to configure data sources is now being revised. Configuration on - the data source for DDNS will be very likely to be changed in a backward - incompatible manner in a near future version. - - In general, if something goes wrong regarding the dependency described - above, b10-ddns will log the related event at the warning or error level. - It's advisable to check the log message when you first enable DDNS or if - it doesn't work as you expect to see if there's any warning or error log - message. - - Next, to enable the DDNS service, b10-ddns needs to be explicitly - configured to run. It can be done by using the bindctl utility. For - example: - - > config add Boss/components b10-ddns - > config set Boss/components/b10-ddns/address DDNS - > config set Boss/components/b10-ddns/kind dispensable - > config commit - - Note - - In theory kind could be omitted because "dispensable" is its default. But - there's some peculiar behavior (which should be a bug and should be fixed - eventually; see Trac ticket #2064) with bindctl and you'll still need to - specify that explicitly. Likewise, address may look unnecessary because - b10-ddns would start and work without specifying it. But for it to - shutdown gracefully this parameter should also be specified. - -11.2. Access Control - - By default, b10-ddns rejects any update requests from any clients by - returning a REFUSED response. To allow updates to take effect, an access - control rule (called update ACL) with a policy allowing updates must - explicitly be configured. Update ACL must be configured per zone basis in - the zones configuration parameter of b10-ddns. This is a list of per-zone - configurations regarding DDNS. Each list element consists of the following - parameters: - - origin - The zone's origin name - - class - The RR class of the zone (normally “INâ€, and in that case can be - omitted in configuration) - - update_acl - List of access control rules (ACL) for the zone - - The syntax of the ACL is the same as ACLs for other components. Specific - examples are given below. - - In general, an update ACL rule that allows an update request should be - configured with a TSIG key. This is an example update ACL that allows - updates to the zone named “example.org†(of default RR class “INâ€) from - clients that send requests signed with a TSIG whose key name is - "key.example.org" (and refuses all others): - - > config add DDNS/zones - > config set DDNS/zones[0]/origin example.org - > config add DDNS/zones[0]/update_acl {"action": "ACCEPT", "key": "key.example.org"} - > config commit - - The TSIG key must be configured system wide (see Chapter 10, Outbound Zone - Transfers.) - - Multiple rules can be specified in the ACL, and an ACL rule can consist of - multiple constraints, such as a combination of IP address and TSIG. The - following configuration sequence will add a new rule to the ACL created in - the above example. This additional rule allows update requests sent from a - client using TSIG key name of "key.example" (different from the key used - in the previous example) and has an IPv6 address of ::1. - - > config add DDNS/zones[0]/update_acl {"action": "ACCEPT", "from": "::1", "key": "key.example"} - > config show DDNS/zones[0]/update_acl - DDNS/zones[0]/update_acl[0] {"action": "ACCEPT", "key": "key.example.org"} any (modified) - DDNS/zones[0]/update_acl[1] {"action": "ACCEPT", "from": "::1", "key": "key.example"} any (modified) - > config commit - - (Note the "add" in the first line. Before this sequence, we have had only - entry in zones[0]/update_acl. The add command with a value (rule) adds a - new entry and sets it to the given rule. Due to a limitation of the - current implementation, it doesn't work if you first try to just add a new - entry and then set it to a given rule.) - - Note - - The b10-ddns component accepts an ACL rule that just allows updates from a - specific IP address (i.e., without requiring TSIG), but this is highly - discouraged (remember that requests can be made over UDP and spoofing the - source address of a UDP packet is often pretty easy). Unless you know what - you are doing and that you can accept its consequence, any update ACL rule - that allows updates should have a TSIG key in its constraints. - - The ACL rules will be checked in the listed order, and the first matching - one will apply. If none of the rules matches, the default rule will apply, - which is rejecting any requests in the case of b10-ddns. - - Other actions than "ACCEPT", namely "REJECT" and "DROP", can be used, too. - See Chapter 12, Recursive Name Server about their effects. - - Currently update ACL can only control updates per zone basis; it's not - possible to specify access control with higher granularity such as for - particular domain names or specific types of RRs. - - Note - - Contrary to what RFC 2136 (literally) specifies, b10-ddns checks the - update ACL before checking the prerequisites of the update request. This - is a deliberate implementation decision. This counter intuitive - specification has been repeatedly discussed among implementers and in the - IETF, and it is now widely agreed that it does not make sense to strictly - follow that part of RFC. One known specific bad result of following the - RFC is that it could leak information about which name or record exists or - does not exist in the zone as a result of prerequisite checks even if a - zone is somehow configured to reject normal queries from arbitrary - clients. There have been other troubles that could have been avoided if - the ACL could be checked before the prerequisite check. - -11.3. Miscellaneous Operational Issues - - Unlike BIND 9, BIND 10 currently does not support automatic re-signing of - DNSSEC-signed zone when it's updated via DDNS. It could be possible to - re-sign the updated zone afterwards or make sure the update request also - updates related DNSSEC records, but that will be pretty error-prone - operation. In general, it's not advisable to allow DDNS for a signed zone - at this moment. - - Also unlike BIND 9, it's currently not possible to “freeze†a zone - temporarily in order to suspend DDNS while you manually update the zone. - If you need to make manual updates to a dynamic zone, you'll need to - temporarily reject any updates to the zone via the update ACLs. - - Dynamic updates are only applicable to primary zones. In order to avoid - updating secondary zones via DDNS requests, b10-ddns refers to the - “secondary_zones†configuration of b10-zonemgr. Zones listed in - “secondary_zones†will never be updated via DDNS regardless of the update - ACL configuration; b10-ddns will return a NOTAUTH (server not - authoritative for the zone) response. If you have a "conceptual" secondary - zone whose content is a copy of some external source but is not updated - via the standard zone transfers and therefore not listed in - “secondary_zonesâ€, be careful not to allow DDNS for the zone; it would be - quite likely to lead to inconsistent state between different servers. - Normally this should not be a problem because the default update ACL - rejects any update requests, but you may want to take an extra care about - the configuration if you have such type of secondary zones. - - The difference of two versions of a zone, before and after a DDNS - transaction, is automatically recorded in the underlying data source, and - can be retrieved in the form of outbound IXFR. This is done automatically; - it does not require specific configuration to make this possible. - -Chapter 12. Recursive Name Server - - Table of Contents - - 12.1. Access Control - - 12.2. Forwarding - - The b10-resolver process is started by bind10. - - The main bind10 process can be configured to select to run either the - authoritative or resolver or both. By default, it doesn't start either - one. You may change this using bindctl, for example: - - > config add Boss/components b10-resolver - > config set Boss/components/b10-resolver/special resolver - > config set Boss/components/b10-resolver/kind needed - > config set Boss/components/b10-resolver/priority 10 - > config commit - - The master bind10 will stop and start the desired services. - - By default, the resolver listens on port 53 for 127.0.0.1 and ::1. The - following example shows how it can be configured to listen on an - additional address (and port): - - > config add Resolver/listen_on - > config set Resolver/listen_on[2]/address "192.168.1.1" - > config set Resolver/listen_on[2]/port 53 - > config commit - - (Replace the “2†as needed; run “config show Resolver/listen_on†if - needed.) - -12.1. Access Control - - By default, the b10-resolver daemon only accepts DNS queries from the - localhost (127.0.0.1 and ::1). The Resolver/query_acl configuration may be - used to reject, drop, or allow specific IPs or networks. This - configuration list is first match. - - The configuration's action item may be set to “ACCEPT†to allow the - incoming query, “REJECT†to respond with a DNS REFUSED return code, or - “DROP†to ignore the query without any response (such as a blackhole). For - more information, see the respective debugging messages: - RESOLVER_QUERY_ACCEPTED, RESOLVER_QUERY_REJECTED, and - RESOLVER_QUERY_DROPPED. - - The required configuration's from item is set to an IPv4 or IPv6 address, - addresses with an network mask, or to the special lowercase keywords - “any6†(for any IPv6 address) or “any4†(for any IPv4 address). - - For example to allow the 192.168.1.0/24 network to use your recursive name - server, at the bindctl prompt run: - - > config add Resolver/query_acl - > config set Resolver/query_acl[2]/action "ACCEPT" - > config set Resolver/query_acl[2]/from "192.168.1.0/24" - > config commit - - (Replace the “2†as needed; run “config show Resolver/query_acl†if - needed.) - - Note - - This prototype access control configuration syntax may be changed. - -12.2. Forwarding - - To enable forwarding, the upstream address and port must be configured to - forward queries to, such as: - - > config set Resolver/forward_addresses [{ "address": "192.168.1.1", "port": 53 }] - > config commit - - (Replace 192.168.1.1 to point to your full resolver.) - - Normal iterative name service can be re-enabled by clearing the forwarding - address(es); for example: - - > config set Resolver/forward_addresses [] - > config commit - -Chapter 13. DHCPv4 Server - - Table of Contents - - 13.1. DHCPv4 Server Usage - - 13.2. DHCPv4 Server Configuration - - 13.3. Supported standards - - 13.4. DHCPv4 Server Limitations - - Dynamic Host Configuration Protocol for IPv4 (DHCP or DHCPv4) and Dynamic - Host Configuration Protocol for IPv6 (DHCPv6) are protocols that allow one - node (server) to provision configuration parameters to many hosts and - devices (clients). To ease deployment in larger networks, additional nodes - (relays) may be deployed that facilitate communication between servers and - clients. Even though principles of both DHCPv4 and DHCPv6 are somewhat - similar, these are two radically different protocols. BIND10 offers server - implementations for both DHCPv4 and DHCPv6. This chapter is about DHCP for - IPv4. For a description of the DHCPv6 server, see Chapter 14, DHCPv6 - Server. - - The DHCPv4 server component is currently under intense development. You - may want to check out BIND10 DHCP (Kea) wiki and recent posts on BIND10 - developers mailing list. - - The DHCPv4 and DHCPv6 components in BIND10 architecture are internally - code named “Keaâ€. - - Note - - As of December 2011, both DHCPv4 and DHCPv6 components are skeleton - servers. That means that while they are capable of performing DHCP - configuration, they are not fully functional yet. In particular, neither - has functional lease databases. This means that they will assign the same, - fixed, hardcoded addresses to any client that will ask. See Section 13.4, - “DHCPv4 Server Limitations†and Section 14.4, “DHCPv6 Server Limitations†- for detailed description. - -13.1. DHCPv4 Server Usage - - BIND10 provides the DHCPv4 server component since December 2011. It is a - skeleton server and can be described as an early prototype that is not - fully functional yet. It is mature enough to conduct first tests in lab - environment, but it has significant limitations. See Section 13.4, “DHCPv4 - Server Limitations†for details. - - b10-dhcp4 is a BIND10 component and is being run under BIND10 framework. - To add a DHCPv4 process to the set of running BIND10 services, you can use - following commands in bindctl: - - > config add Boss/components b10-dhcp4 - > config set Boss/components/b10-dhcp4/kind dispensable - > config commit - - To shutdown running b10-dhcp4, please use the following command: - - > Dhcp4 shutdown - - or - - > config remove Boss/components b10-dhcp4 - > config commit - - During start-up the server will detect available network interfaces and - will attempt to open UDP sockets on all interfaces that are up, running, - are not loopback, and have IPv4 address assigned. The server will then - listen to incoming traffic. Currently supported client messages are - DISCOVER and REQUEST. The server will respond to them with OFFER and ACK, - respectively. Since the DHCPv4 server opens privileged ports, it requires - root access. Make sure you run this daemon as root. - -13.2. DHCPv4 Server Configuration - - The DHCPv4 server does not have a lease database implemented yet nor any - support for configuration, so every time the same set of configuration - options (including the same fixed address) will be assigned every time. - - At this stage of development, the only way to alter the server - configuration is to tweak its source code. To do so, please edit - src/bin/dhcp4/dhcp4_srv.cc file and modify following parameters and - recompile: - - const std::string HARDCODED_LEASE = "192.0.2.222"; // assigned lease - const std::string HARDCODED_NETMASK = "255.255.255.0"; - const uint32_t HARDCODED_LEASE_TIME = 60; // in seconds - const std::string HARDCODED_GATEWAY = "192.0.2.1"; - const std::string HARDCODED_DNS_SERVER = "192.0.2.2"; - const std::string HARDCODED_DOMAIN_NAME = "isc.example.com"; - const std::string HARDCODED_SERVER_ID = "192.0.2.1"; - - Lease database and configuration support is planned for 2012. - -13.3. Supported standards - - The following standards and draft standards are currently supported: - - o RFC2131: Supported messages are DISCOVER, OFFER, REQUEST, and ACK. - o RFC2132: Supported options are: PAD (0), END(255), Message Type(53), - DHCP Server Identifier (54), Domain Name (15), DNS Servers (6), IP - Address Lease Time (51), Subnet mask (1), and Routers (3). - -13.4. DHCPv4 Server Limitations - - These are the current limitations of the DHCPv4 server software. Most of - them are reflections of the early stage of development and should be - treated as “not implemented yetâ€, rather than actual limitations. - - o During initial IPv4 node configuration, the server is expected to send - packets to a node that does not have IPv4 address assigned yet. The - server requires certain tricks (or hacks) to transmit such packets. - This is not implemented yet, therefore DHCPv4 server supports relayed - traffic only (that is, normal point to point communication). - o b10-dhcp4 provides a single, fixed, hardcoded lease to any client that - asks. There is no lease manager implemented. If two clients request - addresses, they will both get the same fixed address. - o b10-dhcp4 does not support any configuration mechanisms yet. The whole - configuration is currently hardcoded. The only way to tweak - configuration is to directly modify source code. See see Section 13.2, - “DHCPv4 Server Configuration†for details. - o Upon start, the server will open sockets on all interfaces that are - not loopback, are up and running and have IPv4 address. - o PRL (Parameter Request List, a list of options requested by a client) - is currently ignored and server assigns DNS SERVER and DOMAIN NAME - options. - o b10-dhcp4 does not support BOOTP. That is a design choice. This - limitation is permanent. If you have legacy nodes that can't use DHCP - and require BOOTP support, please use latest version of ISC DHCP - http://www.isc.org/software/dhcp. - o Interface detection is currently working on Linux only. See - Section 15.1, “Interface detection†for details. - o b10-dhcp4 does not verify that assigned address is unused. According - to RFC2131, the allocating server should verify that address is no - used by sending ICMP echo request. - o Address renewal (RENEW), rebinding (REBIND), confirmation (CONFIRM), - duplication report (DECLINE) and release (RELEASE) are not supported - yet. - o DNS Update is not supported yet. - o -v (verbose) command line option is currently the default, and cannot - be disabled. - -Chapter 14. DHCPv6 Server - - Table of Contents - - 14.1. DHCPv6 Server Usage - - 14.2. DHCPv6 Server Configuration - - 14.3. Supported DHCPv6 Standards - - 14.4. DHCPv6 Server Limitations - - Dynamic Host Configuration Protocol for IPv6 (DHCPv6) is specified in - RFC3315. BIND10 provides DHCPv6 server implementation that is described in - this chapter. For a description of the DHCPv4 server implementation, see - Chapter 13, DHCPv4 Server. - - The DHCPv6 server component is currently under intense development. You - may want to check out BIND10 DHCP (Kea) wiki and recent posts on BIND10 - developers mailing list. - - The DHCPv4 and DHCPv6 components in BIND10 architecture are internally - code named “Keaâ€. - - Note - - As of December 2011, both DHCPv4 and DHCPv6 components are skeleton - servers. That means that while they are capable of performing DHCP - configuration, they are not fully functional yet. In particular, neither - has functional lease databases. This means that they will assign the same, - fixed, hardcoded addresses to any client that will ask. See Section 13.4, - “DHCPv4 Server Limitations†and Section 14.4, “DHCPv6 Server Limitations†- for detailed description. - -14.1. DHCPv6 Server Usage - - BIND10 provides the DHCPv6 server component since September 2011. It is a - skeleton server and can be described as an early prototype that is not - fully functional yet. It is mature enough to conduct first tests in lab - environment, but it has significant limitations. See Section 14.4, “DHCPv6 - Server Limitations†for details. - - b10-dhcp6 is a BIND10 component and is being run under BIND10 framework. - To add a DHCPv6 process to the set of running BIND10 services, you can use - following commands in bindctl: - - > config add Boss/components b10-dhcp6 - > config set Boss/components/b10-dhcp6/kind dispensable - > config commit - - To shutdown running b10-dhcp6, please use the following command: - - > Dhcp6 shutdown - - or - - > config remove Boss/components b10-dhcp6 - > config commit - - During start-up the server will detect available network interfaces and - will attempt to open UDP sockets on all interfaces that are up, running, - are not loopback, are multicast-capable, and have IPv6 address assigned. - The server will then listen to incoming traffic. Currently supported - client messages are SOLICIT and REQUEST. The server will respond to them - with ADVERTISE and REPLY, respectively. Since the DHCPv6 server opens - privileged ports, it requires root access. Make sure you run this daemon - as root. - -14.2. DHCPv6 Server Configuration - - The DHCPv6 server does not have lease database implemented yet or any - support for configuration, so every time the same set of configuration - options (including the same fixed address) will be assigned every time. - - At this stage of development, the only way to alter server configuration - is to tweak its source code. To do so, please edit - src/bin/dhcp6/dhcp6_srv.cc file, modify the following parameters and - recompile: - - const std::string HARDCODED_LEASE = "2001:db8:1::1234:abcd"; - const uint32_t HARDCODED_T1 = 1500; // in seconds - const uint32_t HARDCODED_T2 = 2600; // in seconds - const uint32_t HARDCODED_PREFERRED_LIFETIME = 3600; // in seconds - const uint32_t HARDCODED_VALID_LIFETIME = 7200; // in seconds - const std::string HARDCODED_DNS_SERVER = "2001:db8:1::1"; - - Lease database and configuration support is planned for 2012. - -14.3. Supported DHCPv6 Standards - - The following standards and draft standards are currently supported: - - o RFC3315: Supported messages are SOLICIT, ADVERTISE, REQUEST, and - REPLY. Supported options are SERVER_ID, CLIENT_ID, IA_NA, and - IAADDRESS. - o RFC3646: Supported option is DNS_SERVERS. - -14.4. DHCPv6 Server Limitations - - These are the current limitations of the DHCPv6 server software. Most of - them are reflections of the early stage of development and should be - treated as “not implemented yetâ€, rather than actual limitations. - - o Relayed traffic is not supported. - o b10-dhcp6 provides a single, fixed, hardcoded lease to any client that - asks. There is no lease manager implemented. If two clients request - addresses, they will both get the same fixed address. - o b10-dhcp6 does not support any configuration mechanisms yet. The whole - configuration is currently hardcoded. The only way to tweak - configuration is to directly modify source code. See see Section 14.2, - “DHCPv6 Server Configuration†for details. - o Upon start, the server will open sockets on all interfaces that are - not loopback, are up, running and are multicast capable and have IPv6 - address. Support for multiple interfaces is not coded in reception - routines yet, so if you are running this code on a machine that has - many interfaces and b10-dhcp6 happens to listen on wrong interface, - the easiest way to work around this problem is to turn down other - interfaces. This limitation will be fixed shortly. - o ORO (Option Request Option, a list of options requested by a client) - is currently ignored and server assigns DNS SERVER option. - o Temporary addresses are not supported yet. - o Prefix delegation is not supported yet. - o Address renewal (RENEW), rebinding (REBIND), confirmation (CONFIRM), - duplication report (DECLINE) and release (RELEASE) are not supported - yet. - o DNS Update is not supported yet. - o Interface detection is currently working on Linux only. See - Section 15.1, “Interface detection†for details. - o -v (verbose) command line option is currently the default, and cannot - be disabled. - -Chapter 15. libdhcp++ library - - Table of Contents - - 15.1. Interface detection - - 15.2. DHCPv4/DHCPv6 packet handling - - libdhcp++ is a common library written in C++ that handles many - DHCP-related tasks, like DHCPv4 and DHCPv6 packets parsing, manipulation - and assembly, option parsing, manipulation and assembly, network interface - detection and socket operations, like socket creations, data transmission - and reception and socket closing. - - While this library is currently used by b10-dhcp4 and b10-dhcp6 only, it - is designed to be portable, universal library useful for any kind of - DHCP-related software. - -15.1. Interface detection - - Both DHCPv4 and DHCPv6 components share network interface detection - routines. Interface detection is currently only supported on Linux - systems. - - For non-Linux systems, there is currently stub implementation provided. - Interface manager detects loopback interfaces only as their name (lo or - lo0) can be easily predicted. Please contact BIND10 development team if - you are interested in running DHCP components on systems other than Linux. - -15.2. DHCPv4/DHCPv6 packet handling - - TODO: Describe packet handling here, with pointers to wiki - -Chapter 16. Statistics - - The b10-stats process is started by bind10. It periodically collects - statistics data from various modules and aggregates it. - - This stats daemon provides commands to identify if it is running, show - specified or all statistics data, and show specified or all statistics data - schema. For example, using bindctl: - - > Stats show - { - "Auth": { - "opcode.iquery": 0, - "opcode.notify": 10, - "opcode.query": 869617, - ... - "queries.tcp": 1749, - "queries.udp": 867868 - }, - "Boss": { - "boot_time": "2011-01-20T16:59:03Z" - }, - "Stats": { - "boot_time": "2011-01-20T16:59:05Z", - "last_update_time": "2011-01-20T17:04:05Z", - "lname": "4d3869d9_a@jreed.example.net", - "report_time": "2011-01-20T17:04:06Z", - "timestamp": 1295543046.823504 - } - } - - -Chapter 17. Logging - - Table of Contents - - 17.1. Logging configuration - - 17.1.1. Loggers - - 17.1.2. Output Options - - 17.1.3. Example session - - 17.2. Logging Message Format - -17.1. Logging configuration - - The logging system in BIND 10 is configured through the Logging module. - All BIND 10 modules will look at the configuration in Logging to see what - should be logged and to where. - - 17.1.1. Loggers - - Within BIND 10, a message is logged through a component called a "logger". - Different parts of BIND 10 log messages through different loggers, and - each logger can be configured independently of one another. - - In the Logging module, you can specify the configuration for zero or more - loggers; any that are not specified will take appropriate default values. - - The three most important elements of a logger configuration are the name - (the component that is generating the messages), the severity (what to - log), and the output_options (where to log). - - 17.1.1.1. name (string) - - Each logger in the system has a name, the name being that of the component - using it to log messages. For instance, if you want to configure logging - for the resolver module, you add an entry for a logger named “Resolverâ€. - This configuration will then be used by the loggers in the Resolver - module, and all the libraries used by it. - - If you want to specify logging for one specific library within the module, - you set the name to module.library. For example, the logger used by the - nameserver address store component has the full name of “Resolver.nsasâ€. - If there is no entry in Logging for a particular library, it will use the - configuration given for the module. - - To illustrate this, suppose you want the cache library to log messages of - severity DEBUG, and the rest of the resolver code to log messages of - severity INFO. To achieve this you specify two loggers, one with the name - “Resolver†and severity INFO, and one with the name “Resolver.cache†with - severity DEBUG. As there are no entries for other libraries (e.g. the - nsas), they will use the configuration for the module (“Resolverâ€), so - giving the desired behavior. - - One special case is that of a module name of “*†(asterisks), which is - interpreted as any module. You can set global logging options by using - this, including setting the logging configuration for a library that is - used by multiple modules (e.g. “*.config†specifies the configuration - library code in whatever module is using it). - - If there are multiple logger specifications in the configuration that - might match a particular logger, the specification with the more specific - logger name takes precedence. For example, if there are entries for for - both “*†and “Resolverâ€, the resolver module — and all libraries it uses — - will log messages according to the configuration in the second entry - (“Resolverâ€). All other modules will use the configuration of the first - entry (“*â€). If there was also a configuration entry for “Resolver.cacheâ€, - the cache library within the resolver would use that in preference to the - entry for “Resolverâ€. - - One final note about the naming. When specifying the module name within a - logger, use the name of the module as specified in bindctl, e.g. - “Resolver†for the resolver module, “Xfrout†for the xfrout module, etc. - When the message is logged, the message will include the name of the - logger generating the message, but with the module name replaced by the - name of the process implementing the module (so for example, a message - generated by the “Auth.cache†logger will appear in the output with a - logger name of “b10-auth.cacheâ€). - - 17.1.1.2. severity (string) - - This specifies the category of messages logged. Each message is logged - with an associated severity which may be one of the following (in - descending order of severity): - - o FATAL - o ERROR - o WARN - o INFO - o DEBUG - - When the severity of a logger is set to one of these values, it will only - log messages of that severity, and the severities above it. The severity - may also be set to NONE, in which case all messages from that logger are - inhibited. - - 17.1.1.3. output_options (list) - - Each logger can have zero or more output_options. These specify where log - messages are sent to. These are explained in detail below. - - The other options for a logger are: - - 17.1.1.4. debuglevel (integer) - - When a logger's severity is set to DEBUG, this value specifies what debug - messages should be printed. It ranges from 0 (least verbose) to 99 (most - verbose). - - If severity for the logger is not DEBUG, this value is ignored. - - 17.1.1.5. additive (true or false) - - If this is true, the output_options from the parent will be used. For - example, if there are two loggers configured; “Resolver†and - “Resolver.cacheâ€, and additive is true in the second, it will write the - log messages not only to the destinations specified for “Resolver.cacheâ€, - but also to the destinations as specified in the output_options in the - logger named “Resolverâ€. - - 17.1.2. Output Options - - The main settings for an output option are the destination and a value - called output, the meaning of which depends on the destination that is - set. - - 17.1.2.1. destination (string) - - The destination is the type of output. It can be one of: - - o console - o file - o syslog - - 17.1.2.2. output (string) - - Depending on what is set as the output destination, this value is - interpreted as follows: - - destination is “console†- - The value of output must be one of “stdout†(messages printed to - standard output) or “stderr†(messages printed to standard error). - - Note: if output is set to “stderr†and a lot of messages are - produced in a short time (e.g. if the logging level is set to - DEBUG), you may occasionally see some messages jumbled up - together. This is due to a combination of the way that messages - are written to the screen and the unbuffered nature of the - standard error stream. If this occurs, it is recommended that - output be set to “stdoutâ€. - - destination is “file†- - The value of output is interpreted as a file name; log messages - will be appended to this file. - - destination is “syslog†- - The value of output is interpreted as the syslog facility (e.g. - local0) that should be used for log messages. - - The other options for output_options are: - - 17.1.2.2.1. flush (true of false) - - Flush buffers after each log message. Doing this will reduce performance - but will ensure that if the program terminates abnormally, all messages up - to the point of termination are output. - - 17.1.2.2.2. maxsize (integer) - - Only relevant when destination is file, this is maximum file size of - output files in bytes. When the maximum size is reached, the file is - renamed and a new file opened. (For example, a ".1" is appended to the - name — if a ".1" file exists, it is renamed ".2", etc.) - - If this is 0, no maximum file size is used. - - 17.1.2.2.3. maxver (integer) - - Maximum number of old log files to keep around when rolling the output - file. Only relevant when destination is “fileâ€. - - 17.1.3. Example session - - In this example we want to set the global logging to write to the file - /var/log/my_bind10.log, at severity WARN. We want the authoritative server - to log at DEBUG with debuglevel 40, to a different file - (/tmp/debug_messages). - - Start bindctl. - - ["login success "] - > config show Logging - Logging/loggers [] list - - By default, no specific loggers are configured, in which case the severity - defaults to INFO and the output is written to stderr. - - Let's first add a default logger: - - > config add Logging/loggers - > config show Logging - Logging/loggers/ list (modified) - - The loggers value line changed to indicate that it is no longer an empty - list: - - > config show Logging/loggers - Logging/loggers[0]/name "" string (default) - Logging/loggers[0]/severity "INFO" string (default) - Logging/loggers[0]/debuglevel 0 integer (default) - Logging/loggers[0]/additive false boolean (default) - Logging/loggers[0]/output_options [] list (default) - - The name is mandatory, so we must set it. We will also change the severity - as well. Let's start with the global logger. - - > config set Logging/loggers[0]/name * - > config set Logging/loggers[0]/severity WARN - > config show Logging/loggers - Logging/loggers[0]/name "*" string (modified) - Logging/loggers[0]/severity "WARN" string (modified) - Logging/loggers[0]/debuglevel 0 integer (default) - Logging/loggers[0]/additive false boolean (default) - Logging/loggers[0]/output_options [] list (default) - - Of course, we need to specify where we want the log messages to go, so we - add an entry for an output option. - - > config add Logging/loggers[0]/output_options - > config show Logging/loggers[0]/output_options - Logging/loggers[0]/output_options[0]/destination "console" string (default) - Logging/loggers[0]/output_options[0]/output "stdout" string (default) - Logging/loggers[0]/output_options[0]/flush false boolean (default) - Logging/loggers[0]/output_options[0]/maxsize 0 integer (default) - Logging/loggers[0]/output_options[0]/maxver 0 integer (default) - - These aren't the values we are looking for. - - > config set Logging/loggers[0]/output_options[0]/destination file - > config set Logging/loggers[0]/output_options[0]/output /var/log/bind10.log - > config set Logging/loggers[0]/output_options[0]/maxsize 204800 - > config set Logging/loggers[0]/output_options[0]/maxver 8 - - Which would make the entire configuration for this logger look like: - - > config show all Logging/loggers - Logging/loggers[0]/name "*" string (modified) - Logging/loggers[0]/severity "WARN" string (modified) - Logging/loggers[0]/debuglevel 0 integer (default) - Logging/loggers[0]/additive false boolean (default) - Logging/loggers[0]/output_options[0]/destination "file" string (modified) - Logging/loggers[0]/output_options[0]/output "/var/log/bind10.log" string (modified) - Logging/loggers[0]/output_options[0]/flush false boolean (default) - Logging/loggers[0]/output_options[0]/maxsize 204800 integer (modified) - Logging/loggers[0]/output_options[0]/maxver 8 integer (modified) - - That looks OK, so let's commit it before we add the configuration for the - authoritative server's logger. - - > config commit - - Now that we have set it, and checked each value along the way, adding a - second entry is quite similar. - - > config add Logging/loggers - > config set Logging/loggers[1]/name Auth - > config set Logging/loggers[1]/severity DEBUG - > config set Logging/loggers[1]/debuglevel 40 - > config add Logging/loggers[1]/output_options - > config set Logging/loggers[1]/output_options[0]/destination file - > config set Logging/loggers[1]/output_options[0]/output /tmp/auth_debug.log - > config commit - - And that's it. Once we have found whatever it was we needed the debug - messages for, we can simply remove the second logger to let the - authoritative server use the same settings as the rest. - - > config remove Logging/loggers[1] - > config commit - - And every module will now be using the values from the logger named “*â€. - -17.2. Logging Message Format - - Each message written by BIND 10 to the configured logging destinations - comprises a number of components that identify the origin of the message - and, if the message indicates a problem, information about the problem - that may be useful in fixing it. - - Consider the message below logged to a file: - - 2011-06-15 13:48:22.034 ERROR [b10-resolver.asiolink] - ASIODNS_OPENSOCK error 111 opening TCP socket to 127.0.0.1(53) - - Note: the layout of messages written to the system logging file (syslog) - may be slightly different. This message has been split across two lines - here for display reasons; in the logging file, it will appear on one - line.) - - The log message comprises a number of components: - - 2011-06-15 13:48:22.034 - - The date and time at which the message was generated. - - ERROR - - The severity of the message. - - [b10-resolver.asiolink] - - The source of the message. This comprises two components: the BIND - 10 process generating the message (in this case, b10-resolver) and - the module within the program from which the message originated - (which in the example is the asynchronous I/O link module, - asiolink). - - ASIODNS_OPENSOCK - - The message identification. Every message in BIND 10 has a unique - identification, which can be used as an index into the BIND 10 - Messages Manual (http://bind10.isc.org/docs/bind10-messages.html) - from which more information can be obtained. - - error 111 opening TCP socket to 127.0.0.1(53) - - A brief description of the cause of the problem. Within this text, - information relating to the condition that caused the message to - be logged will be included. In this example, error number 111 (an - operating system-specific error number) was encountered when - trying to open a TCP connection to port 53 on the local system - (address 127.0.0.1). The next step would be to find out the reason - for the failure by consulting your system's documentation to - identify what error number 111 means. diff --git a/doc/guide/bind10-guide.xml b/doc/guide/bind10-guide.xml index 49cb419de6..a95b0f540e 100644 --- a/doc/guide/bind10-guide.xml +++ b/doc/guide/bind10-guide.xml @@ -785,7 +785,7 @@ as a dependency earlier --> - Starting BIND10 with <command>bind10</command> + Starting BIND 10 with <command>bind10</command> BIND 10 provides the bind10 command which starts up the required processes. @@ -1633,6 +1633,17 @@ can use various data source backends. + + tcp_recv_timeout + + + tcp_recv_timeout is the timeout used on + incoming TCP connections, in milliseconds. If the query + is not sent within this time, the connection is closed. + Setting this to 0 will disable TCP timeouts completely. + + + @@ -1735,7 +1746,7 @@ can use various data source backends. Each data source has several options. The first one is type, which specifies the type of data source to - use. Valid types include the ones listed below, but bind10 uses + use. Valid types include the ones listed below, but BIND 10 uses dynamically loaded modules for them, so there may be more in your case. This option is mandatory. @@ -1754,8 +1765,14 @@ can use various data source backends. answering up. The first option is cache-enable, a boolean value turning the cache on and off (off is the default). The second one, cache-zones, is a list of zone - origins to load into in-memory. Remember that zones in the data source - not listed here will not be loaded and will not be available at all. + origins to load into in-memory. + +
@@ -1764,7 +1781,7 @@ can use various data source backends. As mentioned, the type used by default is sqlite3. It has single configuration option inside paramsdatabase_file, which contains the path - to the sqlite3 file containing the data. + to the SQLite3 file containing the data. @@ -1781,7 +1798,7 @@ can use various data source backends.
Examples - As this is one of the more complex configurations of Bind10, + As this is one of the more complex configurations of BIND 10, we show some examples. They all assume they start with default configuration. @@ -1807,7 +1824,7 @@ can use various data source backends. > config commit Now every time the zone in the data source is changed by the - operator, Bind10 needs to be told to reload it, by + operator, the authoritative server needs to be told to reload it, by > Auth loadzone example.org You don't need to do this when the zone is modified by XfrIn, it does so automatically. @@ -1815,7 +1832,7 @@ can use various data source backends. Now, the last example is when there are master files we want to - serve in addition to whatever is inside the sqlite3 database. + serve in addition to whatever is inside the SQLite3 database. > config add data_sources/classes/IN > config set data_sources/classes/IN[1]/type MasterFiles @@ -1844,7 +1861,7 @@ can use various data source backends. There's also Auth/database_file configuration - variable, pointing to a sqlite3 database file. This is no longer + variable, pointing to a SQLite3 database file. This is no longer used by b10-auth, but it is left in place for now, since other modules use it. Once b10-xfrin, b10-xfrout and b10-ddns @@ -2589,18 +2606,18 @@ then change those defaults with config set Resolver/forward_addresses[0]/address be deployed that facilitate communication between servers and clients. Even though principles of both DHCPv4 and DHCPv6 are somewhat similar, these are two radically different - protocols. BIND10 offers server implementations for both DHCPv4 + protocols. BIND 10 offers server implementations for both DHCPv4 and DHCPv6. This chapter is about DHCP for IPv4. For a description of the DHCPv6 server, see . The DHCPv4 server component is currently under intense development. You may want to check out BIND10 DHCP (Kea) wiki + url="http://bind10.isc.org/wiki/Kea">BIND 10 DHCP (Kea) wiki and recent posts on BIND10 + url="https://lists.isc.org/mailman/listinfo/bind10-dev">BIND 10 developers mailing list. - The DHCPv4 and DHCPv6 components in BIND10 architecture are + The DHCPv4 and DHCPv6 components in BIND 10 architecture are internally code named Kea. @@ -2618,7 +2635,7 @@ then change those defaults with config set Resolver/forward_addresses[0]/address
DHCPv4 Server Usage - BIND10 provides the DHCPv4 server component since December + BIND 10 provides the DHCPv4 server component since December 2011. It is a skeleton server and can be described as an early prototype that is not fully functional yet. It is mature enough to conduct first tests in lab environment, but it has @@ -2627,9 +2644,9 @@ then change those defaults with config set Resolver/forward_addresses[0]/address - b10-dhcp4 is a BIND10 component and is being - run under BIND10 framework. To add a DHCPv4 process to the set of running - BIND10 services, you can use following commands in bindctl: + b10-dhcp4 is a BIND 10 component and is being + run under BIND 10 framework. To add a DHCPv4 process to the set of running + BIND 10 services, you can use following commands in bindctl: > config add Boss/components b10-dhcp4 > config set Boss/components/b10-dhcp4/kind dispensable > config commit @@ -2779,19 +2796,19 @@ const std::string HARDCODED_SERVER_ID = "192.0.2.1"; DHCPv6 Server Dynamic Host Configuration Protocol for IPv6 (DHCPv6) is - specified in RFC3315. BIND10 provides DHCPv6 server implementation + specified in RFC3315. BIND 10 provides DHCPv6 server implementation that is described in this chapter. For a description of the DHCPv4 server implementation, see . The DHCPv6 server component is currently under intense development. You may want to check out BIND10 DHCP (Kea) wiki + url="http://bind10.isc.org/wiki/Kea">BIND 10 DHCP (Kea) wiki and recent posts on BIND10 + url="https://lists.isc.org/mailman/listinfo/bind10-dev">BIND 10 developers mailing list. - The DHCPv4 and DHCPv6 components in BIND10 architecture are + The DHCPv4 and DHCPv6 components in BIND 10 architecture are internally code named Kea. @@ -2810,7 +2827,7 @@ const std::string HARDCODED_SERVER_ID = "192.0.2.1";
DHCPv6 Server Usage - BIND10 provides the DHCPv6 server component since September + BIND 10 provides the DHCPv6 server component since September 2011. It is a skeleton server and can be described as an early prototype that is not fully functional yet. It is mature enough to conduct first tests in lab environment, but it has @@ -2819,9 +2836,9 @@ const std::string HARDCODED_SERVER_ID = "192.0.2.1"; - b10-dhcp6 is a BIND10 component and is being - run under BIND10 framework. To add a DHCPv6 process to the set of running - BIND10 services, you can use following commands in bindctl: + b10-dhcp6 is a BIND 10 component and is being + run under BIND 10 framework. To add a DHCPv6 process to the set of running + BIND 10 services, you can use following commands in bindctl: > config add Boss/components b10-dhcp6 > config set Boss/components/b10-dhcp6/kind dispensable > config commit @@ -2988,7 +3005,7 @@ const std::string HARDCODED_DNS_SERVER = "2001:db8:1::1"; For non-Linux systems, there is currently stub implementation provided. Interface manager detects loopback interfaces only as their name (lo or lo0) can be easily predicted. - Please contact BIND10 development team if you are interested + Please contact the BIND 10 development team if you are interested in running DHCP components on systems other than Linux.
diff --git a/doc/guide/bind10-messages.html b/doc/guide/bind10-messages.html deleted file mode 100644 index cfa27a660c..0000000000 --- a/doc/guide/bind10-messages.html +++ /dev/null @@ -1,3303 +0,0 @@ -BIND 10 Messages Manual

BIND 10 Messages Manual

This is the messages manual for BIND 10 version - 20120712.

Abstract

BIND 10 is a Domain Name System (DNS) suite managed by - Internet Systems Consortium (ISC). It includes DNS libraries - and modular components for controlling authoritative and - recursive DNS servers. -

- This is the messages manual for BIND 10 version 20120712. - The most up-to-date version of this document, along with - other documents for BIND 10, can be found at - http://bind10.isc.org/docs. -


Chapter 1. Introduction

- This document lists each message that can be logged by the - programs in the BIND 10 package. Each entry in this manual - is of the form: -

IDENTIFICATION message-text

- ... where "IDENTIFICATION" is the message identification included - in each message logged and "message-text" is the accompanying - message text. The "message-text" may include placeholders of the - form "%1", "%2" etc.; these parameters are replaced by relevant - values when the message is logged. -

- Each entry is also accompanied by a description giving more - information about the circumstances that result in the message - being logged. -

- For information on configuring and using BIND 10 logging, - refer to the BIND 10 Guide. -

Chapter 2. BIND 10 Messages

-

ASIODNS_FD_ADD_TCP adding a new TCP server by opened fd %1

-A debug message informing about installing a file descriptor as a server. -The file descriptor number is noted. -

ASIODNS_FD_ADD_UDP adding a new UDP server by opened fd %1

-A debug message informing about installing a file descriptor as a server. -The file descriptor number is noted. -

ASIODNS_FETCH_COMPLETED upstream fetch to %1(%2) has now completed

-A debug message, this records that the upstream fetch (a query made by the -resolver on behalf of its client) to the specified address has completed. -

ASIODNS_FETCH_STOPPED upstream fetch to %1(%2) has been stopped

-An external component has requested the halting of an upstream fetch. This -is an allowed operation, and the message should only appear if debug is -enabled. -

ASIODNS_OPEN_SOCKET error %1 opening %2 socket to %3(%4)

-The asynchronous I/O code encountered an error when trying to open a socket -of the specified protocol in order to send a message to the target address. -The number of the system error that caused the problem is given in the -message. -

ASIODNS_READ_DATA error %1 reading %2 data from %3(%4)

-The asynchronous I/O code encountered an error when trying to read data from -the specified address on the given protocol. The number of the system -error that caused the problem is given in the message. -

ASIODNS_READ_TIMEOUT receive timeout while waiting for data from %1(%2)

-An upstream fetch from the specified address timed out. This may happen for -any number of reasons and is most probably a problem at the remote server -or a problem on the network. The message will only appear if debug is -enabled. -

ASIODNS_SEND_DATA error %1 sending data using %2 to %3(%4)

-The asynchronous I/O code encountered an error when trying to send data to -the specified address on the given protocol. The number of the system -error that caused the problem is given in the message. -

ASIODNS_UNKNOWN_ORIGIN unknown origin for ASIO error code %1 (protocol: %2, address %3)

-An internal consistency check on the origin of a message from the -asynchronous I/O module failed. This may indicate an internal error; -please submit a bug report. -

ASIODNS_UNKNOWN_RESULT unknown result (%1) when IOFetch::stop() was executed for I/O to %2(%3)

-An internal error indicating that the termination method of the resolver's -upstream fetch class was called with an unknown result code (which is -given in the message). Please submit a bug report. -

AUTH_AXFR_ERROR error handling AXFR request: %1

-This is a debug message produced by the authoritative server when it -has encountered an error processing an AXFR request. The message gives -the reason for the error, and the server will return a SERVFAIL code to -the sender. -

AUTH_AXFR_UDP AXFR query received over UDP

-This is a debug message output when the authoritative server has received -an AXFR query over UDP. Use of UDP for AXFRs is not permitted by the -protocol, so the server will return a FORMERR error to the sender. -

AUTH_COMMAND_FAILED execution of command channel instruction '%1' failed: %2

-Execution of the specified command by the authoritative server failed. The -message contains the reason for the failure. -

AUTH_CONFIG_CHANNEL_CREATED configuration session channel created

-This is a debug message indicating that authoritative server has created -the channel to the configuration manager. It is issued during server -startup is an indication that the initialization is proceeding normally. -

AUTH_CONFIG_CHANNEL_ESTABLISHED configuration session channel established

-This is a debug message indicating that authoritative server -has established communication the configuration manager over the -previously-created channel. It is issued during server startup is an -indication that the initialization is proceeding normally. -

AUTH_CONFIG_CHANNEL_STARTED configuration session channel started

-This is a debug message, issued when the authoritative server has -posted a request to be notified when new configuration information is -available. It is issued during server startup is an indication that -the initialization is proceeding normally. -

AUTH_CONFIG_LOAD_FAIL load of configuration failed: %1

-An attempt to configure the server with information from the configuration -database during the startup sequence has failed. (The reason for -the failure is given in the message.) The server will continue its -initialization although it may not be configured in the desired way. -

AUTH_CONFIG_UPDATE_FAIL update of configuration failed: %1

-At attempt to update the configuration the server with information -from the configuration database has failed, the reason being given in -the message. -

AUTH_DATA_SOURCE data source database file: %1

-This is a debug message produced by the authoritative server when it accesses a -datebase data source, listing the file that is being accessed. -

AUTH_DNS_SERVICES_CREATED DNS services created

-This is a debug message indicating that the component that will handling -incoming queries for the authoritative server (DNSServices) has been -successfully created. It is issued during server startup is an indication -that the initialization is proceeding normally. -

AUTH_HEADER_PARSE_FAIL unable to parse header in received DNS packet: %1

-This is a debug message, generated by the authoritative server when an -attempt to parse the header of a received DNS packet has failed. (The -reason for the failure is given in the message.) The server will drop the -packet. -

AUTH_INVALID_STATISTICS_DATA invalid specification of statistics data specified

-An error was encountered when the authoritiative server specified -statistics data which is invalid for the auth specification file. -

AUTH_LOAD_TSIG loading TSIG keys

-This is a debug message indicating that the authoritative server -has requested the keyring holding TSIG keys from the configuration -database. It is issued during server startup is an indication that the -initialization is proceeding normally. -

AUTH_LOAD_ZONE loaded zone %1/%2

-This debug message is issued during the processing of the 'loadzone' command -when the authoritative server has successfully loaded the named zone of the -named class. -

AUTH_MEM_DATASRC_DISABLED memory data source is disabled for class %1

-This is a debug message reporting that the authoritative server has -discovered that the memory data source is disabled for the given class. -

AUTH_MEM_DATASRC_ENABLED memory data source is enabled for class %1

-This is a debug message reporting that the authoritative server has -discovered that the memory data source is enabled for the given class. -

AUTH_MESSAGE_FORWARD_ERROR failed to forward %1 request from %2: %3

-The authoritative server tried to forward some type DNS request -message to a separate process (e.g., forwarding dynamic update -requests to b10-ddns) to handle it, but it failed. The authoritative -server returns SERVFAIL to the client on behalf of the separate -process. The error could be configuration mismatch between b10-auth -and the recipient component, or it may be because the requests are -coming too fast and the receipient process cannot keep up with the -rate, or some system level failure. In either case this means the -BIND 10 system is not working as expected, so the administrator should -look into the cause and address the issue. The log message includes -the client's address (and port), and the error message sent from the -lower layer that detects the failure. -

AUTH_NOTIFY_QUESTIONS invalid number of questions (%1) in incoming NOTIFY

-This debug message is logged by the authoritative server when it receives -a NOTIFY packet that contains zero or more than one question. (A valid -NOTIFY packet contains one question.) The server will return a FORMERR -error to the sender. -

AUTH_NOTIFY_RRTYPE invalid question RR type (%1) in incoming NOTIFY

-This debug message is logged by the authoritative server when it receives -a NOTIFY packet that an RR type of something other than SOA in the -question section. (The RR type received is included in the message.) The -server will return a FORMERR error to the sender. -

AUTH_NO_STATS_SESSION session interface for statistics is not available

-The authoritative server had no session with the statistics module at the -time it attempted to send it data: the attempt has been abandoned. This -could be an error in configuration. -

AUTH_NO_XFRIN received NOTIFY but XFRIN session is not running

-This is a debug message produced by the authoritative server when it receives -a NOTIFY packet but the XFRIN process is not running. The packet will be -dropped and nothing returned to the sender. -

AUTH_PACKET_PARSE_ERROR unable to parse received DNS packet: %1

-This is a debug message, generated by the authoritative server when an -attempt to parse a received DNS packet has failed due to something other -than a protocol error. The reason for the failure is given in the message; -the server will return a SERVFAIL error code to the sender. -

AUTH_PACKET_PROTOCOL_ERROR DNS packet protocol error: %1. Returning %2

-This is a debug message, generated by the authoritative server when an -attempt to parse a received DNS packet has failed due to a protocol error. -The reason for the failure is given in the message, as is the error code -that will be returned to the sender. -

AUTH_PACKET_RECEIVED message received:\n%1

-This is a debug message output by the authoritative server when it -receives a valid DNS packet. -

-Note: This message includes the packet received, rendered in the form of -multiple lines of text. For this reason, it is suggested that this log message -not be routed to the syslog file, where the multiple lines could confuse -programs that expect a format of one message per line. -

AUTH_PROCESS_FAIL message processing failure: %1

-This message is generated by the authoritative server when it has -encountered an internal error whilst processing a received packet: -the cause of the error is included in the message. -

-The server will return a SERVFAIL error code to the sender of the packet. -This message indicates a potential error in the server. Please open a -bug ticket for this issue. -

AUTH_RECEIVED_COMMAND command '%1' received

-This is a debug message issued when the authoritative server has received -a command on the command channel. -

AUTH_RECEIVED_NOTIFY received incoming NOTIFY for zone name %1, zone class %2

-This is a debug message reporting that an incoming NOTIFY was received. -

AUTH_RECEIVED_SENDSTATS command 'sendstats' received

-This is a debug message issued when the authoritative server has received -a command from the statistics module to send it data. The 'sendstats' -command is handled differently to other commands, which is why the debug -message associated with it has its own code. -

AUTH_RESPONSE_FAILURE exception while building response to query: %1

-This is a debug message, generated by the authoritative server when an -attempt to create a response to a received DNS packet has failed. The -reason for the failure is given in the log message. A SERVFAIL response -is sent back. The most likely cause of this is an error in the data -source implementation; it is either creating bad responses or raising -exceptions itself. -

AUTH_RESPONSE_FAILURE_UNKNOWN unknown exception while building response to query

-This debug message is similar to AUTH_RESPONSE_FAILURE, but further -details about the error are unknown, because it was signaled by something -which is not an exception. This is definitely a bug. -

AUTH_RESPONSE_RECEIVED received response message, ignoring

-This is a debug message, this is output if the authoritative server -receives a DNS packet with the QR bit set, i.e. a DNS response. The -server ignores the packet as it only responds to question packets. -

AUTH_SEND_ERROR_RESPONSE sending an error response (%1 bytes):\n%2

-This is a debug message recording that the authoritative server is sending -an error response to the originator of the query. A previous message will -have recorded details of the failure. -

-Note: This message includes the packet sent, rendered in the form of -multiple lines of text. For this reason, it is suggested that this log message -not be routed to the syslog file, where the multiple lines could confuse -programs that expect a format of one message per line. -

AUTH_SEND_NORMAL_RESPONSE sending an error response (%1 bytes):\n%2

-This is a debug message recording that the authoritative server is sending -a response to the originator of a query. -

-Note: This message includes the packet sent, rendered in the form of -multiple lines of text. For this reason, it is suggested that this log message -not be routed to the syslog file, where the multiple lines could confuse -programs that expect a format of one message per line. -

AUTH_SERVER_CREATED server created

-An informational message indicating that the authoritative server process has -been created and is initializing. The AUTH_SERVER_STARTED message will be -output when initialization has successfully completed and the server starts -accepting queries. -

AUTH_SERVER_FAILED server failed: %1

-The authoritative server has encountered a fatal error and is terminating. The -reason for the failure is included in the message. -

AUTH_SERVER_STARTED server started

-Initialization of the authoritative server has completed successfully -and it is entering the main loop, waiting for queries to arrive. -

AUTH_SHUTDOWN asked to stop, doing so

-This is a debug message indicating the server was asked to shut down and it is -complying to the request. -

AUTH_SQLITE3 nothing to do for loading sqlite3

-This is a debug message indicating that the authoritative server has -found that the data source it is loading is an SQLite3 data source, -so no further validation is needed. -

AUTH_START_DDNS_FORWARDER DDNS UPDATE handling started

-This is a debug message indicating that b10-auth has received a message -that it should internally forward UPDATE message to b10-ddns. When b10-ddns -is not running, b10-auth will respond to UPDATE requests with rcode NOTIMP. -When b10-ddns is running, b10-ddns will handle and respond to the UPDATE -message. -

AUTH_STATS_CHANNEL_CREATED STATS session channel created

-This is a debug message indicating that the authoritative server has -created a channel to the statistics process. It is issued during server -startup is an indication that the initialization is proceeding normally. -

AUTH_STATS_CHANNEL_ESTABLISHED STATS session channel established

-This is a debug message indicating that the authoritative server -has established communication over the previously created statistics -channel. It is issued during server startup is an indication that the -initialization is proceeding normally. -

AUTH_STATS_COMMS communication error in sending statistics data: %1

-An error was encountered when the authoritative server tried to send data -to the statistics daemon. The message includes additional information -describing the reason for the failure. -

AUTH_STATS_TIMEOUT timeout while sending statistics data: %1

-The authoritative server sent data to the statistics daemon but received -no acknowledgement within the specified time. The message includes -additional information describing the reason for the failure. -

AUTH_STATS_TIMER_DISABLED statistics timer has been disabled

-This is a debug message indicating that the statistics timer has been -disabled in the authoritative server and no statistics information is -being produced. -

AUTH_STATS_TIMER_SET statistics timer set to %1 second(s)

-This is a debug message indicating that the statistics timer has been -enabled and that the authoritative server will produce statistics data -at the specified interval. -

AUTH_STOP_DDNS_FORWARDER DDNS UPDATE handling stopped

-This is a debug message indicating that b10-auth has received a message -that it should stop internally forwarding UPDATE message to b10-ddns. -b10-auth will no longer forward UPDATE messages to b10-ddns, but will -respond itself with error code NOTIMP. -This message is also logged when the forwarding is restarted (for instance -if b10-ddns is restarted and the internal connection needs to be created -again), in which case it should be followed by AUTH_START_DDNS_FORWARDER. -

AUTH_UNSUPPORTED_OPCODE unsupported opcode: %1

-This is a debug message, produced when a received DNS packet being -processed by the authoritative server has been found to contain an -unsupported opcode. (The opcode is included in the message.) The server -will return an error code of NOTIMPL to the sender. -

AUTH_XFRIN_CHANNEL_CREATED XFRIN session channel created

-This is a debug message indicating that the authoritative server has -created a channel to the XFRIN (Transfer-in) process. It is issued -during server startup is an indication that the initialization is -proceeding normally. -

AUTH_XFRIN_CHANNEL_ESTABLISHED XFRIN session channel established

-This is a debug message indicating that the authoritative server has -established communication over the previously-created channel to the -XFRIN (Transfer-in) process. It is issued during server startup is an -indication that the initialization is proceeding normally. -

AUTH_ZONEMGR_COMMS error communicating with zone manager: %1

-This is a debug message output during the processing of a NOTIFY request. -An error (listed in the message) has been encountered whilst communicating -with the zone manager. The NOTIFY request will not be honored. -

AUTH_ZONEMGR_ERROR received error response from zone manager: %1

-This is a debug message output during the processing of a NOTIFY -request. The zone manager component has been informed of the request, -but has returned an error response (which is included in the message). The -NOTIFY request will not be honored. -

BIND10_CHECK_MSGQ_ALREADY_RUNNING checking if msgq is already running

-The boss process is starting up and will now check if the message bus -daemon is already running. If so, it will not be able to start, as it -needs a dedicated message bus. -

BIND10_COMPONENT_FAILED component %1 (pid %2) failed: %3

-The process terminated, but the bind10 boss didn't expect it to, which means -it must have failed. -

BIND10_COMPONENT_RESTART component %1 is about to restart

-The named component failed previously and we will try to restart it to provide -as flawless service as possible, but it should be investigated what happened, -as it could happen again. -

BIND10_COMPONENT_START component %1 is starting

-The named component is about to be started by the boss process. -

BIND10_COMPONENT_START_EXCEPTION component %1 failed to start: %2

-An exception (mentioned in the message) happened during the startup of the -named component. The componet is not considered started and further actions -will be taken about it. -

BIND10_COMPONENT_STOP component %1 is being stopped

-A component is about to be asked to stop willingly by the boss. -

BIND10_COMPONENT_UNSATISFIED component %1 is required to run and failed

-A component failed for some reason (see previous messages). It is either a core -component or needed component that was just started. In any case, the system -can't continue without it and will terminate. -

BIND10_CONFIGURATOR_BUILD building plan '%1' -> '%2'

-A debug message. This indicates that the configurator is building a plan -how to change configuration from the older one to newer one. This does no -real work yet, it just does the planning what needs to be done. -

BIND10_CONFIGURATOR_PLAN_INTERRUPTED configurator plan interrupted, only %1 of %2 done

-There was an exception during some planned task. The plan will not continue and -only some tasks of the plan were completed. The rest is aborted. The exception -will be propagated. -

BIND10_CONFIGURATOR_RECONFIGURE reconfiguring running components

-A different configuration of which components should be running is being -installed. All components that are no longer needed will be stopped and -newly introduced ones started. This happens at startup, when the configuration -is read the first time, or when an operator changes configuration of the boss. -

BIND10_CONFIGURATOR_RUN running plan of %1 tasks

-A debug message. The configurator is about to execute a plan of actions it -computed previously. -

BIND10_CONFIGURATOR_START bind10 component configurator is starting up

-The part that cares about starting and stopping the right component from the -boss process is starting up. This happens only once at the startup of the -boss process. It will start the basic set of processes now (the ones boss -needs to read the configuration), the rest will be started after the -configuration is known. -

BIND10_CONFIGURATOR_STOP bind10 component configurator is shutting down

-The part that cares about starting and stopping processes in the boss is -shutting down. All started components will be shut down now (more precisely, -asked to terminate by their own, if they fail to comply, other parts of -the boss process will try to force them). -

BIND10_CONFIGURATOR_TASK performing task %1 on %2

-A debug message. The configurator is about to perform one task of the plan it -is currently executing on the named component. -

BIND10_INVALID_STATISTICS_DATA invalid specification of statistics data specified

-An error was encountered when the boss module specified -statistics data which is invalid for the boss specification file. -

BIND10_INVALID_USER invalid user: %1

-The boss process was started with the -u option, to drop root privileges -and continue running as the specified user, but the user is unknown. -

BIND10_KILLING_ALL_PROCESSES killing all started processes

-The boss module was not able to start every process it needed to start -during startup, and will now kill the processes that did get started. -

BIND10_KILL_PROCESS killing process %1

-The boss module is sending a kill signal to process with the given name, -as part of the process of killing all started processes during a failed -startup, as described for BIND10_KILLING_ALL_PROCESSES -

BIND10_LOST_SOCKET_CONSUMER consumer %1 of sockets disconnected, considering all its sockets closed

-A connection from one of the applications which requested a socket was -closed. This means the application has terminated, so all the sockets it was -using are now closed and bind10 process can release them as well, unless the -same sockets are used by yet another application. -

BIND10_MSGQ_ALREADY_RUNNING msgq daemon already running, cannot start

-There already appears to be a message bus daemon running. Either an -old process was not shut down correctly, and needs to be killed, or -another instance of BIND10, with the same msgq domain socket, is -running, which needs to be stopped. -

BIND10_MSGQ_DISAPPEARED msgq channel disappeared

-While listening on the message bus channel for messages, it suddenly -disappeared. The msgq daemon may have died. This might lead to an -inconsistent state of the system, and BIND 10 will now shut down. -

BIND10_NO_SOCKET couldn't send a socket for token %1 because of error: %2

-An error occurred when the bind10 process was asked to send a socket file -descriptor. The error is mentioned, most common reason is that the request -is invalid and may not come from bind10 process at all. -

BIND10_PROCESS_ENDED process %2 of %1 ended with status %3

-This indicates a process started previously terminated. The process id -and component owning the process are indicated, as well as the exit code. -This doesn't distinguish if the process was supposed to terminate or not. -

BIND10_READING_BOSS_CONFIGURATION reading boss configuration

-The boss process is starting up, and will now process the initial -configuration, as received from the configuration manager. -

BIND10_RECEIVED_COMMAND received command: %1

-The boss module received a command and shall now process it. The command -is printed. -

BIND10_RECEIVED_NEW_CONFIGURATION received new configuration: %1

-The boss module received a configuration update and is going to apply -it now. The new configuration is printed. -

BIND10_RECEIVED_SIGNAL received signal %1

-The boss module received the given signal. -

BIND10_RESURRECTED_PROCESS resurrected %1 (PID %2)

-The given process has been restarted successfully, and is now running -with the given process id. -

BIND10_RESURRECTING_PROCESS resurrecting dead %1 process...

-The given process has ended unexpectedly, and is now restarted. -

BIND10_SELECT_ERROR error in select() call: %1

-There was a fatal error in the call to select(), used to see if a child -process has ended or if there is a message on the message bus. This -should not happen under normal circumstances and is considered fatal, -so BIND 10 will now shut down. The specific error is printed. -

BIND10_SEND_SIGKILL sending SIGKILL to %1 (PID %2)

-The boss module is sending a SIGKILL signal to the given process. -

BIND10_SEND_SIGTERM sending SIGTERM to %1 (PID %2)

-The boss module is sending a SIGTERM signal to the given process. -

BIND10_SETGID setting GID to %1

-The boss switches the process group ID to the given value. This happens -when BIND 10 starts with the -u option, and the group ID will be set to -that of the specified user. -

BIND10_SETUID setting UID to %1

-The boss switches the user it runs as to the given UID. -

BIND10_SHUTDOWN stopping the server

-The boss process received a command or signal telling it to shut down. -It will send a shutdown command to each process. The processes that do -not shut down will then receive a SIGTERM signal. If that doesn't work, -it shall send SIGKILL signals to the processes still alive. -

BIND10_SHUTDOWN_COMPLETE all processes ended, shutdown complete

-All child processes have been stopped, and the boss process will now -stop itself. -

BIND10_SOCKCREATOR_BAD_CAUSE unknown error cause from socket creator: %1

-The socket creator reported an error when creating a socket. But the function -which failed is unknown (not one of 'S' for socket or 'B' for bind). -

BIND10_SOCKCREATOR_BAD_RESPONSE unknown response for socket request: %1

-The boss requested a socket from the creator, but the answer is unknown. This -looks like a programmer error. -

BIND10_SOCKCREATOR_EOF eof while expecting data from socket creator

-There should be more data from the socket creator, but it closed the socket. -It probably crashed. -

BIND10_SOCKCREATOR_INIT initializing socket creator parser

-The boss module initializes routines for parsing the socket creator -protocol. -

BIND10_SOCKCREATOR_KILL killing the socket creator

-The socket creator is being terminated the aggressive way, by sending it -sigkill. This should not happen usually. -

BIND10_SOCKCREATOR_TERMINATE terminating socket creator

-The boss module sends a request to terminate to the socket creator. -

BIND10_SOCKCREATOR_TRANSPORT_ERROR transport error when talking to the socket creator: %1

-Either sending or receiving data from the socket creator failed with the given -error. The creator probably crashed or some serious OS-level problem happened, -as the communication happens only on local host. -

BIND10_SOCKET_CREATED successfully created socket %1

-The socket creator successfully created and sent a requested socket, it has -the given file number. -

BIND10_SOCKET_ERROR error on %1 call in the creator: %2/%3

-The socket creator failed to create the requested socket. It failed on the -indicated OS API function with given error. -

BIND10_SOCKET_GET requesting socket [%1]:%2 of type %3 from the creator

-The boss forwards a request for a socket to the socket creator. -

BIND10_STARTED_CC started configuration/command session

-Debug message given when BIND 10 has successfull started the object that -handles configuration and commands. -

BIND10_STARTED_PROCESS started %1

-The given process has successfully been started. -

BIND10_STARTED_PROCESS_PID started %1 (PID %2)

-The given process has successfully been started, and has the given PID. -

BIND10_STARTING starting BIND10: %1

-Informational message on startup that shows the full version. -

BIND10_STARTING_CC starting configuration/command session

-Informational message given when BIND 10 is starting the session object -that handles configuration and commands. -

BIND10_STARTING_PROCESS starting process %1

-The boss module is starting the given process. -

BIND10_STARTING_PROCESS_PORT starting process %1 (to listen on port %2)

-The boss module is starting the given process, which will listen on the -given port number. -

BIND10_STARTING_PROCESS_PORT_ADDRESS starting process %1 (to listen on %2#%3)

-The boss module is starting the given process, which will listen on the -given address and port number (written as <address>#<port>). -

BIND10_STARTUP_COMPLETE BIND 10 started

-All modules have been successfully started, and BIND 10 is now running. -

BIND10_STARTUP_ERROR error during startup: %1

-There was a fatal error when BIND10 was trying to start. The error is -shown, and BIND10 will now shut down. -

BIND10_STARTUP_UNEXPECTED_MESSAGE unrecognised startup message %1

-During the startup process, a number of messages are exchanged between the -Boss process and the processes it starts. This error is output when a -message received by the Boss process is recognised as being of the -correct format but is unexpected. It may be that processes are starting -of sequence. -

BIND10_STARTUP_UNRECOGNISED_MESSAGE unrecognised startup message %1

-During the startup process, a number of messages are exchanged between the -Boss process and the processes it starts. This error is output when a -message received by the Boss process is not recognised. -

BIND10_START_AS_NON_ROOT_AUTH starting b10-auth as a user, not root. This might fail.

-The authoritative server is being started or restarted without root privileges. -If the module needs these privileges, it may have problems starting. -Note that this issue should be resolved by the pending 'socket-creator' -process; once that has been implemented, modules should not need root -privileges anymore. See tickets #800 and #801 for more information. -

BIND10_START_AS_NON_ROOT_RESOLVER starting b10-resolver as a user, not root. This might fail.

-The resolver is being started or restarted without root privileges. -If the module needs these privileges, it may have problems starting. -Note that this issue should be resolved by the pending 'socket-creator' -process; once that has been implemented, modules should not need root -privileges anymore. See tickets #800 and #801 for more information. -

BIND10_STOP_PROCESS asking %1 to shut down

-The boss module is sending a shutdown command to the given module over -the message channel. -

BIND10_UNKNOWN_CHILD_PROCESS_ENDED unknown child pid %1 exited

-An unknown child process has exited. The PID is printed, but no further -action will be taken by the boss process. -

BIND10_WAIT_CFGMGR waiting for configuration manager process to initialize

-The configuration manager process is so critical to operation of BIND 10 -that after starting it, the Boss module will wait for it to initialize -itself before continuing. This debug message is produced during the -wait and may be output zero or more times depending on how long it takes -the configuration manager to start up. The total length of time Boss -will wait for the configuration manager before reporting an error is -set with the command line --wait switch, which has a default value of -ten seconds. -

CACHE_ENTRY_MISSING_RRSET missing RRset to generate message for %1

-The cache tried to generate the complete answer message. It knows the structure -of the message, but some of the RRsets to be put there are not in cache (they -probably expired already). Therefore it pretends the message was not found. -

CACHE_LOCALZONE_FOUND found entry with key %1 in local zone data

-Debug message, noting that the requested data was successfully found in the -local zone data of the cache. -

CACHE_LOCALZONE_UNKNOWN entry with key %1 not found in local zone data

-Debug message. The requested data was not found in the local zone data. -

CACHE_LOCALZONE_UPDATE updating local zone element at key %1

-Debug message issued when there's update to the local zone section of cache. -

CACHE_MESSAGES_DEINIT deinitialized message cache

-Debug message. It is issued when the server deinitializes the message cache. -

CACHE_MESSAGES_EXPIRED found an expired message entry for %1 in the message cache

-Debug message. The requested data was found in the message cache, but it -already expired. Therefore the cache removes the entry and pretends it found -nothing. -

CACHE_MESSAGES_FOUND found a message entry for %1 in the message cache

-Debug message. We found the whole message in the cache, so it can be returned -to user without any other lookups. -

CACHE_MESSAGES_INIT initialized message cache for %1 messages of class %2

-Debug message issued when a new message cache is issued. It lists the class -of messages it can hold and the maximum size of the cache. -

CACHE_MESSAGES_REMOVE removing old instance of %1/%2/%3 first

-Debug message. This may follow CACHE_MESSAGES_UPDATE and indicates that, while -updating, the old instance is being removed prior of inserting a new one. -

CACHE_MESSAGES_UNCACHEABLE not inserting uncacheable message %1/%2/%3

-Debug message, noting that the given message can not be cached. This is because -there's no SOA record in the message. See RFC 2308 section 5 for more -information. -

CACHE_MESSAGES_UNKNOWN no entry for %1 found in the message cache

-Debug message. The message cache didn't find any entry for the given key. -

CACHE_MESSAGES_UPDATE updating message entry %1/%2/%3

-Debug message issued when the message cache is being updated with a new -message. Either the old instance is removed or, if none is found, new one -is created. -

CACHE_RESOLVER_DEEPEST looking up deepest NS for %1/%2

-Debug message. The resolver cache is looking up the deepest known nameserver, -so the resolution doesn't have to start from the root. -

CACHE_RESOLVER_INIT initializing resolver cache for class %1

-Debug message. The resolver cache is being created for this given class. -

CACHE_RESOLVER_INIT_INFO initializing resolver cache for class %1

-Debug message, the resolver cache is being created for this given class. The -difference from CACHE_RESOLVER_INIT is only in different format of passed -information, otherwise it does the same. -

CACHE_RESOLVER_LOCAL_MSG message for %1/%2 found in local zone data

-Debug message. The resolver cache found a complete message for the user query -in the zone data. -

CACHE_RESOLVER_LOCAL_RRSET RRset for %1/%2 found in local zone data

-Debug message. The resolver cache found a requested RRset in the local zone -data. -

CACHE_RESOLVER_LOOKUP_MSG looking up message in resolver cache for %1/%2

-Debug message. The resolver cache is trying to find a message to answer the -user query. -

CACHE_RESOLVER_LOOKUP_RRSET looking up RRset in resolver cache for %1/%2

-Debug message. The resolver cache is trying to find an RRset (which usually -originates as internally from resolver). -

CACHE_RESOLVER_NO_QUESTION answer message for %1/%2 has empty question section

-The cache tried to fill in found data into the response message. But it -discovered the message contains no question section, which is invalid. -This is likely a programmer error, please submit a bug report. -

CACHE_RESOLVER_UNKNOWN_CLASS_MSG no cache for class %1

-Debug message. While trying to lookup a message in the resolver cache, it was -discovered there's no cache for this class at all. Therefore no message is -found. -

CACHE_RESOLVER_UNKNOWN_CLASS_RRSET no cache for class %1

-Debug message. While trying to lookup an RRset in the resolver cache, it was -discovered there's no cache for this class at all. Therefore no data is found. -

CACHE_RESOLVER_UPDATE_MSG updating message for %1/%2/%3

-Debug message. The resolver is updating a message in the cache. -

CACHE_RESOLVER_UPDATE_RRSET updating RRset for %1/%2/%3

-Debug message. The resolver is updating an RRset in the cache. -

CACHE_RESOLVER_UPDATE_UNKNOWN_CLASS_MSG no cache for class %1

-Debug message. While trying to insert a message into the cache, it was -discovered that there's no cache for the class of message. Therefore -the message will not be cached. -

CACHE_RESOLVER_UPDATE_UNKNOWN_CLASS_RRSET no cache for class %1

-Debug message. While trying to insert an RRset into the cache, it was -discovered that there's no cache for the class of the RRset. Therefore -the message will not be cached. -

CACHE_RRSET_EXPIRED found expired RRset %1/%2/%3

-Debug message. The requested data was found in the RRset cache. However, it is -expired, so the cache removed it and is going to pretend nothing was found. -

CACHE_RRSET_INIT initializing RRset cache for %1 RRsets of class %2

-Debug message. The RRset cache to hold at most this many RRsets for the given -class is being created. -

CACHE_RRSET_LOOKUP looking up %1/%2/%3 in RRset cache

-Debug message. The resolver is trying to look up data in the RRset cache. -

CACHE_RRSET_NOT_FOUND no RRset found for %1/%2/%3 in cache

-Debug message which can follow CACHE_RRSET_LOOKUP. This means the data is not -in the cache. -

CACHE_RRSET_REMOVE_OLD removing old RRset for %1/%2/%3 to make space for new one

-Debug message which can follow CACHE_RRSET_UPDATE. During the update, the cache -removed an old instance of the RRset to replace it with the new one. -

CACHE_RRSET_UNTRUSTED not replacing old RRset for %1/%2/%3, it has higher trust level

-Debug message which can follow CACHE_RRSET_UPDATE. The cache already holds the -same RRset, but from more trusted source, so the old one is kept and new one -ignored. -

CACHE_RRSET_UPDATE updating RRset %1/%2/%3 in the cache

-Debug message. The RRset is updating its data with this given RRset. -

CC_ASYNC_READ_FAILED asynchronous read failed (error code = %1)

-This marks a low level error, we tried to read data from the message queue -daemon asynchronously, but the ASIO library returned an error. -

CC_CONN_ERROR error connecting to message queue (%1)

-It is impossible to reach the message queue daemon for the reason given. It -is unlikely there'll be reason for whatever program this currently is to -continue running, as the communication with the rest of BIND 10 is vital -for the components. -

CC_DISCONNECT disconnecting from message queue daemon

-The library is disconnecting from the message queue daemon. This debug message -indicates that the program is trying to shut down gracefully. -

CC_ESTABLISH trying to establish connection with message queue daemon at %1

-This debug message indicates that the command channel library is about to -connect to the message queue daemon, which should be listening on the UNIX-domain -socket listed in the output. -

CC_ESTABLISHED successfully connected to message queue daemon

-This debug message indicates that the connection was successfully made, this -should follow CC_ESTABLISH. -

CC_GROUP_RECEIVE trying to receive a message

-Debug message, noting that a message is expected to come over the command -channel. -

CC_GROUP_RECEIVED message arrived ('%1', '%2')

-Debug message, noting that we successfully received a message (its envelope and -payload listed). This follows CC_GROUP_RECEIVE, but might happen some time -later, depending if we waited for it or just polled. -

CC_GROUP_SEND sending message '%1' to group '%2'

-Debug message, we're about to send a message over the command channel. -

CC_INVALID_LENGTHS invalid length parameters (%1, %2)

-This happens when garbage comes over the command channel or some kind of -confusion happens in the program. The data received from the socket make no -sense if we interpret it as lengths of message. The first one is total length -of the message; the second is the length of the header. The header -and its length (2 bytes) is counted in the total length. -

CC_LENGTH_NOT_READY length not ready

-There should be data representing the length of message on the socket, but it -is not there. -

CC_NO_MESSAGE no message ready to be received yet

-The program polled for incoming messages, but there was no message waiting. -This is a debug message which may happen only after CC_GROUP_RECEIVE. -

CC_NO_MSGQ unable to connect to message queue (%1)

-It isn't possible to connect to the message queue daemon, for reason listed. -It is unlikely any program will be able continue without the communication. -

CC_READ_ERROR error reading data from command channel (%1)

-A low level error happened when the library tried to read data from the -command channel socket. The reason is listed. -

CC_READ_EXCEPTION error reading data from command channel (%1)

-We received an exception while trying to read data from the command -channel socket. The reason is listed. -

CC_REPLY replying to message from '%1' with '%2'

-Debug message, noting we're sending a response to the original message -with the given envelope. -

CC_SET_TIMEOUT setting timeout to %1ms

-Debug message. A timeout for which the program is willing to wait for a reply -is being set. -

CC_START_READ starting asynchronous read

-Debug message. From now on, when a message (or command) comes, it'll wake the -program and the library will automatically pass it over to correct place. -

CC_SUBSCRIBE subscribing to communication group %1

-Debug message. The program wants to receive messages addressed to this group. -

CC_TIMEOUT timeout reading data from command channel

-The program waited too long for data from the command channel (usually when it -sent a query to different program and it didn't answer for whatever reason). -

CC_UNSUBSCRIBE unsubscribing from communication group %1

-Debug message. The program no longer wants to receive messages addressed to -this group. -

CC_WRITE_ERROR error writing data to command channel (%1)

-A low level error happened when the library tried to write data to the command -channel socket. -

CC_ZERO_LENGTH invalid message length (0)

-The library received a message length being zero, which makes no sense, since -all messages must contain at least the envelope. -

CFGMGR_AUTOMATIC_CONFIG_DATABASE_UPDATE Updating configuration database from version %1 to %2

-An older version of the configuration database has been found, from which -there was an automatic upgrade path to the current version. These changes -are now applied, and no action from the administrator is necessary. -

CFGMGR_BACKED_UP_CONFIG_FILE Config file %1 was removed; a backup was made at %2

-BIND 10 has been started with the command to clear the configuration -file. The existing file has been backed up (moved) to the given file -name. A new configuration file will be created in the original location -when necessary. -

CFGMGR_BAD_UPDATE_RESPONSE_FROM_MODULE Unable to parse response from module %1: %2

-The configuration manager sent a configuration update to a module, but -the module responded with an answer that could not be parsed. The answer -message appears to be invalid JSON data, or not decodable to a string. -This is likely to be a problem in the module in question. The update is -assumed to have failed, and will not be stored. -

CFGMGR_CC_SESSION_ERROR Error connecting to command channel: %1

-The configuration manager daemon was unable to connect to the messaging -system. The most likely cause is that msgq is not running. -

CFGMGR_CONFIG_FILE Configuration manager starting with configuration file: %1

-The configuration manager is starting, reading and saving the configuration -settings to the shown file. -

CFGMGR_DATA_READ_ERROR error reading configuration database from disk: %1

-There was a problem reading the persistent configuration data as stored -on disk. The file may be corrupted, or it is of a version from where -there is no automatic upgrade path. The file needs to be repaired or -removed. The configuration manager daemon will now shut down. -

CFGMGR_IOERROR_WHILE_WRITING_CONFIGURATION Unable to write configuration file; configuration not stored: %1

-There was an IO error from the system while the configuration manager -was trying to write the configuration database to disk. The specific -error is given. The most likely cause is that the directory where -the file is stored does not exist, or is not writable. The updated -configuration is not stored. -

CFGMGR_OSERROR_WHILE_WRITING_CONFIGURATION Unable to write configuration file; configuration not stored: %1

-There was an OS error from the system while the configuration manager -was trying to write the configuration database to disk. The specific -error is given. The most likely cause is that the system does not have -write access to the configuration database file. The updated -configuration is not stored. -

CFGMGR_STOPPED_BY_KEYBOARD keyboard interrupt, shutting down

-There was a keyboard interrupt signal to stop the cfgmgr daemon. The -daemon will now shut down. -

CMDCTL_BAD_CONFIG_DATA error in config data: %1

-There was an error reading the updated configuration data. The specific -error is printed. -

CMDCTL_BAD_PASSWORD bad password for user: %1

-A login attempt was made to b10-cmdctl, but the password was wrong. -Users can be managed with the tool b10-cmdctl-usermgr. -

CMDCTL_CC_SESSION_ERROR error reading from cc channel: %1

-There was a problem reading from the command and control channel. The -most likely cause is that the message bus daemon is not running. -

CMDCTL_CC_SESSION_TIMEOUT timeout on cc channel

-A timeout occurred when waiting for essential data from the cc session. -This usually occurs when b10-cfgmgr is not running or not responding. -Since we are waiting for essential information, this is a fatal error, -and the cmdctl daemon will now shut down. -

CMDCTL_COMMAND_ERROR error in command %1 to module %2: %3

-An error was encountered sending the given command to the given module. -Either there was a communication problem with the module, or the module -was not able to process the command, and sent back an error. The -specific error is printed in the message. -

CMDCTL_COMMAND_SENT command '%1' to module '%2' was sent

-This debug message indicates that the given command has been sent to -the given module. -

CMDCTL_NO_SUCH_USER username not found in user database: %1

-A login attempt was made to b10-cmdctl, but the username was not known. -Users can be added with the tool b10-cmdctl-usermgr. -

CMDCTL_NO_USER_ENTRIES_READ failed to read user information, all users will be denied

-The b10-cmdctl daemon was unable to find any user data in the user -database file. Either it was unable to read the file (in which case -this message follows a message CMDCTL_USER_DATABASE_READ_ERROR -containing a specific error), or the file was empty. Users can be added -with the tool b10-cmdctl-usermgr. -

CMDCTL_SEND_COMMAND sending command %1 to module %2

-This debug message indicates that the given command is being sent to -the given module. -

CMDCTL_SSL_SETUP_FAILURE_USER_DENIED failed to create an SSL connection (user denied): %1

-The user was denied because the SSL connection could not successfully -be set up. The specific error is given in the log message. Possible -causes may be that the ssl request itself was bad, or the local key or -certificate file could not be read. -

CMDCTL_STARTED cmdctl is listening for connections on %1:%2

-The cmdctl daemon has started and is now listening for connections. -

CMDCTL_STOPPED_BY_KEYBOARD keyboard interrupt, shutting down

-There was a keyboard interrupt signal to stop the cmdctl daemon. The -daemon will now shut down. -

CMDCTL_UNCAUGHT_EXCEPTION uncaught exception: %1

-The b10-cmdctl daemon encountered an uncaught exception and -will now shut down. This is indicative of a programming error and -should not happen under normal circumstances. The exception message -is printed. -

CMDCTL_USER_DATABASE_READ_ERROR failed to read user database file %1: %2

-The b10-cmdctl daemon was unable to read the user database file. The -file may be unreadable for the daemon, or it may be corrupted. In the -latter case, it can be recreated with b10-cmdctl-usermgr. The specific -error is printed in the log message. -

CONFIG_CCSESSION_MSG error in CC session message: %1

-There was a problem with an incoming message on the command and control -channel. The message does not appear to be a valid command, and is -missing a required element or contains an unknown data format. This -most likely means that another BIND10 module is sending a bad message. -The message itself is ignored by this module. -

CONFIG_CCSESSION_MSG_INTERNAL error handling CC session message: %1

-There was an internal problem handling an incoming message on the command -and control channel. An unexpected exception was thrown, details of -which are appended to the message. The module will continue to run, -but will not send back an answer. -

-The most likely cause of this error is a programming error. Please raise -a bug report. -

CONFIG_CCSESSION_STOPPING error sending stopping message: %1

-There was a problem when sending a message signaling that the module using -this CCSession is stopping. This message is sent so that the rest of the -system is aware that the module is no longer running. Apart from logging -this message, the error itself is ignored, and the ModuleCCSession is -still stopped. The specific exception message is printed. -

CONFIG_CCSESSION_STOPPING_UNKNOWN unknown error sending stopping message

-Similar to CONFIG_CCSESSION_STOPPING, but in this case the exception that -is seen is not a standard exception, and further information is unknown. -This is a bug. -

CONFIG_GET_FAIL error getting configuration from cfgmgr: %1

-The configuration manager returned an error when this module requested -the configuration. The full error message answer from the configuration -manager is appended to the log error. The most likely cause is that -the module is of a different (command specification) version than the -running configuration manager. -

CONFIG_GET_FAILED error getting configuration from cfgmgr: %1

-The configuration manager returned an error response when the module -requested its configuration. The full error message answer from the -configuration manager is appended to the log error. -

CONFIG_JSON_PARSE JSON parse error in %1: %2

-There was an error parsing the JSON file. The given file does not appear -to be in valid JSON format. Please verify that the filename is correct -and that the contents are valid JSON. -

CONFIG_LOG_CONFIG_ERRORS error(s) in logging configuration: %1

-There was a logging configuration update, but the internal validator -for logging configuration found that it contained errors. The errors -are shown, and the update is ignored. -

CONFIG_LOG_EXPLICIT will use logging configuration for explicitly-named logger %1

-This is a debug message. When processing the "loggers" part of the -configuration file, the configuration library found an entry for the named -logger that matches the logger specification for the program. The logging -configuration for the program will be updated with the information. -

CONFIG_LOG_IGNORE_EXPLICIT ignoring logging configuration for explicitly-named logger %1

-This is a debug message. When processing the "loggers" part of the -configuration file, the configuration library found an entry for the -named logger. As this does not match the logger specification for the -program, it has been ignored. -

CONFIG_LOG_IGNORE_WILD ignoring logging configuration for wildcard logger %1

-This is a debug message. When processing the "loggers" part of the -configuration file, the configuration library found the named wildcard -entry (one containing the "*" character) that matched a logger already -matched by an explicitly named entry. The configuration is ignored. -

CONFIG_LOG_WILD_MATCH will use logging configuration for wildcard logger %1

-This is a debug message. When processing the "loggers" part of -the configuration file, the configuration library found the named -wildcard entry (one containing the "*" character) that matches a logger -specification in the program. The logging configuration for the program -will be updated with the information. -

CONFIG_MOD_SPEC_FORMAT module specification error in %1: %2

-The given file does not appear to be a valid specification file: details -are included in the message. Please verify that the filename is correct -and that its contents are a valid BIND10 module specification. -

CONFIG_MOD_SPEC_REJECT module specification rejected by cfgmgr: %1

-The specification file for this module was rejected by the configuration -manager. The full error message answer from the configuration manager is -appended to the log error. The most likely cause is that the module is of -a different (specification file) version than the running configuration -manager. -

CONFIG_OPEN_FAIL error opening %1: %2

-There was an error opening the given file. The reason for the failure -is included in the message. -

CONFIG_SESSION_STOPPING_FAILED error sending stopping message: %1

-There was a problem when sending a message signaling that the module using -this CCSession is stopping. This message is sent so that the rest of the -system is aware that the module is no longer running. Apart from logging -this message, the error itself is ignored, and the ModuleCCSession is -still stopped. The specific exception message is printed. -

DATASRC_BAD_NSEC3_NAME NSEC3 record has a bad owner name '%1'

-The software refuses to load NSEC3 records into a wildcard domain or -the owner name has two or more labels below the zone origin. -It isn't explicitly forbidden, but no sane zone wouldn have such names -for NSEC3. BIND 9 also refuses NSEC3 at wildcard, so this behavior is -compatible with BIND 9. -

DATASRC_CACHE_CREATE creating the hotspot cache

-This is a debug message issued during startup when the hotspot cache -is created. -

DATASRC_CACHE_DESTROY destroying the hotspot cache

-Debug information. The hotspot cache is being destroyed. -

DATASRC_CACHE_DISABLE disabling the hotspot cache

-A debug message issued when the hotspot cache is disabled. -

DATASRC_CACHE_ENABLE enabling the hotspot cache

-A debug message issued when the hotspot cache is enabled. -

DATASRC_CACHE_EXPIRED item '%1' in the hotspot cache has expired

-A debug message issued when a hotspot cache lookup located the item but it -had expired. The item was removed and the program proceeded as if the item -had not been found. -

DATASRC_CACHE_FOUND the item '%1' was found

-Debug information. An item was successfully located in the hotspot cache. -

DATASRC_CACHE_FULL hotspot cache is full, dropping oldest

-Debug information. After inserting an item into the hotspot cache, the -maximum number of items was exceeded, so the least recently used item will -be dropped. This should be directly followed by CACHE_REMOVE. -

DATASRC_CACHE_INSERT inserting item '%1' into the hotspot cache

-A debug message indicating that a new item is being inserted into the hotspot -cache. -

DATASRC_CACHE_NOT_FOUND the item '%1' was not found in the hotspot cache

-A debug message issued when hotspot cache was searched for the specified -item but it was not found. -

DATASRC_CACHE_OLD_FOUND older instance of hotspot cache item '%1' found, replacing

-Debug information. While inserting an item into the hotspot cache, an older -instance of an item with the same name was found; the old instance will be -removed. This will be directly followed by CACHE_REMOVE. -

DATASRC_CACHE_REMOVE removing '%1' from the hotspot cache

-Debug information. An item is being removed from the hotspot cache. -

DATASRC_CACHE_SLOTS setting the hotspot cache size to '%1', dropping '%2' items

-The maximum allowed number of items of the hotspot cache is set to the given -number. If there are too many, some of them will be dropped. The size of 0 -means no limit. -

DATASRC_DATABASE_COVER_NSEC_UNSUPPORTED %1 doesn't support DNSSEC when asked for NSEC data covering %2

-The datasource tried to provide an NSEC proof that the named domain does not -exist, but the database backend doesn't support DNSSEC. No proof is included -in the answer as a result. -

DATASRC_DATABASE_FINDNSEC3 Looking for NSEC3 for %1 in %2 mode

-Debug information. A search in an database data source for NSEC3 that -matches or covers the given name is being started. -

DATASRC_DATABASE_FINDNSEC3_COVER found a covering NSEC3 for %1 at label count %2: %3

-Debug information. An NSEC3 that covers the given name is found and -being returned. The found NSEC3 RRset is also displayed. When the shown label -count is smaller than that of the given name, the matching NSEC3 is for a -superdomain of the given name (see DATASRC_DATABSE_FINDNSEC3_TRYHASH). The -found NSEC3 RRset is also displayed. -

DATASRC_DATABASE_FINDNSEC3_MATCH found a matching NSEC3 for %1 at label count %2: %3

-Debug information. An NSEC3 that matches (a possibly superdomain of) -the given name is found and being returned. When the shown label -count is smaller than that of the given name, the matching NSEC3 is -for a superdomain of the given name (see DATASRC_DATABSE_FINDNSEC3_TRYHASH). -The found NSEC3 RRset is also displayed. -

DATASRC_DATABASE_FINDNSEC3_TRYHASH looking for NSEC3 for %1 at label count %2 (hash %3)

-Debug information. In an attempt of finding an NSEC3 for the give name, -(a possibly superdomain of) the name is hashed and searched for in the -NSEC3 name space. When the shown label count is smaller than that of the -shown name, the search tries the superdomain name that share the shown -(higher) label count of the shown name (e.g., for -www.example.com. with shown label count of 3, example.com. is being -tried, as "." is 1 label long). -

DATASRC_DATABASE_FINDNSEC3_TRYHASH_PREV looking for previous NSEC3 for %1 at label count %2 (hash %3)

-Debug information. An exact match on hash (see -DATASRC_DATABASE_FINDNSEC3_TRYHASH) was unsuccessful. We get the previous hash -to that one instead. -

DATASRC_DATABASE_FIND_RECORDS looking in datasource %1 for record %2/%3/%4

-Debug information. The database data source is looking up records with the given -name and type in the database. -

DATASRC_DATABASE_FIND_TTL_MISMATCH TTL values differ in %1 for elements of %2/%3/%4, setting to %5

-The datasource backend provided resource records for the given RRset with -different TTL values. This isn't allowed on the wire and is considered -an error, so we set it to the lowest value we found (but we don't modify the -database). The data in database should be checked and fixed. -

DATASRC_DATABASE_FOUND_ANY search in datasource %1 resulted in returning all records of %2

-The data returned by the database backend contained data for the given domain -name, so all the RRsets of the domain are returned. -

DATASRC_DATABASE_FOUND_CNAME search in datasource %1 for %2/%3/%4 found CNAME, resulting in %5

-When searching the domain for a name a CNAME was found at that name. -Even though it was not the RR type being sought, it is returned. (The -caller may want to continue the lookup by replacing the query name with -the canonical name and restarting the query with the original RR type.) -

DATASRC_DATABASE_FOUND_DELEGATION Found delegation at %2 in %1

-When searching for a domain, the program met a delegation to a different zone -at the given domain name. It will return that one instead. -

DATASRC_DATABASE_FOUND_DELEGATION_EXACT search in datasource %1 for %2/%3/%4 found delegation at %5

-The program found the domain requested, but it is a delegation point to a -different zone, therefore it is not authoritative for this domain name. -It will return the NS record instead. -

DATASRC_DATABASE_FOUND_DNAME Found DNAME at %2 in %1

-When searching for a domain, the program met a DNAME redirection to a different -place in the domain space at the given domain name. It will return that one -instead. -

DATASRC_DATABASE_FOUND_EMPTY_NONTERMINAL empty non-terminal %2 in %1

-The domain name does not have any RRs associated with it, so it doesn't -exist in the database. However, it has a subdomain, so it does exist -in the DNS address space. This type of domain is known an an "empty -non-terminal" and so we return NXRRSET instead of NXDOMAIN. -

DATASRC_DATABASE_FOUND_NXDOMAIN search in datasource %1 resulted in NXDOMAIN for %2/%3/%4

-The data returned by the database backend did not contain any data for the given -domain name, class and type. -

DATASRC_DATABASE_FOUND_NXRRSET search in datasource %1 for %2/%3/%4 resulted in NXRRSET

-The data returned by the database backend contained data for the given domain -name and class, but not for the given type. -

DATASRC_DATABASE_FOUND_NXRRSET_NSEC search in datasource %1 for %2/%3/%4 resulted in RRset %5

-A search in the database for RRs for the specified name, type and class has -located RRs that match the name and class but not the type. DNSSEC information -has been requested and returned. -

DATASRC_DATABASE_FOUND_RRSET search in datasource %1 resulted in RRset %2

-The data returned by the database backend contained data for the given domain -name, and it either matches the type or has a relevant type. The RRset that is -returned is printed. -

DATASRC_DATABASE_ITERATE iterating zone %1

-The program is reading the whole zone, eg. not searching for data, but going -through each of the RRsets there. -

DATASRC_DATABASE_ITERATE_END iterating zone finished

-While iterating through the zone, the program reached end of the data. -

DATASRC_DATABASE_ITERATE_NEXT next RRset in zone is %1/%2

-While iterating through the zone, the program extracted next RRset from it. -The name and RRtype of the RRset is indicated in the message. -

DATASRC_DATABASE_ITERATE_TTL_MISMATCH TTL values differ for RRs of %1/%2/%3, setting to %4

-While iterating through the zone, the time to live for RRs of the -given RRset were found to be different. Since an RRset cannot have -multiple TTLs, we set it to the lowest value we found (but we don't -modify the database). This is what the client would do when such RRs -were given in a DNS response according to RFC2181. The data in -database should be checked and fixed. -

DATASRC_DATABASE_JOURNALREADER_END %1/%2 on %3 from %4 to %5

-This is a debug message indicating that the program (successfully) -reaches the end of sequences of a zone's differences. The zone's name -and class, database name, and the start and end serials are shown in -the message. -

DATASRC_DATABASE_JOURNALREADER_NEXT %1/%2 in %3/%4 on %5

-This is a debug message indicating that the program retrieves one -difference in difference sequences of a zone and successfully converts -it to an RRset. The zone's name and class, database name, and the -name and RR type of the retrieved diff are shown in the message. -

DATASRC_DATABASE_JOURNALREADER_START %1/%2 on %3 from %4 to %5

-This is a debug message indicating that the program starts reading -a zone's difference sequences from a database-based data source. The -zone's name and class, database name, and the start and end serials -are shown in the message. -

DATASRC_DATABASE_JOURNALREADR_BADDATA failed to convert a diff to RRset in %1/%2 on %3 between %4 and %5: %6

-This is an error message indicating that a zone's diff is broken and -the data source library failed to convert it to a valid RRset. The -most likely cause of this is that someone has manually modified the -zone's diff in the database and inserted invalid data as a result. -The zone's name and class, database name, and the start and end -serials, and an additional detail of the error are shown in the -message. The administrator should examine the diff in the database -to find any invalid data and fix it. -

DATASRC_DATABASE_NO_MATCH not match for %2/%3/%4 in %1

-No match (not even a wildcard) was found in the named data source for the given -name/type/class in the data source. -

DATASRC_DATABASE_UPDATER_COMMIT updates committed for '%1/%2' on %3

-Debug information. A set of updates to a zone has been successfully -committed to the corresponding database backend. The zone name, -its class and the database name are printed. -

DATASRC_DATABASE_UPDATER_CREATED zone updater created for '%1/%2' on %3

-Debug information. A zone updater object is created to make updates to -the shown zone on the shown backend database. -

DATASRC_DATABASE_UPDATER_DESTROYED zone updater destroyed for '%1/%2' on %3

-Debug information. A zone updater object is destroyed, either successfully -or after failure of, making updates to the shown zone on the shown backend -database. -

DATASRC_DATABASE_UPDATER_ROLLBACK zone updates roll-backed for '%1/%2' on %3

-A zone updater is being destroyed without committing the changes. -This would typically mean the update attempt was aborted due to some -error, but may also be a bug of the application that forgets committing -the changes. The intermediate changes made through the updater won't -be applied to the underlying database. The zone name, its class, and -the underlying database name are shown in the log message. -

DATASRC_DATABASE_UPDATER_ROLLBACKFAIL failed to roll back zone updates for '%1/%2' on %3: %4

-A zone updater is being destroyed without committing the changes to -the database, and attempts to rollback incomplete updates, but it -unexpectedly fails. The higher level implementation does not expect -it to fail, so this means either a serious operational error in the -underlying data source (such as a system failure of a database) or -software bug in the underlying data source implementation. In either -case if this message is logged the administrator should carefully -examine the underlying data source to see what exactly happens and -whether the data is still valid. The zone name, its class, and the -underlying database name as well as the error message thrown from the -database module are shown in the log message. -

DATASRC_DATABASE_WILDCARD_ANY search in datasource %1 resulted in wildcard match type ANY on %2

-The database doesn't contain directly matching name. When searching -for a wildcard match, a wildcard record matching the name of the query -containing some RRsets was found. All the RRsets of the node are returned. -

DATASRC_DATABASE_WILDCARD_CANCEL_NS canceled wildcard match on %3 because %2 contains NS (data source %1)

-The database was queried to provide glue data and it didn't find direct match. -It could create it from given wildcard, but matching wildcards is forbidden -under a zone cut, which was found. Therefore the delegation will be returned -instead. -

DATASRC_DATABASE_WILDCARD_CANCEL_SUB wildcard %2 can't be used to construct %3 because %4 exists in %1

-The answer could be constructed using the wildcard, but the given subdomain -exists, therefore this name is something like empty non-terminal (actually, -from the protocol point of view, it is empty non-terminal, but the code -discovers it differently). -

DATASRC_DATABASE_WILDCARD_CNAME search in datasource %1 for %2/%3/%4 found wildcard CNAME at %5, resulting in %6

-The database doesn't contain directly matching name. When searching -for a wildcard match, a CNAME RR was found at a wildcard record -matching the name. This is returned as the result of the search. -

DATASRC_DATABASE_WILDCARD_EMPTY found subdomains of %2 which is a wildcard match for %3 in %1

-The given wildcard matches the name being sough but it as an empty -nonterminal (e.g. there's nothing at *.example.com but something like -subdomain.*.example.org, do exist: so *.example.org exists in the -namespace but has no RRs assopciated with it). This will produce NXRRSET. -

DATASRC_DATABASE_WILDCARD_MATCH search in datasource %1 resulted in wildcard match at %2 with RRset %3

-The database doesn't contain directly matching name. When searching -for a wildcard match, a wildcard record matching the name and type of -the query was found. The data at this point is returned. -

DATASRC_DATABASE_WILDCARD_NS search in datasource %1 for %2/%3/%4 found wildcard delegation at %5, resulting in %6

-The database doesn't contain directly matching name. When searching -for a wildcard match, an NS RR was found at a wildcard record matching -the name. This is returned as the result of the search. -

DATASRC_DATABASE_WILDCARD_NXRRSET search in datasource %1 for %2/%3/%4 resulted in wildcard NXRRSET at %5

-The database doesn't contain directly matching name. When searching -for a wildcard match, a matching wildcard entry was found but it did -not contain RRs the requested type. AN NXRRSET indication is returned. -

DATASRC_DO_QUERY handling query for '%1/%2'

-A debug message indicating that a query for the given name and RR type is being -processed. -

DATASRC_LIST_NOT_CACHED zone %1/%2 not cached, cache disabled globally. Will not be available.

-The process disabled caching of RR data completely. However, the given zone -is provided as a master file and it can be served from memory cache only. -Therefore, the zone will not be available for this process. If this is -a problem, you should move the zone to some database backend (sqlite3, for -example) and use it from there. -

DATASRC_MEM_ADD_RRSET adding RRset '%1/%2' into zone '%3'

-Debug information. An RRset is being added to the in-memory data source. -

DATASRC_MEM_ADD_WILDCARD adding wildcards for '%1'

-This is a debug message issued during the processing of a wildcard -name. The internal domain name tree is scanned and some nodes are -specially marked to allow the wildcard lookup to succeed. -

DATASRC_MEM_ADD_ZONE adding zone '%1/%2'

-Debug information. A zone is being added into the in-memory data source. -

DATASRC_MEM_ANY_SUCCESS ANY query for '%1' successful

-Debug information. The domain was found and an ANY type query is being answered -by providing everything found inside the domain. -

DATASRC_MEM_CNAME CNAME at the domain '%1'

-Debug information. The requested domain is an alias to a different domain, -returning the CNAME instead. -

DATASRC_MEM_CNAME_COEXIST can't add data to CNAME in domain '%1'

-This is the same problem as in MEM_CNAME_TO_NONEMPTY, but it happened the -other way around -- adding some other data to CNAME. -

DATASRC_MEM_CNAME_TO_NONEMPTY can't add CNAME to domain with other data in '%1'

-Someone or something tried to add a CNAME into a domain that already contains -some other data. But the protocol forbids coexistence of CNAME with anything -(RFC 1034, section 3.6.2). This indicates a problem with provided data. -

DATASRC_MEM_CREATE creating zone '%1' in '%2' class

-Debug information. A representation of a zone for the in-memory data source is -being created. -

DATASRC_MEM_DELEG_FOUND delegation found at '%1'

-Debug information. A delegation point was found above the requested record. -

DATASRC_MEM_DESTROY destroying zone '%1' in '%2' class

-Debug information. A zone from in-memory data source is being destroyed. -

DATASRC_MEM_DNAME_ENCOUNTERED encountered a DNAME

-Debug information. While searching for the requested domain, a DNAME was -encountered on the way. This may lead to redirection to a different domain and -stop the search. -

DATASRC_MEM_DNAME_FOUND DNAME found at '%1'

-Debug information. A DNAME was found instead of the requested information. -

DATASRC_MEM_DNAME_NS DNAME and NS can't coexist in non-apex domain '%1'

-A request was made for DNAME and NS records to be put into the same -domain which is not the apex (the top of the zone). This is forbidden -by RFC 2672 (section 3) and indicates a problem with provided data. -

DATASRC_MEM_DOMAIN_EMPTY requested domain '%1' is empty

-Debug information. The requested domain exists in the tree of domains, but -it is empty. Therefore it doesn't contain the requested resource type. -

DATASRC_MEM_DUP_RRSET duplicate RRset '%1/%2'

-An RRset is being inserted into in-memory data source for a second time. The -original version must be removed first. Note that loading master files where an -RRset is split into multiple locations is not supported yet. -

DATASRC_MEM_EXACT_DELEGATION delegation at the exact domain '%1'

-Debug information. There's a NS record at the requested domain. This means -this zone is not authoritative for the requested domain, but a delegation -should be followed. The requested domain is an apex of some zone. -

DATASRC_MEM_FIND find '%1/%2'

-Debug information. A search for the requested RRset is being started. -

DATASRC_MEM_FINDNSEC3 finding NSEC3 for %1, mode %2

-Debug information. A search in an in-memory data source for NSEC3 that -matches or covers the given name is being started. -

DATASRC_MEM_FINDNSEC3_COVER found a covering NSEC3 for %1: %2

-Debug information. An NSEC3 that covers the given name is found and -being returned. The found NSEC3 RRset is also displayed. -

DATASRC_MEM_FINDNSEC3_MATCH found a matching NSEC3 for %1 at label count %2: %3

-Debug information. An NSEC3 that matches (a possibly superdomain of) -the given name is found and being returned. When the shown label -count is smaller than that of the given name, the matching NSEC3 is -for a superdomain of the given name (see DATASRC_MEM_FINDNSEC3_TRYHASH). -The found NSEC3 RRset is also displayed. -

DATASRC_MEM_FINDNSEC3_TRYHASH looking for NSEC3 for %1 at label count %2 (hash %3)

-Debug information. In an attempt of finding an NSEC3 for the give name, -(a possibly superdomain of) the name is hashed and searched for in the -NSEC3 name space. When the shown label count is smaller than that of the -shown name, the search tries the superdomain name that share the shown -(higher) label count of the shown name (e.g., for -www.example.com. with shown label count of 3, example.com. is being -tried). -

DATASRC_MEM_FIND_ZONE looking for zone '%1'

-Debug information. A zone object for this zone is being searched for in the -in-memory data source. -

DATASRC_MEM_LOAD loading zone '%1' from file '%2'

-Debug information. The content of master file is being loaded into the memory. -

DATASRC_MEM_NOT_FOUND requested domain '%1' not found

-Debug information. The requested domain does not exist. -

DATASRC_MEM_NO_NSEC3PARAM NSEC3PARAM is missing for NSEC3-signed zone %1/%2

-The in-memory data source has loaded a zone signed with NSEC3 RRs, -but it doesn't have a NSEC3PARAM RR at the zone origin. It's likely that -the zone is somehow broken, but this RR is not necessarily needed for -handling lookups with NSEC3 in this data source, so it accepts the given -content of the zone. Nevertheless the administrator should look into -the integrity of the zone data. -

DATASRC_MEM_NS_ENCOUNTERED encountered a NS

-Debug information. While searching for the requested domain, a NS was -encountered on the way (a delegation). This may lead to stop of the search. -

DATASRC_MEM_NXRRSET no such type '%1' at '%2'

-Debug information. The domain exists, but it doesn't hold any record of the -requested type. -

DATASRC_MEM_OUT_OF_ZONE domain '%1' doesn't belong to zone '%2'

-It was attempted to add the domain into a zone that shouldn't have it -(eg. the domain is not subdomain of the zone origin). This indicates a -problem with provided data. -

DATASRC_MEM_RENAME renaming RRset from '%1' to '%2'

-Debug information. A RRset is being generated from a different RRset (most -probably a wildcard). So it must be renamed to whatever the user asked for. In -fact, it's impossible to rename RRsets with our libraries, so a new one is -created and all resource records are copied over. -

DATASRC_MEM_SINGLETON trying to add multiple RRs for domain '%1' and type '%2'

-Some resource types are singletons -- only one is allowed in a domain -(for example CNAME or SOA). This indicates a problem with provided data. -

DATASRC_MEM_SUCCESS query for '%1/%2' successful

-Debug information. The requested record was found. -

DATASRC_MEM_SUPER_STOP stopped as '%1' is superdomain of a zone node, meaning it's empty

-Debug information. The search stopped because the requested domain was -detected to be a superdomain of some existing node of zone (while there -was no exact match). This means that the domain is an empty nonterminal, -therefore it is treated as NXRRSET case (eg. the domain exists, but it -doesn't have the requested record type). -

DATASRC_MEM_SWAP swapping contents of two zone representations ('%1' and '%2')

-Debug information. The contents of two in-memory zones are being exchanged. -This is usual practice to do some manipulation in exception-safe manner -- the -new data are prepared in a different zone object and when it works, they are -swapped. The old one contains the new data and the other one can be safely -destroyed. -

DATASRC_MEM_WILDCARD_CANCEL wildcard match canceled for '%1'

-Debug information. A domain above wildcard was reached, but there's something -below the requested domain. Therefore the wildcard doesn't apply here. This -behaviour is specified by RFC 1034, section 4.3.3 -

DATASRC_MEM_WILDCARD_DNAME DNAME record in wildcard domain '%1'

-The software refuses to load DNAME records into a wildcard domain. It isn't -explicitly forbidden, but the protocol is ambiguous about how this should -behave and BIND 9 refuses that as well. Please describe your intention using -different tools. -

DATASRC_MEM_WILDCARD_NS NS record in wildcard domain '%1'

-The software refuses to load NS records into a wildcard domain. It isn't -explicitly forbidden, but the protocol is ambiguous about how this should -behave and BIND 9 refuses that as well. Please describe your intention using -different tools. -

DATASRC_META_ADD adding a data source into meta data source

-This is a debug message issued during startup or reconfiguration. -Another data source is being added into the meta data source. -

DATASRC_META_ADD_CLASS_MISMATCH mismatch between classes '%1' and '%2'

-It was attempted to add a data source into a meta data source, but their -classes do not match. -

DATASRC_META_REMOVE removing data source from meta data source

-Debug information. A data source is being removed from meta data source. -

DATASRC_QUERY_ADD_NSEC adding NSEC record for '%1'

-Debug information. A NSEC record covering this zone is being added. -

DATASRC_QUERY_ADD_NSEC3 adding NSEC3 record of zone '%1'

-Debug information. A NSEC3 record for the given zone is being added to the -response message. -

DATASRC_QUERY_ADD_RRSET adding RRset '%1/%2' to message

-Debug information. An RRset is being added to the response message. -

DATASRC_QUERY_ADD_SOA adding SOA of '%1'

-Debug information. A SOA record of the given zone is being added to the -authority section of the response message. -

DATASRC_QUERY_AUTH_FAIL the underlying data source failed with %1

-The underlying data source failed to answer the authoritative query. 1 means -some error, 2 is not implemented. The data source should have logged the -specific error already. -

DATASRC_QUERY_BAD_REFERRAL bad referral to '%1'

-The domain lives in another zone. But it is not possible to generate referral -information for it. -

DATASRC_QUERY_CACHED data for %1/%2 found in hotspot cache

-Debug information. The requested data were found in the hotspot cache, so -no query is sent to the real data source. -

DATASRC_QUERY_CHECK_CACHE checking hotspot cache for '%1/%2'

-Debug information. While processing a query, lookup to the hotspot cache -is being made. -

DATASRC_QUERY_COPY_AUTH copying authoritative section into message

-Debug information. The whole referral information is being copied into the -response message. -

DATASRC_QUERY_DELEGATION looking for delegation on the path to '%1'

-Debug information. The software is trying to identify delegation points on the -way down to the given domain. -

DATASRC_QUERY_EMPTY_CNAME CNAME at '%1' is empty

-A CNAME chain was being followed and an entry was found that pointed -to a domain name that had no RRsets associated with it. As a result, -the query cannot be answered. This indicates a problem with supplied data. -

DATASRC_QUERY_EMPTY_DNAME the DNAME on '%1' is empty

-During an attempt to synthesize CNAME from this DNAME it was discovered the -DNAME is empty (it has no records). This indicates problem with supplied data. -

DATASRC_QUERY_FAIL query failed

-Some subtask of query processing failed. The reason should have been reported -already and a SERVFAIL will be returned to the querying system. -

DATASRC_QUERY_FOLLOW_CNAME following CNAME at '%1'

-Debug information. The domain is a CNAME (or a DNAME and a CNAME for it -has already been created) and the search is following this chain. -

DATASRC_QUERY_GET_MX_ADDITIONAL addition of A/AAAA for '%1' requested by MX '%2'

-Debug information. While processing a query, a MX record was met. It -references the mentioned address, so A/AAAA records for it are looked up -and put it into the additional section. -

DATASRC_QUERY_GET_NS_ADDITIONAL addition of A/AAAA for '%1' requested by NS '%2'

-Debug information. While processing a query, a NS record was met. It -references the mentioned address, so A/AAAA records for it are looked up -and put it into the additional section. -

DATASRC_QUERY_GLUE_FAIL the underlying data source failed with %1

-The underlying data source failed to answer the glue query. 1 means some error, -2 is not implemented. The data source should have logged the specific error -already. -

DATASRC_QUERY_INVALID_OP invalid query operation requested

-This indicates a programmer error. The DO_QUERY was called with unknown -operation code. -

DATASRC_QUERY_IS_AUTH auth query (%1/%2)

-Debug information. The last DO_QUERY is an auth query. -

DATASRC_QUERY_IS_GLUE glue query (%1/%2)

-Debug information. The last DO_QUERY is a query for glue addresses. -

DATASRC_QUERY_IS_NOGLUE query for non-glue addresses (%1/%2)

-Debug information. The last DO_QUERY is a query for addresses that are not -glue. -

DATASRC_QUERY_IS_REF query for referral (%1/%2)

-Debug information. The last DO_QUERY is a query for referral information. -

DATASRC_QUERY_IS_SIMPLE simple query (%1/%2)

-Debug information. The last DO_QUERY is a simple query. -

DATASRC_QUERY_MISPLACED_TASK task of this type should not be here

-This indicates a programming error. A task was found in the internal task -queue, but this kind of task wasn't designed to be inside the queue (it should -be handled right away, not queued). -

DATASRC_QUERY_MISSING_NS missing NS records for '%1'

-NS records should have been put into the authority section. However, this zone -has none. This indicates problem with provided data. -

DATASRC_QUERY_MISSING_SOA the zone '%1' has no SOA

-The answer should have been a negative one (eg. of nonexistence of something). -To do so, a SOA record should be put into the authority section, but the zone -does not have one. This indicates problem with provided data. -

DATASRC_QUERY_NOGLUE_FAIL the underlying data source failed with %1

-The underlying data source failed to answer the no-glue query. 1 means some -error, 2 is not implemented. The data source should have logged the specific -error already. -

DATASRC_QUERY_NO_CACHE_ANY_AUTH ignoring hotspot cache for ANY query (%1/%2 in %3 class)

-Debug information. The hotspot cache is ignored for authoritative ANY queries -for consistency reasons. -

DATASRC_QUERY_NO_CACHE_ANY_SIMPLE ignoring hotspot cache for ANY query (%1/%2 in %3 class)

-Debug information. The hotspot cache is ignored for ANY queries for consistency -reasons. -

DATASRC_QUERY_NO_DS_NSEC there's no DS record in the '%1' zone

-An attempt to add a NSEC record into the message failed, because the zone does -not have any DS record. This indicates problem with the provided data. -

DATASRC_QUERY_NO_DS_NSEC3 there's no DS record in the '%1' zone

-An attempt to add a NSEC3 record into the message failed, because the zone does -not have any DS record. This indicates problem with the provided data. -

DATASRC_QUERY_NO_ZONE no zone containing '%1' in class '%2'

-Debug information. Lookup of domain failed because the datasource -has no zone that contains the domain. Maybe someone sent a query -to the wrong server for some reason. This may also happen when -looking in the datasource for addresses for NS records. -

DATASRC_QUERY_PROCESS processing query '%1/%2' in the '%3' class

-Debug information. A sure query is being processed now. -

DATASRC_QUERY_PROVE_NX_FAIL unable to prove nonexistence of '%1'

-The user wants DNSSEC and we discovered the entity doesn't exist (either -domain or the record). But there was an error getting NSEC/NSEC3 record -to prove the nonexistence. -

DATASRC_QUERY_REF_FAIL the underlying data source failed with %1

-The underlying data source failed to answer the query for referral information. -1 means some error, 2 is not implemented. The data source should have logged -the specific error already. -

DATASRC_QUERY_RRSIG unable to answer RRSIG query for %1

-The server is unable to answer a direct query for RRSIG type, but was asked -to do so. -

DATASRC_QUERY_SIMPLE_FAIL the underlying data source failed with %1

-The underlying data source failed to answer the simple query. 1 means some -error, 2 is not implemented. The data source should have logged the specific -error already. -

DATASRC_QUERY_SYNTH_CNAME synthesizing CNAME from DNAME on '%1'

-This is a debug message. While answering a query, a DNAME was encountered. The -DNAME itself will be returned, along with a synthesized CNAME for clients that -do not understand the DNAME RR. -

DATASRC_QUERY_TASK_FAIL task failed with %1

-The query subtask failed. The reason should have been reported by the subtask -already. The code is 1 for error, 2 for not implemented. -

DATASRC_QUERY_TOO_MANY_CNAMES CNAME chain limit exceeded at '%1'

-A CNAME led to another CNAME and it led to another, and so on. After 16 -CNAMEs, the software gave up. Long CNAME chains are discouraged, and this -might possibly be a loop as well. Note that some of the CNAMEs might have -been synthesized from DNAMEs. This indicates problem with supplied data. -

DATASRC_QUERY_UNKNOWN_RESULT unknown result of subtask

-This indicates a programmer error. The answer of subtask doesn't look like -anything known. -

DATASRC_QUERY_WILDCARD looking for a wildcard covering '%1'

-Debug information. A direct match wasn't found, so a wildcard covering the -domain is being looked for now. -

DATASRC_QUERY_WILDCARD_FAIL error processing wildcard for '%1'

-During an attempt to cover the domain by a wildcard an error happened. The -exact kind was hopefully already reported. -

DATASRC_QUERY_WILDCARD_PROVE_NX_FAIL unable to prove nonexistence of '%1' (%2)

-While processing a wildcard, it wasn't possible to prove nonexistence of the -given domain or record. The code is 1 for error and 2 for not implemented. -

DATASRC_QUERY_WILDCARD_REFERRAL unable to find referral info for '%1' (%2)

-While processing a wildcard, a referral was met. But it wasn't possible to get -enough information for it. The code is 1 for error, 2 for not implemented. -

DATASRC_SQLITE_CLOSE closing SQLite database

-Debug information. The SQLite data source is closing the database file. -

DATASRC_SQLITE_COMPATIBLE_VERSION database schema V%1.%2 not up to date (expecting V%3.%4) but is compatible

-The version of the SQLite3 database schema used to hold the zone data -is not the latest one - the current version of BIND 10 was written -with a later schema version in mind. However, the database is -compatible with the current version of BIND 10, and BIND 10 will run -without any problems. -

-Consult the release notes for your version of BIND 10. Depending on -the changes made to the database schema, it is possible that improved -performance could result if the database were upgraded. -

DATASRC_SQLITE_CONNCLOSE Closing sqlite database

-The database file is no longer needed and is being closed. -

DATASRC_SQLITE_CONNOPEN Opening sqlite database file '%1'

-The database file is being opened so it can start providing data. -

DATASRC_SQLITE_CREATE SQLite data source created

-Debug information. An instance of SQLite data source is being created. -

DATASRC_SQLITE_DESTROY SQLite data source destroyed

-Debug information. An instance of SQLite data source is being destroyed. -

DATASRC_SQLITE_DROPCONN SQLite3Database is being deinitialized

-The object around a database connection is being destroyed. -

DATASRC_SQLITE_ENCLOSURE looking for zone containing '%1'

-Debug information. The SQLite data source is trying to identify which zone -should hold this domain. -

DATASRC_SQLITE_ENCLOSURE_NOT_FOUND no zone contains '%1'

-Debug information. The last SQLITE_ENCLOSURE query was unsuccessful; there's -no such zone in our data. -

DATASRC_SQLITE_FIND looking for RRset '%1/%2'

-Debug information. The SQLite data source is looking up a resource record -set. -

DATASRC_SQLITE_FINDADDRS looking for A/AAAA addresses for '%1'

-Debug information. The data source is looking up the addresses for given -domain name. -

DATASRC_SQLITE_FINDADDRS_BAD_CLASS class mismatch looking for addresses ('%1' and '%2')

-The SQLite data source was looking up A/AAAA addresses, but the data source -contains different class than the query was for. -

DATASRC_SQLITE_FINDEXACT looking for exact RRset '%1/%2'

-Debug information. The SQLite data source is looking up an exact resource -record. -

DATASRC_SQLITE_FINDEXACT_BAD_CLASS class mismatch looking for an RRset ('%1' and '%2')

-The SQLite data source was looking up an exact RRset, but the data source -contains different class than the query was for. -

DATASRC_SQLITE_FINDREC looking for record '%1/%2'

-Debug information. The SQLite data source is looking up records of given name -and type in the database. -

DATASRC_SQLITE_FINDREF looking for referral at '%1'

-Debug information. The SQLite data source is identifying if this domain is -a referral and where it goes. -

DATASRC_SQLITE_FINDREF_BAD_CLASS class mismatch looking for referral ('%1' and '%2')

-The SQLite data source was trying to identify if there's a referral. But -it contains different class than the query was for. -

DATASRC_SQLITE_FIND_BAD_CLASS class mismatch looking for an RRset ('%1' and '%2')

-The SQLite data source was looking up an RRset, but the data source contains -different class than the query was for. -

DATASRC_SQLITE_FIND_NSEC3 looking for NSEC3 in zone '%1' for hash '%2'

-Debug information. We're trying to look up a NSEC3 record in the SQLite data -source. -

DATASRC_SQLITE_FIND_NSEC3_NO_ZONE no such zone '%1'

-The SQLite data source was asked to provide a NSEC3 record for given zone. -But it doesn't contain that zone. -

DATASRC_SQLITE_INCOMPATIBLE_VERSION database schema V%1.%2 incompatible with version (V%3.%4) expected

-The version of the SQLite3 database schema used to hold the zone data -is incompatible with the version expected by BIND 10. As a result, -BIND 10 is unable to run using the database file as the data source. -

-The database should be updated using the means described in the BIND -10 documentation. -

DATASRC_SQLITE_NEWCONN SQLite3Database is being initialized

-A wrapper object to hold database connection is being initialized. -

DATASRC_SQLITE_OPEN opening SQLite database '%1'

-Debug information. The SQLite data source is loading an SQLite database in -the provided file. -

DATASRC_SQLITE_PREVIOUS looking for name previous to '%1'

-This is a debug message. The name given was not found, so the program -is searching for the next name higher up the hierarchy (e.g. if -www.example.com were queried for and not found, the software searches -for the "previous" name, example.com). -

DATASRC_SQLITE_PREVIOUS_NO_ZONE no zone containing '%1'

-The name given was not found, so the program is searching for the next -name higher up the hierarchy (e.g. if www.example.com were queried -for and not found, the software searches for the "previous" name, -example.com). However, this name is not contained in any zone in the -data source. This is an error since it indicates a problem in the earlier -processing of the query. -

DATASRC_SQLITE_SETUP setting up SQLite database

-The database for SQLite data source was found empty. It is assumed this is the -first run and it is being initialized with current schema. It'll still contain -no data, but it will be ready for use. -

DATASRC_STATIC_CLASS_NOT_CH static data source can handle CH class only

-An error message indicating that a query requesting a RR for a class other -that CH was sent to the static data source (which only handles CH queries). -

DATASRC_STATIC_CREATE creating the static datasource

-Debug information. The static data source (the one holding stuff like -version.bind) is being created. -

DATASRC_STATIC_FIND looking for '%1/%2'

-Debug information. This resource record set is being looked up in the static -data source. -

DATASRC_UNEXPECTED_QUERY_STATE unexpected query state

-This indicates a programming error. An internal task of unknown type was -generated. -

DBUTIL_BACKUP created backup of %1 in %2

-A backup for the given database file was created. Same of original file and -backup are given in the output message. -

DBUTIL_CHECK_ERROR unable to check database version: %1

-There was an error while trying to check the current version of the database -schema. The error is shown in the message. -

DBUTIL_CHECK_NOCONFIRM --noconfirm is not compatible with --check

-b10-dbutil was called with --check and --noconfirm. --noconfirm only has -meaning with --upgrade, so this is considered an error. -

DBUTIL_CHECK_OK this is the latest version of the database schema. No upgrade is required

-The database schema version has been checked, and is up to date. -No action is required. -

DBUTIL_CHECK_UPGRADE_NEEDED re-run this program with the --upgrade switch to upgrade

-The database schema version is not up to date, and an update is required. -Please run the dbutil tool again, with the --upgrade argument. -

DBUTIL_COMMAND_NONE must select one of --check or --upgrade

-b10-dbutil was called with neither --check nor --upgrade. One action must be -provided. -

DBUTIL_COMMAND_UPGRADE_CHECK --upgrade is not compatible with --check

-b10-dbutil was called with both the commands --upgrade and --check. Only one -action can be performed at a time. -

DBUTIL_DATABASE_MAY_BE_CORRUPT database file %1 may be corrupt, restore it from backup (%2)

-The upgrade failed while it was in progress; the database may now be in an -inconsistent state, and it is advised to restore it from the backup that was -created when b10-dbutil started. -

DBUTIL_EXECUTE Executing SQL statement: %1

-Debug message; the given SQL statement is executed -

DBUTIL_FILE Database file: %1

-The database file that is being checked. -

DBUTIL_NO_FILE must supply name of the database file to upgrade

-b10-dbutil was called without a database file. Currently, it cannot find this -file on its own, and it must be provided. -

DBUTIL_STATEMENT_ERROR failed to execute %1: %2

-The given database statement failed to execute. The error is shown in the -message. -

DBUTIL_TOO_MANY_ARGUMENTS too many arguments to the command, maximum of one expected

-There were too many command-line arguments to b10-dbutil -

DBUTIL_UPGRADE_CANCELED upgrade canceled; database has not been changed

-The user aborted the upgrade, and b10-dbutil will now exit. -

DBUTIL_UPGRADE_DBUTIL please get the latest version of b10-dbutil and re-run

-A database schema was found that was newer than this version of dbutil, which -is apparently out of date and should be upgraded itself. -

DBUTIL_UPGRADE_FAILED upgrade failed: %1

-While the upgrade was in progress, an unexpected error occurred. The error -is shown in the message. -

DBUTIL_UPGRADE_NOT_ATTEMPTED database upgrade was not attempted

-Due to the earlier failure, the database schema upgrade was not attempted, -and b10-dbutil will now exit. -

DBUTIL_UPGRADE_NOT_NEEDED database already at latest version, no upgrade necessary

-b10-dbutil was told to upgrade the database schema, but it is already at the -latest version. -

DBUTIL_UPGRADE_NOT_POSSIBLE database at a later version than this utility can support

-b10-dbutil was told to upgrade the database schema, but it is at a higher -version than this tool currently supports. Please update b10-dbutil and try -again. -

DBUTIL_UPGRADE_PREPARATION_FAILED upgrade preparation failed: %1

-An unexpected error occurred while b10-dbutil was preparing to upgrade the -database schema. The error is shown in the message -

DBUTIL_UPGRADE_SUCCESFUL database upgrade successfully completed

-The database schema update was completed successfully. -

DBUTIL_UPGRADING upgrading database from %1 to %2

-An upgrade is in progress, the versions of the current upgrade action are shown. -

DBUTIL_VERSION_CURRENT database version %1

-The current version of the database schema. -

DBUTIL_VERSION_HIGH database is at a later version (%1) than this program can cope with (%2)

-The database schema is at a higher version than b10-dbutil knows about. -

DBUTIL_VERSION_LOW database version %1, latest version is %2.

-The database schema is not up to date, the current version and the latest -version are in the message. -

DDNS_ACCEPT_FAILURE error accepting a connection: %1

-There was a low-level error when we tried to accept an incoming connection -(probably coming from b10-auth). We continue serving on whatever other -connections we already have, but this connection is dropped. The reason -is logged. -

DDNS_AUTH_DBFILE_UPDATE updated auth DB file to %1

-b10-ddns was notified of updates to the SQLite3 DB file that b10-auth -uses for the underlying data source and on which b10-ddns needs to -make updates. b10-ddns then updated its internal setup so further -updates would be made on the new DB. -

DDNS_CC_SESSION_ERROR error reading from cc channel: %1

-There was a problem reading from the command and control channel. The -most likely cause is that the msgq process is not running. -

DDNS_CC_SESSION_TIMEOUT_ERROR timeout waiting for cc response

-There was a problem reading a response from another module over the -command and control channel. The most likely cause is that the -configuration manager b10-cfgmgr is not running. -

DDNS_CONFIG_ERROR error found in configuration data: %1

-The ddns process encountered an error when installing the configuration at -startup time. Details of the error are included in the log message. -

DDNS_CONFIG_HANDLER_ERROR failed to update ddns configuration: %1

-An update to b10-ddns configuration was delivered but an error was -found while applying them. None of the delivered updates were applied -to the running b10-ddns system, and the server will keep running with -the existing configuration. If this happened in the initial -configuration setup, the server will be running with the default -configurations. -

DDNS_DROP_CONN dropping connection on file descriptor %1 because of error %2

-There was an error on a connection with the b10-auth server (or whatever -connects to the ddns daemon). This might be OK, for example when the -authoritative server shuts down, the connection would get closed. It also -can mean the system is busy and can't keep up or that the other side got -confused and sent bad data. -

DDNS_GET_REMOTE_CONFIG_FAIL failed to get %1 module configuration %2 times: %3

-b10-ddns tried to get configuration of some remote modules for its -operation, but it failed. The most likely cause of this is that the -remote module has not fully started up and b10-ddns couldn't get the -configuration in a timely fashion. b10-ddns attempts to retry it a -few times, imposing a short delay, hoping it eventually succeeds if -it's just a timing issue. The number of total failed attempts is also -logged. If it reaches an internal threshold b10-ddns considers it a -fatal error and terminates. Even in that case, if b10-ddns is -configured as a "dispensable" component (which is the default), the -parent bind10 process will restart it, and there will be another -chance of getting the remote configuration successfully. These are -not the optimal behavior, but it's believed to be sufficient in -practice (there would normally be no failure in the first place). If -it really causes an operational trouble other than having a few of -these log messages, please submit a bug report; there can be several -ways to make it more sophisticated. Another, less likely reason for -having this error is because the remote modules are not actually -configured to run. If that's the case fixing the configuration should -solve the problem - either by making sure the remote module will run -or by not running b10-ddns (without these remote modules b10-ddns is -not functional, so there's no point in running it in this case). -

DDNS_MODULECC_SESSION_ERROR error encountered by configuration/command module: %1

-There was a problem in the lower level module handling configuration and -control commands. This could happen for various reasons, but the most likely -cause is that the configuration database contains a syntax error and ddns -failed to start at initialization. A detailed error message from the module -will also be displayed. -

DDNS_NEW_CONN new connection on file descriptor %1 from %2

-Debug message. We received a connection and we are going to start handling -requests from it. The file descriptor number and the address where the request -comes from is logged. The connection is over a unix domain socket and is likely -coming from a b10-auth process. -

DDNS_RECEIVED_AUTH_UPDATE received configuration updates from auth server

-b10-ddns is notified of updates to b10-auth configuration -(including a report of the initial configuration) that b10-ddns might -be interested in. -

DDNS_RECEIVED_SHUTDOWN_COMMAND shutdown command received

-The ddns process received a shutdown command from the command channel -and will now shut down. -

DDNS_RECEIVED_ZONEMGR_UPDATE received configuration updates from zonemgr

-b10-ddns is notified of updates to b10-zonemgr's configuration -(including a report of the initial configuration). It may possibly -contain changes to the secondary zones, in which case b10-ddns will -update its internal copy of that configuration. -

DDNS_REQUEST_PARSE_FAIL failed to parse update request: %1

-b10-ddns received an update request via b10-auth, but the received -data failed to pass minimum validation: it was either broken wire -format data for a valid DNS message (e.g. it's shorter than the -fixed-length header), or the opcode is not update, or TSIG is included -in the request but it fails to validate. Since b10-auth should have -performed this level of checks, such an error shouldn't be detected at -this stage and should rather be considered an internal bug. This -event is therefore logged at the error level, and the request is -simply dropped. Additional information of the error is also logged. -

DDNS_REQUEST_TCP_QUOTA reject TCP update client %1 (%2 running)

-b10-ddns received a new update request from a client over TCP, but -the number of TCP clients being handled by the server already reached -the configured quota, so the latest client was rejected by closing -the connection. The administrator may want to check the status of -b10-ddns, and if this happens even if the server is not very busy, -the quota may have to be increased. Or, if it's more likely to be -malicious or simply bogus clients that somehow keep the TCP connection -open for a long period, maybe they should be rejected with an -appropriate ACL configuration or some lower layer filtering. The -number of existing TCP clients are shown in the log, which should be -identical to the current quota. -

DDNS_RESPONSE_SOCKET_ERROR failed to send update response to %1: %2

-Network I/O error happens in sending an update response. The -client's address that caused the error and error details are also -logged. -

DDNS_RESPONSE_TCP_SOCKET_ERROR failed to complete sending update response to %1 over TCP

-b10-ddns had tried to send an update response over TCP, and it hadn't -been completed at that time, and a followup attempt to complete the -send operation failed due to some network I/O error. While a network -error can happen any time, this event is quite unexpected for two -reasons. First, since the size of a response to an update request -should be generally small, it's unlikely that the initial attempt -didn't fail but wasn't completed. Second, since the first attempt -succeeded and the TCP connection had been established in the first -place, it's more likely for the subsequent attempt to succeed. In any -case, there may not be able to do anything to fix it at the server -side, but the administrator may want to check the general reachability -with the client address. -

DDNS_SECONDARY_ZONES_UPDATE updated secondary zone list (%1 zones are listed)

-b10-ddns has successfully updated the internal copy of secondary zones -obtained from b10-zonemgr, based on a latest update to zonemgr's -configuration. The number of newly configured (unique) secondary -zones is logged. -

DDNS_SECONDARY_ZONES_UPDATE_FAIL failed to update secondary zone list: %1

-An error message. b10-ddns was notified of updates to a list of -secondary zones from b10-zonemgr and tried to update its own internal -copy of the list, but it failed. This can happen if the configuration -contains an error, and b10-zonemgr should also reject that update. -Unfortunately, in the current implementation there is no way to ensure -that both zonemgr and ddns have consistent information when an update -contains an error; further, as of this writing zonemgr has a bug that -it could partially update the list of secondary zones if part of the -list has an error (see Trac ticket #2038). b10-ddns still keeps -running with the previous configuration, but it's strongly advisable -to check log messages from zonemgr, and if it indicates there can be -inconsistent state, it's better to restart the entire BIND 10 system -(just restarting b10-ddns wouldn't be enough, because zonemgr can have -partially updated configuration due to bug #2038). The log message -contains an error description, but it's intentionally kept simple as -it's primarily a matter of zonemgr. To know the details of the error, -log messages of zonemgr should be consulted. -

DDNS_SESSION session arrived on file descriptor %1

-A debug message, informing there's some activity on the given file descriptor. -It will be either a request or the file descriptor will be closed. See -following log messages to see what of it. -

DDNS_SHUTDOWN ddns server shutting down

-The ddns process is shutting down. It will no longer listen for new commands -or updates. Any command or update that is being addressed at this moment will -be completed, after which the process will exit. -

DDNS_STARTED ddns server is running and listening for updates

-The ddns process has successfully started and is now ready to receive commands -and updates. -

DDNS_START_FORWARDER_ERROR Error from b10-auth when requesting DDNS UPDATE forwarding: %1

-There was an error response from b10-auth to the command to start -forwarding DDNS UPDATE messages to b10-ddns. -It is almost certain that DDNS UPDATE messages are not handled now, and that -they will be responded to with a NOTIMP error code, even though b10-ddns is -running. -The error message is printed, and additional information may be found in -the b10-auth log output. Since this is an error that is sent by the -b10-auth module, it should have more information as to what the actual -problem was. -

DDNS_START_FORWARDER_FAIL Error sending request for DDNS UPDATE forwarding to b10-auth: %1

-There was an error when attempting to send b10-auth the request to forward -DDNS UPDATE messages to the b10-ddns module. This points to an internal -problem using the inter-module messaging system. -This needs to be inspected, as it is almost certain that DDNS UPDATE messages -are not handled now. -The specific error is printed in the log message. -

DDNS_STOPPED ddns server has stopped

-The ddns process has successfully stopped and is no longer listening for or -handling commands or updates, and will now exit. -

DDNS_STOPPED_BY_KEYBOARD keyboard interrupt, shutting down

-There was a keyboard interrupt signal to stop the ddns process. The -process will now shut down. -

DDNS_STOP_FORWARDER_ERROR Error from b10-auth when requesting to stop DDNS UPDATE forwarding: %1

-There was an error response from b10-auth to the command to stop -forwarding DDNS UPDATE messages to b10-ddns. -This specific error may not be fatal; instead of returning NOTIMP for future -DDNS UPDATE messages, it will return SERVFAIL. However, this does point to -an underlying problem in the messaging system, and should be inspected. -The error message is printed, and additional information may be found in -the b10-auth log output. -

DDNS_STOP_FORWARDER_FAIL Error sending request to stop DDNS UPDATE forwarding to b10-auth: %1

-There was an error when attempting to send b10-auth the request to stop -forwarding DDNS UPDATE messages to the b10-ddns module. This points to an -internal problem using the inter-module messaging system. -This specific error may not be fatal; instead of returning NOTIMP for future -DDNS UPDATE messages, it will return SERVFAIL. However, this does point to -an underlying problem in the messaging system, and should be inspected. -The specific error is printed in the log message. -

DDNS_UNCAUGHT_EXCEPTION uncaught exception of type %1: %2

-The b10-ddns process encountered an uncaught exception and will now shut -down. This is indicative of a programming error and should not happen under -normal circumstances. The exception type and message are printed. -

DDNS_UPDATE_NOTIFY notified %1 of updates to %2

-Debug message. b10-ddns has made updates to a zone based on an update -request and has successfully notified an external module of the updates. -The notified module will use that information for updating its own -state or any necessary protocol action such as zone reloading or sending -notify messages to secondary servers. -

DDNS_UPDATE_NOTIFY_FAIL failed to notify %1 of updates to %2: %3

-b10-ddns has made updates to a zone based on an update request and -tried to notify an external component of the updates, but the -notification fails. One possible cause of this is that the external -component is not really running and it times out in waiting for the -response, although it will be less likely to happen in practice -because these components will normally be configured to run when the -server provides the authoritative DNS service; ddns is rather optional -among them. If this happens, however, it will suspend b10-ddns for a -few seconds during which it cannot handle new requests (some may be -delayed, some may be dropped, depending on the volume of the incoming -requests). This is obviously bad, and if this error happens due to -this reason, the administrator should make sure the component in -question should be configured to run. For a longer term, b10-ddns -should be more robust about this case such as by making this -notification asynchronously and/or detecting the existence of the -external components to avoid hopeless notification in the first place. -Severity of this error for the receiving components depends on the -type of the component. If it's b10-xfrout, this means DNS notify -messages won't be sent to secondary servers of the zone. It's -suboptimal, but not necessarily critical as the secondary servers will -try to check the zone's status periodically. If it's b10-auth and the -notification was needed to have it reload the corresponding zone, it's -more serious because b10-auth won't be able to serve the new version -of the zone unless some explicit recovery action is taken. So the -administrator needs to examine this message and takes an appropriate -action. In either case, this notification is generally expected to -succeed; so the fact it fails itself means there's something wrong in -the BIND 10 system, and it would be advisable to check other log -messages. -

LIBDDNS_DATASRC_ERROR update client %1 failed due to data source error: %2

-An update attempt failed due to some error in the corresponding data -source. This is generally an unexpected event, but can still happen -for various reasons such as DB lock contention or a failure of the -backend DB server. The cause of the error is also logged. It's -advisable to check the message, and, if necessary, take an appropriate -action (e.g., restarting the DB server if it dies). If this message -is logged the data source isn't modified due to the -corresponding update request. When used by the b10-ddns, the server -will return a response with an RCODE of SERVFAIL. -

LIBDDNS_PREREQ_FORMERR update client %1 for zone %2: Format error in prerequisite (%3). Non-zero TTL.

-The prerequisite with the given name, class and type is not well-formed. -The specific prerequisite is shown. In this case, it has a non-zero TTL value. -A FORMERR error response is sent to the client. -

LIBDDNS_PREREQ_FORMERR_ANY update client %1 for zone %2: Format error in prerequisite (%3). Non-zero TTL or rdata found.

-The prerequisite with the given name, class and type is not well-formed. -The specific prerequisite is shown. In this case, it either has a non-zero -TTL value, or has rdata fields. A FORMERR error response is sent to the client. -

LIBDDNS_PREREQ_FORMERR_CLASS update client %1 for zone %2: Format error in prerequisite (%3). Bad class.

-The prerequisite with the given name, class and type is not well-formed. -The specific prerequisite is shown. In this case, the class of the -prerequisite should either match the class of the zone in the Zone Section, -or it should be ANY or NONE, and it is not. A FORMERR error response is sent -to the client. -

LIBDDNS_PREREQ_FORMERR_NONE update client %1 for zone %2: Format error in prerequisite (%3). Non-zero TTL or rdata found.

-The prerequisite with the given name, class and type is not well-formed. -The specific prerequisite is shown. In this case, it either has a non-zero -TTL value, or has rdata fields. A FORMERR error response is sent to the client. -

LIBDDNS_PREREQ_NAME_IN_USE_FAILED update client %1 for zone %2: 'Name is in use' prerequisite not satisfied (%3), rcode: %4

-A DNS UPDATE prerequisite was not satisfied. The specific prerequisite that -was not satisfied is shown. The client is sent an error response with the -given rcode. -In this case, the specific prerequisite is 'Name is in use'. From RFC2136: -Name is in use. At least one RR with a specified NAME (in -the zone and class specified by the Zone Section) must exist. -Note that this prerequisite is NOT satisfied by empty -nonterminals. -

LIBDDNS_PREREQ_NAME_NOT_IN_USE_FAILED update client %1 for zone %2: 'Name is not in use' (%3) prerequisite not satisfied, rcode: %4

-A DNS UPDATE prerequisite was not satisfied. The specific prerequisite that -was not satisfied is shown. The client is sent an error response with the -given rcode. -In this case, the specific prerequisite is 'Name is not in use'. -From RFC2136: -Name is not in use. No RR of any type is owned by a -specified NAME. Note that this prerequisite IS satisfied by -empty nonterminals. -

LIBDDNS_PREREQ_NOTZONE update client %1 for zone %2: prerequisite not in zone (%3)

-A DDNS UPDATE prerequisite has a name that does not appear to be inside -the zone specified in the Zone section of the UPDATE message. -The specific prerequisite is shown. A NOTZONE error response is sent to -the client. -

LIBDDNS_PREREQ_RRSET_DOES_NOT_EXIST_FAILED update client %1 for zone %2: 'RRset does not exist' (%3) prerequisite not satisfied, rcode: %4

-A DNS UPDATE prerequisite was not satisfied. The specific prerequisite that -was not satisfied is shown. The client is sent an error response with the -given rcode. -In this case, the specific prerequisite is 'RRset does not exist'. -From RFC2136: -RRset does not exist. No RRs with a specified NAME and TYPE -(in the zone and class denoted by the Zone Section) can exist. -

LIBDDNS_PREREQ_RRSET_EXISTS_FAILED update client %1 for zone %2: 'RRset exists (value independent)' (%3) prerequisite not satisfied, rcode: %4

-A DNS UPDATE prerequisite was not satisfied. The specific prerequisite that -was not satisfied is shown. The client is sent an error response with the -given rcode. -In this case, the specific prerequisite is 'RRset exists (value independent)'. -From RFC2136: -RRset exists (value dependent). A set of RRs with a -specified NAME and TYPE exists and has the same members -with the same RDATAs as the RRset specified here in this -Section. -

LIBDDNS_PREREQ_RRSET_EXISTS_VAL_FAILED update client %1 for zone %2: 'RRset exists (value dependent)' (%3) prerequisite not satisfied, rcode: %4

-A DNS UPDATE prerequisite was not satisfied. The specific prerequisite that -was not satisfied is shown. The client is sent an error response with the -given rcode. -In this case, the specific prerequisite is 'RRset exists (value dependent)'. -From RFC2136: -RRset exists (value independent). At least one RR with a -specified NAME and TYPE (in the zone and class specified by -the Zone Section) must exist. -

LIBDDNS_UPDATE_ADD_BAD_TYPE update client %1 for zone %2: update addition RR bad type: %3

-The Update section of a DDNS update message contains a statement -that tries to add a record of an invalid type. Most likely the -record has an RRType that is considered a 'meta' type, which -cannot be zone content data. The specific record is shown. -A FORMERR response is sent back to the client. -

LIBDDNS_UPDATE_APPROVED update client %1 for zone %2 approved

-Debug message. An update request was approved in terms of the zone's -update ACL. -

LIBDDNS_UPDATE_BAD_CLASS update client %1 for zone %2: bad class in update RR: %3

-The Update section of a DDNS update message contains an RRset with -a bad class. The class of the update RRset must be either the same -as the class in the Zone Section, ANY, or NONE. -A FORMERR response is sent back to the client. -

LIBDDNS_UPDATE_DATASRC_ERROR error in datasource during DDNS update: %1

-An error occured while committing the DDNS update changes to the -datasource. The specific error is printed. A SERVFAIL response is sent -back to the client. -

LIBDDNS_UPDATE_DELETE_BAD_TYPE update client %1 for zone %2: update deletion RR bad type: %3

-The Update section of a DDNS update message contains a statement -that tries to delete an rrset of an invalid type. Most likely the -record has an RRType that is considered a 'meta' type, which -cannot be zone content data. The specific record is shown. -A FORMERR response is sent back to the client. -

LIBDDNS_UPDATE_DELETE_NONZERO_TTL update client %1 for zone %2: update deletion RR has non-zero TTL: %3

-The Update section of a DDNS update message contains a 'delete rrset' -statement with a non-zero TTL. This is not allowed by the protocol. -A FORMERR response is sent back to the client. -

LIBDDNS_UPDATE_DELETE_RRSET_NOT_EMPTY update client %1 for zone %2: update deletion RR contains data %3

-The Update section of a DDNS update message contains a 'delete rrset' -statement with a non-empty RRset. This is not allowed by the protocol. -A FORMERR response is sent back to the client. -

LIBDDNS_UPDATE_DELETE_RR_BAD_TYPE update client %1 for zone %2: update deletion RR bad type: %3

-The Update section of a DDNS update message contains a statement -that tries to delete one or more rrs of an invalid type. Most -likely the records have an RRType that is considered a 'meta' -type, which cannot be zone content data. The specific record is -shown. A FORMERR response is sent back to the client. -

LIBDDNS_UPDATE_DELETE_RR_NONZERO_TTL update client %1 for zone %2: update deletion RR has non-zero TTL: %3

-The Update section of a DDNS update message contains a 'delete rrs' -statement with a non-zero TTL. This is not allowed by the protocol. -A FORMERR response is sent back to the client. -

LIBDDNS_UPDATE_DENIED update client %1 for zone %2 denied

-Informational message. An update request was denied because it was -rejected by the zone's update ACL. When this library is used by -b10-ddns, the server will respond to the request with an RCODE of -REFUSED as described in Section 3.3 of RFC2136. -

LIBDDNS_UPDATE_DROPPED update client %1 for zone %2 dropped

-Informational message. An update request was denied because it was -rejected by the zone's update ACL. When this library is used by -b10-ddns, the server will then completely ignore the request; no -response will be sent. -

LIBDDNS_UPDATE_ERROR update client %1 for zone %2: %3

-Debug message. An error is found in processing a dynamic update -request. This log message is used for general errors that are not -normally expected to happen. So, in general, it would mean some -problem in the client implementation or an interoperability issue -with this implementation. The client's address, the zone name and -class, and description of the error are logged. -

LIBDDNS_UPDATE_FORWARD_FAIL update client %1 for zone %2: update forwarding not supported

-Debug message. An update request is sent to a secondary server. This -is not necessarily invalid, but this implementation does not yet -support update forwarding as specified in Section 6 of RFC2136 and it -will simply return a response with an RCODE of NOTIMP to the client. -The client's address and the zone name/class are logged. -

LIBDDNS_UPDATE_NOTAUTH update client %1 for zone %2: not authoritative for update zone

-Debug message. An update request was received for a zone for which -the receiving server doesn't have authority. In theory this is an -unexpected event, but there are client implementations that could send -update requests carelessly, so it may not necessarily be so uncommon -in practice. If possible, you may want to check the implementation or -configuration of those clients to suppress the requests. As specified -in Section 3.1 of RFC2136, the receiving server will return a response -with an RCODE of NOTAUTH. -

LIBDDNS_UPDATE_NOTZONE update client %1 for zone %2: update RR out of zone %3

-A DDNS UPDATE record has a name that does not appear to be inside -the zone specified in the Zone section of the UPDATE message. -The specific update record is shown. A NOTZONE error response is -sent to the client. -

LIBDDNS_UPDATE_PREREQUISITE_FAILED prerequisite failed in update client %1 for zone %2: result code %3

-The handling of the prerequisite section (RFC2136 Section 3.2) found -that one of the prerequisites was not satisfied. The result code -should give more information on what prerequisite type failed. -If the result code is FORMERR, the prerequisite section was not well-formed. -An error response with the given result code is sent back to the client. -

LIBDDNS_UPDATE_UNCAUGHT_EXCEPTION update client %1 for zone %2: uncaught exception while processing update section: %3

-An uncaught exception was encountered while processing the Update -section of a DDNS message. The specific exception is shown in the log message. -To make sure DDNS service is not interrupted, this problem is caught instead -of reraised; The update is aborted, and a SERVFAIL is sent back to the client. -This is most probably a bug in the DDNS code, but *could* be caused by -the data source. -

LIBXFRIN_DIFFERENT_TTL multiple data with different TTLs (%1, %2) on %3/%4/%5. Adjusting %2 -> %1.

-The xfrin module received an update containing multiple rdata changes for the -same RRset. But the TTLs of these don't match each other. As we combine them -together, the latter one gets overwritten to the earlier one in the sequence. -

LIBXFRIN_NO_JOURNAL disabled journaling for updates to %1 on %2

-An attempt was made to create a Diff object with journaling enabled, but -the underlying data source didn't support journaling (while still allowing -updates) and so the created object has it disabled. At a higher level this -means that the updates will be applied to the zone but subsequent IXFR requests -will result in a full zone transfer (i.e., an AXFR-style IXFR). Unless the -overhead of the full transfer is an issue this message can be ignored; -otherwise you may want to check why the journaling wasn't allowed on the -data source and either fix the issue or use a different type of data source. -

LOGIMPL_ABOVE_MAX_DEBUG debug level of %1 is too high and will be set to the maximum of %2

-A message from the interface to the underlying logger implementation reporting -that the debug level (as set by an internally-created string DEBUGn, where n -is an integer, e.g. DEBUG22) is above the maximum allowed value and has -been reduced to that value. The appearance of this message may indicate -a programming error - please submit a bug report. -

LOGIMPL_BAD_DEBUG_STRING debug string '%1' has invalid format

-A message from the interface to the underlying logger implementation -reporting that an internally-created string used to set the debug level -is not of the correct format (it should be of the form DEBUGn, where n -is an integer, e.g. DEBUG22). The appearance of this message indicates -a programming error - please submit a bug report. -

LOGIMPL_BELOW_MIN_DEBUG debug level of %1 is too low and will be set to the minimum of %2

-A message from the interface to the underlying logger implementation reporting -that the debug level (as set by an internally-created string DEBUGn, where n -is an integer, e.g. DEBUG22) is below the minimum allowed value and has -been increased to that value. The appearance of this message may indicate -a programming error - please submit a bug report. -

LOG_BAD_DESTINATION unrecognized log destination: %1

-A logger destination value was given that was not recognized. The -destination should be one of "console", "file", or "syslog". -

LOG_BAD_SEVERITY unrecognized log severity: %1

-A logger severity value was given that was not recognized. The severity -should be one of "DEBUG", "INFO", "WARN", "ERROR", "FATAL" or "NONE". -

LOG_BAD_STREAM bad log console output stream: %1

-Logging has been configured so that output is written to the terminal -(console) but the stream on which it is to be written is not recognised. -Allowed values are "stdout" and "stderr". -

LOG_DUPLICATE_MESSAGE_ID duplicate message ID (%1) in compiled code

-During start-up, BIND 10 detected that the given message identification -had been defined multiple times in the BIND 10 code. This indicates a -programming error; please submit a bug report. -

LOG_DUPLICATE_NAMESPACE line %1: duplicate $NAMESPACE directive found

-When reading a message file, more than one $NAMESPACE directive was found. -(This directive is used to set a C++ namespace when generating header -files during software development.) Such a condition is regarded as an -error and the read will be abandoned. -

LOG_INPUT_OPEN_FAIL unable to open message file %1 for input: %2

-The program was not able to open the specified input message file for -the reason given. -

LOG_INVALID_MESSAGE_ID line %1: invalid message identification '%2'

-An invalid message identification (ID) has been found during the read of -a message file. Message IDs should comprise only alphanumeric characters -and the underscore, and should not start with a digit. -

LOG_LOCK_TEST_MESSAGE this is a test message.

-This is a log message used in testing. -

LOG_NAMESPACE_EXTRA_ARGS line %1: $NAMESPACE directive has too many arguments

-The $NAMESPACE directive in a message file takes a single argument, a -namespace in which all the generated symbol names are placed. This error -is generated when the compiler finds a $NAMESPACE directive with more -than one argument. -

LOG_NAMESPACE_INVALID_ARG line %1: $NAMESPACE directive has an invalid argument ('%2')

-The $NAMESPACE argument in a message file should be a valid C++ namespace. -This message is output if the simple check on the syntax of the string -carried out by the reader fails. -

LOG_NAMESPACE_NO_ARGS line %1: no arguments were given to the $NAMESPACE directive

-The $NAMESPACE directive in a message file takes a single argument, -a C++ namespace in which all the generated symbol names are placed. -This error is generated when the compiler finds a $NAMESPACE directive -with no arguments. -

LOG_NO_MESSAGE_ID line %1: message definition line found without a message ID

-Within a message file, message are defined by lines starting with a "%". -The rest of the line should comprise the message ID and text describing -the message. This error indicates the message compiler found a line in -the message file comprising just the "%" and nothing else. -

LOG_NO_MESSAGE_TEXT line %1: line found containing a message ID ('%2') and no text

-Within a message file, message are defined by lines starting with a "%". -The rest of the line should comprise the message ID and text describing -the message. This error indicates the message compiler found a line -in the message file comprising just the "%" and message identification, -but no text. -

LOG_NO_SUCH_MESSAGE could not replace message text for '%1': no such message

-During start-up a local message file was read. A line with the listed -message identification was found in the file, but the identification is -not one contained in the compiled-in message dictionary. This message -may appear a number of times in the file, once for every such unknown -message identification. -

-There may be several reasons why this message may appear: -

-- The message ID has been mis-spelled in the local message file. -

-- The program outputting the message may not use that particular message -(e.g. it originates in a module not used by the program.) -

-- The local file was written for an earlier version of the BIND 10 software -and the later version no longer generates that message. -

-Whatever the reason, there is no impact on the operation of BIND 10. -

LOG_OPEN_OUTPUT_FAIL unable to open %1 for output: %2

-Originating within the logging code, the program was not able to open -the specified output file for the reason given. -

LOG_PREFIX_EXTRA_ARGS line %1: $PREFIX directive has too many arguments

-Within a message file, the $PREFIX directive takes a single argument, -a prefix to be added to the symbol names when a C++ file is created. -This error is generated when the compiler finds a $PREFIX directive with -more than one argument. -

-Note: the $PREFIX directive is deprecated and will be removed in a future -version of BIND 10. -

LOG_PREFIX_INVALID_ARG line %1: $PREFIX directive has an invalid argument ('%2')

-Within a message file, the $PREFIX directive takes a single argument, -a prefix to be added to the symbol names when a C++ file is created. -As such, it must adhere to restrictions on C++ symbol names (e.g. may -only contain alphanumeric characters or underscores, and may nor start -with a digit). A $PREFIX directive was found with an argument (given -in the message) that violates those restrictions. -

-Note: the $PREFIX directive is deprecated and will be removed in a future -version of BIND 10. -

LOG_READING_LOCAL_FILE reading local message file %1

-This is an informational message output by BIND 10 when it starts to read -a local message file. (A local message file may replace the text of -one of more messages; the ID of the message will not be changed though.) -

LOG_READ_ERROR error reading from message file %1: %2

-The specified error was encountered reading from the named message file. -

LOG_UNRECOGNISED_DIRECTIVE line %1: unrecognised directive '%2'

-Within a message file, a line starting with a dollar symbol was found -(indicating the presence of a directive) but the first word on the line -(shown in the message) was not recognised. -

LOG_WRITE_ERROR error writing to %1: %2

-The specified error was encountered by the message compiler when writing -to the named output file. -

NOTIFY_OUT_DATASRC_ACCESS_FAILURE failed to get access to data source: %1

-notify_out failed to get access to one of configured data sources. -Detailed error is shown in the log message. This can be either a -configuration error or installation setup failure. -

NOTIFY_OUT_DATASRC_ZONE_NOT_FOUND Zone %1 is not found

-notify_out attempted to get slave information of a zone but the zone -isn't found in the expected data source. This shouldn't happen, -because notify_out first identifies a list of available zones before -this process. So this means some critical inconsistency in the data -source or software bug. -

NOTIFY_OUT_INVALID_ADDRESS invalid address %1#%2: %3

-The notify_out library tried to send a notify message to the given -address, but it appears to be an invalid address. The configuration -for secondary nameservers might contain a typographic error, or a -different BIND 10 module has forgotten to validate its data before -sending this module a notify command. As such, this should normally -not happen, and points to an oversight in a different module. -

NOTIFY_OUT_REPLY_BAD_OPCODE bad opcode in notify reply from %1#%2: %3

-The notify_out library sent a notify message to the nameserver at -the given address, but the response did not have the opcode set to -NOTIFY. The opcode in the response is printed. Since there was a -response, no more notifies will be sent to this server for this -notification event. -

NOTIFY_OUT_REPLY_BAD_QID bad QID in notify reply from %1#%2: got %3, should be %4

-The notify_out library sent a notify message to the nameserver at -the given address, but the query id in the response does not match -the one we sent. Since there was a response, no more notifies will -be sent to this server for this notification event. -

NOTIFY_OUT_REPLY_BAD_QUERY_NAME bad query name in notify reply from %1#%2: got %3, should be %4

-The notify_out library sent a notify message to the nameserver at -the given address, but the query name in the response does not match -the one we sent. Since there was a response, no more notifies will -be sent to this server for this notification event. -

NOTIFY_OUT_REPLY_QR_NOT_SET QR flags set to 0 in reply to notify from %1#%2

-The notify_out library sent a notify message to the namesever at the -given address, but the reply did not have the QR bit set to one. -Since there was a response, no more notifies will be sent to this -server for this notification event. -

NOTIFY_OUT_REPLY_UNCAUGHT_EXCEPTION uncaught exception: %1

-There was an uncaught exception in the handling of a notify reply -message, either in the message parser, or while trying to extract data -from the parsed message. The error is printed, and notify_out will -treat the response as a bad message, but this does point to a -programming error, since all exceptions should have been caught -explicitly. Please file a bug report. Since there was a response, -no more notifies will be sent to this server for this notification -event. -

NOTIFY_OUT_RETRY_EXCEEDED notify to %1#%2: number of retries (%3) exceeded

-The maximum number of retries for the notify target has been exceeded. -Either the address of the secondary nameserver is wrong, or it is not -responding. -

NOTIFY_OUT_SENDING_NOTIFY sending notify to %1#%2

-A notify message is sent to the secondary nameserver at the given -address. -

NOTIFY_OUT_SOCKET_ERROR socket error sending notify to %1#%2: %3

-There was a network error while trying to send a notify message to -the given address. The address might be unreachable. The socket -error is printed and should provide more information. -

NOTIFY_OUT_SOCKET_RECV_ERROR socket error reading notify reply from %1#%2: %3

-There was a network error while trying to read a notify reply -message from the given address. The socket error is printed and should -provide more information. -

NOTIFY_OUT_TIMEOUT retry notify to %1#%2

-The notify message to the given address (noted as address#port) has -timed out, and the message will be resent until the max retry limit -is reached. -

NOTIFY_OUT_ZONE_BAD_SOA Zone %1 is invalid in terms of SOA

-This is a warning issued when the notify_out module finds a zone that -doesn't have an SOA RR or has multiple SOA RRs. Notify message won't -be sent to such a zone. -

NOTIFY_OUT_ZONE_NO_NS Zone %1 doesn't have NS RR

-This is a warning issued when the notify_out module finds a zone that -doesn't have an NS RR. Notify message won't be sent to such a zone. -

NSAS_EMPTY_RESPONSE response to query for %1 returned an empty answer section

-The NSAS (nameserver address store - part of the resolver) made a query -for information it needed. The query completed successfully but the -answer section in the response was empty. -

NSAS_ERROR_RESPONSE error response of %1 returned in query for %2

-The NSAS (nameserver address store - part of the resolver) made a query -for information it needed. The query completed successfully but the -RCODE in the response was something other than NOERROR. -

NSAS_FIND_NS_ADDRESS asking resolver to obtain A and AAAA records for %1

-A debug message issued when the NSAS (nameserver address store - part -of the resolver) is making a callback into the resolver to retrieve the -address records for the specified nameserver. -

NSAS_FOUND_ADDRESS found address %1 for %2

-A debug message issued when the NSAS (nameserver address store - part -of the resolver) has retrieved the given address for the specified -nameserver through an external query. -

NSAS_LOOKUP_CANCEL lookup for zone %1 has been canceled

-A debug message issued when an NSAS (nameserver address store - part of -the resolver) lookup for a zone has been canceled. -

NSAS_NS_LOOKUP_FAIL failed to lookup any %1 for %2

-A debug message issued when the NSAS (nameserver address store - part of -the resolver) has been unable to retrieve the specified resource record -for the specified nameserver. This is not necessarily a problem - the -nameserver may be unreachable, in which case the NSAS will try other -nameservers in the zone. -

NSAS_NULL_RESPONSE got null message in success callback for query for %1

-The NSAS (nameserver address store - part of the resolver) made a query -for information it needed. The query completed successfully, but the -message passed to the callback was null. -

-This message indicates an internal error in the NSAS. Please raise a -bug report. -

NSAS_SEARCH_ZONE_NS searching NSAS for nameservers for zone %1

-A debug message output when a call is made to the NSAS (nameserver -address store - part of the resolver) to obtain the nameservers for -the specified zone. -

NSAS_UPDATE_RTT update RTT for %1: was %2 ms, is now %3 ms

-A NSAS (nameserver address store - part of the resolver) debug message -reporting the update of a round-trip time (RTT) for a query made to the -specified nameserver. The RTT has been updated using the value given -and the new RTT is displayed. (The RTT is subject to a calculation that -damps out sudden changes. As a result, the new RTT used by the NSAS in -future decisions of which nameserver to use is not necessarily equal to -the RTT reported.) -

NSAS_WRONG_ANSWER queried for %1 RR of type/class %2/%3, received response %4/%5

-A NSAS (nameserver address store - part of the resolver) made a query for -a resource record of a particular type and class, but instead received -an answer with a different given type and class. -

-This message indicates an internal error in the NSAS. Please raise a -bug report. -

PYSERVER_COMMON_DNS_TCP_SEND_DONE completed sending TCP message to %1 (%2 bytes in total)

-Debug message. A complete DNS message has been successfully -transmitted over a TCP connection, possibly after multiple send -operations. The destination address and the total size of the message -(including the 2-byte length field) are shown in the log message. -

PYSERVER_COMMON_DNS_TCP_SEND_ERROR failed to send TCP message to %1 (%2/%3 bytes sent): %4

-A DNS message has been attempted to be sent out over a TCP connection, -but it failed due to some network error. Although it's not expected -to happen too often, it can still happen for various reasons. The -administrator may want to examine the cause of the failure, which is -included in the log message, to see if it requires some action to -be taken at the server side. When this message is logged, the -corresponding TCP connection was closed immediately after the error -was detected. -

PYSERVER_COMMON_DNS_TCP_SEND_PENDING sent part TCP message to %1 (up to %2/%3 bytes)

-Debug message. A part of DNS message has been transmitted over a TCP -connection, and it's suspended because further attempt would block. -The destination address and the total size of the message that has -been transmitted so far (including the 2-byte length field) are shown -in the log message. -

PYSERVER_COMMON_TSIG_KEYRING_DEINIT Deinitializing global TSIG keyring

-A debug message noting that the global TSIG keyring is being removed from -memory. Most programs don't do that, they just exit, which is OK. -

PYSERVER_COMMON_TSIG_KEYRING_INIT Initializing global TSIG keyring

-A debug message noting the TSIG keyring storage is being prepared. It should -appear at most once in the lifetime of a program. The keyring still needs -to be loaded from configuration. -

PYSERVER_COMMON_TSIG_KEYRING_UPDATE Updating global TSIG keyring

-A debug message. The TSIG keyring is being (re)loaded from configuration. -This happens at startup or when the configuration changes. The old keyring -is removed and new one created with all the keys. -

RESLIB_ANSWER answer received in response to query for <%1>

-A debug message reporting that an answer has been received to an upstream -query for the specified question. Previous debug messages will have -indicated the server to which the question was sent. -

RESLIB_CNAME CNAME received in response to query for <%1>

-A debug message recording that CNAME response has been received to an -upstream query for the specified question. Previous debug messages will -have indicated the server to which the question was sent. -

RESLIB_DEEPEST did not find <%1> in cache, deepest delegation found is %2

-A debug message, a cache lookup did not find the specified <name, -class, type> tuple in the cache; instead, the deepest delegation found -is indicated. -

RESLIB_EMPTY_RESPONSE empty response received to query for <%1>

-A debug message, the response to the specified query from an upstream -nameserver did not contain anything in the answer or authority sections, -although in all other respects it was a valid response. A SERVFAIL will -be returned to the system making the original query. -

RESLIB_ERROR_RESPONSE unspecified error received in response to query for <%1>

-A debug message, the response to the specified query to an upstream -nameserver indicated that the response was classified as an erroneous -response, but that the nature of the error cannot be identified. -A SERVFAIL will be returned to the system making the original query. -

RESLIB_EXTRADATA_RESPONSE extra data in response to query for <%1>

-A debug message indicating that the response to the specified query -from an upstream nameserver contained too much data. This can happen if -an ANY query was sent and the answer section in the response contained -multiple RRs with different names. A SERVFAIL will be returned to the -system making the original query. -

RESLIB_FOLLOW_CNAME following CNAME chain to <%1>

-A debug message, a CNAME response was received and another query is -being issued for the <name, class, type> tuple. -

RESLIB_INVALID_NAMECLASS_RESPONSE invalid name or class in response to query for <%1>

-A debug message, the response to the specified query from an upstream -nameserver (as identified by the ID of the response) contained either -an answer not matching the query name or an answer having a different -class to that queried for. A SERVFAIL will be returned to the system -making the original query. -

RESLIB_INVALID_QNAME_RESPONSE invalid name or class in response to query for <%1>

-A debug message, the response to the specified query from an upstream -nameserver (as identified by the ID of the response) contained a name -in the question section that did not match that of the query. A SERVFAIL -will be returned to the system making the original query. -

RESLIB_INVALID_TYPE_RESPONSE invalid name or class in response to query for <%1>

-A debug message, the response to the specified query from an upstream -nameserver (as identified by the ID of the response) contained an -invalid type field. A SERVFAIL will be returned to the system making -the original query. -

RESLIB_LONG_CHAIN CNAME received in response to query for <%1>: CNAME chain length exceeded

-A debug message recording that a CNAME response has been received to an upstream -query for the specified question (Previous debug messages will have indicated -the server to which the question was sent). However, receipt of this CNAME -has meant that the resolver has exceeded the CNAME chain limit (a CNAME chain -is where on CNAME points to another) and so an error is being returned. -

RESLIB_MULTIPLE_CLASS_RESPONSE response to query for <%1> contained multiple RRsets with different classes

-A debug message reporting that the response to an upstream query for -the specified name contained multiple RRsets in the answer and not all -were of the same class. This is a violation of the standard and so a -SERVFAIL will be returned. -

RESLIB_NOTSINGLE_RESPONSE response to query for <%1> was not a response

-A debug message, the response to the specified query from an upstream -nameserver was a CNAME that had mutiple RRs in the RRset. This is -an invalid response according to the standards so a SERVFAIL will be -returned to the system making the original query. -

RESLIB_NOT_ONE_QNAME_RESPONSE not one question in response to query for <%1>

-A debug message, the response to the specified query from an upstream -nameserver (as identified by the ID of the response) did not contain -one name in the question section as required by the standard. A SERVFAIL -will be returned to the system making the original query. -

RESLIB_NOT_RESPONSE response to query for <%1> was not a response

-A debug message, the response to the specified query from an upstream -nameserver (as identified by the ID of the response) did not have the QR -bit set (thus indicating that the packet was a query, not a response). -A SERVFAIL will be returned to the system making the original query. -

RESLIB_NO_NS_RRSET no NS RRSet in referral response received to query for <%1>

-A debug message, this indicates that a response was received for the specified -query and was categorized as a referral. However, the received message did -not contain any NS RRsets. This may indicate a programming error in the -response classification code. -

RESLIB_NSAS_LOOKUP looking up nameserver for zone %1 in the NSAS

-A debug message, the RunningQuery object is querying the NSAS for the -nameservers for the specified zone. -

RESLIB_NXDOM_NXRR NXDOMAIN/NXRRSET received in response to query for <%1>

-A debug message recording that either a NXDOMAIN or an NXRRSET response has -been received to an upstream query for the specified question. Previous debug -messages will have indicated the server to which the question was sent. -

RESLIB_OPCODE_RESPONSE response to query for <%1> did not have query opcode

-A debug message, the response to the specified query from an upstream -nameserver was a response that did not have the opcode set to that of -a query. According to the standards, this is an invalid response to -the query that was made, so a SERVFAIL will be returned to the system -making the original query. -

RESLIB_PROTOCOL protocol error in answer for %1: %3

-A debug message indicating that a protocol error was received. As there -are no retries left, an error will be reported. -

RESLIB_PROTOCOL_RETRY protocol error in answer for %1: %2 (retries left: %3)

-A debug message indicating that a protocol error was received and that -the resolver is repeating the query to the same nameserver. After this -repeated query, there will be the indicated number of retries left. -

RESLIB_RCODE_ERROR response to query for <%1> returns RCODE of %2

-A debug message, the response to the specified query indicated an error -that is not covered by a specific code path. A SERVFAIL will be returned. -

RESLIB_RECQ_CACHE_FIND found <%1> in the cache (resolve() instance %2)

-This is a debug message and indicates that a RecursiveQuery object found the -the specified <name, class, type> tuple in the cache. The instance number -at the end of the message indicates which of the two resolve() methods has -been called. -

RESLIB_RECQ_CACHE_NO_FIND did not find <%1> in the cache, starting RunningQuery (resolve() instance %2)

-This is a debug message and indicates that the look in the cache made by the -RecursiveQuery::resolve() method did not find an answer, so a new RunningQuery -object has been created to resolve the question. The instance number at -the end of the message indicates which of the two resolve() methods has -been called. -

RESLIB_REFERRAL referral received in response to query for <%1>

-A debug message recording that a referral response has been received to an -upstream query for the specified question. Previous debug messages will -have indicated the server to which the question was sent. -

RESLIB_REFER_ZONE referred to zone %1

-A debug message indicating that the last referral message was to the specified -zone. -

RESLIB_RESOLVE asked to resolve <%1> (resolve() instance %2)

-A debug message, the RecursiveQuery::resolve method has been called to resolve -the specified <name, class, type> tuple. The first action will be to lookup -the specified tuple in the cache. The instance number at the end of the -message indicates which of the two resolve() methods has been called. -

RESLIB_RRSET_FOUND found single RRset in the cache when querying for <%1> (resolve() instance %2)

-A debug message, indicating that when RecursiveQuery::resolve queried the -cache, a single RRset was found which was put in the answer. The instance -number at the end of the message indicates which of the two resolve() -methods has been called. -

RESLIB_RTT round-trip time of last query calculated as %1 ms

-A debug message giving the round-trip time of the last query and response. -

RESLIB_RUNQ_CACHE_FIND found <%1> in the cache

-This is a debug message and indicates that a RunningQuery object found -the specified <name, class, type> tuple in the cache. -

RESLIB_RUNQ_CACHE_LOOKUP looking up up <%1> in the cache

-This is a debug message and indicates that a RunningQuery object has made -a call to its doLookup() method to look up the specified <name, class, type> -tuple, the first action of which will be to examine the cache. -

RESLIB_RUNQ_FAIL failure callback - nameservers are unreachable

-A debug message indicating that a RunningQuery's failure callback has been -called because all nameservers for the zone in question are unreachable. -

RESLIB_RUNQ_SUCCESS success callback - sending query to %1

-A debug message indicating that a RunningQuery's success callback has been -called because a nameserver has been found, and that a query is being sent -to the specified nameserver. -

RESLIB_TCP_TRUNCATED TCP response to query for %1 was truncated

-This is a debug message logged when a response to the specified query to an -upstream nameserver returned a response with the TC (truncation) bit set. This -is treated as an error by the code. -

RESLIB_TEST_SERVER setting test server to %1(%2)

-This is a warning message only generated in unit tests. It indicates -that all upstream queries from the resolver are being routed to the -specified server, regardless of the address of the nameserver to which -the query would normally be routed. If seen during normal operation, -please submit a bug report. -

RESLIB_TEST_UPSTREAM sending upstream query for <%1> to test server at %2

-This is a debug message and should only be seen in unit tests. A query for -the specified <name, class, type> tuple is being sent to a test nameserver -whose address is given in the message. -

RESLIB_TIMEOUT query <%1> to %2 timed out

-A debug message indicating that the specified upstream query has timed out and -there are no retries left. -

RESLIB_TIMEOUT_RETRY query <%1> to %2 timed out, re-trying (retries left: %3)

-A debug message indicating that the specified query has timed out and that -the resolver is repeating the query to the same nameserver. After this -repeated query, there will be the indicated number of retries left. -

RESLIB_TRUNCATED response to query for <%1> was truncated, re-querying over TCP

-A debug message, this indicates that the response to the specified query was -truncated and that the resolver will be re-querying over TCP. There are -various reasons why responses may be truncated, so this message is normal and -gives no cause for concern. -

RESLIB_UPSTREAM sending upstream query for <%1> to %2

-A debug message indicating that a query for the specified <name, class, type> -tuple is being sent to a nameserver whose address is given in the message. -

RESOLVER_AXFR_TCP AXFR request received over TCP

-This is a debug message output when the resolver received a request for -an AXFR (full transfer of a zone) over TCP. Only authoritative servers -are able to handle AXFR requests, so the resolver will return an error -message to the sender with the RCODE set to NOTIMP. -

RESOLVER_AXFR_UDP AXFR request received over UDP

-This is a debug message output when the resolver received a request for -an AXFR (full transfer of a zone) over UDP. Only authoritative servers -are able to handle AXFR requests (and in any case, an AXFR request should -be sent over TCP), so the resolver will return an error message to the -sender with the RCODE set to NOTIMP. -

RESOLVER_CLIENT_TIME_SMALL client timeout of %1 is too small

-During the update of the resolver's configuration parameters, the value -of the client timeout was found to be too small. The configuration -update was abandoned and the parameters were not changed. -

RESOLVER_CONFIG_CHANNEL configuration channel created

-This is a debug message output when the resolver has successfully -established a connection to the configuration channel. -

RESOLVER_CONFIG_ERROR error in configuration: %1

-An error was detected in a configuration update received by the -resolver. This may be in the format of the configuration message (in -which case this is a programming error) or it may be in the data supplied -(in which case it is a user error). The reason for the error, included -in the message, will give more details. The configuration update is -not applied and the resolver parameters were not changed. -

RESOLVER_CONFIG_LOADED configuration loaded

-This is a debug message output when the resolver configuration has been -successfully loaded. -

RESOLVER_CONFIG_UPDATED configuration updated: %1

-This is a debug message output when the resolver configuration is being -updated with the specified information. -

RESOLVER_CREATED main resolver object created

-This is a debug message indicating that the main resolver object has -been created. -

RESOLVER_DNS_MESSAGE_RECEIVED DNS message received: %1

-This is a debug message from the resolver listing the contents of a -received DNS message. -

RESOLVER_DNS_MESSAGE_SENT DNS message of %1 bytes sent: %2

-This is a debug message containing details of the response returned by -the resolver to the querying system. -

RESOLVER_FAILED resolver failed, reason: %1

-This is an error message output when an unhandled exception is caught -by the resolver. After this, the resolver will shut itself down. -Please submit a bug report. -

RESOLVER_FORWARD_ADDRESS setting forward address %1(%2)

-If the resolver is running in forward mode, this message will appear -during startup to list the forward address. If multiple addresses are -specified, it will appear once for each address. -

RESOLVER_FORWARD_QUERY processing forward query

-This is a debug message indicating that a query received by the resolver -has passed a set of checks (message is well-formed, it is allowed by the -ACL, it is a supported opcode, etc.) and is being forwarded to upstream -servers. -

RESOLVER_HEADER_ERROR message received, exception when processing header: %1

-This is a debug message from the resolver noting that an exception -occurred during the processing of a received packet. The packet has -been dropped. -

RESOLVER_IXFR IXFR request received

-This is a debug message indicating that the resolver received a request -for an IXFR (incremental transfer of a zone). Only authoritative servers -are able to handle IXFR requests, so the resolver will return an error -message to the sender with the RCODE set to NOTIMP. -

RESOLVER_LOOKUP_TIME_SMALL lookup timeout of %1 is too small

-During the update of the resolver's configuration parameters, the value -of the lookup timeout was found to be too small. The configuration -update will not be applied. -

RESOLVER_MESSAGE_ERROR error parsing received message: %1 - returning %2

-This is a debug message noting that parsing of the body of a received -message by the resolver failed due to some error (although the parsing of -the header succeeded). The message parameters give a textual description -of the problem and the RCODE returned. -

RESOLVER_NEGATIVE_RETRIES negative number of retries (%1) specified in the configuration

-This error is issued when a resolver configuration update has specified -a negative retry count: only zero or positive values are valid. The -configuration update was abandoned and the parameters were not changed. -

RESOLVER_NON_IN_PACKET non-IN class request received, returning REFUSED message

-This debug message is issued when resolver has received a DNS packet that -was not IN (Internet) class. The resolver cannot handle such packets, -so is returning a REFUSED response to the sender. -

RESOLVER_NORMAL_QUERY processing normal query

-This is a debug message indicating that the query received by the resolver -has passed a set of checks (message is well-formed, it is allowed by the -ACL, it is a supported opcode, etc.) and is being processed by the resolver. -

RESOLVER_NOTIFY_RECEIVED NOTIFY arrived but server is not authoritative

-The resolver has received a NOTIFY message. As the server is not -authoritative it cannot process it, so it returns an error message to -the sender with the RCODE set to NOTAUTH. -

RESOLVER_NOT_ONE_QUESTION query contained %1 questions, exactly one question was expected

-This debug message indicates that the resolver received a query that -contained the number of entries in the question section detailed in -the message. This is a malformed message, as a DNS query must contain -only one question. The resolver will return a message to the sender -with the RCODE set to FORMERR. -

RESOLVER_NO_ROOT_ADDRESS no root addresses available

-A warning message issued during resolver startup, this indicates that -no root addresses have been set. This may be because the resolver will -get them from a priming query. -

RESOLVER_PARSE_ERROR error parsing received message: %1 - returning %2

-This is a debug message noting that the resolver received a message and -the parsing of the body of the message failed due to some non-protocol -related reason (although the parsing of the header succeeded). -The message parameters give a textual description of the problem and -the RCODE returned. -

RESOLVER_PRINT_COMMAND print message command, arguments are: %1

-This debug message is logged when a "print_message" command is received -by the resolver over the command channel. -

RESOLVER_PROTOCOL_ERROR protocol error parsing received message: %1 - returning %2

-This is a debug message noting that the resolver received a message and -the parsing of the body of the message failed due to some protocol error -(although the parsing of the header succeeded). The message parameters -give a textual description of the problem and the RCODE returned. -

RESOLVER_QUERY_ACCEPTED query accepted: '%1/%2/%3' from %4

-This debug message is produced by the resolver when an incoming query -is accepted in terms of the query ACL. The log message shows the query -in the form of <query name>/<query type>/<query class>, and the client -that sends the query in the form of <Source IP address>#<source port>. -

RESOLVER_QUERY_DROPPED query dropped: '%1/%2/%3' from %4

-This is an informational message that indicates an incoming query has -been dropped by the resolver because of the query ACL. Unlike the -RESOLVER_QUERY_REJECTED case, the server does not return any response. -The log message shows the query in the form of <query name>/<query -type>/<query class>, and the client that sends the query in the form of -<Source IP address>#<source port>. -

RESOLVER_QUERY_REJECTED query rejected: '%1/%2/%3' from %4

-This is an informational message that indicates an incoming query has -been rejected by the resolver because of the query ACL. This results -in a response with an RCODE of REFUSED. The log message shows the query -in the form of <query name>/<query type>/<query class>, and the client -that sends the query in the form of <Source IP address>#<source port>. -

RESOLVER_QUERY_SETUP query setup

-This is a debug message noting that the resolver is creating a -RecursiveQuery object. -

RESOLVER_QUERY_SHUTDOWN query shutdown

-This is a debug message noting that the resolver is destroying a -RecursiveQuery object. -

RESOLVER_QUERY_TIME_SMALL query timeout of %1 is too small

-During the update of the resolver's configuration parameters, the value -of the query timeout was found to be too small. The configuration -parameters were not changed. -

RESOLVER_RECEIVED_MESSAGE resolver has received a DNS message

-This is a debug message indicating that the resolver has received a -DNS message. Depending on the debug settings, subsequent log output -will indicate the nature of the message. -

RESOLVER_RECURSIVE running in recursive mode

-This is an informational message that appears at startup noting that -the resolver is running in recursive mode. -

RESOLVER_SERVICE_CREATED service object created

-This debug message is output when resolver creates the main service object -(which handles the received queries). -

RESOLVER_SET_PARAMS query timeout: %1, client timeout: %2, lookup timeout: %3, retry count: %4

-This debug message lists the parameters being set for the resolver. These are: -query timeout: the timeout (in ms) used for queries originated by the resolver -to upstream servers. Client timeout: the interval to resolve a query by -a client: after this time, the resolver sends back a SERVFAIL to the client -whilst continuing to resolve the query. Lookup timeout: the time at which the -resolver gives up trying to resolve a query. Retry count: the number of times -the resolver will retry a query to an upstream server if it gets a timeout. -

-The client and lookup timeouts require a bit more explanation. The -resolution of the client query might require a large number of queries to -upstream nameservers. Even if none of these queries timeout, the total time -taken to perform all the queries may exceed the client timeout. When this -happens, a SERVFAIL is returned to the client, but the resolver continues -with the resolution process; data received is added to the cache. However, -there comes a time - the lookup timeout - when even the resolver gives up. -At this point it will wait for pending upstream queries to complete or -timeout and drop the query. -

RESOLVER_SET_QUERY_ACL query ACL is configured

-This debug message is generated when a new query ACL is configured for -the resolver. -

RESOLVER_SET_ROOT_ADDRESS setting root address %1(%2)

-This message gives the address of one of the root servers used by the -resolver. It is output during startup and may appear multiple times, -once for each root server address. -

RESOLVER_SHUTDOWN resolver shutdown complete

-This informational message is output when the resolver has shut down. -

RESOLVER_SHUTDOWN_RECEIVED received command to shut down

-A debug message noting that the server was asked to terminate and is -complying to the request. -

RESOLVER_STARTED resolver started

-This informational message is output by the resolver when all initialization -has been completed and it is entering its main loop. -

RESOLVER_STARTING starting resolver with command line '%1'

-An informational message, this is output when the resolver starts up. -

RESOLVER_UNEXPECTED_RESPONSE received unexpected response, ignoring

-This is a debug message noting that the resolver received a DNS response -packet on the port on which is it listening for queries. The packet -has been ignored. -

RESOLVER_UNSUPPORTED_OPCODE opcode %1 not supported by the resolver

-This is debug message output when the resolver received a message with an -unsupported opcode (it can only process QUERY opcodes). It will return -a message to the sender with the RCODE set to NOTIMP. -

SOCKETREQUESTOR_CREATED Socket requestor created for application %1

-Debug message. A socket requesor (client of the socket creator) is created -for the corresponding application. Normally this should happen at most -one time throughout the lifetime of the application. -

SOCKETREQUESTOR_DESTROYED Socket requestor destoryed

-Debug message. The socket requestor created at SOCKETREQUESTOR_CREATED -has been destroyed. This event is generally unexpected other than in -test cases. -

SOCKETREQUESTOR_GETSOCKET Received a %1 socket for [%2]:%3, FD=%4, token=%5, path=%6

-Debug message. The socket requestor for the corresponding application -has requested a socket for a set of address, port and protocol (shown -in the log message) and successfully got it from the creator. The -corresponding file descriptor and the associated "token" (an internal -ID used between the creator and requestor) are shown in the log -message. -

SOCKETREQUESTOR_RELEASESOCKET Released a socket of token %1

-Debug message. The socket requestor has released a socket passed by -the creator. The associated token of the socket is shown in the -log message. If the corresponding SOCKETREQUESTOR_GETSOCKET was logged -more detailed information of the socket can be identified by matching -the token. -

SRVCOMM_ADDRESSES_NOT_LIST the address and port specification is not a list in %1

-This points to an error in configuration. What was supposed to be a list of -IP address - port pairs isn't a list at all but something else. -

SRVCOMM_ADDRESS_FAIL failed to listen on addresses (%1)

-The server failed to bind to one of the address/port pair it should according -to configuration, for reason listed in the message (usually because that pair -is already used by other service or missing privileges). The server will try -to recover and bind the address/port pairs it was listening to before (if any). -

SRVCOMM_ADDRESS_MISSING address specification is missing "address" or "port" element in %1

-This points to an error in configuration. An address specification in the -configuration is missing either an address or port and so cannot be used. The -specification causing the error is given in the message. -

SRVCOMM_ADDRESS_TYPE address specification type is invalid in %1

-This points to an error in configuration. An address specification in the -configuration malformed. The specification causing the error is given in the -message. A valid specification contains an address part (which must be a string -and must represent a valid IPv4 or IPv6 address) and port (which must be an -integer in the range valid for TCP/UDP ports on your system). -

SRVCOMM_ADDRESS_UNRECOVERABLE failed to recover original addresses also (%1)

-The recovery of old addresses after SRVCOMM_ADDRESS_FAIL also failed for -the reason listed. -

-The condition indicates problems with the server and/or the system on -which it is running. The server will continue running to allow -reconfiguration, but will not be listening on any address or port until -an administrator does so. -

SRVCOMM_ADDRESS_VALUE address to set: %1#%2

-Debug message. This lists one address and port value of the set of -addresses we are going to listen on (eg. there will be one log message -per pair). This appears only after SRVCOMM_SET_LISTEN, but might -be hidden, as it has higher debug level. -

SRVCOMM_EXCEPTION_ALLOC exception when allocating a socket: %1

-The process tried to allocate a socket using the socket creator, but an error -occurred. But it is not one of the errors we are sure are "safe". In this case -it is unclear if the unsuccessful communication left the process and the bind10 -process in inconsistent state, so the process is going to abort to prevent -further problems in that area. -

-This is probably a bug in the code, but it could be caused by other unusual -conditions (like insufficient memory, deleted socket file used for -communication). -

SRVCOMM_KEYS_DEINIT deinitializing TSIG keyring

-Debug message indicating that the server is deinitializing the TSIG keyring. -

SRVCOMM_KEYS_INIT initializing TSIG keyring

-Debug message indicating that the server is initializing the global TSIG -keyring. This should be seen only at server start. -

SRVCOMM_KEYS_UPDATE updating TSIG keyring

-Debug message indicating new keyring is being loaded from configuration (either -on startup or as a result of configuration update). -

SRVCOMM_PORT_RANGE port out of valid range (%1 in %2)

-This points to an error in configuration. The port in an address -specification is outside the valid range of 0 to 65535. -

SRVCOMM_SET_LISTEN setting addresses to listen to

-Debug message, noting that the server is about to start listening on a -different set of IP addresses and ports than before. -

SRVCOMM_UNKNOWN_EXCEPTION_ALLOC unknown exception when allocating a socket

-The situation is the same as in the SRVCOMM_EXCEPTION_ALLOC case, but further -details about the error are unknown, because it was signaled by throwing -something not being an exception. This is definitely a bug. -

STATHTTPD_BAD_OPTION_VALUE bad command line argument: %1

-The stats-httpd module was called with a bad command-line argument -and will not start. -

STATHTTPD_CC_SESSION_ERROR error connecting to message bus: %1

-The stats-httpd module was unable to connect to the BIND 10 command -and control bus. A likely problem is that the message bus daemon -(b10-msgq) is not running. The stats-httpd module will now shut down. -

STATHTTPD_CLOSING closing %1#%2

-The stats-httpd daemon will stop listening for requests on the given -address and port number. -

STATHTTPD_CLOSING_CC_SESSION stopping cc session

-Debug message indicating that the stats-httpd module is disconnecting -from the command and control bus. -

STATHTTPD_HANDLE_CONFIG reading configuration: %1

-The stats-httpd daemon has received new configuration data and will now -process it. The (changed) data is printed. -

STATHTTPD_RECEIVED_SHUTDOWN_COMMAND shutdown command received

-A shutdown command was sent to the stats-httpd module, and it will -now shut down. -

STATHTTPD_RECEIVED_STATUS_COMMAND received command to return status

-A status command was sent to the stats-httpd module, and it will -respond with 'Stats Httpd is up.' and its PID. -

STATHTTPD_RECEIVED_UNKNOWN_COMMAND received unknown command: %1

-An unknown command has been sent to the stats-httpd module. The -stats-httpd module will respond with an error, and the command will -be ignored. -

STATHTTPD_SERVER_DATAERROR HTTP server data error: %1

-An internal error occurred while handling an HTTP request. An HTTP 404 -response will be sent back, and the specific error is printed. This -is an error condition that likely points the specified data -corresponding to the requested URI is incorrect. -

STATHTTPD_SERVER_ERROR HTTP server error: %1

-An internal error occurred while handling an HTTP request. An HTTP 500 -response will be sent back, and the specific error is printed. This -is an error condition that likely points to a module that is not -responding correctly to statistic requests. -

STATHTTPD_SERVER_INIT_ERROR HTTP server initialization error: %1

-There was a problem initializing the HTTP server in the stats-httpd -module upon receiving its configuration data. The most likely cause -is a port binding problem or a bad configuration value. The specific -error is printed in the message. The new configuration is ignored, -and an error is sent back. -

STATHTTPD_SHUTDOWN shutting down

-The stats-httpd daemon is shutting down. -

STATHTTPD_STARTED listening on %1#%2

-The stats-httpd daemon will now start listening for requests on the -given address and port number. -

STATHTTPD_STARTING_CC_SESSION starting cc session

-Debug message indicating that the stats-httpd module is connecting to -the command and control bus. -

STATHTTPD_START_SERVER_INIT_ERROR HTTP server initialization error: %1

-There was a problem initializing the HTTP server in the stats-httpd -module upon startup. The most likely cause is that it was not able -to bind to the listening port. The specific error is printed, and the -module will shut down. -

STATHTTPD_STOPPED_BY_KEYBOARD keyboard interrupt, shutting down

-There was a keyboard interrupt signal to stop the stats-httpd -daemon. The daemon will now shut down. -

STATHTTPD_UNKNOWN_CONFIG_ITEM unknown configuration item: %1

-The stats-httpd daemon received a configuration update from the -configuration manager. However, one of the items in the -configuration is unknown. The new configuration is ignored, and an -error is sent back. As possible cause is that there was an upgrade -problem, and the stats-httpd version is out of sync with the rest of -the system. -

STATS_BAD_OPTION_VALUE bad command line argument: %1

-The stats module was called with a bad command-line argument and will -not start. -

STATS_CC_SESSION_ERROR error connecting to message bus: %1

-The stats module was unable to connect to the BIND 10 command and -control bus. A likely problem is that the message bus daemon -(b10-msgq) is not running. The stats module will now shut down. -

STATS_RECEIVED_NEW_CONFIG received new configuration: %1

-This debug message is printed when the stats module has received a -configuration update from the configuration manager. -

STATS_RECEIVED_SHOWSCHEMA_ALL_COMMAND received command to show all statistics schema

-The stats module received a command to show all statistics schemas of all modules. -

STATS_RECEIVED_SHOWSCHEMA_NAME_COMMAND received command to show statistics schema for %1

-The stats module received a command to show the specified statistics schema of the specified module. -

STATS_RECEIVED_SHOW_ALL_COMMAND received command to show all statistics

-The stats module received a command to show all statistics that it has -collected. -

STATS_RECEIVED_SHOW_NAME_COMMAND received command to show statistics for %1

-The stats module received a command to show the statistics that it has -collected for the given item. -

STATS_RECEIVED_SHUTDOWN_COMMAND shutdown command received

-A shutdown command was sent to the stats module and it will now shut down. -

STATS_RECEIVED_STATUS_COMMAND received command to return status

-A status command was sent to the stats module. It will return a -response indicating that it is running normally. -

STATS_RECEIVED_UNKNOWN_COMMAND received unknown command: %1

-An unknown command has been sent to the stats module. The stats module -will respond with an error and the command will be ignored. -

STATS_SEND_REQUEST_BOSS requesting boss to send statistics

-This debug message is printed when a request is sent to the boss module -to send its data to the stats module. -

STATS_STARTING starting

-The stats module will be now starting. -

STATS_START_ERROR stats module error: %1

-An internal error occurred while starting the stats module. The stats -module will be now shutting down. -

STATS_STOPPED_BY_KEYBOARD keyboard interrupt, shutting down

-There was a keyboard interrupt signal to stop the stats module. The -daemon will now shut down. -

STATS_UNKNOWN_COMMAND_IN_SPEC unknown command in specification file: %1

-The specification file for the stats module contains a command that -is unknown in the implementation. The most likely cause is an -installation problem, where the specification file stats.spec is -from a different version of BIND 10 than the stats module itself. -Please check your installation. -

XFRIN_AUTH_LOADZONE sending Auth loadzone for origin=%1, class=%2

-There was a successful zone transfer. We send the "loadzone" command for the -zone to b10-auth. -

XFRIN_AXFR_INCONSISTENT_SOA AXFR SOAs are inconsistent for %1: %2 expected, %3 received

-The serial fields of the first and last SOAs of AXFR (including AXFR-style -IXFR) are not the same. According to RFC 5936 these two SOAs must be the -"same" (not only for the serial), but it is still not clear what the -receiver should do if this condition does not hold. There was a discussion -about this at the IETF dnsext wg: -http://www.ietf.org/mail-archive/web/dnsext/current/msg07908.html -and the general feeling seems that it would be better to reject the -transfer if a mismatch is detected. On the other hand, also as noted -in that email thread, neither BIND 9 nor NSD performs any comparison -on the SOAs. For now, we only check the serials (ignoring other fields) -and only leave a warning log message when a mismatch is found. If it -turns out to happen with a real world primary server implementation -and that server actually feeds broken data (e.g. mixed versions of -zone), we can consider a stricter action. -

XFRIN_BAD_MASTER_ADDR_FORMAT bad format for master address: %1

-The given master address is not a valid IP address. -

XFRIN_BAD_MASTER_PORT_FORMAT bad format for master port: %1

-The master port as read from the configuration is not a valid port number. -

XFRIN_BAD_TSIG_KEY_STRING bad TSIG key string: %1

-The TSIG key string as read from the configuration does not represent -a valid TSIG key. -

XFRIN_BAD_ZONE_CLASS Invalid zone class: %1

-The zone class as read from the configuration is not a valid DNS class. -

XFRIN_CC_SESSION_ERROR error reading from cc channel: %1

-There was a problem reading from the command and control channel. The -most likely cause is that xfrin the msgq daemon is not running. -

XFRIN_COMMAND_ERROR error while executing command '%1': %2

-There was an error while the given command was being processed. The -error is given in the log message. -

XFRIN_CONNECT_MASTER error connecting to master at %1: %2

-There was an error opening a connection to the master. The error is -shown in the log message. -

XFRIN_GOT_INCREMENTAL_RESP got incremental response for %1

-In an attempt of IXFR processing, the begenning SOA of the first difference -(following the initial SOA that specified the final SOA for all the -differences) was found. This means a connection for xfrin tried IXFR -and really aot a response for incremental updates. -

XFRIN_GOT_NONINCREMENTAL_RESP got nonincremental response for %1

-Non incremental transfer was detected at the "first data" of a transfer, -which is the RR following the initial SOA. Non incremental transfer is -either AXFR or AXFR-style IXFR. In the latter case, it means that -in a response to IXFR query the first data is not SOA or its SOA serial -is not equal to the requested SOA serial. -

XFRIN_IMPORT_DNS error importing python DNS module: %1

-There was an error importing the python DNS module pydnspp. The most -likely cause is a PYTHONPATH problem. -

XFRIN_IXFR_TRANSFER_SUCCESS incremental IXFR transfer of zone %1 succeeded (messages: %2, changesets: %3, deletions: %4, additions: %5, bytes: %6, run time: %7 seconds, %8 bytes/second)

-The IXFR transfer for the given zone was successful. -The provided information contains the following values: -

-messages: Number of overhead DNS messages in the transfer. -

-changesets: Number of difference sequences. -

-deletions: Number of Resource Records deleted by all the changesets combined, -including the SOA records. -

-additions: Number of Resource Records added by all the changesets combined, -including the SOA records. -

-bytes: Full size of the transfer data on the wire. -

-run time: Time (in seconds) the complete ixfr took. -

-bytes/second: Transfer speed. -

-Note that there is no cross-checking of additions and deletions; if the same -RR gets added and deleted in multiple changesets, it is counted each time; -therefore, for each changeset, there should at least be 1 deletion and 1 -addition (the updated SOA record). -

XFRIN_IXFR_UPTODATE IXFR requested serial for %1 is %2, master has %3, not updating

-The first SOA record in an IXFR response indicates the zone's serial -at the primary server is not newer than the client's. This is -basically unexpected event because normally the client first checks -the SOA serial by an SOA query, but can still happen if the transfer -is manually invoked or (although unlikely) there is a rapid change at -the primary server between the SOA and IXFR queries. The client -implementation confirms the whole response is this single SOA, and -aborts the transfer just like a successful case. -

XFRIN_MSGQ_SEND_ERROR error while contacting %1 and %2

-There was a problem sending a message to the xfrout module or the -zone manager. This most likely means that the msgq daemon has quit or -was killed. -

XFRIN_MSGQ_SEND_ERROR_AUTH error while contacting %1

-There was a problem sending a message to b10-auth. This most likely -means that the msgq daemon has quit or was killed. -

XFRIN_MSGQ_SEND_ERROR_ZONE_MANAGER error while contacting %1

-There was a problem sending a message to the zone manager. This most -likely means that the msgq daemon has quit or was killed. -

XFRIN_NOTIFY_UNKNOWN_MASTER got notification to retransfer zone %1 from %2, expected %3

-The system received a notify for the given zone, but the address it came -from does not match the master address in the Xfrin configuration. The notify -is ignored. This may indicate that the configuration for the master is wrong, -that a wrong machine is sending notifies, or that fake notifies are being sent. -

XFRIN_RETRANSFER_UNKNOWN_ZONE got notification to retransfer unknown zone %1

-There was an internal command to retransfer the given zone, but the -zone is not known to the system. This may indicate that the configuration -for xfrin is incomplete, or there was a typographical error in the -zone name in the configuration. -

XFRIN_STARTED xfrin started

-This informational message is output by xfrin when all initialization -has been completed and it is entering its main loop. -

XFRIN_STOPPED_BY_KEYBOARD keyboard interrupt, shutting down

-There was a keyboard interrupt signal to stop the xfrin daemon. The -daemon will now shut down. -

XFRIN_TRANSFER_SUCCESS full %1 transfer of zone %2 succeeded (messages: %3, records: %4, bytes: %5, run time: %6 seconds, %7 bytes/second)

-The AXFR transfer of the given zone was successful. -The provided information contains the following values: -

-messages: Number of overhead DNS messages in the transfer -

-records: Number of Resource Records in the full transfer, excluding the -final SOA record that marks the end of the AXFR. -

-bytes: Full size of the transfer data on the wire. -

-run time: Time (in seconds) the complete axfr took -

-bytes/second: Transfer speed -

XFRIN_UNKNOWN_ERROR unknown error: %1

-An uncaught exception was raised while running the xfrin daemon. The -exception message is printed in the log message. -

XFRIN_XFR_OTHER_FAILURE %1 transfer of zone %2 failed: %3

-The XFR transfer for the given zone has failed due to a problem outside -of the xfrin module. Possible reasons are a broken DNS message or failure -in database connection. The error is shown in the log message. -

XFRIN_XFR_PROCESS_FAILURE %1 transfer of zone %2/%3 failed: %4

-An XFR session failed outside the main protocol handling. This -includes an error at the data source level at the initialization -phase, unexpected failure in the network connection setup to the -master server, or even more unexpected failure due to unlikely events -such as memory allocation failure. Details of the error are shown in -the log message. In general, these errors are not really expected -ones, and indicate an installation error or a program bug. The -session handler thread tries to clean up all intermediate resources -even on these errors, but it may be incomplete. So, if this log -message continuously appears, system resource consumption should be -checked, and you may even want to disable the corresponding transfers. -You may also want to file a bug report if this message appears so -often. -

XFRIN_XFR_TRANSFER_FAILURE %1 transfer of zone %2 with %3 failed: %4

-The XFR transfer for the given zone has failed due to an internal error. -The error is shown in the log message. -

XFRIN_XFR_TRANSFER_FALLBACK falling back from IXFR to AXFR for %1

-The IXFR transfer of the given zone failed. This might happen in many cases, -such that the remote server doesn't support IXFR, we don't have the SOA record -(or the zone at all), we are out of sync, etc. In many of these situations, -AXFR could still work. Therefore we try that one in case it helps. -

XFRIN_XFR_TRANSFER_PROTOCOL_ERROR %1 transfer of zone %2 with %3 failed: %4

-The XFR transfer for the given zone has failed due to a protocol -error, such as an unexpected response from the primary server. The -error is shown in the log message. It may be because the primary -server implementation is broken or (although less likely) there was -some attack attempt, but it can also happen due to configuration -mismatch such as the remote server does not have authority for the -zone any more but the local configuration hasn't been updated. So it -is recommended to check the primary server configuration. -

XFRIN_XFR_TRANSFER_STARTED %1 transfer of zone %2 started

-A connection to the master server has been made, the serial value in -the SOA record has been checked, and a zone transfer has been started. -

XFRIN_ZONE_CREATED Zone %1 not found in the given data source, newly created

-On starting an xfrin session, it is identified that the zone to be -transferred is not found in the data source. This can happen if a -secondary DNS server first tries to perform AXFR from a primary server -without creating the zone image beforehand (e.g. by b10-loadzone). As -of this writing the xfrin process provides backward compatible -behavior to previous versions: creating a new one in the data source -not to surprise existing users too much. This is probably not a good -idea, however, in terms of who should be responsible for managing -zones at a higher level. In future it is more likely that a separate -zone management framework is provided, and the situation where the -given zone isn't found in xfrout will be treated as an error. -

XFRIN_ZONE_MULTIPLE_SOA Zone %1 has %2 SOA RRs

-On starting an xfrin session, it is identified that the zone to be -transferred has multiple SOA RRs. Such a zone is broken, but could be -accidentally configured especially in a data source using "non -captive" backend database. The implementation ignores entire SOA RRs -and tries to continue processing as if the zone were empty. This -means subsequent AXFR can succeed and possibly replace the zone with -valid content, but an IXFR attempt will fail. -

XFRIN_ZONE_NO_SOA Zone %1 does not have SOA

-On starting an xfrin session, it is identified that the zone to be -transferred does not have an SOA RR in the data source. This is not -necessarily an error; if a secondary DNS server first tries to perform -transfer from a primary server, the zone can be empty, and therefore -doesn't have an SOA. Subsequent AXFR will fill in the zone; if the -attempt is IXFR it will fail in query creation. -

XFRIN_ZONE_SERIAL_AHEAD Serial number (%1) for %2 received from master %3 < ours (%4)

-The response to an SOA query prior to xfr indicated that the zone's -SOA serial at the primary server is smaller than that of the xfrin -client. This is not necessarily an error especially if that -particular primary server is another secondary server which hasn't got -the latest version of the zone. But if the primary server is known to -be the real source of the zone, some unexpected inconsistency may have -happened, and you may want to take a closer look. In this case xfrin -doesn't perform subsequent zone transfer. -

XFROUT_BAD_TSIG_KEY_STRING bad TSIG key string: %1

-The TSIG key string as read from the configuration does not represent -a valid TSIG key. -

XFROUT_CC_SESSION_ERROR error reading from cc channel: %1

-There was a problem reading from the command and control channel. The -most likely cause is that the msgq daemon is not running. -

XFROUT_CC_SESSION_TIMEOUT_ERROR timeout waiting for cc response

-There was a problem reading a response from another module over the -command and control channel. The most likely cause is that the -configuration manager b10-cfgmgr is not running. -

XFROUT_CONFIG_ERROR error found in configuration data: %1

-The xfrout process encountered an error when installing the configuration at -startup time. Details of the error are included in the log message. -

XFROUT_FETCH_REQUEST_ERROR socket error while fetching a request from the auth daemon

-There was a socket error while contacting the b10-auth daemon to -fetch a transfer request. The auth daemon may have shutdown. -

XFROUT_HANDLE_QUERY_ERROR error while handling query: %1

-There was a general error handling an xfrout query. The error is shown -in the message. In principle this error should not appear, and points -to an oversight catching exceptions in the right place. However, to -ensure the daemon keeps running, this error is caught and reported. -

XFROUT_IMPORT error importing python module: %1

-There was an error importing a python module. One of the modules needed -by xfrout could not be found. This suggests that either some libraries -are missing on the system, or the PYTHONPATH variable is not correct. -The specific place where this library needs to be depends on your -system and your specific installation. -

XFROUT_IXFR_MULTIPLE_SOA IXFR client %1: authority section has multiple SOAs

-An IXFR request was received with more than one SOA RRs in the authority -section. The xfrout daemon rejects the request with an RCODE of -FORMERR. -

XFROUT_IXFR_NO_JOURNAL_SUPPORT IXFR client %1, %2: journaling not supported in the data source, falling back to AXFR

-An IXFR request was received but the underlying data source did -not support journaling. The xfrout daemon fell back to AXFR-style -IXFR. -

XFROUT_IXFR_NO_SOA IXFR client %1: missing SOA

-An IXFR request was received with no SOA RR in the authority section. -The xfrout daemon rejects the request with an RCODE of FORMERR. -

XFROUT_IXFR_NO_VERSION IXFR client %1, %2: version (%3 to %4) not in journal, falling back to AXFR

-An IXFR request was received, but the requested range of differences -were not found in the data source. The xfrout daemon fell back to -AXFR-style IXFR. -

XFROUT_IXFR_NO_ZONE IXFR client %1, %2: zone not found with journal

-The requested zone in IXFR was not found in the data source -even though the xfrout daemon sucessfully found the SOA RR of the zone -in the data source. This can happen if the administrator removed the -zone from the data source within the small duration between these -operations, but it's more likely to be a bug or broken data source. -Unless you know why this message was logged, and especially if it -happens often, it's advisable to check whether the data source is -valid for this zone. The xfrout daemon considers it a possible, -though unlikely, event, and returns a response with an RCODE of -NOTAUTH. -

XFROUT_IXFR_UPTODATE IXFR client %1, %2: client version is new enough (theirs=%3, ours=%4)

-An IXFR request was received, but the client's SOA version is the same as -or newer than that of the server. The xfrout server responds to the -request with the answer section being just one SOA of that version. -Note: as of this wrting the 'newer version' cannot be identified due to -the lack of support for the serial number arithmetic. This will soon -be implemented. -

XFROUT_MODULECC_SESSION_ERROR error encountered by configuration/command module: %1

-There was a problem in the lower level module handling configuration and -control commands. This could happen for various reasons, but the most likely -cause is that the configuration database contains a syntax error and xfrout -failed to start at initialization. A detailed error message from the module -will also be displayed. -

XFROUT_NEW_CONFIG Update xfrout configuration

-New configuration settings have been sent from the configuration -manager. The xfrout daemon will now apply them. -

XFROUT_NEW_CONFIG_DONE Update xfrout configuration done

-The xfrout daemon is now done reading the new configuration settings -received from the configuration manager. -

XFROUT_NOTIFY_COMMAND received command to send notifies for %1/%2

-The xfrout daemon received a command on the command channel that -NOTIFY packets should be sent for the given zone. -

XFROUT_PARSE_QUERY_ERROR error parsing query: %1

-There was a parse error while reading an incoming query. The parse -error is shown in the log message. A remote client sent a packet we -do not understand or support. The xfrout request will be ignored. -In general, this should only occur for unexpected problems like -memory allocation failures, as the query should already have been -parsed by the b10-auth daemon, before it was passed here. -

XFROUT_PROCESS_REQUEST_ERROR error processing transfer request: %1

-There was an error in receiving a transfer request from b10-auth. -This is generally an unexpected event, but is possible when, for -example, b10-auth terminates in the middle of forwarding the request. -When this happens it's unlikely to be recoverable with the same -communication session with b10-auth, so b10-xfrout drops it and -waits for a new session. In any case, this error indicates that -there's something very wrong in the system, so it's advisable to check -the over all status of the BIND 10 system. -

XFROUT_QUERY_DROPPED %1 client %2: request to transfer %3 dropped

-The xfrout process silently dropped a request to transfer zone to -given host. This is required by the ACLs. The %2 represents the IP -address and port of the peer requesting the transfer, and the %3 -represents the zone name and class. -

XFROUT_QUERY_QUOTA_EXCCEEDED %1 client %2: request denied due to quota (%3)

-The xfr request was rejected because the server was already handling -the maximum number of allowable transfers as specified in the transfers_out -configuration parameter, which is also shown in the log message. The -request was immediately responded and terminated with an RCODE of REFUSED. -This can happen for a busy xfrout server, and you may want to increase -this parameter; if the server is being too busy due to requests from -unexpected clients you may want to restrict the legitimate clients -with ACL. -

XFROUT_QUERY_REJECTED %1 client %2: request to transfer %3 rejected

-The xfrout process rejected (by REFUSED rcode) a request to transfer zone to -given host. This is because of ACLs. The %2 represents the IP -address and port of the peer requesting the transfer, and the %3 -represents the zone name and class. -

XFROUT_RECEIVED_SHUTDOWN_COMMAND shutdown command received

-The xfrout daemon received a shutdown command from the command channel -and will now shut down. -

XFROUT_RECEIVE_FILE_DESCRIPTOR_ERROR error receiving the file descriptor for an XFR connection

-There was an error receiving the file descriptor for the transfer -request from b10-auth. There can be several reasons for this, but -the most likely cause is that b10-auth terminates for some reason -(maybe it's a bug of b10-auth, maybe it's an intentional restart by -the administrator), so depending on how this happens it may or may not -be a serious error. But in any case this is not expected to happen -frequently, and it's advisable to figure out how this happened if -this message is logged. Even if this error happens xfrout will reset -its internal state and will keep receiving further requests. So -if it's just a temporary restart of b10-auth the administrator does -not have to do anything. -

XFROUT_REMOVE_OLD_UNIX_SOCKET_FILE_ERROR error removing unix socket file %1: %2

-The unix socket file xfrout needs for contact with the auth daemon -already exists, and needs to be removed first, but there is a problem -removing it. It is likely that we do not have permission to remove -this file. The specific error is show in the log message. The xfrout -daemon will shut down. -

XFROUT_REMOVE_UNIX_SOCKET_FILE_ERROR error clearing unix socket file %1: %2

-When shutting down, the xfrout daemon tried to clear the unix socket -file used for communication with the auth daemon. It failed to remove -the file. The reason for the failure is given in the error message. -

XFROUT_SOCKET_SELECT_ERROR error while calling select() on request socket: %1

-There was an error while calling select() on the socket that informs -the xfrout daemon that a new xfrout request has arrived. This should -be a result of rare local error such as memory allocation failure and -shouldn't happen under normal conditions. The error is included in the -log message. -

XFROUT_STARTED xfrout started

-This informational message is output by xfrout when all initialization -has been completed and it is entering its main loop. -

XFROUT_STOPPED_BY_KEYBOARD keyboard interrupt, shutting down

-There was a keyboard interrupt signal to stop the xfrout daemon. The -daemon will now shut down. -

XFROUT_STOPPING the xfrout daemon is shutting down

-The current transfer is aborted, as the xfrout daemon is shutting down. -

XFROUT_UNIX_SOCKET_FILE_IN_USE another xfrout process seems to be using the unix socket file %1

-While starting up, the xfrout daemon tried to clear the unix domain -socket needed for contacting the b10-auth daemon to pass requests -on, but the file is in use. The most likely cause is that another -xfrout daemon process is still running. This xfrout daemon (the one -printing this message) will not start. -

XFROUT_XFR_TRANSFER_CHECK_ERROR %1 client %2: check for transfer of %3 failed: %4

-Pre-response check for an incomding XFR request failed unexpectedly. -The most likely cause of this is that some low level error in the data -source, but it may also be other general (more unlikely) errors such -as memory shortage. Some detail of the error is also included in the -message. The xfrout server tries to return a SERVFAIL response in this case. -

XFROUT_XFR_TRANSFER_DONE %1 client %2: transfer of %3 complete

-The transfer of the given zone has been completed successfully, or was -aborted due to a shutdown event. -

XFROUT_XFR_TRANSFER_ERROR %1 client %2: error transferring zone %3: %4

-An uncaught exception was encountered while sending the response to -an AXFR query. The error message of the exception is included in the -log message, but this error most likely points to incomplete exception -handling in the code. -

XFROUT_XFR_TRANSFER_FAILED %1 client %2: transfer of %3 failed, rcode: %4

-A transfer out for the given zone failed. An error response is sent -to the client. The given rcode is the rcode that is set in the error -response. This is either NOTAUTH (we are not authoritative for the -zone), SERVFAIL (our internal database is missing the SOA record for -the zone), or REFUSED (the limit of simultaneous outgoing AXFR -transfers, as specified by the configuration value -Xfrout/max_transfers_out, has been reached). -

XFROUT_XFR_TRANSFER_STARTED %1 client %2: transfer of zone %3 has started

-A transfer out of the given zone has started. -

ZONEMGR_CCSESSION_ERROR command channel session error: %1

-An error was encountered on the command channel. The message indicates -the nature of the error. -

ZONEMGR_JITTER_TOO_BIG refresh_jitter is too big, setting to 0.5

-The value specified in the configuration for the refresh jitter is too large -so its value has been set to the maximum of 0.5. -

ZONEMGR_KEYBOARD_INTERRUPT exiting zonemgr process as result of keyboard interrupt

-An informational message output when the zone manager was being run at a -terminal and it was terminated via a keyboard interrupt signal. -

ZONEMGR_LOAD_ZONE loading zone %1 (class %2)

-This is a debug message indicating that the zone of the specified class -is being loaded. -

ZONEMGR_NO_MASTER_ADDRESS internal BIND 10 command did not contain address of master

-A command received by the zone manager from the Auth module did not -contain the address of the master server from which a NOTIFY message -was received. This may be due to an internal programming error; please -submit a bug report. -

ZONEMGR_NO_SOA zone %1 (class %2) does not have an SOA record

-When loading the named zone of the specified class the zone manager -discovered that the data did not contain an SOA record. The load has -been abandoned. -

ZONEMGR_NO_TIMER_THREAD trying to stop zone timer thread but it is not running

-An attempt was made to stop the timer thread (used to track when zones -should be refreshed) but it was not running. This may indicate an -internal program error. Please submit a bug report. -

ZONEMGR_NO_ZONE_CLASS internal BIND 10 command did not contain class of zone

-A command received by the zone manager from another BIND 10 module did -not contain the class of the zone on which the zone manager should act. -This may be due to an internal programming error; please submit a -bug report. -

ZONEMGR_NO_ZONE_NAME internal BIND 10 command did not contain name of zone

-A command received by the zone manager from another BIND 10 module did -not contain the name of the zone on which the zone manager should act. -This may be due to an internal programming error; please submit a -bug report. -

ZONEMGR_RECEIVE_NOTIFY received NOTIFY command for zone %1 (class %2)

-This is a debug message indicating that the zone manager has received a -NOTIFY command over the command channel. The command is sent by the Auth -process when it is acting as a slave server for the zone and causes the -zone manager to record the master server for the zone and start a timer; -when the timer expires, the master will be polled to see if it contains -new data. -

ZONEMGR_RECEIVE_SHUTDOWN received SHUTDOWN command

-This is a debug message indicating that the zone manager has received -a SHUTDOWN command over the command channel from the Boss process. -It will act on this command and shut down. -

ZONEMGR_RECEIVE_UNKNOWN received unknown command '%1'

-This is a warning message indicating that the zone manager has received -the stated command over the command channel. The command is not known -to the zone manager and although the command is ignored, its receipt -may indicate an internal error. Please submit a bug report. -

ZONEMGR_RECEIVE_XFRIN_FAILED received XFRIN FAILED command for zone %1 (class %2)

-This is a debug message indicating that the zone manager has received -an XFRIN FAILED command over the command channel. The command is sent -by the Xfrin process when a transfer of zone data into the system has -failed, and causes the zone manager to schedule another transfer attempt. -

ZONEMGR_RECEIVE_XFRIN_SUCCESS received XFRIN SUCCESS command for zone %1 (class %2)

-This is a debug message indicating that the zone manager has received -an XFRIN SUCCESS command over the command channel. The command is sent -by the Xfrin process when the transfer of zone data into the system has -succeeded, and causes the data to be loaded and served by BIND 10. -

ZONEMGR_REFRESH_ZONE refreshing zone %1 (class %2)

-The zone manager is refreshing the named zone of the specified class -with updated information. -

ZONEMGR_SELECT_ERROR error with select(): %1

-An attempt to wait for input from a socket failed. The failing operation -is a call to the operating system's select() function, which failed for -the given reason. -

ZONEMGR_SEND_FAIL failed to send command to %1, session has been closed

-The zone manager attempted to send a command to the named BIND 10 module, -but the send failed. The session between the modules has been closed. -

ZONEMGR_SESSION_ERROR unable to establish session to command channel daemon

-The zonemgr process was not able to be started because it could not -connect to the command channel daemon. The most usual cause of this -problem is that the daemon is not running. -

ZONEMGR_SESSION_TIMEOUT timeout on session to command channel daemon

-The zonemgr process was not able to be started because it timed out when -connecting to the command channel daemon. The most usual cause of this -problem is that the daemon is not running. -

ZONEMGR_SHUTDOWN zone manager has shut down

-A debug message, output when the zone manager has shut down completely. -

ZONEMGR_STARTED zonemgr started

-This informational message is output by zonemgr when all initialization -has been completed and it is entering its main loop. -

ZONEMGR_STARTING zone manager starting

-A debug message output when the zone manager starts up. -

ZONEMGR_TIMER_THREAD_RUNNING trying to start timer thread but one is already running

-This message is issued when an attempt is made to start the timer -thread (which keeps track of when zones need a refresh) but one is -already running. It indicates either an error in the program logic or -a problem with stopping a previous instance of the timer. Please submit -a bug report. -

ZONEMGR_UNKNOWN_ZONE_FAIL zone %1 (class %2) is not known to the zone manager

-An XFRIN operation has failed but the zone that was the subject of the -operation is not being managed by the zone manager. This can be either the -result of a bindctl command to transfer in a currently unknown (or mistyped) -zone, or, if this error appears without the administrator giving transfer -commands, it can indicate an error in the program, as it should not have -initiated transfers of unknown zones on its own. -

ZONEMGR_UNKNOWN_ZONE_NOTIFIED notified zone %1 (class %2) is not known to the zone manager

-A NOTIFY was received but the zone that was the subject of the operation -is not being managed by the zone manager. This may indicate an error -in the program (as the operation should not have been initiated if this -were the case). Please submit a bug report. -

ZONEMGR_UNKNOWN_ZONE_SUCCESS zone %1 (class %2) is not known to the zone manager

-An XFRIN operation has succeeded but the zone received is not being -managed by the zone manager. This may indicate an error in the program -(as the operation should not have been initiated if this were the case). -Please submit a bug report. -

-

diff --git a/doc/guide/bind10-messages.xml b/doc/guide/bind10-messages.xml deleted file mode 100644 index 79dfe655ad..0000000000 --- a/doc/guide/bind10-messages.xml +++ /dev/null @@ -1,7116 +0,0 @@ - - - -%version; -]> - - - - - - BIND 10 Messages Manual - - - 2011-2012Internet Systems Consortium, Inc. - - - - BIND 10 is a Domain Name System (DNS) suite managed by - Internet Systems Consortium (ISC). It includes DNS libraries - and modular components for controlling authoritative and - recursive DNS servers. - - - This is the messages manual for BIND 10 version &__VERSION__;. - The most up-to-date version of this document, along with - other documents for BIND 10, can be found at - . - - - - This is the messages manual for BIND 10 version - &__VERSION__;. - - - - Introduction - - This document lists each message that can be logged by the - programs in the BIND 10 package. Each entry in this manual - is of the form: - IDENTIFICATION message-text - ... where "IDENTIFICATION" is the message identification included - in each message logged and "message-text" is the accompanying - message text. The "message-text" may include placeholders of the - form "%1", "%2" etc.; these parameters are replaced by relevant - values when the message is logged. - - - Each entry is also accompanied by a description giving more - information about the circumstances that result in the message - being logged. - - - For information on configuring and using BIND 10 logging, - refer to the BIND 10 Guide. - - - - - BIND 10 Messages - - - - -ASIODNS_FD_ADD_TCP adding a new TCP server by opened fd %1 - -A debug message informing about installing a file descriptor as a server. -The file descriptor number is noted. - - - - -ASIODNS_FD_ADD_UDP adding a new UDP server by opened fd %1 - -A debug message informing about installing a file descriptor as a server. -The file descriptor number is noted. - - - - -ASIODNS_FETCH_COMPLETED upstream fetch to %1(%2) has now completed - -A debug message, this records that the upstream fetch (a query made by the -resolver on behalf of its client) to the specified address has completed. - - - - -ASIODNS_FETCH_STOPPED upstream fetch to %1(%2) has been stopped - -An external component has requested the halting of an upstream fetch. This -is an allowed operation, and the message should only appear if debug is -enabled. - - - - -ASIODNS_OPEN_SOCKET error %1 opening %2 socket to %3(%4) - -The asynchronous I/O code encountered an error when trying to open a socket -of the specified protocol in order to send a message to the target address. -The number of the system error that caused the problem is given in the -message. - - - - -ASIODNS_READ_DATA error %1 reading %2 data from %3(%4) - -The asynchronous I/O code encountered an error when trying to read data from -the specified address on the given protocol. The number of the system -error that caused the problem is given in the message. - - - - -ASIODNS_READ_TIMEOUT receive timeout while waiting for data from %1(%2) - -An upstream fetch from the specified address timed out. This may happen for -any number of reasons and is most probably a problem at the remote server -or a problem on the network. The message will only appear if debug is -enabled. - - - - -ASIODNS_SEND_DATA error %1 sending data using %2 to %3(%4) - -The asynchronous I/O code encountered an error when trying to send data to -the specified address on the given protocol. The number of the system -error that caused the problem is given in the message. - - - - -ASIODNS_UNKNOWN_ORIGIN unknown origin for ASIO error code %1 (protocol: %2, address %3) - -An internal consistency check on the origin of a message from the -asynchronous I/O module failed. This may indicate an internal error; -please submit a bug report. - - - - -ASIODNS_UNKNOWN_RESULT unknown result (%1) when IOFetch::stop() was executed for I/O to %2(%3) - -An internal error indicating that the termination method of the resolver's -upstream fetch class was called with an unknown result code (which is -given in the message). Please submit a bug report. - - - - -AUTH_AXFR_ERROR error handling AXFR request: %1 - -This is a debug message produced by the authoritative server when it -has encountered an error processing an AXFR request. The message gives -the reason for the error, and the server will return a SERVFAIL code to -the sender. - - - - -AUTH_AXFR_UDP AXFR query received over UDP - -This is a debug message output when the authoritative server has received -an AXFR query over UDP. Use of UDP for AXFRs is not permitted by the -protocol, so the server will return a FORMERR error to the sender. - - - - -AUTH_COMMAND_FAILED execution of command channel instruction '%1' failed: %2 - -Execution of the specified command by the authoritative server failed. The -message contains the reason for the failure. - - - - -AUTH_CONFIG_CHANNEL_CREATED configuration session channel created - -This is a debug message indicating that authoritative server has created -the channel to the configuration manager. It is issued during server -startup is an indication that the initialization is proceeding normally. - - - - -AUTH_CONFIG_CHANNEL_ESTABLISHED configuration session channel established - -This is a debug message indicating that authoritative server -has established communication the configuration manager over the -previously-created channel. It is issued during server startup is an -indication that the initialization is proceeding normally. - - - - -AUTH_CONFIG_CHANNEL_STARTED configuration session channel started - -This is a debug message, issued when the authoritative server has -posted a request to be notified when new configuration information is -available. It is issued during server startup is an indication that -the initialization is proceeding normally. - - - - -AUTH_CONFIG_LOAD_FAIL load of configuration failed: %1 - -An attempt to configure the server with information from the configuration -database during the startup sequence has failed. (The reason for -the failure is given in the message.) The server will continue its -initialization although it may not be configured in the desired way. - - - - -AUTH_CONFIG_UPDATE_FAIL update of configuration failed: %1 - -At attempt to update the configuration the server with information -from the configuration database has failed, the reason being given in -the message. - - - - -AUTH_DATA_SOURCE data source database file: %1 - -This is a debug message produced by the authoritative server when it accesses a -datebase data source, listing the file that is being accessed. - - - - -AUTH_DNS_SERVICES_CREATED DNS services created - -This is a debug message indicating that the component that will handling -incoming queries for the authoritative server (DNSServices) has been -successfully created. It is issued during server startup is an indication -that the initialization is proceeding normally. - - - - -AUTH_HEADER_PARSE_FAIL unable to parse header in received DNS packet: %1 - -This is a debug message, generated by the authoritative server when an -attempt to parse the header of a received DNS packet has failed. (The -reason for the failure is given in the message.) The server will drop the -packet. - - - - -AUTH_INVALID_STATISTICS_DATA invalid specification of statistics data specified - -An error was encountered when the authoritiative server specified -statistics data which is invalid for the auth specification file. - - - - -AUTH_LOAD_TSIG loading TSIG keys - -This is a debug message indicating that the authoritative server -has requested the keyring holding TSIG keys from the configuration -database. It is issued during server startup is an indication that the -initialization is proceeding normally. - - - - -AUTH_LOAD_ZONE loaded zone %1/%2 - -This debug message is issued during the processing of the 'loadzone' command -when the authoritative server has successfully loaded the named zone of the -named class. - - - - -AUTH_MEM_DATASRC_DISABLED memory data source is disabled for class %1 - -This is a debug message reporting that the authoritative server has -discovered that the memory data source is disabled for the given class. - - - - -AUTH_MEM_DATASRC_ENABLED memory data source is enabled for class %1 - -This is a debug message reporting that the authoritative server has -discovered that the memory data source is enabled for the given class. - - - - -AUTH_MESSAGE_FORWARD_ERROR failed to forward %1 request from %2: %3 - -The authoritative server tried to forward some type DNS request -message to a separate process (e.g., forwarding dynamic update -requests to b10-ddns) to handle it, but it failed. The authoritative -server returns SERVFAIL to the client on behalf of the separate -process. The error could be configuration mismatch between b10-auth -and the recipient component, or it may be because the requests are -coming too fast and the receipient process cannot keep up with the -rate, or some system level failure. In either case this means the -BIND 10 system is not working as expected, so the administrator should -look into the cause and address the issue. The log message includes -the client's address (and port), and the error message sent from the -lower layer that detects the failure. - - - - -AUTH_NOTIFY_QUESTIONS invalid number of questions (%1) in incoming NOTIFY - -This debug message is logged by the authoritative server when it receives -a NOTIFY packet that contains zero or more than one question. (A valid -NOTIFY packet contains one question.) The server will return a FORMERR -error to the sender. - - - - -AUTH_NOTIFY_RRTYPE invalid question RR type (%1) in incoming NOTIFY - -This debug message is logged by the authoritative server when it receives -a NOTIFY packet that an RR type of something other than SOA in the -question section. (The RR type received is included in the message.) The -server will return a FORMERR error to the sender. - - - - -AUTH_NO_STATS_SESSION session interface for statistics is not available - -The authoritative server had no session with the statistics module at the -time it attempted to send it data: the attempt has been abandoned. This -could be an error in configuration. - - - - -AUTH_NO_XFRIN received NOTIFY but XFRIN session is not running - -This is a debug message produced by the authoritative server when it receives -a NOTIFY packet but the XFRIN process is not running. The packet will be -dropped and nothing returned to the sender. - - - - -AUTH_PACKET_PARSE_ERROR unable to parse received DNS packet: %1 - -This is a debug message, generated by the authoritative server when an -attempt to parse a received DNS packet has failed due to something other -than a protocol error. The reason for the failure is given in the message; -the server will return a SERVFAIL error code to the sender. - - - - -AUTH_PACKET_PROTOCOL_ERROR DNS packet protocol error: %1. Returning %2 - -This is a debug message, generated by the authoritative server when an -attempt to parse a received DNS packet has failed due to a protocol error. -The reason for the failure is given in the message, as is the error code -that will be returned to the sender. - - - - -AUTH_PACKET_RECEIVED message received:\n%1 - -This is a debug message output by the authoritative server when it -receives a valid DNS packet. - -Note: This message includes the packet received, rendered in the form of -multiple lines of text. For this reason, it is suggested that this log message -not be routed to the syslog file, where the multiple lines could confuse -programs that expect a format of one message per line. - - - - -AUTH_PROCESS_FAIL message processing failure: %1 - -This message is generated by the authoritative server when it has -encountered an internal error whilst processing a received packet: -the cause of the error is included in the message. - -The server will return a SERVFAIL error code to the sender of the packet. -This message indicates a potential error in the server. Please open a -bug ticket for this issue. - - - - -AUTH_RECEIVED_COMMAND command '%1' received - -This is a debug message issued when the authoritative server has received -a command on the command channel. - - - - -AUTH_RECEIVED_NOTIFY received incoming NOTIFY for zone name %1, zone class %2 - -This is a debug message reporting that an incoming NOTIFY was received. - - - - -AUTH_RESPONSE_FAILURE exception while building response to query: %1 - -This is a debug message, generated by the authoritative server when an -attempt to create a response to a received DNS packet has failed. The -reason for the failure is given in the log message. A SERVFAIL response -is sent back. The most likely cause of this is an error in the data -source implementation; it is either creating bad responses or raising -exceptions itself. - - - - -AUTH_RESPONSE_FAILURE_UNKNOWN unknown exception while building response to query - -This debug message is similar to AUTH_RESPONSE_FAILURE, but further -details about the error are unknown, because it was signaled by something -which is not an exception. This is definitely a bug. - - - - -AUTH_RESPONSE_RECEIVED received response message, ignoring - -This is a debug message, this is output if the authoritative server -receives a DNS packet with the QR bit set, i.e. a DNS response. The -server ignores the packet as it only responds to question packets. - - - - -AUTH_SEND_ERROR_RESPONSE sending an error response (%1 bytes):\n%2 - -This is a debug message recording that the authoritative server is sending -an error response to the originator of the query. A previous message will -have recorded details of the failure. - -Note: This message includes the packet sent, rendered in the form of -multiple lines of text. For this reason, it is suggested that this log message -not be routed to the syslog file, where the multiple lines could confuse -programs that expect a format of one message per line. - - - - -AUTH_SEND_NORMAL_RESPONSE sending an error response (%1 bytes):\n%2 - -This is a debug message recording that the authoritative server is sending -a response to the originator of a query. - -Note: This message includes the packet sent, rendered in the form of -multiple lines of text. For this reason, it is suggested that this log message -not be routed to the syslog file, where the multiple lines could confuse -programs that expect a format of one message per line. - - - - -AUTH_SERVER_CREATED server created - -An informational message indicating that the authoritative server process has -been created and is initializing. The AUTH_SERVER_STARTED message will be -output when initialization has successfully completed and the server starts -accepting queries. - - - - -AUTH_SERVER_FAILED server failed: %1 - -The authoritative server has encountered a fatal error and is terminating. The -reason for the failure is included in the message. - - - - -AUTH_SERVER_STARTED server started - -Initialization of the authoritative server has completed successfully -and it is entering the main loop, waiting for queries to arrive. - - - - -AUTH_SHUTDOWN asked to stop, doing so - -This is a debug message indicating the server was asked to shut down and it is -complying to the request. - - - - -AUTH_SQLITE3 nothing to do for loading sqlite3 - -This is a debug message indicating that the authoritative server has -found that the data source it is loading is an SQLite3 data source, -so no further validation is needed. - - - - -AUTH_START_DDNS_FORWARDER DDNS UPDATE handling started - -This is a debug message indicating that b10-auth has received a message -that it should internally forward UPDATE message to b10-ddns. When b10-ddns -is not running, b10-auth will respond to UPDATE requests with rcode NOTIMP. -When b10-ddns is running, b10-ddns will handle and respond to the UPDATE -message. - - - - -AUTH_STATS_CHANNEL_CREATED STATS session channel created - -This is a debug message indicating that the authoritative server has -created a channel to the statistics process. It is issued during server -startup is an indication that the initialization is proceeding normally. - - - - -AUTH_STATS_CHANNEL_ESTABLISHED STATS session channel established - -This is a debug message indicating that the authoritative server -has established communication over the previously created statistics -channel. It is issued during server startup is an indication that the -initialization is proceeding normally. - - - - -AUTH_STATS_COMMS communication error in sending statistics data: %1 - -An error was encountered when the authoritative server tried to send data -to the statistics daemon. The message includes additional information -describing the reason for the failure. - - - - -AUTH_STATS_TIMEOUT timeout while sending statistics data: %1 - -The authoritative server sent data to the statistics daemon but received -no acknowledgement within the specified time. The message includes -additional information describing the reason for the failure. - - - - -AUTH_STATS_TIMER_DISABLED statistics timer has been disabled - -This is a debug message indicating that the statistics timer has been -disabled in the authoritative server and no statistics information is -being produced. - - - - -AUTH_STATS_TIMER_SET statistics timer set to %1 second(s) - -This is a debug message indicating that the statistics timer has been -enabled and that the authoritative server will produce statistics data -at the specified interval. - - - - -AUTH_STOP_DDNS_FORWARDER DDNS UPDATE handling stopped - -This is a debug message indicating that b10-auth has received a message -that it should stop internally forwarding UPDATE message to b10-ddns. -b10-auth will no longer forward UPDATE messages to b10-ddns, but will -respond itself with error code NOTIMP. -This message is also logged when the forwarding is restarted (for instance -if b10-ddns is restarted and the internal connection needs to be created -again), in which case it should be followed by AUTH_START_DDNS_FORWARDER. - - - - -AUTH_UNSUPPORTED_OPCODE unsupported opcode: %1 - -This is a debug message, produced when a received DNS packet being -processed by the authoritative server has been found to contain an -unsupported opcode. (The opcode is included in the message.) The server -will return an error code of NOTIMPL to the sender. - - - - -AUTH_XFRIN_CHANNEL_CREATED XFRIN session channel created - -This is a debug message indicating that the authoritative server has -created a channel to the XFRIN (Transfer-in) process. It is issued -during server startup is an indication that the initialization is -proceeding normally. - - - - -AUTH_XFRIN_CHANNEL_ESTABLISHED XFRIN session channel established - -This is a debug message indicating that the authoritative server has -established communication over the previously-created channel to the -XFRIN (Transfer-in) process. It is issued during server startup is an -indication that the initialization is proceeding normally. - - - - -AUTH_ZONEMGR_COMMS error communicating with zone manager: %1 - -This is a debug message output during the processing of a NOTIFY request. -An error (listed in the message) has been encountered whilst communicating -with the zone manager. The NOTIFY request will not be honored. - - - - -AUTH_ZONEMGR_ERROR received error response from zone manager: %1 - -This is a debug message output during the processing of a NOTIFY -request. The zone manager component has been informed of the request, -but has returned an error response (which is included in the message). The -NOTIFY request will not be honored. - - - - -BIND10_CHECK_MSGQ_ALREADY_RUNNING checking if msgq is already running - -The boss process is starting up and will now check if the message bus -daemon is already running. If so, it will not be able to start, as it -needs a dedicated message bus. - - - - -BIND10_COMPONENT_FAILED component %1 (pid %2) failed: %3 - -The process terminated, but the bind10 boss didn't expect it to, which means -it must have failed. - - - - -BIND10_COMPONENT_RESTART component %1 is about to restart - -The named component failed previously and we will try to restart it to provide -as flawless service as possible, but it should be investigated what happened, -as it could happen again. - - - - -BIND10_COMPONENT_START component %1 is starting - -The named component is about to be started by the boss process. - - - - -BIND10_COMPONENT_START_EXCEPTION component %1 failed to start: %2 - -An exception (mentioned in the message) happened during the startup of the -named component. The componet is not considered started and further actions -will be taken about it. - - - - -BIND10_COMPONENT_STOP component %1 is being stopped - -A component is about to be asked to stop willingly by the boss. - - - - -BIND10_COMPONENT_UNSATISFIED component %1 is required to run and failed - -A component failed for some reason (see previous messages). It is either a core -component or needed component that was just started. In any case, the system -can't continue without it and will terminate. - - - - -BIND10_CONFIGURATOR_BUILD building plan '%1' -> '%2' - -A debug message. This indicates that the configurator is building a plan -how to change configuration from the older one to newer one. This does no -real work yet, it just does the planning what needs to be done. - - - - -BIND10_CONFIGURATOR_PLAN_INTERRUPTED configurator plan interrupted, only %1 of %2 done - -There was an exception during some planned task. The plan will not continue and -only some tasks of the plan were completed. The rest is aborted. The exception -will be propagated. - - - - -BIND10_CONFIGURATOR_RECONFIGURE reconfiguring running components - -A different configuration of which components should be running is being -installed. All components that are no longer needed will be stopped and -newly introduced ones started. This happens at startup, when the configuration -is read the first time, or when an operator changes configuration of the boss. - - - - -BIND10_CONFIGURATOR_RUN running plan of %1 tasks - -A debug message. The configurator is about to execute a plan of actions it -computed previously. - - - - -BIND10_CONFIGURATOR_START bind10 component configurator is starting up - -The part that cares about starting and stopping the right component from the -boss process is starting up. This happens only once at the startup of the -boss process. It will start the basic set of processes now (the ones boss -needs to read the configuration), the rest will be started after the -configuration is known. - - - - -BIND10_CONFIGURATOR_STOP bind10 component configurator is shutting down - -The part that cares about starting and stopping processes in the boss is -shutting down. All started components will be shut down now (more precisely, -asked to terminate by their own, if they fail to comply, other parts of -the boss process will try to force them). - - - - -BIND10_CONFIGURATOR_TASK performing task %1 on %2 - -A debug message. The configurator is about to perform one task of the plan it -is currently executing on the named component. - - - - -BIND10_INVALID_STATISTICS_DATA invalid specification of statistics data specified - -An error was encountered when the boss module specified -statistics data which is invalid for the boss specification file. - - - - -BIND10_INVALID_USER invalid user: %1 - -The boss process was started with the -u option, to drop root privileges -and continue running as the specified user, but the user is unknown. - - - - -BIND10_KILLING_ALL_PROCESSES killing all started processes - -The boss module was not able to start every process it needed to start -during startup, and will now kill the processes that did get started. - - - - -BIND10_KILL_PROCESS killing process %1 - -The boss module is sending a kill signal to process with the given name, -as part of the process of killing all started processes during a failed -startup, as described for BIND10_KILLING_ALL_PROCESSES - - - - -BIND10_LOST_SOCKET_CONSUMER consumer %1 of sockets disconnected, considering all its sockets closed - -A connection from one of the applications which requested a socket was -closed. This means the application has terminated, so all the sockets it was -using are now closed and bind10 process can release them as well, unless the -same sockets are used by yet another application. - - - - -BIND10_MSGQ_ALREADY_RUNNING msgq daemon already running, cannot start - -There already appears to be a message bus daemon running. Either an -old process was not shut down correctly, and needs to be killed, or -another instance of BIND10, with the same msgq domain socket, is -running, which needs to be stopped. - - - - -BIND10_MSGQ_DISAPPEARED msgq channel disappeared - -While listening on the message bus channel for messages, it suddenly -disappeared. The msgq daemon may have died. This might lead to an -inconsistent state of the system, and BIND 10 will now shut down. - - - - -BIND10_NO_SOCKET couldn't send a socket for token %1 because of error: %2 - -An error occurred when the bind10 process was asked to send a socket file -descriptor. The error is mentioned, most common reason is that the request -is invalid and may not come from bind10 process at all. - - - - -BIND10_PROCESS_ENDED process %2 of %1 ended with status %3 - -This indicates a process started previously terminated. The process id -and component owning the process are indicated, as well as the exit code. -This doesn't distinguish if the process was supposed to terminate or not. - - - - -BIND10_READING_BOSS_CONFIGURATION reading boss configuration - -The boss process is starting up, and will now process the initial -configuration, as received from the configuration manager. - - - - -BIND10_RECEIVED_COMMAND received command: %1 - -The boss module received a command and shall now process it. The command -is printed. - - - - -BIND10_RECEIVED_NEW_CONFIGURATION received new configuration: %1 - -The boss module received a configuration update and is going to apply -it now. The new configuration is printed. - - - - -BIND10_RECEIVED_SIGNAL received signal %1 - -The boss module received the given signal. - - - - -BIND10_RESURRECTED_PROCESS resurrected %1 (PID %2) - -The given process has been restarted successfully, and is now running -with the given process id. - - - - -BIND10_RESURRECTING_PROCESS resurrecting dead %1 process... - -The given process has ended unexpectedly, and is now restarted. - - - - -BIND10_SELECT_ERROR error in select() call: %1 - -There was a fatal error in the call to select(), used to see if a child -process has ended or if there is a message on the message bus. This -should not happen under normal circumstances and is considered fatal, -so BIND 10 will now shut down. The specific error is printed. - - - - -BIND10_SEND_SIGKILL sending SIGKILL to %1 (PID %2) - -The boss module is sending a SIGKILL signal to the given process. - - - - -BIND10_SEND_SIGTERM sending SIGTERM to %1 (PID %2) - -The boss module is sending a SIGTERM signal to the given process. - - - - -BIND10_SETGID setting GID to %1 - -The boss switches the process group ID to the given value. This happens -when BIND 10 starts with the -u option, and the group ID will be set to -that of the specified user. - - - - -BIND10_SETUID setting UID to %1 - -The boss switches the user it runs as to the given UID. - - - - -BIND10_SHUTDOWN stopping the server - -The boss process received a command or signal telling it to shut down. -It will send a shutdown command to each process. The processes that do -not shut down will then receive a SIGTERM signal. If that doesn't work, -it shall send SIGKILL signals to the processes still alive. - - - - -BIND10_SHUTDOWN_COMPLETE all processes ended, shutdown complete - -All child processes have been stopped, and the boss process will now -stop itself. - - - - -BIND10_SOCKCREATOR_BAD_CAUSE unknown error cause from socket creator: %1 - -The socket creator reported an error when creating a socket. But the function -which failed is unknown (not one of 'S' for socket or 'B' for bind). - - - - -BIND10_SOCKCREATOR_BAD_RESPONSE unknown response for socket request: %1 - -The boss requested a socket from the creator, but the answer is unknown. This -looks like a programmer error. - - - - -BIND10_SOCKCREATOR_EOF eof while expecting data from socket creator - -There should be more data from the socket creator, but it closed the socket. -It probably crashed. - - - - -BIND10_SOCKCREATOR_INIT initializing socket creator parser - -The boss module initializes routines for parsing the socket creator -protocol. - - - - -BIND10_SOCKCREATOR_KILL killing the socket creator - -The socket creator is being terminated the aggressive way, by sending it -sigkill. This should not happen usually. - - - - -BIND10_SOCKCREATOR_TERMINATE terminating socket creator - -The boss module sends a request to terminate to the socket creator. - - - - -BIND10_SOCKCREATOR_TRANSPORT_ERROR transport error when talking to the socket creator: %1 - -Either sending or receiving data from the socket creator failed with the given -error. The creator probably crashed or some serious OS-level problem happened, -as the communication happens only on local host. - - - - -BIND10_SOCKET_CREATED successfully created socket %1 - -The socket creator successfully created and sent a requested socket, it has -the given file number. - - - - -BIND10_SOCKET_ERROR error on %1 call in the creator: %2/%3 - -The socket creator failed to create the requested socket. It failed on the -indicated OS API function with given error. - - - - -BIND10_SOCKET_GET requesting socket [%1]:%2 of type %3 from the creator - -The boss forwards a request for a socket to the socket creator. - - - - -BIND10_STARTED_CC started configuration/command session - -Debug message given when BIND 10 has successfull started the object that -handles configuration and commands. - - - - -BIND10_STARTED_PROCESS started %1 - -The given process has successfully been started. - - - - -BIND10_STARTED_PROCESS_PID started %1 (PID %2) - -The given process has successfully been started, and has the given PID. - - - - -BIND10_STARTING starting BIND10: %1 - -Informational message on startup that shows the full version. - - - - -BIND10_STARTING_CC starting configuration/command session - -Informational message given when BIND 10 is starting the session object -that handles configuration and commands. - - - - -BIND10_STARTING_PROCESS starting process %1 - -The boss module is starting the given process. - - - - -BIND10_STARTING_PROCESS_PORT starting process %1 (to listen on port %2) - -The boss module is starting the given process, which will listen on the -given port number. - - - - -BIND10_STARTING_PROCESS_PORT_ADDRESS starting process %1 (to listen on %2#%3) - -The boss module is starting the given process, which will listen on the -given address and port number (written as <address>#<port>). - - - - -BIND10_STARTUP_COMPLETE BIND 10 started - -All modules have been successfully started, and BIND 10 is now running. - - - - -BIND10_STARTUP_ERROR error during startup: %1 - -There was a fatal error when BIND10 was trying to start. The error is -shown, and BIND10 will now shut down. - - - - -BIND10_STARTUP_UNEXPECTED_MESSAGE unrecognised startup message %1 - -During the startup process, a number of messages are exchanged between the -Boss process and the processes it starts. This error is output when a -message received by the Boss process is recognised as being of the -correct format but is unexpected. It may be that processes are starting -of sequence. - - - - -BIND10_STARTUP_UNRECOGNISED_MESSAGE unrecognised startup message %1 - -During the startup process, a number of messages are exchanged between the -Boss process and the processes it starts. This error is output when a -message received by the Boss process is not recognised. - - - - -BIND10_START_AS_NON_ROOT_AUTH starting b10-auth as a user, not root. This might fail. - -The authoritative server is being started or restarted without root privileges. -If the module needs these privileges, it may have problems starting. -Note that this issue should be resolved by the pending 'socket-creator' -process; once that has been implemented, modules should not need root -privileges anymore. See tickets #800 and #801 for more information. - - - - -BIND10_START_AS_NON_ROOT_RESOLVER starting b10-resolver as a user, not root. This might fail. - -The resolver is being started or restarted without root privileges. -If the module needs these privileges, it may have problems starting. -Note that this issue should be resolved by the pending 'socket-creator' -process; once that has been implemented, modules should not need root -privileges anymore. See tickets #800 and #801 for more information. - - - - -BIND10_STOP_PROCESS asking %1 to shut down - -The boss module is sending a shutdown command to the given module over -the message channel. - - - - -BIND10_UNKNOWN_CHILD_PROCESS_ENDED unknown child pid %1 exited - -An unknown child process has exited. The PID is printed, but no further -action will be taken by the boss process. - - - - -BIND10_WAIT_CFGMGR waiting for configuration manager process to initialize - -The configuration manager process is so critical to operation of BIND 10 -that after starting it, the Boss module will wait for it to initialize -itself before continuing. This debug message is produced during the -wait and may be output zero or more times depending on how long it takes -the configuration manager to start up. The total length of time Boss -will wait for the configuration manager before reporting an error is -set with the command line --wait switch, which has a default value of -ten seconds. - - - - -CACHE_ENTRY_MISSING_RRSET missing RRset to generate message for %1 - -The cache tried to generate the complete answer message. It knows the structure -of the message, but some of the RRsets to be put there are not in cache (they -probably expired already). Therefore it pretends the message was not found. - - - - -CACHE_LOCALZONE_FOUND found entry with key %1 in local zone data - -Debug message, noting that the requested data was successfully found in the -local zone data of the cache. - - - - -CACHE_LOCALZONE_UNKNOWN entry with key %1 not found in local zone data - -Debug message. The requested data was not found in the local zone data. - - - - -CACHE_LOCALZONE_UPDATE updating local zone element at key %1 - -Debug message issued when there's update to the local zone section of cache. - - - - -CACHE_MESSAGES_DEINIT deinitialized message cache - -Debug message. It is issued when the server deinitializes the message cache. - - - - -CACHE_MESSAGES_EXPIRED found an expired message entry for %1 in the message cache - -Debug message. The requested data was found in the message cache, but it -already expired. Therefore the cache removes the entry and pretends it found -nothing. - - - - -CACHE_MESSAGES_FOUND found a message entry for %1 in the message cache - -Debug message. We found the whole message in the cache, so it can be returned -to user without any other lookups. - - - - -CACHE_MESSAGES_INIT initialized message cache for %1 messages of class %2 - -Debug message issued when a new message cache is issued. It lists the class -of messages it can hold and the maximum size of the cache. - - - - -CACHE_MESSAGES_REMOVE removing old instance of %1/%2/%3 first - -Debug message. This may follow CACHE_MESSAGES_UPDATE and indicates that, while -updating, the old instance is being removed prior of inserting a new one. - - - - -CACHE_MESSAGES_UNCACHEABLE not inserting uncacheable message %1/%2/%3 - -Debug message, noting that the given message can not be cached. This is because -there's no SOA record in the message. See RFC 2308 section 5 for more -information. - - - - -CACHE_MESSAGES_UNKNOWN no entry for %1 found in the message cache - -Debug message. The message cache didn't find any entry for the given key. - - - - -CACHE_MESSAGES_UPDATE updating message entry %1/%2/%3 - -Debug message issued when the message cache is being updated with a new -message. Either the old instance is removed or, if none is found, new one -is created. - - - - -CACHE_RESOLVER_DEEPEST looking up deepest NS for %1/%2 - -Debug message. The resolver cache is looking up the deepest known nameserver, -so the resolution doesn't have to start from the root. - - - - -CACHE_RESOLVER_INIT initializing resolver cache for class %1 - -Debug message. The resolver cache is being created for this given class. - - - - -CACHE_RESOLVER_INIT_INFO initializing resolver cache for class %1 - -Debug message, the resolver cache is being created for this given class. The -difference from CACHE_RESOLVER_INIT is only in different format of passed -information, otherwise it does the same. - - - - -CACHE_RESOLVER_LOCAL_MSG message for %1/%2 found in local zone data - -Debug message. The resolver cache found a complete message for the user query -in the zone data. - - - - -CACHE_RESOLVER_LOCAL_RRSET RRset for %1/%2 found in local zone data - -Debug message. The resolver cache found a requested RRset in the local zone -data. - - - - -CACHE_RESOLVER_LOOKUP_MSG looking up message in resolver cache for %1/%2 - -Debug message. The resolver cache is trying to find a message to answer the -user query. - - - - -CACHE_RESOLVER_LOOKUP_RRSET looking up RRset in resolver cache for %1/%2 - -Debug message. The resolver cache is trying to find an RRset (which usually -originates as internally from resolver). - - - - -CACHE_RESOLVER_NO_QUESTION answer message for %1/%2 has empty question section - -The cache tried to fill in found data into the response message. But it -discovered the message contains no question section, which is invalid. -This is likely a programmer error, please submit a bug report. - - - - -CACHE_RESOLVER_UNKNOWN_CLASS_MSG no cache for class %1 - -Debug message. While trying to lookup a message in the resolver cache, it was -discovered there's no cache for this class at all. Therefore no message is -found. - - - - -CACHE_RESOLVER_UNKNOWN_CLASS_RRSET no cache for class %1 - -Debug message. While trying to lookup an RRset in the resolver cache, it was -discovered there's no cache for this class at all. Therefore no data is found. - - - - -CACHE_RESOLVER_UPDATE_MSG updating message for %1/%2/%3 - -Debug message. The resolver is updating a message in the cache. - - - - -CACHE_RESOLVER_UPDATE_RRSET updating RRset for %1/%2/%3 - -Debug message. The resolver is updating an RRset in the cache. - - - - -CACHE_RESOLVER_UPDATE_UNKNOWN_CLASS_MSG no cache for class %1 - -Debug message. While trying to insert a message into the cache, it was -discovered that there's no cache for the class of message. Therefore -the message will not be cached. - - - - -CACHE_RESOLVER_UPDATE_UNKNOWN_CLASS_RRSET no cache for class %1 - -Debug message. While trying to insert an RRset into the cache, it was -discovered that there's no cache for the class of the RRset. Therefore -the message will not be cached. - - - - -CACHE_RRSET_EXPIRED found expired RRset %1/%2/%3 - -Debug message. The requested data was found in the RRset cache. However, it is -expired, so the cache removed it and is going to pretend nothing was found. - - - - -CACHE_RRSET_INIT initializing RRset cache for %1 RRsets of class %2 - -Debug message. The RRset cache to hold at most this many RRsets for the given -class is being created. - - - - -CACHE_RRSET_LOOKUP looking up %1/%2/%3 in RRset cache - -Debug message. The resolver is trying to look up data in the RRset cache. - - - - -CACHE_RRSET_NOT_FOUND no RRset found for %1/%2/%3 in cache - -Debug message which can follow CACHE_RRSET_LOOKUP. This means the data is not -in the cache. - - - - -CACHE_RRSET_REMOVE_OLD removing old RRset for %1/%2/%3 to make space for new one - -Debug message which can follow CACHE_RRSET_UPDATE. During the update, the cache -removed an old instance of the RRset to replace it with the new one. - - - - -CACHE_RRSET_UNTRUSTED not replacing old RRset for %1/%2/%3, it has higher trust level - -Debug message which can follow CACHE_RRSET_UPDATE. The cache already holds the -same RRset, but from more trusted source, so the old one is kept and new one -ignored. - - - - -CACHE_RRSET_UPDATE updating RRset %1/%2/%3 in the cache - -Debug message. The RRset is updating its data with this given RRset. - - - - -CC_ASYNC_READ_FAILED asynchronous read failed (error code = %1) - -This marks a low level error, we tried to read data from the message queue -daemon asynchronously, but the ASIO library returned an error. - - - - -CC_CONN_ERROR error connecting to message queue (%1) - -It is impossible to reach the message queue daemon for the reason given. It -is unlikely there'll be reason for whatever program this currently is to -continue running, as the communication with the rest of BIND 10 is vital -for the components. - - - - -CC_DISCONNECT disconnecting from message queue daemon - -The library is disconnecting from the message queue daemon. This debug message -indicates that the program is trying to shut down gracefully. - - - - -CC_ESTABLISH trying to establish connection with message queue daemon at %1 - -This debug message indicates that the command channel library is about to -connect to the message queue daemon, which should be listening on the UNIX-domain -socket listed in the output. - - - - -CC_ESTABLISHED successfully connected to message queue daemon - -This debug message indicates that the connection was successfully made, this -should follow CC_ESTABLISH. - - - - -CC_GROUP_RECEIVE trying to receive a message - -Debug message, noting that a message is expected to come over the command -channel. - - - - -CC_GROUP_RECEIVED message arrived ('%1', '%2') - -Debug message, noting that we successfully received a message (its envelope and -payload listed). This follows CC_GROUP_RECEIVE, but might happen some time -later, depending if we waited for it or just polled. - - - - -CC_GROUP_SEND sending message '%1' to group '%2' - -Debug message, we're about to send a message over the command channel. - - - - -CC_INVALID_LENGTHS invalid length parameters (%1, %2) - -This happens when garbage comes over the command channel or some kind of -confusion happens in the program. The data received from the socket make no -sense if we interpret it as lengths of message. The first one is total length -of the message; the second is the length of the header. The header -and its length (2 bytes) is counted in the total length. - - - - -CC_LENGTH_NOT_READY length not ready - -There should be data representing the length of message on the socket, but it -is not there. - - - - -CC_NO_MESSAGE no message ready to be received yet - -The program polled for incoming messages, but there was no message waiting. -This is a debug message which may happen only after CC_GROUP_RECEIVE. - - - - -CC_NO_MSGQ unable to connect to message queue (%1) - -It isn't possible to connect to the message queue daemon, for reason listed. -It is unlikely any program will be able continue without the communication. - - - - -CC_READ_ERROR error reading data from command channel (%1) - -A low level error happened when the library tried to read data from the -command channel socket. The reason is listed. - - - - -CC_READ_EXCEPTION error reading data from command channel (%1) - -We received an exception while trying to read data from the command -channel socket. The reason is listed. - - - - -CC_REPLY replying to message from '%1' with '%2' - -Debug message, noting we're sending a response to the original message -with the given envelope. - - - - -CC_SET_TIMEOUT setting timeout to %1ms - -Debug message. A timeout for which the program is willing to wait for a reply -is being set. - - - - -CC_START_READ starting asynchronous read - -Debug message. From now on, when a message (or command) comes, it'll wake the -program and the library will automatically pass it over to correct place. - - - - -CC_SUBSCRIBE subscribing to communication group %1 - -Debug message. The program wants to receive messages addressed to this group. - - - - -CC_TIMEOUT timeout reading data from command channel - -The program waited too long for data from the command channel (usually when it -sent a query to different program and it didn't answer for whatever reason). - - - - -CC_UNSUBSCRIBE unsubscribing from communication group %1 - -Debug message. The program no longer wants to receive messages addressed to -this group. - - - - -CC_WRITE_ERROR error writing data to command channel (%1) - -A low level error happened when the library tried to write data to the command -channel socket. - - - - -CC_ZERO_LENGTH invalid message length (0) - -The library received a message length being zero, which makes no sense, since -all messages must contain at least the envelope. - - - - -CFGMGR_AUTOMATIC_CONFIG_DATABASE_UPDATE Updating configuration database from version %1 to %2 - -An older version of the configuration database has been found, from which -there was an automatic upgrade path to the current version. These changes -are now applied, and no action from the administrator is necessary. - - - - -CFGMGR_BACKED_UP_CONFIG_FILE Config file %1 was removed; a backup was made at %2 - -BIND 10 has been started with the command to clear the configuration -file. The existing file has been backed up (moved) to the given file -name. A new configuration file will be created in the original location -when necessary. - - - - -CFGMGR_BAD_UPDATE_RESPONSE_FROM_MODULE Unable to parse response from module %1: %2 - -The configuration manager sent a configuration update to a module, but -the module responded with an answer that could not be parsed. The answer -message appears to be invalid JSON data, or not decodable to a string. -This is likely to be a problem in the module in question. The update is -assumed to have failed, and will not be stored. - - - - -CFGMGR_CC_SESSION_ERROR Error connecting to command channel: %1 - -The configuration manager daemon was unable to connect to the messaging -system. The most likely cause is that msgq is not running. - - - - -CFGMGR_CONFIG_FILE Configuration manager starting with configuration file: %1 - -The configuration manager is starting, reading and saving the configuration -settings to the shown file. - - - - -CFGMGR_DATA_READ_ERROR error reading configuration database from disk: %1 - -There was a problem reading the persistent configuration data as stored -on disk. The file may be corrupted, or it is of a version from where -there is no automatic upgrade path. The file needs to be repaired or -removed. The configuration manager daemon will now shut down. - - - - -CFGMGR_IOERROR_WHILE_WRITING_CONFIGURATION Unable to write configuration file; configuration not stored: %1 - -There was an IO error from the system while the configuration manager -was trying to write the configuration database to disk. The specific -error is given. The most likely cause is that the directory where -the file is stored does not exist, or is not writable. The updated -configuration is not stored. - - - - -CFGMGR_OSERROR_WHILE_WRITING_CONFIGURATION Unable to write configuration file; configuration not stored: %1 - -There was an OS error from the system while the configuration manager -was trying to write the configuration database to disk. The specific -error is given. The most likely cause is that the system does not have -write access to the configuration database file. The updated -configuration is not stored. - - - - -CFGMGR_STOPPED_BY_KEYBOARD keyboard interrupt, shutting down - -There was a keyboard interrupt signal to stop the cfgmgr daemon. The -daemon will now shut down. - - - - -CMDCTL_BAD_CONFIG_DATA error in config data: %1 - -There was an error reading the updated configuration data. The specific -error is printed. - - - - -CMDCTL_BAD_PASSWORD bad password for user: %1 - -A login attempt was made to b10-cmdctl, but the password was wrong. -Users can be managed with the tool b10-cmdctl-usermgr. - - - - -CMDCTL_CC_SESSION_ERROR error reading from cc channel: %1 - -There was a problem reading from the command and control channel. The -most likely cause is that the message bus daemon is not running. - - - - -CMDCTL_CC_SESSION_TIMEOUT timeout on cc channel - -A timeout occurred when waiting for essential data from the cc session. -This usually occurs when b10-cfgmgr is not running or not responding. -Since we are waiting for essential information, this is a fatal error, -and the cmdctl daemon will now shut down. - - - - -CMDCTL_COMMAND_ERROR error in command %1 to module %2: %3 - -An error was encountered sending the given command to the given module. -Either there was a communication problem with the module, or the module -was not able to process the command, and sent back an error. The -specific error is printed in the message. - - - - -CMDCTL_COMMAND_SENT command '%1' to module '%2' was sent - -This debug message indicates that the given command has been sent to -the given module. - - - - -CMDCTL_NO_SUCH_USER username not found in user database: %1 - -A login attempt was made to b10-cmdctl, but the username was not known. -Users can be added with the tool b10-cmdctl-usermgr. - - - - -CMDCTL_NO_USER_ENTRIES_READ failed to read user information, all users will be denied - -The b10-cmdctl daemon was unable to find any user data in the user -database file. Either it was unable to read the file (in which case -this message follows a message CMDCTL_USER_DATABASE_READ_ERROR -containing a specific error), or the file was empty. Users can be added -with the tool b10-cmdctl-usermgr. - - - - -CMDCTL_SEND_COMMAND sending command %1 to module %2 - -This debug message indicates that the given command is being sent to -the given module. - - - - -CMDCTL_SSL_SETUP_FAILURE_USER_DENIED failed to create an SSL connection (user denied): %1 - -The user was denied because the SSL connection could not successfully -be set up. The specific error is given in the log message. Possible -causes may be that the ssl request itself was bad, or the local key or -certificate file could not be read. - - - - -CMDCTL_STARTED cmdctl is listening for connections on %1:%2 - -The cmdctl daemon has started and is now listening for connections. - - - - -CMDCTL_STOPPED_BY_KEYBOARD keyboard interrupt, shutting down - -There was a keyboard interrupt signal to stop the cmdctl daemon. The -daemon will now shut down. - - - - -CMDCTL_UNCAUGHT_EXCEPTION uncaught exception: %1 - -The b10-cmdctl daemon encountered an uncaught exception and -will now shut down. This is indicative of a programming error and -should not happen under normal circumstances. The exception message -is printed. - - - - -CMDCTL_USER_DATABASE_READ_ERROR failed to read user database file %1: %2 - -The b10-cmdctl daemon was unable to read the user database file. The -file may be unreadable for the daemon, or it may be corrupted. In the -latter case, it can be recreated with b10-cmdctl-usermgr. The specific -error is printed in the log message. - - - - -CONFIG_CCSESSION_MSG error in CC session message: %1 - -There was a problem with an incoming message on the command and control -channel. The message does not appear to be a valid command, and is -missing a required element or contains an unknown data format. This -most likely means that another BIND10 module is sending a bad message. -The message itself is ignored by this module. - - - - -CONFIG_CCSESSION_MSG_INTERNAL error handling CC session message: %1 - -There was an internal problem handling an incoming message on the command -and control channel. An unexpected exception was thrown, details of -which are appended to the message. The module will continue to run, -but will not send back an answer. - -The most likely cause of this error is a programming error. Please raise -a bug report. - - - - -CONFIG_CCSESSION_STOPPING error sending stopping message: %1 - -There was a problem when sending a message signaling that the module using -this CCSession is stopping. This message is sent so that the rest of the -system is aware that the module is no longer running. Apart from logging -this message, the error itself is ignored, and the ModuleCCSession is -still stopped. The specific exception message is printed. - - - - -CONFIG_CCSESSION_STOPPING_UNKNOWN unknown error sending stopping message - -Similar to CONFIG_CCSESSION_STOPPING, but in this case the exception that -is seen is not a standard exception, and further information is unknown. -This is a bug. - - - - -CONFIG_GET_FAIL error getting configuration from cfgmgr: %1 - -The configuration manager returned an error when this module requested -the configuration. The full error message answer from the configuration -manager is appended to the log error. The most likely cause is that -the module is of a different (command specification) version than the -running configuration manager. - - - - -CONFIG_GET_FAILED error getting configuration from cfgmgr: %1 - -The configuration manager returned an error response when the module -requested its configuration. The full error message answer from the -configuration manager is appended to the log error. - - - - -CONFIG_JSON_PARSE JSON parse error in %1: %2 - -There was an error parsing the JSON file. The given file does not appear -to be in valid JSON format. Please verify that the filename is correct -and that the contents are valid JSON. - - - - -CONFIG_LOG_CONFIG_ERRORS error(s) in logging configuration: %1 - -There was a logging configuration update, but the internal validator -for logging configuration found that it contained errors. The errors -are shown, and the update is ignored. - - - - -CONFIG_LOG_EXPLICIT will use logging configuration for explicitly-named logger %1 - -This is a debug message. When processing the "loggers" part of the -configuration file, the configuration library found an entry for the named -logger that matches the logger specification for the program. The logging -configuration for the program will be updated with the information. - - - - -CONFIG_LOG_IGNORE_EXPLICIT ignoring logging configuration for explicitly-named logger %1 - -This is a debug message. When processing the "loggers" part of the -configuration file, the configuration library found an entry for the -named logger. As this does not match the logger specification for the -program, it has been ignored. - - - - -CONFIG_LOG_IGNORE_WILD ignoring logging configuration for wildcard logger %1 - -This is a debug message. When processing the "loggers" part of the -configuration file, the configuration library found the named wildcard -entry (one containing the "*" character) that matched a logger already -matched by an explicitly named entry. The configuration is ignored. - - - - -CONFIG_LOG_WILD_MATCH will use logging configuration for wildcard logger %1 - -This is a debug message. When processing the "loggers" part of -the configuration file, the configuration library found the named -wildcard entry (one containing the "*" character) that matches a logger -specification in the program. The logging configuration for the program -will be updated with the information. - - - - -CONFIG_MOD_SPEC_FORMAT module specification error in %1: %2 - -The given file does not appear to be a valid specification file: details -are included in the message. Please verify that the filename is correct -and that its contents are a valid BIND10 module specification. - - - - -CONFIG_MOD_SPEC_REJECT module specification rejected by cfgmgr: %1 - -The specification file for this module was rejected by the configuration -manager. The full error message answer from the configuration manager is -appended to the log error. The most likely cause is that the module is of -a different (specification file) version than the running configuration -manager. - - - - -CONFIG_OPEN_FAIL error opening %1: %2 - -There was an error opening the given file. The reason for the failure -is included in the message. - - - - -CONFIG_SESSION_STOPPING_FAILED error sending stopping message: %1 - -There was a problem when sending a message signaling that the module using -this CCSession is stopping. This message is sent so that the rest of the -system is aware that the module is no longer running. Apart from logging -this message, the error itself is ignored, and the ModuleCCSession is -still stopped. The specific exception message is printed. - - - - -DATASRC_BAD_NSEC3_NAME NSEC3 record has a bad owner name '%1' - -The software refuses to load NSEC3 records into a wildcard domain or -the owner name has two or more labels below the zone origin. -It isn't explicitly forbidden, but no sane zone wouldn have such names -for NSEC3. BIND 9 also refuses NSEC3 at wildcard, so this behavior is -compatible with BIND 9. - - - - -DATASRC_CACHE_CREATE creating the hotspot cache - -This is a debug message issued during startup when the hotspot cache -is created. - - - - -DATASRC_CACHE_DESTROY destroying the hotspot cache - -Debug information. The hotspot cache is being destroyed. - - - - -DATASRC_CACHE_DISABLE disabling the hotspot cache - -A debug message issued when the hotspot cache is disabled. - - - - -DATASRC_CACHE_ENABLE enabling the hotspot cache - -A debug message issued when the hotspot cache is enabled. - - - - -DATASRC_CACHE_EXPIRED item '%1' in the hotspot cache has expired - -A debug message issued when a hotspot cache lookup located the item but it -had expired. The item was removed and the program proceeded as if the item -had not been found. - - - - -DATASRC_CACHE_FOUND the item '%1' was found - -Debug information. An item was successfully located in the hotspot cache. - - - - -DATASRC_CACHE_FULL hotspot cache is full, dropping oldest - -Debug information. After inserting an item into the hotspot cache, the -maximum number of items was exceeded, so the least recently used item will -be dropped. This should be directly followed by CACHE_REMOVE. - - - - -DATASRC_CACHE_INSERT inserting item '%1' into the hotspot cache - -A debug message indicating that a new item is being inserted into the hotspot -cache. - - - - -DATASRC_CACHE_NOT_FOUND the item '%1' was not found in the hotspot cache - -A debug message issued when hotspot cache was searched for the specified -item but it was not found. - - - - -DATASRC_CACHE_OLD_FOUND older instance of hotspot cache item '%1' found, replacing - -Debug information. While inserting an item into the hotspot cache, an older -instance of an item with the same name was found; the old instance will be -removed. This will be directly followed by CACHE_REMOVE. - - - - -DATASRC_CACHE_REMOVE removing '%1' from the hotspot cache - -Debug information. An item is being removed from the hotspot cache. - - - - -DATASRC_CACHE_SLOTS setting the hotspot cache size to '%1', dropping '%2' items - -The maximum allowed number of items of the hotspot cache is set to the given -number. If there are too many, some of them will be dropped. The size of 0 -means no limit. - - - - -DATASRC_DATABASE_COVER_NSEC_UNSUPPORTED %1 doesn't support DNSSEC when asked for NSEC data covering %2 - -The datasource tried to provide an NSEC proof that the named domain does not -exist, but the database backend doesn't support DNSSEC. No proof is included -in the answer as a result. - - - - -DATASRC_DATABASE_FINDNSEC3 Looking for NSEC3 for %1 in %2 mode - -Debug information. A search in an database data source for NSEC3 that -matches or covers the given name is being started. - - - - -DATASRC_DATABASE_FINDNSEC3_COVER found a covering NSEC3 for %1 at label count %2: %3 - -Debug information. An NSEC3 that covers the given name is found and -being returned. The found NSEC3 RRset is also displayed. When the shown label -count is smaller than that of the given name, the matching NSEC3 is for a -superdomain of the given name (see DATASRC_DATABSE_FINDNSEC3_TRYHASH). The -found NSEC3 RRset is also displayed. - - - - -DATASRC_DATABASE_FINDNSEC3_MATCH found a matching NSEC3 for %1 at label count %2: %3 - -Debug information. An NSEC3 that matches (a possibly superdomain of) -the given name is found and being returned. When the shown label -count is smaller than that of the given name, the matching NSEC3 is -for a superdomain of the given name (see DATASRC_DATABSE_FINDNSEC3_TRYHASH). -The found NSEC3 RRset is also displayed. - - - - -DATASRC_DATABASE_FINDNSEC3_TRYHASH looking for NSEC3 for %1 at label count %2 (hash %3) - -Debug information. In an attempt of finding an NSEC3 for the give name, -(a possibly superdomain of) the name is hashed and searched for in the -NSEC3 name space. When the shown label count is smaller than that of the -shown name, the search tries the superdomain name that share the shown -(higher) label count of the shown name (e.g., for -www.example.com. with shown label count of 3, example.com. is being -tried, as "." is 1 label long). - - - - -DATASRC_DATABASE_FINDNSEC3_TRYHASH_PREV looking for previous NSEC3 for %1 at label count %2 (hash %3) - -Debug information. An exact match on hash (see -DATASRC_DATABASE_FINDNSEC3_TRYHASH) was unsuccessful. We get the previous hash -to that one instead. - - - - -DATASRC_DATABASE_FIND_RECORDS looking in datasource %1 for record %2/%3/%4 - -Debug information. The database data source is looking up records with the given -name and type in the database. - - - - -DATASRC_DATABASE_FIND_TTL_MISMATCH TTL values differ in %1 for elements of %2/%3/%4, setting to %5 - -The datasource backend provided resource records for the given RRset with -different TTL values. This isn't allowed on the wire and is considered -an error, so we set it to the lowest value we found (but we don't modify the -database). The data in database should be checked and fixed. - - - - -DATASRC_DATABASE_FOUND_ANY search in datasource %1 resulted in returning all records of %2 - -The data returned by the database backend contained data for the given domain -name, so all the RRsets of the domain are returned. - - - - -DATASRC_DATABASE_FOUND_CNAME search in datasource %1 for %2/%3/%4 found CNAME, resulting in %5 - -When searching the domain for a name a CNAME was found at that name. -Even though it was not the RR type being sought, it is returned. (The -caller may want to continue the lookup by replacing the query name with -the canonical name and restarting the query with the original RR type.) - - - - -DATASRC_DATABASE_FOUND_DELEGATION Found delegation at %2 in %1 - -When searching for a domain, the program met a delegation to a different zone -at the given domain name. It will return that one instead. - - - - -DATASRC_DATABASE_FOUND_DELEGATION_EXACT search in datasource %1 for %2/%3/%4 found delegation at %5 - -The program found the domain requested, but it is a delegation point to a -different zone, therefore it is not authoritative for this domain name. -It will return the NS record instead. - - - - -DATASRC_DATABASE_FOUND_DNAME Found DNAME at %2 in %1 - -When searching for a domain, the program met a DNAME redirection to a different -place in the domain space at the given domain name. It will return that one -instead. - - - - -DATASRC_DATABASE_FOUND_EMPTY_NONTERMINAL empty non-terminal %2 in %1 - -The domain name does not have any RRs associated with it, so it doesn't -exist in the database. However, it has a subdomain, so it does exist -in the DNS address space. This type of domain is known an an "empty -non-terminal" and so we return NXRRSET instead of NXDOMAIN. - - - - -DATASRC_DATABASE_FOUND_NXDOMAIN search in datasource %1 resulted in NXDOMAIN for %2/%3/%4 - -The data returned by the database backend did not contain any data for the given -domain name, class and type. - - - - -DATASRC_DATABASE_FOUND_NXRRSET search in datasource %1 for %2/%3/%4 resulted in NXRRSET - -The data returned by the database backend contained data for the given domain -name and class, but not for the given type. - - - - -DATASRC_DATABASE_FOUND_NXRRSET_NSEC search in datasource %1 for %2/%3/%4 resulted in RRset %5 - -A search in the database for RRs for the specified name, type and class has -located RRs that match the name and class but not the type. DNSSEC information -has been requested and returned. - - - - -DATASRC_DATABASE_FOUND_RRSET search in datasource %1 resulted in RRset %2 - -The data returned by the database backend contained data for the given domain -name, and it either matches the type or has a relevant type. The RRset that is -returned is printed. - - - - -DATASRC_DATABASE_ITERATE iterating zone %1 - -The program is reading the whole zone, eg. not searching for data, but going -through each of the RRsets there. - - - - -DATASRC_DATABASE_ITERATE_END iterating zone finished - -While iterating through the zone, the program reached end of the data. - - - - -DATASRC_DATABASE_ITERATE_NEXT next RRset in zone is %1/%2 - -While iterating through the zone, the program extracted next RRset from it. -The name and RRtype of the RRset is indicated in the message. - - - - -DATASRC_DATABASE_ITERATE_TTL_MISMATCH TTL values differ for RRs of %1/%2/%3, setting to %4 - -While iterating through the zone, the time to live for RRs of the -given RRset were found to be different. Since an RRset cannot have -multiple TTLs, we set it to the lowest value we found (but we don't -modify the database). This is what the client would do when such RRs -were given in a DNS response according to RFC2181. The data in -database should be checked and fixed. - - - - -DATASRC_DATABASE_JOURNALREADER_END %1/%2 on %3 from %4 to %5 - -This is a debug message indicating that the program (successfully) -reaches the end of sequences of a zone's differences. The zone's name -and class, database name, and the start and end serials are shown in -the message. - - - - -DATASRC_DATABASE_JOURNALREADER_NEXT %1/%2 in %3/%4 on %5 - -This is a debug message indicating that the program retrieves one -difference in difference sequences of a zone and successfully converts -it to an RRset. The zone's name and class, database name, and the -name and RR type of the retrieved diff are shown in the message. - - - - -DATASRC_DATABASE_JOURNALREADER_START %1/%2 on %3 from %4 to %5 - -This is a debug message indicating that the program starts reading -a zone's difference sequences from a database-based data source. The -zone's name and class, database name, and the start and end serials -are shown in the message. - - - - -DATASRC_DATABASE_JOURNALREADR_BADDATA failed to convert a diff to RRset in %1/%2 on %3 between %4 and %5: %6 - -This is an error message indicating that a zone's diff is broken and -the data source library failed to convert it to a valid RRset. The -most likely cause of this is that someone has manually modified the -zone's diff in the database and inserted invalid data as a result. -The zone's name and class, database name, and the start and end -serials, and an additional detail of the error are shown in the -message. The administrator should examine the diff in the database -to find any invalid data and fix it. - - - - -DATASRC_DATABASE_NO_MATCH not match for %2/%3/%4 in %1 - -No match (not even a wildcard) was found in the named data source for the given -name/type/class in the data source. - - - - -DATASRC_DATABASE_UPDATER_COMMIT updates committed for '%1/%2' on %3 - -Debug information. A set of updates to a zone has been successfully -committed to the corresponding database backend. The zone name, -its class and the database name are printed. - - - - -DATASRC_DATABASE_UPDATER_CREATED zone updater created for '%1/%2' on %3 - -Debug information. A zone updater object is created to make updates to -the shown zone on the shown backend database. - - - - -DATASRC_DATABASE_UPDATER_DESTROYED zone updater destroyed for '%1/%2' on %3 - -Debug information. A zone updater object is destroyed, either successfully -or after failure of, making updates to the shown zone on the shown backend -database. - - - - -DATASRC_DATABASE_UPDATER_ROLLBACK zone updates roll-backed for '%1/%2' on %3 - -A zone updater is being destroyed without committing the changes. -This would typically mean the update attempt was aborted due to some -error, but may also be a bug of the application that forgets committing -the changes. The intermediate changes made through the updater won't -be applied to the underlying database. The zone name, its class, and -the underlying database name are shown in the log message. - - - - -DATASRC_DATABASE_UPDATER_ROLLBACKFAIL failed to roll back zone updates for '%1/%2' on %3: %4 - -A zone updater is being destroyed without committing the changes to -the database, and attempts to rollback incomplete updates, but it -unexpectedly fails. The higher level implementation does not expect -it to fail, so this means either a serious operational error in the -underlying data source (such as a system failure of a database) or -software bug in the underlying data source implementation. In either -case if this message is logged the administrator should carefully -examine the underlying data source to see what exactly happens and -whether the data is still valid. The zone name, its class, and the -underlying database name as well as the error message thrown from the -database module are shown in the log message. - - - - -DATASRC_DATABASE_WILDCARD_ANY search in datasource %1 resulted in wildcard match type ANY on %2 - -The database doesn't contain directly matching name. When searching -for a wildcard match, a wildcard record matching the name of the query -containing some RRsets was found. All the RRsets of the node are returned. - - - - -DATASRC_DATABASE_WILDCARD_CANCEL_NS canceled wildcard match on %3 because %2 contains NS (data source %1) - -The database was queried to provide glue data and it didn't find direct match. -It could create it from given wildcard, but matching wildcards is forbidden -under a zone cut, which was found. Therefore the delegation will be returned -instead. - - - - -DATASRC_DATABASE_WILDCARD_CANCEL_SUB wildcard %2 can't be used to construct %3 because %4 exists in %1 - -The answer could be constructed using the wildcard, but the given subdomain -exists, therefore this name is something like empty non-terminal (actually, -from the protocol point of view, it is empty non-terminal, but the code -discovers it differently). - - - - -DATASRC_DATABASE_WILDCARD_CNAME search in datasource %1 for %2/%3/%4 found wildcard CNAME at %5, resulting in %6 - -The database doesn't contain directly matching name. When searching -for a wildcard match, a CNAME RR was found at a wildcard record -matching the name. This is returned as the result of the search. - - - - -DATASRC_DATABASE_WILDCARD_EMPTY found subdomains of %2 which is a wildcard match for %3 in %1 - -The given wildcard matches the name being sough but it as an empty -nonterminal (e.g. there's nothing at *.example.com but something like -subdomain.*.example.org, do exist: so *.example.org exists in the -namespace but has no RRs assopciated with it). This will produce NXRRSET. - - - - -DATASRC_DATABASE_WILDCARD_MATCH search in datasource %1 resulted in wildcard match at %2 with RRset %3 - -The database doesn't contain directly matching name. When searching -for a wildcard match, a wildcard record matching the name and type of -the query was found. The data at this point is returned. - - - - -DATASRC_DATABASE_WILDCARD_NS search in datasource %1 for %2/%3/%4 found wildcard delegation at %5, resulting in %6 - -The database doesn't contain directly matching name. When searching -for a wildcard match, an NS RR was found at a wildcard record matching -the name. This is returned as the result of the search. - - - - -DATASRC_DATABASE_WILDCARD_NXRRSET search in datasource %1 for %2/%3/%4 resulted in wildcard NXRRSET at %5 - -The database doesn't contain directly matching name. When searching -for a wildcard match, a matching wildcard entry was found but it did -not contain RRs the requested type. AN NXRRSET indication is returned. - - - - -DATASRC_DO_QUERY handling query for '%1/%2' - -A debug message indicating that a query for the given name and RR type is being -processed. - - - - -DATASRC_LIST_NOT_CACHED zone %1/%2 not cached, cache disabled globally. Will not be available. - -The process disabled caching of RR data completely. However, the given zone -is provided as a master file and it can be served from memory cache only. -Therefore, the zone will not be available for this process. If this is -a problem, you should move the zone to some database backend (sqlite3, for -example) and use it from there. - - - - -DATASRC_MEM_ADD_RRSET adding RRset '%1/%2' into zone '%3' - -Debug information. An RRset is being added to the in-memory data source. - - - - -DATASRC_MEM_ADD_WILDCARD adding wildcards for '%1' - -This is a debug message issued during the processing of a wildcard -name. The internal domain name tree is scanned and some nodes are -specially marked to allow the wildcard lookup to succeed. - - - - -DATASRC_MEM_ADD_ZONE adding zone '%1/%2' - -Debug information. A zone is being added into the in-memory data source. - - - - -DATASRC_MEM_ANY_SUCCESS ANY query for '%1' successful - -Debug information. The domain was found and an ANY type query is being answered -by providing everything found inside the domain. - - - - -DATASRC_MEM_CNAME CNAME at the domain '%1' - -Debug information. The requested domain is an alias to a different domain, -returning the CNAME instead. - - - - -DATASRC_MEM_CNAME_COEXIST can't add data to CNAME in domain '%1' - -This is the same problem as in MEM_CNAME_TO_NONEMPTY, but it happened the -other way around -- adding some other data to CNAME. - - - - -DATASRC_MEM_CNAME_TO_NONEMPTY can't add CNAME to domain with other data in '%1' - -Someone or something tried to add a CNAME into a domain that already contains -some other data. But the protocol forbids coexistence of CNAME with anything -(RFC 1034, section 3.6.2). This indicates a problem with provided data. - - - - -DATASRC_MEM_CREATE creating zone '%1' in '%2' class - -Debug information. A representation of a zone for the in-memory data source is -being created. - - - - -DATASRC_MEM_DELEG_FOUND delegation found at '%1' - -Debug information. A delegation point was found above the requested record. - - - - -DATASRC_MEM_DESTROY destroying zone '%1' in '%2' class - -Debug information. A zone from in-memory data source is being destroyed. - - - - -DATASRC_MEM_DNAME_ENCOUNTERED encountered a DNAME - -Debug information. While searching for the requested domain, a DNAME was -encountered on the way. This may lead to redirection to a different domain and -stop the search. - - - - -DATASRC_MEM_DNAME_FOUND DNAME found at '%1' - -Debug information. A DNAME was found instead of the requested information. - - - - -DATASRC_MEM_DNAME_NS DNAME and NS can't coexist in non-apex domain '%1' - -A request was made for DNAME and NS records to be put into the same -domain which is not the apex (the top of the zone). This is forbidden -by RFC 2672 (section 3) and indicates a problem with provided data. - - - - -DATASRC_MEM_DOMAIN_EMPTY requested domain '%1' is empty - -Debug information. The requested domain exists in the tree of domains, but -it is empty. Therefore it doesn't contain the requested resource type. - - - - -DATASRC_MEM_DUP_RRSET duplicate RRset '%1/%2' - -An RRset is being inserted into in-memory data source for a second time. The -original version must be removed first. Note that loading master files where an -RRset is split into multiple locations is not supported yet. - - - - -DATASRC_MEM_EXACT_DELEGATION delegation at the exact domain '%1' - -Debug information. There's a NS record at the requested domain. This means -this zone is not authoritative for the requested domain, but a delegation -should be followed. The requested domain is an apex of some zone. - - - - -DATASRC_MEM_FIND find '%1/%2' - -Debug information. A search for the requested RRset is being started. - - - - -DATASRC_MEM_FINDNSEC3 finding NSEC3 for %1, mode %2 - -Debug information. A search in an in-memory data source for NSEC3 that -matches or covers the given name is being started. - - - - -DATASRC_MEM_FINDNSEC3_COVER found a covering NSEC3 for %1: %2 - -Debug information. An NSEC3 that covers the given name is found and -being returned. The found NSEC3 RRset is also displayed. - - - - -DATASRC_MEM_FINDNSEC3_MATCH found a matching NSEC3 for %1 at label count %2: %3 - -Debug information. An NSEC3 that matches (a possibly superdomain of) -the given name is found and being returned. When the shown label -count is smaller than that of the given name, the matching NSEC3 is -for a superdomain of the given name (see DATASRC_MEM_FINDNSEC3_TRYHASH). -The found NSEC3 RRset is also displayed. - - - - -DATASRC_MEM_FINDNSEC3_TRYHASH looking for NSEC3 for %1 at label count %2 (hash %3) - -Debug information. In an attempt of finding an NSEC3 for the give name, -(a possibly superdomain of) the name is hashed and searched for in the -NSEC3 name space. When the shown label count is smaller than that of the -shown name, the search tries the superdomain name that share the shown -(higher) label count of the shown name (e.g., for -www.example.com. with shown label count of 3, example.com. is being -tried). - - - - -DATASRC_MEM_FIND_ZONE looking for zone '%1' - -Debug information. A zone object for this zone is being searched for in the -in-memory data source. - - - - -DATASRC_MEM_LOAD loading zone '%1' from file '%2' - -Debug information. The content of master file is being loaded into the memory. - - - - -DATASRC_MEM_NOT_FOUND requested domain '%1' not found - -Debug information. The requested domain does not exist. - - - - -DATASRC_MEM_NO_NSEC3PARAM NSEC3PARAM is missing for NSEC3-signed zone %1/%2 - -The in-memory data source has loaded a zone signed with NSEC3 RRs, -but it doesn't have a NSEC3PARAM RR at the zone origin. It's likely that -the zone is somehow broken, but this RR is not necessarily needed for -handling lookups with NSEC3 in this data source, so it accepts the given -content of the zone. Nevertheless the administrator should look into -the integrity of the zone data. - - - - -DATASRC_MEM_NS_ENCOUNTERED encountered a NS - -Debug information. While searching for the requested domain, a NS was -encountered on the way (a delegation). This may lead to stop of the search. - - - - -DATASRC_MEM_NXRRSET no such type '%1' at '%2' - -Debug information. The domain exists, but it doesn't hold any record of the -requested type. - - - - -DATASRC_MEM_OUT_OF_ZONE domain '%1' doesn't belong to zone '%2' - -It was attempted to add the domain into a zone that shouldn't have it -(eg. the domain is not subdomain of the zone origin). This indicates a -problem with provided data. - - - - -DATASRC_MEM_RENAME renaming RRset from '%1' to '%2' - -Debug information. A RRset is being generated from a different RRset (most -probably a wildcard). So it must be renamed to whatever the user asked for. In -fact, it's impossible to rename RRsets with our libraries, so a new one is -created and all resource records are copied over. - - - - -DATASRC_MEM_SINGLETON trying to add multiple RRs for domain '%1' and type '%2' - -Some resource types are singletons -- only one is allowed in a domain -(for example CNAME or SOA). This indicates a problem with provided data. - - - - -DATASRC_MEM_SUCCESS query for '%1/%2' successful - -Debug information. The requested record was found. - - - - -DATASRC_MEM_SUPER_STOP stopped as '%1' is superdomain of a zone node, meaning it's empty - -Debug information. The search stopped because the requested domain was -detected to be a superdomain of some existing node of zone (while there -was no exact match). This means that the domain is an empty nonterminal, -therefore it is treated as NXRRSET case (eg. the domain exists, but it -doesn't have the requested record type). - - - - -DATASRC_MEM_SWAP swapping contents of two zone representations ('%1' and '%2') - -Debug information. The contents of two in-memory zones are being exchanged. -This is usual practice to do some manipulation in exception-safe manner -- the -new data are prepared in a different zone object and when it works, they are -swapped. The old one contains the new data and the other one can be safely -destroyed. - - - - -DATASRC_MEM_WILDCARD_CANCEL wildcard match canceled for '%1' - -Debug information. A domain above wildcard was reached, but there's something -below the requested domain. Therefore the wildcard doesn't apply here. This -behaviour is specified by RFC 1034, section 4.3.3 - - - - -DATASRC_MEM_WILDCARD_DNAME DNAME record in wildcard domain '%1' - -The software refuses to load DNAME records into a wildcard domain. It isn't -explicitly forbidden, but the protocol is ambiguous about how this should -behave and BIND 9 refuses that as well. Please describe your intention using -different tools. - - - - -DATASRC_MEM_WILDCARD_NS NS record in wildcard domain '%1' - -The software refuses to load NS records into a wildcard domain. It isn't -explicitly forbidden, but the protocol is ambiguous about how this should -behave and BIND 9 refuses that as well. Please describe your intention using -different tools. - - - - -DATASRC_META_ADD adding a data source into meta data source - -This is a debug message issued during startup or reconfiguration. -Another data source is being added into the meta data source. - - - - -DATASRC_META_ADD_CLASS_MISMATCH mismatch between classes '%1' and '%2' - -It was attempted to add a data source into a meta data source, but their -classes do not match. - - - - -DATASRC_META_REMOVE removing data source from meta data source - -Debug information. A data source is being removed from meta data source. - - - - -DATASRC_QUERY_ADD_NSEC adding NSEC record for '%1' - -Debug information. A NSEC record covering this zone is being added. - - - - -DATASRC_QUERY_ADD_NSEC3 adding NSEC3 record of zone '%1' - -Debug information. A NSEC3 record for the given zone is being added to the -response message. - - - - -DATASRC_QUERY_ADD_RRSET adding RRset '%1/%2' to message - -Debug information. An RRset is being added to the response message. - - - - -DATASRC_QUERY_ADD_SOA adding SOA of '%1' - -Debug information. A SOA record of the given zone is being added to the -authority section of the response message. - - - - -DATASRC_QUERY_AUTH_FAIL the underlying data source failed with %1 - -The underlying data source failed to answer the authoritative query. 1 means -some error, 2 is not implemented. The data source should have logged the -specific error already. - - - - -DATASRC_QUERY_BAD_REFERRAL bad referral to '%1' - -The domain lives in another zone. But it is not possible to generate referral -information for it. - - - - -DATASRC_QUERY_CACHED data for %1/%2 found in hotspot cache - -Debug information. The requested data were found in the hotspot cache, so -no query is sent to the real data source. - - - - -DATASRC_QUERY_CHECK_CACHE checking hotspot cache for '%1/%2' - -Debug information. While processing a query, lookup to the hotspot cache -is being made. - - - - -DATASRC_QUERY_COPY_AUTH copying authoritative section into message - -Debug information. The whole referral information is being copied into the -response message. - - - - -DATASRC_QUERY_DELEGATION looking for delegation on the path to '%1' - -Debug information. The software is trying to identify delegation points on the -way down to the given domain. - - - - -DATASRC_QUERY_EMPTY_CNAME CNAME at '%1' is empty - -A CNAME chain was being followed and an entry was found that pointed -to a domain name that had no RRsets associated with it. As a result, -the query cannot be answered. This indicates a problem with supplied data. - - - - -DATASRC_QUERY_EMPTY_DNAME the DNAME on '%1' is empty - -During an attempt to synthesize CNAME from this DNAME it was discovered the -DNAME is empty (it has no records). This indicates problem with supplied data. - - - - -DATASRC_QUERY_FAIL query failed - -Some subtask of query processing failed. The reason should have been reported -already and a SERVFAIL will be returned to the querying system. - - - - -DATASRC_QUERY_FOLLOW_CNAME following CNAME at '%1' - -Debug information. The domain is a CNAME (or a DNAME and a CNAME for it -has already been created) and the search is following this chain. - - - - -DATASRC_QUERY_GET_MX_ADDITIONAL addition of A/AAAA for '%1' requested by MX '%2' - -Debug information. While processing a query, a MX record was met. It -references the mentioned address, so A/AAAA records for it are looked up -and put it into the additional section. - - - - -DATASRC_QUERY_GET_NS_ADDITIONAL addition of A/AAAA for '%1' requested by NS '%2' - -Debug information. While processing a query, a NS record was met. It -references the mentioned address, so A/AAAA records for it are looked up -and put it into the additional section. - - - - -DATASRC_QUERY_GLUE_FAIL the underlying data source failed with %1 - -The underlying data source failed to answer the glue query. 1 means some error, -2 is not implemented. The data source should have logged the specific error -already. - - - - -DATASRC_QUERY_INVALID_OP invalid query operation requested - -This indicates a programmer error. The DO_QUERY was called with unknown -operation code. - - - - -DATASRC_QUERY_IS_AUTH auth query (%1/%2) - -Debug information. The last DO_QUERY is an auth query. - - - - -DATASRC_QUERY_IS_GLUE glue query (%1/%2) - -Debug information. The last DO_QUERY is a query for glue addresses. - - - - -DATASRC_QUERY_IS_NOGLUE query for non-glue addresses (%1/%2) - -Debug information. The last DO_QUERY is a query for addresses that are not -glue. - - - - -DATASRC_QUERY_IS_REF query for referral (%1/%2) - -Debug information. The last DO_QUERY is a query for referral information. - - - - -DATASRC_QUERY_IS_SIMPLE simple query (%1/%2) - -Debug information. The last DO_QUERY is a simple query. - - - - -DATASRC_QUERY_MISPLACED_TASK task of this type should not be here - -This indicates a programming error. A task was found in the internal task -queue, but this kind of task wasn't designed to be inside the queue (it should -be handled right away, not queued). - - - - -DATASRC_QUERY_MISSING_NS missing NS records for '%1' - -NS records should have been put into the authority section. However, this zone -has none. This indicates problem with provided data. - - - - -DATASRC_QUERY_MISSING_SOA the zone '%1' has no SOA - -The answer should have been a negative one (eg. of nonexistence of something). -To do so, a SOA record should be put into the authority section, but the zone -does not have one. This indicates problem with provided data. - - - - -DATASRC_QUERY_NOGLUE_FAIL the underlying data source failed with %1 - -The underlying data source failed to answer the no-glue query. 1 means some -error, 2 is not implemented. The data source should have logged the specific -error already. - - - - -DATASRC_QUERY_NO_CACHE_ANY_AUTH ignoring hotspot cache for ANY query (%1/%2 in %3 class) - -Debug information. The hotspot cache is ignored for authoritative ANY queries -for consistency reasons. - - - - -DATASRC_QUERY_NO_CACHE_ANY_SIMPLE ignoring hotspot cache for ANY query (%1/%2 in %3 class) - -Debug information. The hotspot cache is ignored for ANY queries for consistency -reasons. - - - - -DATASRC_QUERY_NO_DS_NSEC there's no DS record in the '%1' zone - -An attempt to add a NSEC record into the message failed, because the zone does -not have any DS record. This indicates problem with the provided data. - - - - -DATASRC_QUERY_NO_DS_NSEC3 there's no DS record in the '%1' zone - -An attempt to add a NSEC3 record into the message failed, because the zone does -not have any DS record. This indicates problem with the provided data. - - - - -DATASRC_QUERY_NO_ZONE no zone containing '%1' in class '%2' - -Debug information. Lookup of domain failed because the datasource -has no zone that contains the domain. Maybe someone sent a query -to the wrong server for some reason. This may also happen when -looking in the datasource for addresses for NS records. - - - - -DATASRC_QUERY_PROCESS processing query '%1/%2' in the '%3' class - -Debug information. A sure query is being processed now. - - - - -DATASRC_QUERY_PROVE_NX_FAIL unable to prove nonexistence of '%1' - -The user wants DNSSEC and we discovered the entity doesn't exist (either -domain or the record). But there was an error getting NSEC/NSEC3 record -to prove the nonexistence. - - - - -DATASRC_QUERY_REF_FAIL the underlying data source failed with %1 - -The underlying data source failed to answer the query for referral information. -1 means some error, 2 is not implemented. The data source should have logged -the specific error already. - - - - -DATASRC_QUERY_RRSIG unable to answer RRSIG query for %1 - -The server is unable to answer a direct query for RRSIG type, but was asked -to do so. - - - - -DATASRC_QUERY_SIMPLE_FAIL the underlying data source failed with %1 - -The underlying data source failed to answer the simple query. 1 means some -error, 2 is not implemented. The data source should have logged the specific -error already. - - - - -DATASRC_QUERY_SYNTH_CNAME synthesizing CNAME from DNAME on '%1' - -This is a debug message. While answering a query, a DNAME was encountered. The -DNAME itself will be returned, along with a synthesized CNAME for clients that -do not understand the DNAME RR. - - - - -DATASRC_QUERY_TASK_FAIL task failed with %1 - -The query subtask failed. The reason should have been reported by the subtask -already. The code is 1 for error, 2 for not implemented. - - - - -DATASRC_QUERY_TOO_MANY_CNAMES CNAME chain limit exceeded at '%1' - -A CNAME led to another CNAME and it led to another, and so on. After 16 -CNAMEs, the software gave up. Long CNAME chains are discouraged, and this -might possibly be a loop as well. Note that some of the CNAMEs might have -been synthesized from DNAMEs. This indicates problem with supplied data. - - - - -DATASRC_QUERY_UNKNOWN_RESULT unknown result of subtask - -This indicates a programmer error. The answer of subtask doesn't look like -anything known. - - - - -DATASRC_QUERY_WILDCARD looking for a wildcard covering '%1' - -Debug information. A direct match wasn't found, so a wildcard covering the -domain is being looked for now. - - - - -DATASRC_QUERY_WILDCARD_FAIL error processing wildcard for '%1' - -During an attempt to cover the domain by a wildcard an error happened. The -exact kind was hopefully already reported. - - - - -DATASRC_QUERY_WILDCARD_PROVE_NX_FAIL unable to prove nonexistence of '%1' (%2) - -While processing a wildcard, it wasn't possible to prove nonexistence of the -given domain or record. The code is 1 for error and 2 for not implemented. - - - - -DATASRC_QUERY_WILDCARD_REFERRAL unable to find referral info for '%1' (%2) - -While processing a wildcard, a referral was met. But it wasn't possible to get -enough information for it. The code is 1 for error, 2 for not implemented. - - - - -DATASRC_SQLITE_CLOSE closing SQLite database - -Debug information. The SQLite data source is closing the database file. - - - - -DATASRC_SQLITE_COMPATIBLE_VERSION database schema V%1.%2 not up to date (expecting V%3.%4) but is compatible - -The version of the SQLite3 database schema used to hold the zone data -is not the latest one - the current version of BIND 10 was written -with a later schema version in mind. However, the database is -compatible with the current version of BIND 10, and BIND 10 will run -without any problems. - -Consult the release notes for your version of BIND 10. Depending on -the changes made to the database schema, it is possible that improved -performance could result if the database were upgraded. - - - - -DATASRC_SQLITE_CONNCLOSE Closing sqlite database - -The database file is no longer needed and is being closed. - - - - -DATASRC_SQLITE_CONNOPEN Opening sqlite database file '%1' - -The database file is being opened so it can start providing data. - - - - -DATASRC_SQLITE_CREATE SQLite data source created - -Debug information. An instance of SQLite data source is being created. - - - - -DATASRC_SQLITE_DESTROY SQLite data source destroyed - -Debug information. An instance of SQLite data source is being destroyed. - - - - -DATASRC_SQLITE_DROPCONN SQLite3Database is being deinitialized - -The object around a database connection is being destroyed. - - - - -DATASRC_SQLITE_ENCLOSURE looking for zone containing '%1' - -Debug information. The SQLite data source is trying to identify which zone -should hold this domain. - - - - -DATASRC_SQLITE_ENCLOSURE_NOT_FOUND no zone contains '%1' - -Debug information. The last SQLITE_ENCLOSURE query was unsuccessful; there's -no such zone in our data. - - - - -DATASRC_SQLITE_FIND looking for RRset '%1/%2' - -Debug information. The SQLite data source is looking up a resource record -set. - - - - -DATASRC_SQLITE_FINDADDRS looking for A/AAAA addresses for '%1' - -Debug information. The data source is looking up the addresses for given -domain name. - - - - -DATASRC_SQLITE_FINDADDRS_BAD_CLASS class mismatch looking for addresses ('%1' and '%2') - -The SQLite data source was looking up A/AAAA addresses, but the data source -contains different class than the query was for. - - - - -DATASRC_SQLITE_FINDEXACT looking for exact RRset '%1/%2' - -Debug information. The SQLite data source is looking up an exact resource -record. - - - - -DATASRC_SQLITE_FINDEXACT_BAD_CLASS class mismatch looking for an RRset ('%1' and '%2') - -The SQLite data source was looking up an exact RRset, but the data source -contains different class than the query was for. - - - - -DATASRC_SQLITE_FINDREC looking for record '%1/%2' - -Debug information. The SQLite data source is looking up records of given name -and type in the database. - - - - -DATASRC_SQLITE_FINDREF looking for referral at '%1' - -Debug information. The SQLite data source is identifying if this domain is -a referral and where it goes. - - - - -DATASRC_SQLITE_FINDREF_BAD_CLASS class mismatch looking for referral ('%1' and '%2') - -The SQLite data source was trying to identify if there's a referral. But -it contains different class than the query was for. - - - - -DATASRC_SQLITE_FIND_BAD_CLASS class mismatch looking for an RRset ('%1' and '%2') - -The SQLite data source was looking up an RRset, but the data source contains -different class than the query was for. - - - - -DATASRC_SQLITE_FIND_NSEC3 looking for NSEC3 in zone '%1' for hash '%2' - -Debug information. We're trying to look up a NSEC3 record in the SQLite data -source. - - - - -DATASRC_SQLITE_FIND_NSEC3_NO_ZONE no such zone '%1' - -The SQLite data source was asked to provide a NSEC3 record for given zone. -But it doesn't contain that zone. - - - - -DATASRC_SQLITE_INCOMPATIBLE_VERSION database schema V%1.%2 incompatible with version (V%3.%4) expected - -The version of the SQLite3 database schema used to hold the zone data -is incompatible with the version expected by BIND 10. As a result, -BIND 10 is unable to run using the database file as the data source. - -The database should be updated using the means described in the BIND -10 documentation. - - - - -DATASRC_SQLITE_NEWCONN SQLite3Database is being initialized - -A wrapper object to hold database connection is being initialized. - - - - -DATASRC_SQLITE_OPEN opening SQLite database '%1' - -Debug information. The SQLite data source is loading an SQLite database in -the provided file. - - - - -DATASRC_SQLITE_PREVIOUS looking for name previous to '%1' - -This is a debug message. The name given was not found, so the program -is searching for the next name higher up the hierarchy (e.g. if -www.example.com were queried for and not found, the software searches -for the "previous" name, example.com). - - - - -DATASRC_SQLITE_PREVIOUS_NO_ZONE no zone containing '%1' - -The name given was not found, so the program is searching for the next -name higher up the hierarchy (e.g. if www.example.com were queried -for and not found, the software searches for the "previous" name, -example.com). However, this name is not contained in any zone in the -data source. This is an error since it indicates a problem in the earlier -processing of the query. - - - - -DATASRC_SQLITE_SETUP setting up SQLite database - -The database for SQLite data source was found empty. It is assumed this is the -first run and it is being initialized with current schema. It'll still contain -no data, but it will be ready for use. - - - - -DATASRC_STATIC_CLASS_NOT_CH static data source can handle CH class only - -An error message indicating that a query requesting a RR for a class other -that CH was sent to the static data source (which only handles CH queries). - - - - -DATASRC_STATIC_CREATE creating the static datasource - -Debug information. The static data source (the one holding stuff like -version.bind) is being created. - - - - -DATASRC_STATIC_FIND looking for '%1/%2' - -Debug information. This resource record set is being looked up in the static -data source. - - - - -DATASRC_UNEXPECTED_QUERY_STATE unexpected query state - -This indicates a programming error. An internal task of unknown type was -generated. - - - - -DBUTIL_BACKUP created backup of %1 in %2 - -A backup for the given database file was created. Same of original file and -backup are given in the output message. - - - - -DBUTIL_CHECK_ERROR unable to check database version: %1 - -There was an error while trying to check the current version of the database -schema. The error is shown in the message. - - - - -DBUTIL_CHECK_NOCONFIRM --noconfirm is not compatible with --check - -b10-dbutil was called with --check and --noconfirm. --noconfirm only has -meaning with --upgrade, so this is considered an error. - - - - -DBUTIL_CHECK_OK this is the latest version of the database schema. No upgrade is required - -The database schema version has been checked, and is up to date. -No action is required. - - - - -DBUTIL_CHECK_UPGRADE_NEEDED re-run this program with the --upgrade switch to upgrade - -The database schema version is not up to date, and an update is required. -Please run the dbutil tool again, with the --upgrade argument. - - - - -DBUTIL_COMMAND_NONE must select one of --check or --upgrade - -b10-dbutil was called with neither --check nor --upgrade. One action must be -provided. - - - - -DBUTIL_COMMAND_UPGRADE_CHECK --upgrade is not compatible with --check - -b10-dbutil was called with both the commands --upgrade and --check. Only one -action can be performed at a time. - - - - -DBUTIL_DATABASE_MAY_BE_CORRUPT database file %1 may be corrupt, restore it from backup (%2) - -The upgrade failed while it was in progress; the database may now be in an -inconsistent state, and it is advised to restore it from the backup that was -created when b10-dbutil started. - - - - -DBUTIL_EXECUTE Executing SQL statement: %1 - -Debug message; the given SQL statement is executed - - - - -DBUTIL_FILE Database file: %1 - -The database file that is being checked. - - - - -DBUTIL_NO_FILE must supply name of the database file to upgrade - -b10-dbutil was called without a database file. Currently, it cannot find this -file on its own, and it must be provided. - - - - -DBUTIL_STATEMENT_ERROR failed to execute %1: %2 - -The given database statement failed to execute. The error is shown in the -message. - - - - -DBUTIL_TOO_MANY_ARGUMENTS too many arguments to the command, maximum of one expected - -There were too many command-line arguments to b10-dbutil - - - - -DBUTIL_UPGRADE_CANCELED upgrade canceled; database has not been changed - -The user aborted the upgrade, and b10-dbutil will now exit. - - - - -DBUTIL_UPGRADE_DBUTIL please get the latest version of b10-dbutil and re-run - -A database schema was found that was newer than this version of dbutil, which -is apparently out of date and should be upgraded itself. - - - - -DBUTIL_UPGRADE_FAILED upgrade failed: %1 - -While the upgrade was in progress, an unexpected error occurred. The error -is shown in the message. - - - - -DBUTIL_UPGRADE_NOT_ATTEMPTED database upgrade was not attempted - -Due to the earlier failure, the database schema upgrade was not attempted, -and b10-dbutil will now exit. - - - - -DBUTIL_UPGRADE_NOT_NEEDED database already at latest version, no upgrade necessary - -b10-dbutil was told to upgrade the database schema, but it is already at the -latest version. - - - - -DBUTIL_UPGRADE_NOT_POSSIBLE database at a later version than this utility can support - -b10-dbutil was told to upgrade the database schema, but it is at a higher -version than this tool currently supports. Please update b10-dbutil and try -again. - - - - -DBUTIL_UPGRADE_PREPARATION_FAILED upgrade preparation failed: %1 - -An unexpected error occurred while b10-dbutil was preparing to upgrade the -database schema. The error is shown in the message - - - - -DBUTIL_UPGRADE_SUCCESFUL database upgrade successfully completed - -The database schema update was completed successfully. - - - - -DBUTIL_UPGRADING upgrading database from %1 to %2 - -An upgrade is in progress, the versions of the current upgrade action are shown. - - - - -DBUTIL_VERSION_CURRENT database version %1 - -The current version of the database schema. - - - - -DBUTIL_VERSION_HIGH database is at a later version (%1) than this program can cope with (%2) - -The database schema is at a higher version than b10-dbutil knows about. - - - - -DBUTIL_VERSION_LOW database version %1, latest version is %2. - -The database schema is not up to date, the current version and the latest -version are in the message. - - - - -DDNS_ACCEPT_FAILURE error accepting a connection: %1 - -There was a low-level error when we tried to accept an incoming connection -(probably coming from b10-auth). We continue serving on whatever other -connections we already have, but this connection is dropped. The reason -is logged. - - - - -DDNS_AUTH_DBFILE_UPDATE updated auth DB file to %1 - -b10-ddns was notified of updates to the SQLite3 DB file that b10-auth -uses for the underlying data source and on which b10-ddns needs to -make updates. b10-ddns then updated its internal setup so further -updates would be made on the new DB. - - - - -DDNS_CC_SESSION_ERROR error reading from cc channel: %1 - -There was a problem reading from the command and control channel. The -most likely cause is that the msgq process is not running. - - - - -DDNS_CC_SESSION_TIMEOUT_ERROR timeout waiting for cc response - -There was a problem reading a response from another module over the -command and control channel. The most likely cause is that the -configuration manager b10-cfgmgr is not running. - - - - -DDNS_CONFIG_ERROR error found in configuration data: %1 - -The ddns process encountered an error when installing the configuration at -startup time. Details of the error are included in the log message. - - - - -DDNS_CONFIG_HANDLER_ERROR failed to update ddns configuration: %1 - -An update to b10-ddns configuration was delivered but an error was -found while applying them. None of the delivered updates were applied -to the running b10-ddns system, and the server will keep running with -the existing configuration. If this happened in the initial -configuration setup, the server will be running with the default -configurations. - - - - -DDNS_DROP_CONN dropping connection on file descriptor %1 because of error %2 - -There was an error on a connection with the b10-auth server (or whatever -connects to the ddns daemon). This might be OK, for example when the -authoritative server shuts down, the connection would get closed. It also -can mean the system is busy and can't keep up or that the other side got -confused and sent bad data. - - - - -DDNS_GET_REMOTE_CONFIG_FAIL failed to get %1 module configuration %2 times: %3 - -b10-ddns tried to get configuration of some remote modules for its -operation, but it failed. The most likely cause of this is that the -remote module has not fully started up and b10-ddns couldn't get the -configuration in a timely fashion. b10-ddns attempts to retry it a -few times, imposing a short delay, hoping it eventually succeeds if -it's just a timing issue. The number of total failed attempts is also -logged. If it reaches an internal threshold b10-ddns considers it a -fatal error and terminates. Even in that case, if b10-ddns is -configured as a "dispensable" component (which is the default), the -parent bind10 process will restart it, and there will be another -chance of getting the remote configuration successfully. These are -not the optimal behavior, but it's believed to be sufficient in -practice (there would normally be no failure in the first place). If -it really causes an operational trouble other than having a few of -these log messages, please submit a bug report; there can be several -ways to make it more sophisticated. Another, less likely reason for -having this error is because the remote modules are not actually -configured to run. If that's the case fixing the configuration should -solve the problem - either by making sure the remote module will run -or by not running b10-ddns (without these remote modules b10-ddns is -not functional, so there's no point in running it in this case). - - - - -DDNS_MODULECC_SESSION_ERROR error encountered by configuration/command module: %1 - -There was a problem in the lower level module handling configuration and -control commands. This could happen for various reasons, but the most likely -cause is that the configuration database contains a syntax error and ddns -failed to start at initialization. A detailed error message from the module -will also be displayed. - - - - -DDNS_NEW_CONN new connection on file descriptor %1 from %2 - -Debug message. We received a connection and we are going to start handling -requests from it. The file descriptor number and the address where the request -comes from is logged. The connection is over a unix domain socket and is likely -coming from a b10-auth process. - - - - -DDNS_RECEIVED_AUTH_UPDATE received configuration updates from auth server - -b10-ddns is notified of updates to b10-auth configuration -(including a report of the initial configuration) that b10-ddns might -be interested in. - - - - -DDNS_RECEIVED_SHUTDOWN_COMMAND shutdown command received - -The ddns process received a shutdown command from the command channel -and will now shut down. - - - - -DDNS_RECEIVED_ZONEMGR_UPDATE received configuration updates from zonemgr - -b10-ddns is notified of updates to b10-zonemgr's configuration -(including a report of the initial configuration). It may possibly -contain changes to the secondary zones, in which case b10-ddns will -update its internal copy of that configuration. - - - - -DDNS_REQUEST_PARSE_FAIL failed to parse update request: %1 - -b10-ddns received an update request via b10-auth, but the received -data failed to pass minimum validation: it was either broken wire -format data for a valid DNS message (e.g. it's shorter than the -fixed-length header), or the opcode is not update, or TSIG is included -in the request but it fails to validate. Since b10-auth should have -performed this level of checks, such an error shouldn't be detected at -this stage and should rather be considered an internal bug. This -event is therefore logged at the error level, and the request is -simply dropped. Additional information of the error is also logged. - - - - -DDNS_REQUEST_TCP_QUOTA reject TCP update client %1 (%2 running) - -b10-ddns received a new update request from a client over TCP, but -the number of TCP clients being handled by the server already reached -the configured quota, so the latest client was rejected by closing -the connection. The administrator may want to check the status of -b10-ddns, and if this happens even if the server is not very busy, -the quota may have to be increased. Or, if it's more likely to be -malicious or simply bogus clients that somehow keep the TCP connection -open for a long period, maybe they should be rejected with an -appropriate ACL configuration or some lower layer filtering. The -number of existing TCP clients are shown in the log, which should be -identical to the current quota. - - - - -DDNS_RESPONSE_SOCKET_ERROR failed to send update response to %1: %2 - -Network I/O error happens in sending an update response. The -client's address that caused the error and error details are also -logged. - - - - -DDNS_RESPONSE_TCP_SOCKET_ERROR failed to complete sending update response to %1 over TCP - -b10-ddns had tried to send an update response over TCP, and it hadn't -been completed at that time, and a followup attempt to complete the -send operation failed due to some network I/O error. While a network -error can happen any time, this event is quite unexpected for two -reasons. First, since the size of a response to an update request -should be generally small, it's unlikely that the initial attempt -didn't fail but wasn't completed. Second, since the first attempt -succeeded and the TCP connection had been established in the first -place, it's more likely for the subsequent attempt to succeed. In any -case, there may not be able to do anything to fix it at the server -side, but the administrator may want to check the general reachability -with the client address. - - - - -DDNS_SECONDARY_ZONES_UPDATE updated secondary zone list (%1 zones are listed) - -b10-ddns has successfully updated the internal copy of secondary zones -obtained from b10-zonemgr, based on a latest update to zonemgr's -configuration. The number of newly configured (unique) secondary -zones is logged. - - - - -DDNS_SECONDARY_ZONES_UPDATE_FAIL failed to update secondary zone list: %1 - -An error message. b10-ddns was notified of updates to a list of -secondary zones from b10-zonemgr and tried to update its own internal -copy of the list, but it failed. This can happen if the configuration -contains an error, and b10-zonemgr should also reject that update. -Unfortunately, in the current implementation there is no way to ensure -that both zonemgr and ddns have consistent information when an update -contains an error; further, as of this writing zonemgr has a bug that -it could partially update the list of secondary zones if part of the -list has an error (see Trac ticket #2038). b10-ddns still keeps -running with the previous configuration, but it's strongly advisable -to check log messages from zonemgr, and if it indicates there can be -inconsistent state, it's better to restart the entire BIND 10 system -(just restarting b10-ddns wouldn't be enough, because zonemgr can have -partially updated configuration due to bug #2038). The log message -contains an error description, but it's intentionally kept simple as -it's primarily a matter of zonemgr. To know the details of the error, -log messages of zonemgr should be consulted. - - - - -DDNS_SESSION session arrived on file descriptor %1 - -A debug message, informing there's some activity on the given file descriptor. -It will be either a request or the file descriptor will be closed. See -following log messages to see what of it. - - - - -DDNS_SHUTDOWN ddns server shutting down - -The ddns process is shutting down. It will no longer listen for new commands -or updates. Any command or update that is being addressed at this moment will -be completed, after which the process will exit. - - - - -DDNS_STARTED ddns server is running and listening for updates - -The ddns process has successfully started and is now ready to receive commands -and updates. - - - - -DDNS_START_FORWARDER_ERROR Error from b10-auth when requesting DDNS UPDATE forwarding: %1 - -There was an error response from b10-auth to the command to start -forwarding DDNS UPDATE messages to b10-ddns. -It is almost certain that DDNS UPDATE messages are not handled now, and that -they will be responded to with a NOTIMP error code, even though b10-ddns is -running. -The error message is printed, and additional information may be found in -the b10-auth log output. Since this is an error that is sent by the -b10-auth module, it should have more information as to what the actual -problem was. - - - - -DDNS_START_FORWARDER_FAIL Error sending request for DDNS UPDATE forwarding to b10-auth: %1 - -There was an error when attempting to send b10-auth the request to forward -DDNS UPDATE messages to the b10-ddns module. This points to an internal -problem using the inter-module messaging system. -This needs to be inspected, as it is almost certain that DDNS UPDATE messages -are not handled now. -The specific error is printed in the log message. - - - - -DDNS_STOPPED ddns server has stopped - -The ddns process has successfully stopped and is no longer listening for or -handling commands or updates, and will now exit. - - - - -DDNS_STOPPED_BY_KEYBOARD keyboard interrupt, shutting down - -There was a keyboard interrupt signal to stop the ddns process. The -process will now shut down. - - - - -DDNS_STOP_FORWARDER_ERROR Error from b10-auth when requesting to stop DDNS UPDATE forwarding: %1 - -There was an error response from b10-auth to the command to stop -forwarding DDNS UPDATE messages to b10-ddns. -This specific error may not be fatal; instead of returning NOTIMP for future -DDNS UPDATE messages, it will return SERVFAIL. However, this does point to -an underlying problem in the messaging system, and should be inspected. -The error message is printed, and additional information may be found in -the b10-auth log output. - - - - -DDNS_STOP_FORWARDER_FAIL Error sending request to stop DDNS UPDATE forwarding to b10-auth: %1 - -There was an error when attempting to send b10-auth the request to stop -forwarding DDNS UPDATE messages to the b10-ddns module. This points to an -internal problem using the inter-module messaging system. -This specific error may not be fatal; instead of returning NOTIMP for future -DDNS UPDATE messages, it will return SERVFAIL. However, this does point to -an underlying problem in the messaging system, and should be inspected. -The specific error is printed in the log message. - - - - -DDNS_UNCAUGHT_EXCEPTION uncaught exception of type %1: %2 - -The b10-ddns process encountered an uncaught exception and will now shut -down. This is indicative of a programming error and should not happen under -normal circumstances. The exception type and message are printed. - - - - -DDNS_UPDATE_NOTIFY notified %1 of updates to %2 - -Debug message. b10-ddns has made updates to a zone based on an update -request and has successfully notified an external module of the updates. -The notified module will use that information for updating its own -state or any necessary protocol action such as zone reloading or sending -notify messages to secondary servers. - - - - -DDNS_UPDATE_NOTIFY_FAIL failed to notify %1 of updates to %2: %3 - -b10-ddns has made updates to a zone based on an update request and -tried to notify an external component of the updates, but the -notification fails. One possible cause of this is that the external -component is not really running and it times out in waiting for the -response, although it will be less likely to happen in practice -because these components will normally be configured to run when the -server provides the authoritative DNS service; ddns is rather optional -among them. If this happens, however, it will suspend b10-ddns for a -few seconds during which it cannot handle new requests (some may be -delayed, some may be dropped, depending on the volume of the incoming -requests). This is obviously bad, and if this error happens due to -this reason, the administrator should make sure the component in -question should be configured to run. For a longer term, b10-ddns -should be more robust about this case such as by making this -notification asynchronously and/or detecting the existence of the -external components to avoid hopeless notification in the first place. -Severity of this error for the receiving components depends on the -type of the component. If it's b10-xfrout, this means DNS notify -messages won't be sent to secondary servers of the zone. It's -suboptimal, but not necessarily critical as the secondary servers will -try to check the zone's status periodically. If it's b10-auth and the -notification was needed to have it reload the corresponding zone, it's -more serious because b10-auth won't be able to serve the new version -of the zone unless some explicit recovery action is taken. So the -administrator needs to examine this message and takes an appropriate -action. In either case, this notification is generally expected to -succeed; so the fact it fails itself means there's something wrong in -the BIND 10 system, and it would be advisable to check other log -messages. - - - - -LIBDDNS_DATASRC_ERROR update client %1 failed due to data source error: %2 - -An update attempt failed due to some error in the corresponding data -source. This is generally an unexpected event, but can still happen -for various reasons such as DB lock contention or a failure of the -backend DB server. The cause of the error is also logged. It's -advisable to check the message, and, if necessary, take an appropriate -action (e.g., restarting the DB server if it dies). If this message -is logged the data source isn't modified due to the -corresponding update request. When used by the b10-ddns, the server -will return a response with an RCODE of SERVFAIL. - - - - -LIBDDNS_PREREQ_FORMERR update client %1 for zone %2: Format error in prerequisite (%3). Non-zero TTL. - -The prerequisite with the given name, class and type is not well-formed. -The specific prerequisite is shown. In this case, it has a non-zero TTL value. -A FORMERR error response is sent to the client. - - - - -LIBDDNS_PREREQ_FORMERR_ANY update client %1 for zone %2: Format error in prerequisite (%3). Non-zero TTL or rdata found. - -The prerequisite with the given name, class and type is not well-formed. -The specific prerequisite is shown. In this case, it either has a non-zero -TTL value, or has rdata fields. A FORMERR error response is sent to the client. - - - - -LIBDDNS_PREREQ_FORMERR_CLASS update client %1 for zone %2: Format error in prerequisite (%3). Bad class. - -The prerequisite with the given name, class and type is not well-formed. -The specific prerequisite is shown. In this case, the class of the -prerequisite should either match the class of the zone in the Zone Section, -or it should be ANY or NONE, and it is not. A FORMERR error response is sent -to the client. - - - - -LIBDDNS_PREREQ_FORMERR_NONE update client %1 for zone %2: Format error in prerequisite (%3). Non-zero TTL or rdata found. - -The prerequisite with the given name, class and type is not well-formed. -The specific prerequisite is shown. In this case, it either has a non-zero -TTL value, or has rdata fields. A FORMERR error response is sent to the client. - - - - -LIBDDNS_PREREQ_NAME_IN_USE_FAILED update client %1 for zone %2: 'Name is in use' prerequisite not satisfied (%3), rcode: %4 - -A DNS UPDATE prerequisite was not satisfied. The specific prerequisite that -was not satisfied is shown. The client is sent an error response with the -given rcode. -In this case, the specific prerequisite is 'Name is in use'. From RFC2136: -Name is in use. At least one RR with a specified NAME (in -the zone and class specified by the Zone Section) must exist. -Note that this prerequisite is NOT satisfied by empty -nonterminals. - - - - -LIBDDNS_PREREQ_NAME_NOT_IN_USE_FAILED update client %1 for zone %2: 'Name is not in use' (%3) prerequisite not satisfied, rcode: %4 - -A DNS UPDATE prerequisite was not satisfied. The specific prerequisite that -was not satisfied is shown. The client is sent an error response with the -given rcode. -In this case, the specific prerequisite is 'Name is not in use'. -From RFC2136: -Name is not in use. No RR of any type is owned by a -specified NAME. Note that this prerequisite IS satisfied by -empty nonterminals. - - - - -LIBDDNS_PREREQ_NOTZONE update client %1 for zone %2: prerequisite not in zone (%3) - -A DDNS UPDATE prerequisite has a name that does not appear to be inside -the zone specified in the Zone section of the UPDATE message. -The specific prerequisite is shown. A NOTZONE error response is sent to -the client. - - - - -LIBDDNS_PREREQ_RRSET_DOES_NOT_EXIST_FAILED update client %1 for zone %2: 'RRset does not exist' (%3) prerequisite not satisfied, rcode: %4 - -A DNS UPDATE prerequisite was not satisfied. The specific prerequisite that -was not satisfied is shown. The client is sent an error response with the -given rcode. -In this case, the specific prerequisite is 'RRset does not exist'. -From RFC2136: -RRset does not exist. No RRs with a specified NAME and TYPE -(in the zone and class denoted by the Zone Section) can exist. - - - - -LIBDDNS_PREREQ_RRSET_EXISTS_FAILED update client %1 for zone %2: 'RRset exists (value independent)' (%3) prerequisite not satisfied, rcode: %4 - -A DNS UPDATE prerequisite was not satisfied. The specific prerequisite that -was not satisfied is shown. The client is sent an error response with the -given rcode. -In this case, the specific prerequisite is 'RRset exists (value independent)'. -From RFC2136: -RRset exists (value dependent). A set of RRs with a -specified NAME and TYPE exists and has the same members -with the same RDATAs as the RRset specified here in this -Section. - - - - -LIBDDNS_PREREQ_RRSET_EXISTS_VAL_FAILED update client %1 for zone %2: 'RRset exists (value dependent)' (%3) prerequisite not satisfied, rcode: %4 - -A DNS UPDATE prerequisite was not satisfied. The specific prerequisite that -was not satisfied is shown. The client is sent an error response with the -given rcode. -In this case, the specific prerequisite is 'RRset exists (value dependent)'. -From RFC2136: -RRset exists (value independent). At least one RR with a -specified NAME and TYPE (in the zone and class specified by -the Zone Section) must exist. - - - - -LIBDDNS_UPDATE_ADD_BAD_TYPE update client %1 for zone %2: update addition RR bad type: %3 - -The Update section of a DDNS update message contains a statement -that tries to add a record of an invalid type. Most likely the -record has an RRType that is considered a 'meta' type, which -cannot be zone content data. The specific record is shown. -A FORMERR response is sent back to the client. - - - - -LIBDDNS_UPDATE_APPROVED update client %1 for zone %2 approved - -Debug message. An update request was approved in terms of the zone's -update ACL. - - - - -LIBDDNS_UPDATE_BAD_CLASS update client %1 for zone %2: bad class in update RR: %3 - -The Update section of a DDNS update message contains an RRset with -a bad class. The class of the update RRset must be either the same -as the class in the Zone Section, ANY, or NONE. -A FORMERR response is sent back to the client. - - - - -LIBDDNS_UPDATE_DATASRC_ERROR error in datasource during DDNS update: %1 - -An error occured while committing the DDNS update changes to the -datasource. The specific error is printed. A SERVFAIL response is sent -back to the client. - - - - -LIBDDNS_UPDATE_DELETE_BAD_TYPE update client %1 for zone %2: update deletion RR bad type: %3 - -The Update section of a DDNS update message contains a statement -that tries to delete an rrset of an invalid type. Most likely the -record has an RRType that is considered a 'meta' type, which -cannot be zone content data. The specific record is shown. -A FORMERR response is sent back to the client. - - - - -LIBDDNS_UPDATE_DELETE_NONZERO_TTL update client %1 for zone %2: update deletion RR has non-zero TTL: %3 - -The Update section of a DDNS update message contains a 'delete rrset' -statement with a non-zero TTL. This is not allowed by the protocol. -A FORMERR response is sent back to the client. - - - - -LIBDDNS_UPDATE_DELETE_RRSET_NOT_EMPTY update client %1 for zone %2: update deletion RR contains data %3 - -The Update section of a DDNS update message contains a 'delete rrset' -statement with a non-empty RRset. This is not allowed by the protocol. -A FORMERR response is sent back to the client. - - - - -LIBDDNS_UPDATE_DELETE_RR_BAD_TYPE update client %1 for zone %2: update deletion RR bad type: %3 - -The Update section of a DDNS update message contains a statement -that tries to delete one or more rrs of an invalid type. Most -likely the records have an RRType that is considered a 'meta' -type, which cannot be zone content data. The specific record is -shown. A FORMERR response is sent back to the client. - - - - -LIBDDNS_UPDATE_DELETE_RR_NONZERO_TTL update client %1 for zone %2: update deletion RR has non-zero TTL: %3 - -The Update section of a DDNS update message contains a 'delete rrs' -statement with a non-zero TTL. This is not allowed by the protocol. -A FORMERR response is sent back to the client. - - - - -LIBDDNS_UPDATE_DENIED update client %1 for zone %2 denied - -Informational message. An update request was denied because it was -rejected by the zone's update ACL. When this library is used by -b10-ddns, the server will respond to the request with an RCODE of -REFUSED as described in Section 3.3 of RFC2136. - - - - -LIBDDNS_UPDATE_DROPPED update client %1 for zone %2 dropped - -Informational message. An update request was denied because it was -rejected by the zone's update ACL. When this library is used by -b10-ddns, the server will then completely ignore the request; no -response will be sent. - - - - -LIBDDNS_UPDATE_ERROR update client %1 for zone %2: %3 - -Debug message. An error is found in processing a dynamic update -request. This log message is used for general errors that are not -normally expected to happen. So, in general, it would mean some -problem in the client implementation or an interoperability issue -with this implementation. The client's address, the zone name and -class, and description of the error are logged. - - - - -LIBDDNS_UPDATE_FORWARD_FAIL update client %1 for zone %2: update forwarding not supported - -Debug message. An update request is sent to a secondary server. This -is not necessarily invalid, but this implementation does not yet -support update forwarding as specified in Section 6 of RFC2136 and it -will simply return a response with an RCODE of NOTIMP to the client. -The client's address and the zone name/class are logged. - - - - -LIBDDNS_UPDATE_NOTAUTH update client %1 for zone %2: not authoritative for update zone - -Debug message. An update request was received for a zone for which -the receiving server doesn't have authority. In theory this is an -unexpected event, but there are client implementations that could send -update requests carelessly, so it may not necessarily be so uncommon -in practice. If possible, you may want to check the implementation or -configuration of those clients to suppress the requests. As specified -in Section 3.1 of RFC2136, the receiving server will return a response -with an RCODE of NOTAUTH. - - - - -LIBDDNS_UPDATE_NOTZONE update client %1 for zone %2: update RR out of zone %3 - -A DDNS UPDATE record has a name that does not appear to be inside -the zone specified in the Zone section of the UPDATE message. -The specific update record is shown. A NOTZONE error response is -sent to the client. - - - - -LIBDDNS_UPDATE_PREREQUISITE_FAILED prerequisite failed in update client %1 for zone %2: result code %3 - -The handling of the prerequisite section (RFC2136 Section 3.2) found -that one of the prerequisites was not satisfied. The result code -should give more information on what prerequisite type failed. -If the result code is FORMERR, the prerequisite section was not well-formed. -An error response with the given result code is sent back to the client. - - - - -LIBDDNS_UPDATE_UNCAUGHT_EXCEPTION update client %1 for zone %2: uncaught exception while processing update section: %3 - -An uncaught exception was encountered while processing the Update -section of a DDNS message. The specific exception is shown in the log message. -To make sure DDNS service is not interrupted, this problem is caught instead -of reraised; The update is aborted, and a SERVFAIL is sent back to the client. -This is most probably a bug in the DDNS code, but *could* be caused by -the data source. - - - - -LIBXFRIN_DIFFERENT_TTL multiple data with different TTLs (%1, %2) on %3/%4/%5. Adjusting %2 -> %1. - -The xfrin module received an update containing multiple rdata changes for the -same RRset. But the TTLs of these don't match each other. As we combine them -together, the latter one gets overwritten to the earlier one in the sequence. - - - - -LIBXFRIN_NO_JOURNAL disabled journaling for updates to %1 on %2 - -An attempt was made to create a Diff object with journaling enabled, but -the underlying data source didn't support journaling (while still allowing -updates) and so the created object has it disabled. At a higher level this -means that the updates will be applied to the zone but subsequent IXFR requests -will result in a full zone transfer (i.e., an AXFR-style IXFR). Unless the -overhead of the full transfer is an issue this message can be ignored; -otherwise you may want to check why the journaling wasn't allowed on the -data source and either fix the issue or use a different type of data source. - - - - -LOGIMPL_ABOVE_MAX_DEBUG debug level of %1 is too high and will be set to the maximum of %2 - -A message from the interface to the underlying logger implementation reporting -that the debug level (as set by an internally-created string DEBUGn, where n -is an integer, e.g. DEBUG22) is above the maximum allowed value and has -been reduced to that value. The appearance of this message may indicate -a programming error - please submit a bug report. - - - - -LOGIMPL_BAD_DEBUG_STRING debug string '%1' has invalid format - -A message from the interface to the underlying logger implementation -reporting that an internally-created string used to set the debug level -is not of the correct format (it should be of the form DEBUGn, where n -is an integer, e.g. DEBUG22). The appearance of this message indicates -a programming error - please submit a bug report. - - - - -LOGIMPL_BELOW_MIN_DEBUG debug level of %1 is too low and will be set to the minimum of %2 - -A message from the interface to the underlying logger implementation reporting -that the debug level (as set by an internally-created string DEBUGn, where n -is an integer, e.g. DEBUG22) is below the minimum allowed value and has -been increased to that value. The appearance of this message may indicate -a programming error - please submit a bug report. - - - - -LOG_BAD_DESTINATION unrecognized log destination: %1 - -A logger destination value was given that was not recognized. The -destination should be one of "console", "file", or "syslog". - - - - -LOG_BAD_SEVERITY unrecognized log severity: %1 - -A logger severity value was given that was not recognized. The severity -should be one of "DEBUG", "INFO", "WARN", "ERROR", "FATAL" or "NONE". - - - - -LOG_BAD_STREAM bad log console output stream: %1 - -Logging has been configured so that output is written to the terminal -(console) but the stream on which it is to be written is not recognised. -Allowed values are "stdout" and "stderr". - - - - -LOG_DUPLICATE_MESSAGE_ID duplicate message ID (%1) in compiled code - -During start-up, BIND 10 detected that the given message identification -had been defined multiple times in the BIND 10 code. This indicates a -programming error; please submit a bug report. - - - - -LOG_DUPLICATE_NAMESPACE line %1: duplicate $NAMESPACE directive found - -When reading a message file, more than one $NAMESPACE directive was found. -(This directive is used to set a C++ namespace when generating header -files during software development.) Such a condition is regarded as an -error and the read will be abandoned. - - - - -LOG_INPUT_OPEN_FAIL unable to open message file %1 for input: %2 - -The program was not able to open the specified input message file for -the reason given. - - - - -LOG_INVALID_MESSAGE_ID line %1: invalid message identification '%2' - -An invalid message identification (ID) has been found during the read of -a message file. Message IDs should comprise only alphanumeric characters -and the underscore, and should not start with a digit. - - - - -LOG_LOCK_TEST_MESSAGE this is a test message. - -This is a log message used in testing. - - - - -LOG_NAMESPACE_EXTRA_ARGS line %1: $NAMESPACE directive has too many arguments - -The $NAMESPACE directive in a message file takes a single argument, a -namespace in which all the generated symbol names are placed. This error -is generated when the compiler finds a $NAMESPACE directive with more -than one argument. - - - - -LOG_NAMESPACE_INVALID_ARG line %1: $NAMESPACE directive has an invalid argument ('%2') - -The $NAMESPACE argument in a message file should be a valid C++ namespace. -This message is output if the simple check on the syntax of the string -carried out by the reader fails. - - - - -LOG_NAMESPACE_NO_ARGS line %1: no arguments were given to the $NAMESPACE directive - -The $NAMESPACE directive in a message file takes a single argument, -a C++ namespace in which all the generated symbol names are placed. -This error is generated when the compiler finds a $NAMESPACE directive -with no arguments. - - - - -LOG_NO_MESSAGE_ID line %1: message definition line found without a message ID - -Within a message file, message are defined by lines starting with a "%". -The rest of the line should comprise the message ID and text describing -the message. This error indicates the message compiler found a line in -the message file comprising just the "%" and nothing else. - - - - -LOG_NO_MESSAGE_TEXT line %1: line found containing a message ID ('%2') and no text - -Within a message file, message are defined by lines starting with a "%". -The rest of the line should comprise the message ID and text describing -the message. This error indicates the message compiler found a line -in the message file comprising just the "%" and message identification, -but no text. - - - - -LOG_NO_SUCH_MESSAGE could not replace message text for '%1': no such message - -During start-up a local message file was read. A line with the listed -message identification was found in the file, but the identification is -not one contained in the compiled-in message dictionary. This message -may appear a number of times in the file, once for every such unknown -message identification. - -There may be several reasons why this message may appear: - -- The message ID has been mis-spelled in the local message file. - -- The program outputting the message may not use that particular message -(e.g. it originates in a module not used by the program.) - -- The local file was written for an earlier version of the BIND 10 software -and the later version no longer generates that message. - -Whatever the reason, there is no impact on the operation of BIND 10. - - - - -LOG_OPEN_OUTPUT_FAIL unable to open %1 for output: %2 - -Originating within the logging code, the program was not able to open -the specified output file for the reason given. - - - - -LOG_PREFIX_EXTRA_ARGS line %1: $PREFIX directive has too many arguments - -Within a message file, the $PREFIX directive takes a single argument, -a prefix to be added to the symbol names when a C++ file is created. -This error is generated when the compiler finds a $PREFIX directive with -more than one argument. - -Note: the $PREFIX directive is deprecated and will be removed in a future -version of BIND 10. - - - - -LOG_PREFIX_INVALID_ARG line %1: $PREFIX directive has an invalid argument ('%2') - -Within a message file, the $PREFIX directive takes a single argument, -a prefix to be added to the symbol names when a C++ file is created. -As such, it must adhere to restrictions on C++ symbol names (e.g. may -only contain alphanumeric characters or underscores, and may nor start -with a digit). A $PREFIX directive was found with an argument (given -in the message) that violates those restrictions. - -Note: the $PREFIX directive is deprecated and will be removed in a future -version of BIND 10. - - - - -LOG_READING_LOCAL_FILE reading local message file %1 - -This is an informational message output by BIND 10 when it starts to read -a local message file. (A local message file may replace the text of -one of more messages; the ID of the message will not be changed though.) - - - - -LOG_READ_ERROR error reading from message file %1: %2 - -The specified error was encountered reading from the named message file. - - - - -LOG_UNRECOGNISED_DIRECTIVE line %1: unrecognised directive '%2' - -Within a message file, a line starting with a dollar symbol was found -(indicating the presence of a directive) but the first word on the line -(shown in the message) was not recognised. - - - - -LOG_WRITE_ERROR error writing to %1: %2 - -The specified error was encountered by the message compiler when writing -to the named output file. - - - - -NOTIFY_OUT_DATASRC_ACCESS_FAILURE failed to get access to data source: %1 - -notify_out failed to get access to one of configured data sources. -Detailed error is shown in the log message. This can be either a -configuration error or installation setup failure. - - - - -NOTIFY_OUT_DATASRC_ZONE_NOT_FOUND Zone %1 is not found - -notify_out attempted to get slave information of a zone but the zone -isn't found in the expected data source. This shouldn't happen, -because notify_out first identifies a list of available zones before -this process. So this means some critical inconsistency in the data -source or software bug. - - - - -NOTIFY_OUT_INVALID_ADDRESS invalid address %1#%2: %3 - -The notify_out library tried to send a notify message to the given -address, but it appears to be an invalid address. The configuration -for secondary nameservers might contain a typographic error, or a -different BIND 10 module has forgotten to validate its data before -sending this module a notify command. As such, this should normally -not happen, and points to an oversight in a different module. - - - - -NOTIFY_OUT_REPLY_BAD_OPCODE bad opcode in notify reply from %1#%2: %3 - -The notify_out library sent a notify message to the nameserver at -the given address, but the response did not have the opcode set to -NOTIFY. The opcode in the response is printed. Since there was a -response, no more notifies will be sent to this server for this -notification event. - - - - -NOTIFY_OUT_REPLY_BAD_QID bad QID in notify reply from %1#%2: got %3, should be %4 - -The notify_out library sent a notify message to the nameserver at -the given address, but the query id in the response does not match -the one we sent. Since there was a response, no more notifies will -be sent to this server for this notification event. - - - - -NOTIFY_OUT_REPLY_BAD_QUERY_NAME bad query name in notify reply from %1#%2: got %3, should be %4 - -The notify_out library sent a notify message to the nameserver at -the given address, but the query name in the response does not match -the one we sent. Since there was a response, no more notifies will -be sent to this server for this notification event. - - - - -NOTIFY_OUT_REPLY_QR_NOT_SET QR flags set to 0 in reply to notify from %1#%2 - -The notify_out library sent a notify message to the namesever at the -given address, but the reply did not have the QR bit set to one. -Since there was a response, no more notifies will be sent to this -server for this notification event. - - - - -NOTIFY_OUT_REPLY_UNCAUGHT_EXCEPTION uncaught exception: %1 - -There was an uncaught exception in the handling of a notify reply -message, either in the message parser, or while trying to extract data -from the parsed message. The error is printed, and notify_out will -treat the response as a bad message, but this does point to a -programming error, since all exceptions should have been caught -explicitly. Please file a bug report. Since there was a response, -no more notifies will be sent to this server for this notification -event. - - - - -NOTIFY_OUT_RETRY_EXCEEDED notify to %1#%2: number of retries (%3) exceeded - -The maximum number of retries for the notify target has been exceeded. -Either the address of the secondary nameserver is wrong, or it is not -responding. - - - - -NOTIFY_OUT_SENDING_NOTIFY sending notify to %1#%2 - -A notify message is sent to the secondary nameserver at the given -address. - - - - -NOTIFY_OUT_SOCKET_ERROR socket error sending notify to %1#%2: %3 - -There was a network error while trying to send a notify message to -the given address. The address might be unreachable. The socket -error is printed and should provide more information. - - - - -NOTIFY_OUT_SOCKET_RECV_ERROR socket error reading notify reply from %1#%2: %3 - -There was a network error while trying to read a notify reply -message from the given address. The socket error is printed and should -provide more information. - - - - -NOTIFY_OUT_TIMEOUT retry notify to %1#%2 - -The notify message to the given address (noted as address#port) has -timed out, and the message will be resent until the max retry limit -is reached. - - - - -NOTIFY_OUT_ZONE_BAD_SOA Zone %1 is invalid in terms of SOA - -This is a warning issued when the notify_out module finds a zone that -doesn't have an SOA RR or has multiple SOA RRs. Notify message won't -be sent to such a zone. - - - - -NOTIFY_OUT_ZONE_NO_NS Zone %1 doesn't have NS RR - -This is a warning issued when the notify_out module finds a zone that -doesn't have an NS RR. Notify message won't be sent to such a zone. - - - - -NSAS_EMPTY_RESPONSE response to query for %1 returned an empty answer section - -The NSAS (nameserver address store - part of the resolver) made a query -for information it needed. The query completed successfully but the -answer section in the response was empty. - - - - -NSAS_ERROR_RESPONSE error response of %1 returned in query for %2 - -The NSAS (nameserver address store - part of the resolver) made a query -for information it needed. The query completed successfully but the -RCODE in the response was something other than NOERROR. - - - - -NSAS_FIND_NS_ADDRESS asking resolver to obtain A and AAAA records for %1 - -A debug message issued when the NSAS (nameserver address store - part -of the resolver) is making a callback into the resolver to retrieve the -address records for the specified nameserver. - - - - -NSAS_FOUND_ADDRESS found address %1 for %2 - -A debug message issued when the NSAS (nameserver address store - part -of the resolver) has retrieved the given address for the specified -nameserver through an external query. - - - - -NSAS_LOOKUP_CANCEL lookup for zone %1 has been canceled - -A debug message issued when an NSAS (nameserver address store - part of -the resolver) lookup for a zone has been canceled. - - - - -NSAS_NS_LOOKUP_FAIL failed to lookup any %1 for %2 - -A debug message issued when the NSAS (nameserver address store - part of -the resolver) has been unable to retrieve the specified resource record -for the specified nameserver. This is not necessarily a problem - the -nameserver may be unreachable, in which case the NSAS will try other -nameservers in the zone. - - - - -NSAS_NULL_RESPONSE got null message in success callback for query for %1 - -The NSAS (nameserver address store - part of the resolver) made a query -for information it needed. The query completed successfully, but the -message passed to the callback was null. - -This message indicates an internal error in the NSAS. Please raise a -bug report. - - - - -NSAS_SEARCH_ZONE_NS searching NSAS for nameservers for zone %1 - -A debug message output when a call is made to the NSAS (nameserver -address store - part of the resolver) to obtain the nameservers for -the specified zone. - - - - -NSAS_UPDATE_RTT update RTT for %1: was %2 ms, is now %3 ms - -A NSAS (nameserver address store - part of the resolver) debug message -reporting the update of a round-trip time (RTT) for a query made to the -specified nameserver. The RTT has been updated using the value given -and the new RTT is displayed. (The RTT is subject to a calculation that -damps out sudden changes. As a result, the new RTT used by the NSAS in -future decisions of which nameserver to use is not necessarily equal to -the RTT reported.) - - - - -NSAS_WRONG_ANSWER queried for %1 RR of type/class %2/%3, received response %4/%5 - -A NSAS (nameserver address store - part of the resolver) made a query for -a resource record of a particular type and class, but instead received -an answer with a different given type and class. - -This message indicates an internal error in the NSAS. Please raise a -bug report. - - - - -PYSERVER_COMMON_DNS_TCP_SEND_DONE completed sending TCP message to %1 (%2 bytes in total) - -Debug message. A complete DNS message has been successfully -transmitted over a TCP connection, possibly after multiple send -operations. The destination address and the total size of the message -(including the 2-byte length field) are shown in the log message. - - - - -PYSERVER_COMMON_DNS_TCP_SEND_ERROR failed to send TCP message to %1 (%2/%3 bytes sent): %4 - -A DNS message has been attempted to be sent out over a TCP connection, -but it failed due to some network error. Although it's not expected -to happen too often, it can still happen for various reasons. The -administrator may want to examine the cause of the failure, which is -included in the log message, to see if it requires some action to -be taken at the server side. When this message is logged, the -corresponding TCP connection was closed immediately after the error -was detected. - - - - -PYSERVER_COMMON_DNS_TCP_SEND_PENDING sent part TCP message to %1 (up to %2/%3 bytes) - -Debug message. A part of DNS message has been transmitted over a TCP -connection, and it's suspended because further attempt would block. -The destination address and the total size of the message that has -been transmitted so far (including the 2-byte length field) are shown -in the log message. - - - - -PYSERVER_COMMON_TSIG_KEYRING_DEINIT Deinitializing global TSIG keyring - -A debug message noting that the global TSIG keyring is being removed from -memory. Most programs don't do that, they just exit, which is OK. - - - - -PYSERVER_COMMON_TSIG_KEYRING_INIT Initializing global TSIG keyring - -A debug message noting the TSIG keyring storage is being prepared. It should -appear at most once in the lifetime of a program. The keyring still needs -to be loaded from configuration. - - - - -PYSERVER_COMMON_TSIG_KEYRING_UPDATE Updating global TSIG keyring - -A debug message. The TSIG keyring is being (re)loaded from configuration. -This happens at startup or when the configuration changes. The old keyring -is removed and new one created with all the keys. - - - - -RESLIB_ANSWER answer received in response to query for <%1> - -A debug message reporting that an answer has been received to an upstream -query for the specified question. Previous debug messages will have -indicated the server to which the question was sent. - - - - -RESLIB_CNAME CNAME received in response to query for <%1> - -A debug message recording that CNAME response has been received to an -upstream query for the specified question. Previous debug messages will -have indicated the server to which the question was sent. - - - - -RESLIB_DEEPEST did not find <%1> in cache, deepest delegation found is %2 - -A debug message, a cache lookup did not find the specified <name, -class, type> tuple in the cache; instead, the deepest delegation found -is indicated. - - - - -RESLIB_EMPTY_RESPONSE empty response received to query for <%1> - -A debug message, the response to the specified query from an upstream -nameserver did not contain anything in the answer or authority sections, -although in all other respects it was a valid response. A SERVFAIL will -be returned to the system making the original query. - - - - -RESLIB_ERROR_RESPONSE unspecified error received in response to query for <%1> - -A debug message, the response to the specified query to an upstream -nameserver indicated that the response was classified as an erroneous -response, but that the nature of the error cannot be identified. -A SERVFAIL will be returned to the system making the original query. - - - - -RESLIB_EXTRADATA_RESPONSE extra data in response to query for <%1> - -A debug message indicating that the response to the specified query -from an upstream nameserver contained too much data. This can happen if -an ANY query was sent and the answer section in the response contained -multiple RRs with different names. A SERVFAIL will be returned to the -system making the original query. - - - - -RESLIB_FOLLOW_CNAME following CNAME chain to <%1> - -A debug message, a CNAME response was received and another query is -being issued for the <name, class, type> tuple. - - - - -RESLIB_INVALID_NAMECLASS_RESPONSE invalid name or class in response to query for <%1> - -A debug message, the response to the specified query from an upstream -nameserver (as identified by the ID of the response) contained either -an answer not matching the query name or an answer having a different -class to that queried for. A SERVFAIL will be returned to the system -making the original query. - - - - -RESLIB_INVALID_QNAME_RESPONSE invalid name or class in response to query for <%1> - -A debug message, the response to the specified query from an upstream -nameserver (as identified by the ID of the response) contained a name -in the question section that did not match that of the query. A SERVFAIL -will be returned to the system making the original query. - - - - -RESLIB_INVALID_TYPE_RESPONSE invalid name or class in response to query for <%1> - -A debug message, the response to the specified query from an upstream -nameserver (as identified by the ID of the response) contained an -invalid type field. A SERVFAIL will be returned to the system making -the original query. - - - - -RESLIB_LONG_CHAIN CNAME received in response to query for <%1>: CNAME chain length exceeded - -A debug message recording that a CNAME response has been received to an upstream -query for the specified question (Previous debug messages will have indicated -the server to which the question was sent). However, receipt of this CNAME -has meant that the resolver has exceeded the CNAME chain limit (a CNAME chain -is where on CNAME points to another) and so an error is being returned. - - - - -RESLIB_MULTIPLE_CLASS_RESPONSE response to query for <%1> contained multiple RRsets with different classes - -A debug message reporting that the response to an upstream query for -the specified name contained multiple RRsets in the answer and not all -were of the same class. This is a violation of the standard and so a -SERVFAIL will be returned. - - - - -RESLIB_NOTSINGLE_RESPONSE response to query for <%1> was not a response - -A debug message, the response to the specified query from an upstream -nameserver was a CNAME that had mutiple RRs in the RRset. This is -an invalid response according to the standards so a SERVFAIL will be -returned to the system making the original query. - - - - -RESLIB_NOT_ONE_QNAME_RESPONSE not one question in response to query for <%1> - -A debug message, the response to the specified query from an upstream -nameserver (as identified by the ID of the response) did not contain -one name in the question section as required by the standard. A SERVFAIL -will be returned to the system making the original query. - - - - -RESLIB_NOT_RESPONSE response to query for <%1> was not a response - -A debug message, the response to the specified query from an upstream -nameserver (as identified by the ID of the response) did not have the QR -bit set (thus indicating that the packet was a query, not a response). -A SERVFAIL will be returned to the system making the original query. - - - - -RESLIB_NO_NS_RRSET no NS RRSet in referral response received to query for <%1> - -A debug message, this indicates that a response was received for the specified -query and was categorized as a referral. However, the received message did -not contain any NS RRsets. This may indicate a programming error in the -response classification code. - - - - -RESLIB_NSAS_LOOKUP looking up nameserver for zone %1 in the NSAS - -A debug message, the RunningQuery object is querying the NSAS for the -nameservers for the specified zone. - - - - -RESLIB_NXDOM_NXRR NXDOMAIN/NXRRSET received in response to query for <%1> - -A debug message recording that either a NXDOMAIN or an NXRRSET response has -been received to an upstream query for the specified question. Previous debug -messages will have indicated the server to which the question was sent. - - - - -RESLIB_OPCODE_RESPONSE response to query for <%1> did not have query opcode - -A debug message, the response to the specified query from an upstream -nameserver was a response that did not have the opcode set to that of -a query. According to the standards, this is an invalid response to -the query that was made, so a SERVFAIL will be returned to the system -making the original query. - - - - -RESLIB_PROTOCOL protocol error in answer for %1: %3 - -A debug message indicating that a protocol error was received. As there -are no retries left, an error will be reported. - - - - -RESLIB_PROTOCOL_RETRY protocol error in answer for %1: %2 (retries left: %3) - -A debug message indicating that a protocol error was received and that -the resolver is repeating the query to the same nameserver. After this -repeated query, there will be the indicated number of retries left. - - - - -RESLIB_RCODE_ERROR response to query for <%1> returns RCODE of %2 - -A debug message, the response to the specified query indicated an error -that is not covered by a specific code path. A SERVFAIL will be returned. - - - - -RESLIB_RECQ_CACHE_FIND found <%1> in the cache (resolve() instance %2) - -This is a debug message and indicates that a RecursiveQuery object found the -the specified <name, class, type> tuple in the cache. The instance number -at the end of the message indicates which of the two resolve() methods has -been called. - - - - -RESLIB_RECQ_CACHE_NO_FIND did not find <%1> in the cache, starting RunningQuery (resolve() instance %2) - -This is a debug message and indicates that the look in the cache made by the -RecursiveQuery::resolve() method did not find an answer, so a new RunningQuery -object has been created to resolve the question. The instance number at -the end of the message indicates which of the two resolve() methods has -been called. - - - - -RESLIB_REFERRAL referral received in response to query for <%1> - -A debug message recording that a referral response has been received to an -upstream query for the specified question. Previous debug messages will -have indicated the server to which the question was sent. - - - - -RESLIB_REFER_ZONE referred to zone %1 - -A debug message indicating that the last referral message was to the specified -zone. - - - - -RESLIB_RESOLVE asked to resolve <%1> (resolve() instance %2) - -A debug message, the RecursiveQuery::resolve method has been called to resolve -the specified <name, class, type> tuple. The first action will be to lookup -the specified tuple in the cache. The instance number at the end of the -message indicates which of the two resolve() methods has been called. - - - - -RESLIB_RRSET_FOUND found single RRset in the cache when querying for <%1> (resolve() instance %2) - -A debug message, indicating that when RecursiveQuery::resolve queried the -cache, a single RRset was found which was put in the answer. The instance -number at the end of the message indicates which of the two resolve() -methods has been called. - - - - -RESLIB_RTT round-trip time of last query calculated as %1 ms - -A debug message giving the round-trip time of the last query and response. - - - - -RESLIB_RUNQ_CACHE_FIND found <%1> in the cache - -This is a debug message and indicates that a RunningQuery object found -the specified <name, class, type> tuple in the cache. - - - - -RESLIB_RUNQ_CACHE_LOOKUP looking up up <%1> in the cache - -This is a debug message and indicates that a RunningQuery object has made -a call to its doLookup() method to look up the specified <name, class, type> -tuple, the first action of which will be to examine the cache. - - - - -RESLIB_RUNQ_FAIL failure callback - nameservers are unreachable - -A debug message indicating that a RunningQuery's failure callback has been -called because all nameservers for the zone in question are unreachable. - - - - -RESLIB_RUNQ_SUCCESS success callback - sending query to %1 - -A debug message indicating that a RunningQuery's success callback has been -called because a nameserver has been found, and that a query is being sent -to the specified nameserver. - - - - -RESLIB_TCP_TRUNCATED TCP response to query for %1 was truncated - -This is a debug message logged when a response to the specified query to an -upstream nameserver returned a response with the TC (truncation) bit set. This -is treated as an error by the code. - - - - -RESLIB_TEST_SERVER setting test server to %1(%2) - -This is a warning message only generated in unit tests. It indicates -that all upstream queries from the resolver are being routed to the -specified server, regardless of the address of the nameserver to which -the query would normally be routed. If seen during normal operation, -please submit a bug report. - - - - -RESLIB_TEST_UPSTREAM sending upstream query for <%1> to test server at %2 - -This is a debug message and should only be seen in unit tests. A query for -the specified <name, class, type> tuple is being sent to a test nameserver -whose address is given in the message. - - - - -RESLIB_TIMEOUT query <%1> to %2 timed out - -A debug message indicating that the specified upstream query has timed out and -there are no retries left. - - - - -RESLIB_TIMEOUT_RETRY query <%1> to %2 timed out, re-trying (retries left: %3) - -A debug message indicating that the specified query has timed out and that -the resolver is repeating the query to the same nameserver. After this -repeated query, there will be the indicated number of retries left. - - - - -RESLIB_TRUNCATED response to query for <%1> was truncated, re-querying over TCP - -A debug message, this indicates that the response to the specified query was -truncated and that the resolver will be re-querying over TCP. There are -various reasons why responses may be truncated, so this message is normal and -gives no cause for concern. - - - - -RESLIB_UPSTREAM sending upstream query for <%1> to %2 - -A debug message indicating that a query for the specified <name, class, type> -tuple is being sent to a nameserver whose address is given in the message. - - - - -RESOLVER_AXFR_TCP AXFR request received over TCP - -This is a debug message output when the resolver received a request for -an AXFR (full transfer of a zone) over TCP. Only authoritative servers -are able to handle AXFR requests, so the resolver will return an error -message to the sender with the RCODE set to NOTIMP. - - - - -RESOLVER_AXFR_UDP AXFR request received over UDP - -This is a debug message output when the resolver received a request for -an AXFR (full transfer of a zone) over UDP. Only authoritative servers -are able to handle AXFR requests (and in any case, an AXFR request should -be sent over TCP), so the resolver will return an error message to the -sender with the RCODE set to NOTIMP. - - - - -RESOLVER_CLIENT_TIME_SMALL client timeout of %1 is too small - -During the update of the resolver's configuration parameters, the value -of the client timeout was found to be too small. The configuration -update was abandoned and the parameters were not changed. - - - - -RESOLVER_CONFIG_CHANNEL configuration channel created - -This is a debug message output when the resolver has successfully -established a connection to the configuration channel. - - - - -RESOLVER_CONFIG_ERROR error in configuration: %1 - -An error was detected in a configuration update received by the -resolver. This may be in the format of the configuration message (in -which case this is a programming error) or it may be in the data supplied -(in which case it is a user error). The reason for the error, included -in the message, will give more details. The configuration update is -not applied and the resolver parameters were not changed. - - - - -RESOLVER_CONFIG_LOADED configuration loaded - -This is a debug message output when the resolver configuration has been -successfully loaded. - - - - -RESOLVER_CONFIG_UPDATED configuration updated: %1 - -This is a debug message output when the resolver configuration is being -updated with the specified information. - - - - -RESOLVER_CREATED main resolver object created - -This is a debug message indicating that the main resolver object has -been created. - - - - -RESOLVER_DNS_MESSAGE_RECEIVED DNS message received: %1 - -This is a debug message from the resolver listing the contents of a -received DNS message. - - - - -RESOLVER_DNS_MESSAGE_SENT DNS message of %1 bytes sent: %2 - -This is a debug message containing details of the response returned by -the resolver to the querying system. - - - - -RESOLVER_FAILED resolver failed, reason: %1 - -This is an error message output when an unhandled exception is caught -by the resolver. After this, the resolver will shut itself down. -Please submit a bug report. - - - - -RESOLVER_FORWARD_ADDRESS setting forward address %1(%2) - -If the resolver is running in forward mode, this message will appear -during startup to list the forward address. If multiple addresses are -specified, it will appear once for each address. - - - - -RESOLVER_FORWARD_QUERY processing forward query - -This is a debug message indicating that a query received by the resolver -has passed a set of checks (message is well-formed, it is allowed by the -ACL, it is a supported opcode, etc.) and is being forwarded to upstream -servers. - - - - -RESOLVER_HEADER_ERROR message received, exception when processing header: %1 - -This is a debug message from the resolver noting that an exception -occurred during the processing of a received packet. The packet has -been dropped. - - - - -RESOLVER_IXFR IXFR request received - -This is a debug message indicating that the resolver received a request -for an IXFR (incremental transfer of a zone). Only authoritative servers -are able to handle IXFR requests, so the resolver will return an error -message to the sender with the RCODE set to NOTIMP. - - - - -RESOLVER_LOOKUP_TIME_SMALL lookup timeout of %1 is too small - -During the update of the resolver's configuration parameters, the value -of the lookup timeout was found to be too small. The configuration -update will not be applied. - - - - -RESOLVER_MESSAGE_ERROR error parsing received message: %1 - returning %2 - -This is a debug message noting that parsing of the body of a received -message by the resolver failed due to some error (although the parsing of -the header succeeded). The message parameters give a textual description -of the problem and the RCODE returned. - - - - -RESOLVER_NEGATIVE_RETRIES negative number of retries (%1) specified in the configuration - -This error is issued when a resolver configuration update has specified -a negative retry count: only zero or positive values are valid. The -configuration update was abandoned and the parameters were not changed. - - - - -RESOLVER_NON_IN_PACKET non-IN class request received, returning REFUSED message - -This debug message is issued when resolver has received a DNS packet that -was not IN (Internet) class. The resolver cannot handle such packets, -so is returning a REFUSED response to the sender. - - - - -RESOLVER_NORMAL_QUERY processing normal query - -This is a debug message indicating that the query received by the resolver -has passed a set of checks (message is well-formed, it is allowed by the -ACL, it is a supported opcode, etc.) and is being processed by the resolver. - - - - -RESOLVER_NOTIFY_RECEIVED NOTIFY arrived but server is not authoritative - -The resolver has received a NOTIFY message. As the server is not -authoritative it cannot process it, so it returns an error message to -the sender with the RCODE set to NOTAUTH. - - - - -RESOLVER_NOT_ONE_QUESTION query contained %1 questions, exactly one question was expected - -This debug message indicates that the resolver received a query that -contained the number of entries in the question section detailed in -the message. This is a malformed message, as a DNS query must contain -only one question. The resolver will return a message to the sender -with the RCODE set to FORMERR. - - - - -RESOLVER_NO_ROOT_ADDRESS no root addresses available - -A warning message issued during resolver startup, this indicates that -no root addresses have been set. This may be because the resolver will -get them from a priming query. - - - - -RESOLVER_PARSE_ERROR error parsing received message: %1 - returning %2 - -This is a debug message noting that the resolver received a message and -the parsing of the body of the message failed due to some non-protocol -related reason (although the parsing of the header succeeded). -The message parameters give a textual description of the problem and -the RCODE returned. - - - - -RESOLVER_PRINT_COMMAND print message command, arguments are: %1 - -This debug message is logged when a "print_message" command is received -by the resolver over the command channel. - - - - -RESOLVER_PROTOCOL_ERROR protocol error parsing received message: %1 - returning %2 - -This is a debug message noting that the resolver received a message and -the parsing of the body of the message failed due to some protocol error -(although the parsing of the header succeeded). The message parameters -give a textual description of the problem and the RCODE returned. - - - - -RESOLVER_QUERY_ACCEPTED query accepted: '%1/%2/%3' from %4 - -This debug message is produced by the resolver when an incoming query -is accepted in terms of the query ACL. The log message shows the query -in the form of <query name>/<query type>/<query class>, and the client -that sends the query in the form of <Source IP address>#<source port>. - - - - -RESOLVER_QUERY_DROPPED query dropped: '%1/%2/%3' from %4 - -This is an informational message that indicates an incoming query has -been dropped by the resolver because of the query ACL. Unlike the -RESOLVER_QUERY_REJECTED case, the server does not return any response. -The log message shows the query in the form of <query name>/<query -type>/<query class>, and the client that sends the query in the form of -<Source IP address>#<source port>. - - - - -RESOLVER_QUERY_REJECTED query rejected: '%1/%2/%3' from %4 - -This is an informational message that indicates an incoming query has -been rejected by the resolver because of the query ACL. This results -in a response with an RCODE of REFUSED. The log message shows the query -in the form of <query name>/<query type>/<query class>, and the client -that sends the query in the form of <Source IP address>#<source port>. - - - - -RESOLVER_QUERY_SETUP query setup - -This is a debug message noting that the resolver is creating a -RecursiveQuery object. - - - - -RESOLVER_QUERY_SHUTDOWN query shutdown - -This is a debug message noting that the resolver is destroying a -RecursiveQuery object. - - - - -RESOLVER_QUERY_TIME_SMALL query timeout of %1 is too small - -During the update of the resolver's configuration parameters, the value -of the query timeout was found to be too small. The configuration -parameters were not changed. - - - - -RESOLVER_RECEIVED_MESSAGE resolver has received a DNS message - -This is a debug message indicating that the resolver has received a -DNS message. Depending on the debug settings, subsequent log output -will indicate the nature of the message. - - - - -RESOLVER_RECURSIVE running in recursive mode - -This is an informational message that appears at startup noting that -the resolver is running in recursive mode. - - - - -RESOLVER_SERVICE_CREATED service object created - -This debug message is output when resolver creates the main service object -(which handles the received queries). - - - - -RESOLVER_SET_PARAMS query timeout: %1, client timeout: %2, lookup timeout: %3, retry count: %4 - -This debug message lists the parameters being set for the resolver. These are: -query timeout: the timeout (in ms) used for queries originated by the resolver -to upstream servers. Client timeout: the interval to resolve a query by -a client: after this time, the resolver sends back a SERVFAIL to the client -whilst continuing to resolve the query. Lookup timeout: the time at which the -resolver gives up trying to resolve a query. Retry count: the number of times -the resolver will retry a query to an upstream server if it gets a timeout. - -The client and lookup timeouts require a bit more explanation. The -resolution of the client query might require a large number of queries to -upstream nameservers. Even if none of these queries timeout, the total time -taken to perform all the queries may exceed the client timeout. When this -happens, a SERVFAIL is returned to the client, but the resolver continues -with the resolution process; data received is added to the cache. However, -there comes a time - the lookup timeout - when even the resolver gives up. -At this point it will wait for pending upstream queries to complete or -timeout and drop the query. - - - - -RESOLVER_SET_QUERY_ACL query ACL is configured - -This debug message is generated when a new query ACL is configured for -the resolver. - - - - -RESOLVER_SET_ROOT_ADDRESS setting root address %1(%2) - -This message gives the address of one of the root servers used by the -resolver. It is output during startup and may appear multiple times, -once for each root server address. - - - - -RESOLVER_SHUTDOWN resolver shutdown complete - -This informational message is output when the resolver has shut down. - - - - -RESOLVER_SHUTDOWN_RECEIVED received command to shut down - -A debug message noting that the server was asked to terminate and is -complying to the request. - - - - -RESOLVER_STARTED resolver started - -This informational message is output by the resolver when all initialization -has been completed and it is entering its main loop. - - - - -RESOLVER_STARTING starting resolver with command line '%1' - -An informational message, this is output when the resolver starts up. - - - - -RESOLVER_UNEXPECTED_RESPONSE received unexpected response, ignoring - -This is a debug message noting that the resolver received a DNS response -packet on the port on which is it listening for queries. The packet -has been ignored. - - - - -RESOLVER_UNSUPPORTED_OPCODE opcode %1 not supported by the resolver - -This is debug message output when the resolver received a message with an -unsupported opcode (it can only process QUERY opcodes). It will return -a message to the sender with the RCODE set to NOTIMP. - - - - -SOCKETREQUESTOR_CREATED Socket requestor created for application %1 - -Debug message. A socket requesor (client of the socket creator) is created -for the corresponding application. Normally this should happen at most -one time throughout the lifetime of the application. - - - - -SOCKETREQUESTOR_DESTROYED Socket requestor destoryed - -Debug message. The socket requestor created at SOCKETREQUESTOR_CREATED -has been destroyed. This event is generally unexpected other than in -test cases. - - - - -SOCKETREQUESTOR_GETSOCKET Received a %1 socket for [%2]:%3, FD=%4, token=%5, path=%6 - -Debug message. The socket requestor for the corresponding application -has requested a socket for a set of address, port and protocol (shown -in the log message) and successfully got it from the creator. The -corresponding file descriptor and the associated "token" (an internal -ID used between the creator and requestor) are shown in the log -message. - - - - -SOCKETREQUESTOR_RELEASESOCKET Released a socket of token %1 - -Debug message. The socket requestor has released a socket passed by -the creator. The associated token of the socket is shown in the -log message. If the corresponding SOCKETREQUESTOR_GETSOCKET was logged -more detailed information of the socket can be identified by matching -the token. - - - - -SRVCOMM_ADDRESSES_NOT_LIST the address and port specification is not a list in %1 - -This points to an error in configuration. What was supposed to be a list of -IP address - port pairs isn't a list at all but something else. - - - - -SRVCOMM_ADDRESS_FAIL failed to listen on addresses (%1) - -The server failed to bind to one of the address/port pair it should according -to configuration, for reason listed in the message (usually because that pair -is already used by other service or missing privileges). The server will try -to recover and bind the address/port pairs it was listening to before (if any). - - - - -SRVCOMM_ADDRESS_MISSING address specification is missing "address" or "port" element in %1 - -This points to an error in configuration. An address specification in the -configuration is missing either an address or port and so cannot be used. The -specification causing the error is given in the message. - - - - -SRVCOMM_ADDRESS_TYPE address specification type is invalid in %1 - -This points to an error in configuration. An address specification in the -configuration malformed. The specification causing the error is given in the -message. A valid specification contains an address part (which must be a string -and must represent a valid IPv4 or IPv6 address) and port (which must be an -integer in the range valid for TCP/UDP ports on your system). - - - - -SRVCOMM_ADDRESS_UNRECOVERABLE failed to recover original addresses also (%1) - -The recovery of old addresses after SRVCOMM_ADDRESS_FAIL also failed for -the reason listed. - -The condition indicates problems with the server and/or the system on -which it is running. The server will continue running to allow -reconfiguration, but will not be listening on any address or port until -an administrator does so. - - - - -SRVCOMM_ADDRESS_VALUE address to set: %1#%2 - -Debug message. This lists one address and port value of the set of -addresses we are going to listen on (eg. there will be one log message -per pair). This appears only after SRVCOMM_SET_LISTEN, but might -be hidden, as it has higher debug level. - - - - -SRVCOMM_EXCEPTION_ALLOC exception when allocating a socket: %1 - -The process tried to allocate a socket using the socket creator, but an error -occurred. But it is not one of the errors we are sure are "safe". In this case -it is unclear if the unsuccessful communication left the process and the bind10 -process in inconsistent state, so the process is going to abort to prevent -further problems in that area. - -This is probably a bug in the code, but it could be caused by other unusual -conditions (like insufficient memory, deleted socket file used for -communication). - - - - -SRVCOMM_KEYS_DEINIT deinitializing TSIG keyring - -Debug message indicating that the server is deinitializing the TSIG keyring. - - - - -SRVCOMM_KEYS_INIT initializing TSIG keyring - -Debug message indicating that the server is initializing the global TSIG -keyring. This should be seen only at server start. - - - - -SRVCOMM_KEYS_UPDATE updating TSIG keyring - -Debug message indicating new keyring is being loaded from configuration (either -on startup or as a result of configuration update). - - - - -SRVCOMM_PORT_RANGE port out of valid range (%1 in %2) - -This points to an error in configuration. The port in an address -specification is outside the valid range of 0 to 65535. - - - - -SRVCOMM_SET_LISTEN setting addresses to listen to - -Debug message, noting that the server is about to start listening on a -different set of IP addresses and ports than before. - - - - -SRVCOMM_UNKNOWN_EXCEPTION_ALLOC unknown exception when allocating a socket - -The situation is the same as in the SRVCOMM_EXCEPTION_ALLOC case, but further -details about the error are unknown, because it was signaled by throwing -something not being an exception. This is definitely a bug. - - - - -STATHTTPD_BAD_OPTION_VALUE bad command line argument: %1 - -The stats-httpd module was called with a bad command-line argument -and will not start. - - - - -STATHTTPD_CC_SESSION_ERROR error connecting to message bus: %1 - -The stats-httpd module was unable to connect to the BIND 10 command -and control bus. A likely problem is that the message bus daemon -(b10-msgq) is not running. The stats-httpd module will now shut down. - - - - -STATHTTPD_CLOSING closing %1#%2 - -The stats-httpd daemon will stop listening for requests on the given -address and port number. - - - - -STATHTTPD_CLOSING_CC_SESSION stopping cc session - -Debug message indicating that the stats-httpd module is disconnecting -from the command and control bus. - - - - -STATHTTPD_HANDLE_CONFIG reading configuration: %1 - -The stats-httpd daemon has received new configuration data and will now -process it. The (changed) data is printed. - - - - -STATHTTPD_RECEIVED_SHUTDOWN_COMMAND shutdown command received - -A shutdown command was sent to the stats-httpd module, and it will -now shut down. - - - - -STATHTTPD_RECEIVED_STATUS_COMMAND received command to return status - -A status command was sent to the stats-httpd module, and it will -respond with 'Stats Httpd is up.' and its PID. - - - - -STATHTTPD_RECEIVED_UNKNOWN_COMMAND received unknown command: %1 - -An unknown command has been sent to the stats-httpd module. The -stats-httpd module will respond with an error, and the command will -be ignored. - - - - -STATHTTPD_SERVER_DATAERROR HTTP server data error: %1 - -An internal error occurred while handling an HTTP request. An HTTP 404 -response will be sent back, and the specific error is printed. This -is an error condition that likely points the specified data -corresponding to the requested URI is incorrect. - - - - -STATHTTPD_SERVER_ERROR HTTP server error: %1 - -An internal error occurred while handling an HTTP request. An HTTP 500 -response will be sent back, and the specific error is printed. This -is an error condition that likely points to a module that is not -responding correctly to statistic requests. - - - - -STATHTTPD_SERVER_INIT_ERROR HTTP server initialization error: %1 - -There was a problem initializing the HTTP server in the stats-httpd -module upon receiving its configuration data. The most likely cause -is a port binding problem or a bad configuration value. The specific -error is printed in the message. The new configuration is ignored, -and an error is sent back. - - - - -STATHTTPD_SHUTDOWN shutting down - -The stats-httpd daemon is shutting down. - - - - -STATHTTPD_STARTED listening on %1#%2 - -The stats-httpd daemon will now start listening for requests on the -given address and port number. - - - - -STATHTTPD_STARTING_CC_SESSION starting cc session - -Debug message indicating that the stats-httpd module is connecting to -the command and control bus. - - - - -STATHTTPD_START_SERVER_INIT_ERROR HTTP server initialization error: %1 - -There was a problem initializing the HTTP server in the stats-httpd -module upon startup. The most likely cause is that it was not able -to bind to the listening port. The specific error is printed, and the -module will shut down. - - - - -STATHTTPD_STOPPED_BY_KEYBOARD keyboard interrupt, shutting down - -There was a keyboard interrupt signal to stop the stats-httpd -daemon. The daemon will now shut down. - - - - -STATHTTPD_UNKNOWN_CONFIG_ITEM unknown configuration item: %1 - -The stats-httpd daemon received a configuration update from the -configuration manager. However, one of the items in the -configuration is unknown. The new configuration is ignored, and an -error is sent back. As possible cause is that there was an upgrade -problem, and the stats-httpd version is out of sync with the rest of -the system. - - - - -STATS_BAD_OPTION_VALUE bad command line argument: %1 - -The stats module was called with a bad command-line argument and will -not start. - - - - -STATS_CC_SESSION_ERROR error connecting to message bus: %1 - -The stats module was unable to connect to the BIND 10 command and -control bus. A likely problem is that the message bus daemon -(b10-msgq) is not running. The stats module will now shut down. - - - - -STATS_RECEIVED_NEW_CONFIG received new configuration: %1 - -This debug message is printed when the stats module has received a -configuration update from the configuration manager. - - - - -STATS_RECEIVED_SHOWSCHEMA_ALL_COMMAND received command to show all statistics schema - -The stats module received a command to show all statistics schemas of all modules. - - - - -STATS_RECEIVED_SHOWSCHEMA_NAME_COMMAND received command to show statistics schema for %1 - -The stats module received a command to show the specified statistics schema of the specified module. - - - - -STATS_RECEIVED_SHOW_ALL_COMMAND received command to show all statistics - -The stats module received a command to show all statistics that it has -collected. - - - - -STATS_RECEIVED_SHOW_NAME_COMMAND received command to show statistics for %1 - -The stats module received a command to show the statistics that it has -collected for the given item. - - - - -STATS_RECEIVED_SHUTDOWN_COMMAND shutdown command received - -A shutdown command was sent to the stats module and it will now shut down. - - - - -STATS_RECEIVED_STATUS_COMMAND received command to return status - -A status command was sent to the stats module. It will return a -response indicating that it is running normally. - - - - -STATS_RECEIVED_UNKNOWN_COMMAND received unknown command: %1 - -An unknown command has been sent to the stats module. The stats module -will respond with an error and the command will be ignored. - - - - -STATS_SEND_REQUEST_BOSS requesting boss to send statistics - -This debug message is printed when a request is sent to the boss module -to send its data to the stats module. - - - - -STATS_STARTING starting - -The stats module will be now starting. - - - - -STATS_START_ERROR stats module error: %1 - -An internal error occurred while starting the stats module. The stats -module will be now shutting down. - - - - -STATS_STOPPED_BY_KEYBOARD keyboard interrupt, shutting down - -There was a keyboard interrupt signal to stop the stats module. The -daemon will now shut down. - - - - -STATS_UNKNOWN_COMMAND_IN_SPEC unknown command in specification file: %1 - -The specification file for the stats module contains a command that -is unknown in the implementation. The most likely cause is an -installation problem, where the specification file stats.spec is -from a different version of BIND 10 than the stats module itself. -Please check your installation. - - - - -XFRIN_AUTH_LOADZONE sending Auth loadzone for origin=%1, class=%2 - -There was a successful zone transfer. We send the "loadzone" command for the -zone to b10-auth. - - - - -XFRIN_AXFR_INCONSISTENT_SOA AXFR SOAs are inconsistent for %1: %2 expected, %3 received - -The serial fields of the first and last SOAs of AXFR (including AXFR-style -IXFR) are not the same. According to RFC 5936 these two SOAs must be the -"same" (not only for the serial), but it is still not clear what the -receiver should do if this condition does not hold. There was a discussion -about this at the IETF dnsext wg: -http://www.ietf.org/mail-archive/web/dnsext/current/msg07908.html -and the general feeling seems that it would be better to reject the -transfer if a mismatch is detected. On the other hand, also as noted -in that email thread, neither BIND 9 nor NSD performs any comparison -on the SOAs. For now, we only check the serials (ignoring other fields) -and only leave a warning log message when a mismatch is found. If it -turns out to happen with a real world primary server implementation -and that server actually feeds broken data (e.g. mixed versions of -zone), we can consider a stricter action. - - - - -XFRIN_BAD_MASTER_ADDR_FORMAT bad format for master address: %1 - -The given master address is not a valid IP address. - - - - -XFRIN_BAD_MASTER_PORT_FORMAT bad format for master port: %1 - -The master port as read from the configuration is not a valid port number. - - - - -XFRIN_BAD_TSIG_KEY_STRING bad TSIG key string: %1 - -The TSIG key string as read from the configuration does not represent -a valid TSIG key. - - - - -XFRIN_BAD_ZONE_CLASS Invalid zone class: %1 - -The zone class as read from the configuration is not a valid DNS class. - - - - -XFRIN_CC_SESSION_ERROR error reading from cc channel: %1 - -There was a problem reading from the command and control channel. The -most likely cause is that xfrin the msgq daemon is not running. - - - - -XFRIN_COMMAND_ERROR error while executing command '%1': %2 - -There was an error while the given command was being processed. The -error is given in the log message. - - - - -XFRIN_CONNECT_MASTER error connecting to master at %1: %2 - -There was an error opening a connection to the master. The error is -shown in the log message. - - - - -XFRIN_GOT_INCREMENTAL_RESP got incremental response for %1 - -In an attempt of IXFR processing, the begenning SOA of the first difference -(following the initial SOA that specified the final SOA for all the -differences) was found. This means a connection for xfrin tried IXFR -and really aot a response for incremental updates. - - - - -XFRIN_GOT_NONINCREMENTAL_RESP got nonincremental response for %1 - -Non incremental transfer was detected at the "first data" of a transfer, -which is the RR following the initial SOA. Non incremental transfer is -either AXFR or AXFR-style IXFR. In the latter case, it means that -in a response to IXFR query the first data is not SOA or its SOA serial -is not equal to the requested SOA serial. - - - - -XFRIN_IMPORT_DNS error importing python DNS module: %1 - -There was an error importing the python DNS module pydnspp. The most -likely cause is a PYTHONPATH problem. - - - - -XFRIN_IXFR_TRANSFER_SUCCESS incremental IXFR transfer of zone %1 succeeded (messages: %2, changesets: %3, deletions: %4, additions: %5, bytes: %6, run time: %7 seconds, %8 bytes/second) - -The IXFR transfer for the given zone was successful. -The provided information contains the following values: - -messages: Number of overhead DNS messages in the transfer. - -changesets: Number of difference sequences. - -deletions: Number of Resource Records deleted by all the changesets combined, -including the SOA records. - -additions: Number of Resource Records added by all the changesets combined, -including the SOA records. - -bytes: Full size of the transfer data on the wire. - -run time: Time (in seconds) the complete ixfr took. - -bytes/second: Transfer speed. - -Note that there is no cross-checking of additions and deletions; if the same -RR gets added and deleted in multiple changesets, it is counted each time; -therefore, for each changeset, there should at least be 1 deletion and 1 -addition (the updated SOA record). - - - - -XFRIN_IXFR_UPTODATE IXFR requested serial for %1 is %2, master has %3, not updating - -The first SOA record in an IXFR response indicates the zone's serial -at the primary server is not newer than the client's. This is -basically unexpected event because normally the client first checks -the SOA serial by an SOA query, but can still happen if the transfer -is manually invoked or (although unlikely) there is a rapid change at -the primary server between the SOA and IXFR queries. The client -implementation confirms the whole response is this single SOA, and -aborts the transfer just like a successful case. - - - - -XFRIN_MSGQ_SEND_ERROR error while contacting %1 and %2 - -There was a problem sending a message to the xfrout module or the -zone manager. This most likely means that the msgq daemon has quit or -was killed. - - - - -XFRIN_MSGQ_SEND_ERROR_AUTH error while contacting %1 - -There was a problem sending a message to b10-auth. This most likely -means that the msgq daemon has quit or was killed. - - - - -XFRIN_MSGQ_SEND_ERROR_ZONE_MANAGER error while contacting %1 - -There was a problem sending a message to the zone manager. This most -likely means that the msgq daemon has quit or was killed. - - - - -XFRIN_NOTIFY_UNKNOWN_MASTER got notification to retransfer zone %1 from %2, expected %3 - -The system received a notify for the given zone, but the address it came -from does not match the master address in the Xfrin configuration. The notify -is ignored. This may indicate that the configuration for the master is wrong, -that a wrong machine is sending notifies, or that fake notifies are being sent. - - - - -XFRIN_RETRANSFER_UNKNOWN_ZONE got notification to retransfer unknown zone %1 - -There was an internal command to retransfer the given zone, but the -zone is not known to the system. This may indicate that the configuration -for xfrin is incomplete, or there was a typographical error in the -zone name in the configuration. - - - - -XFRIN_STARTED xfrin started - -This informational message is output by xfrin when all initialization -has been completed and it is entering its main loop. - - - - -XFRIN_STOPPED_BY_KEYBOARD keyboard interrupt, shutting down - -There was a keyboard interrupt signal to stop the xfrin daemon. The -daemon will now shut down. - - - - -XFRIN_TRANSFER_SUCCESS full %1 transfer of zone %2 succeeded (messages: %3, records: %4, bytes: %5, run time: %6 seconds, %7 bytes/second) - -The AXFR transfer of the given zone was successful. -The provided information contains the following values: - -messages: Number of overhead DNS messages in the transfer - -records: Number of Resource Records in the full transfer, excluding the -final SOA record that marks the end of the AXFR. - -bytes: Full size of the transfer data on the wire. - -run time: Time (in seconds) the complete axfr took - -bytes/second: Transfer speed - - - - -XFRIN_UNKNOWN_ERROR unknown error: %1 - -An uncaught exception was raised while running the xfrin daemon. The -exception message is printed in the log message. - - - - -XFRIN_XFR_OTHER_FAILURE %1 transfer of zone %2 failed: %3 - -The XFR transfer for the given zone has failed due to a problem outside -of the xfrin module. Possible reasons are a broken DNS message or failure -in database connection. The error is shown in the log message. - - - - -XFRIN_XFR_PROCESS_FAILURE %1 transfer of zone %2/%3 failed: %4 - -An XFR session failed outside the main protocol handling. This -includes an error at the data source level at the initialization -phase, unexpected failure in the network connection setup to the -master server, or even more unexpected failure due to unlikely events -such as memory allocation failure. Details of the error are shown in -the log message. In general, these errors are not really expected -ones, and indicate an installation error or a program bug. The -session handler thread tries to clean up all intermediate resources -even on these errors, but it may be incomplete. So, if this log -message continuously appears, system resource consumption should be -checked, and you may even want to disable the corresponding transfers. -You may also want to file a bug report if this message appears so -often. - - - - -XFRIN_XFR_TRANSFER_FAILURE %1 transfer of zone %2 with %3 failed: %4 - -The XFR transfer for the given zone has failed due to an internal error. -The error is shown in the log message. - - - - -XFRIN_XFR_TRANSFER_FALLBACK falling back from IXFR to AXFR for %1 - -The IXFR transfer of the given zone failed. This might happen in many cases, -such that the remote server doesn't support IXFR, we don't have the SOA record -(or the zone at all), we are out of sync, etc. In many of these situations, -AXFR could still work. Therefore we try that one in case it helps. - - - - -XFRIN_XFR_TRANSFER_PROTOCOL_ERROR %1 transfer of zone %2 with %3 failed: %4 - -The XFR transfer for the given zone has failed due to a protocol -error, such as an unexpected response from the primary server. The -error is shown in the log message. It may be because the primary -server implementation is broken or (although less likely) there was -some attack attempt, but it can also happen due to configuration -mismatch such as the remote server does not have authority for the -zone any more but the local configuration hasn't been updated. So it -is recommended to check the primary server configuration. - - - - -XFRIN_XFR_TRANSFER_STARTED %1 transfer of zone %2 started - -A connection to the master server has been made, the serial value in -the SOA record has been checked, and a zone transfer has been started. - - - - -XFRIN_ZONE_CREATED Zone %1 not found in the given data source, newly created - -On starting an xfrin session, it is identified that the zone to be -transferred is not found in the data source. This can happen if a -secondary DNS server first tries to perform AXFR from a primary server -without creating the zone image beforehand (e.g. by b10-loadzone). As -of this writing the xfrin process provides backward compatible -behavior to previous versions: creating a new one in the data source -not to surprise existing users too much. This is probably not a good -idea, however, in terms of who should be responsible for managing -zones at a higher level. In future it is more likely that a separate -zone management framework is provided, and the situation where the -given zone isn't found in xfrout will be treated as an error. - - - - -XFRIN_ZONE_MULTIPLE_SOA Zone %1 has %2 SOA RRs - -On starting an xfrin session, it is identified that the zone to be -transferred has multiple SOA RRs. Such a zone is broken, but could be -accidentally configured especially in a data source using "non -captive" backend database. The implementation ignores entire SOA RRs -and tries to continue processing as if the zone were empty. This -means subsequent AXFR can succeed and possibly replace the zone with -valid content, but an IXFR attempt will fail. - - - - -XFRIN_ZONE_NO_SOA Zone %1 does not have SOA - -On starting an xfrin session, it is identified that the zone to be -transferred does not have an SOA RR in the data source. This is not -necessarily an error; if a secondary DNS server first tries to perform -transfer from a primary server, the zone can be empty, and therefore -doesn't have an SOA. Subsequent AXFR will fill in the zone; if the -attempt is IXFR it will fail in query creation. - - - - -XFRIN_ZONE_SERIAL_AHEAD Serial number (%1) for %2 received from master %3 < ours (%4) - -The response to an SOA query prior to xfr indicated that the zone's -SOA serial at the primary server is smaller than that of the xfrin -client. This is not necessarily an error especially if that -particular primary server is another secondary server which hasn't got -the latest version of the zone. But if the primary server is known to -be the real source of the zone, some unexpected inconsistency may have -happened, and you may want to take a closer look. In this case xfrin -doesn't perform subsequent zone transfer. - - - - -XFROUT_BAD_TSIG_KEY_STRING bad TSIG key string: %1 - -The TSIG key string as read from the configuration does not represent -a valid TSIG key. - - - - -XFROUT_CC_SESSION_ERROR error reading from cc channel: %1 - -There was a problem reading from the command and control channel. The -most likely cause is that the msgq daemon is not running. - - - - -XFROUT_CC_SESSION_TIMEOUT_ERROR timeout waiting for cc response - -There was a problem reading a response from another module over the -command and control channel. The most likely cause is that the -configuration manager b10-cfgmgr is not running. - - - - -XFROUT_CONFIG_ERROR error found in configuration data: %1 - -The xfrout process encountered an error when installing the configuration at -startup time. Details of the error are included in the log message. - - - - -XFROUT_FETCH_REQUEST_ERROR socket error while fetching a request from the auth daemon - -There was a socket error while contacting the b10-auth daemon to -fetch a transfer request. The auth daemon may have shutdown. - - - - -XFROUT_HANDLE_QUERY_ERROR error while handling query: %1 - -There was a general error handling an xfrout query. The error is shown -in the message. In principle this error should not appear, and points -to an oversight catching exceptions in the right place. However, to -ensure the daemon keeps running, this error is caught and reported. - - - - -XFROUT_IMPORT error importing python module: %1 - -There was an error importing a python module. One of the modules needed -by xfrout could not be found. This suggests that either some libraries -are missing on the system, or the PYTHONPATH variable is not correct. -The specific place where this library needs to be depends on your -system and your specific installation. - - - - -XFROUT_IXFR_MULTIPLE_SOA IXFR client %1: authority section has multiple SOAs - -An IXFR request was received with more than one SOA RRs in the authority -section. The xfrout daemon rejects the request with an RCODE of -FORMERR. - - - - -XFROUT_IXFR_NO_JOURNAL_SUPPORT IXFR client %1, %2: journaling not supported in the data source, falling back to AXFR - -An IXFR request was received but the underlying data source did -not support journaling. The xfrout daemon fell back to AXFR-style -IXFR. - - - - -XFROUT_IXFR_NO_SOA IXFR client %1: missing SOA - -An IXFR request was received with no SOA RR in the authority section. -The xfrout daemon rejects the request with an RCODE of FORMERR. - - - - -XFROUT_IXFR_NO_VERSION IXFR client %1, %2: version (%3 to %4) not in journal, falling back to AXFR - -An IXFR request was received, but the requested range of differences -were not found in the data source. The xfrout daemon fell back to -AXFR-style IXFR. - - - - -XFROUT_IXFR_NO_ZONE IXFR client %1, %2: zone not found with journal - -The requested zone in IXFR was not found in the data source -even though the xfrout daemon sucessfully found the SOA RR of the zone -in the data source. This can happen if the administrator removed the -zone from the data source within the small duration between these -operations, but it's more likely to be a bug or broken data source. -Unless you know why this message was logged, and especially if it -happens often, it's advisable to check whether the data source is -valid for this zone. The xfrout daemon considers it a possible, -though unlikely, event, and returns a response with an RCODE of -NOTAUTH. - - - - -XFROUT_IXFR_UPTODATE IXFR client %1, %2: client version is new enough (theirs=%3, ours=%4) - -An IXFR request was received, but the client's SOA version is the same as -or newer than that of the server. The xfrout server responds to the -request with the answer section being just one SOA of that version. -Note: as of this wrting the 'newer version' cannot be identified due to -the lack of support for the serial number arithmetic. This will soon -be implemented. - - - - -XFROUT_MODULECC_SESSION_ERROR error encountered by configuration/command module: %1 - -There was a problem in the lower level module handling configuration and -control commands. This could happen for various reasons, but the most likely -cause is that the configuration database contains a syntax error and xfrout -failed to start at initialization. A detailed error message from the module -will also be displayed. - - - - -XFROUT_NEW_CONFIG Update xfrout configuration - -New configuration settings have been sent from the configuration -manager. The xfrout daemon will now apply them. - - - - -XFROUT_NEW_CONFIG_DONE Update xfrout configuration done - -The xfrout daemon is now done reading the new configuration settings -received from the configuration manager. - - - - -XFROUT_NOTIFY_COMMAND received command to send notifies for %1/%2 - -The xfrout daemon received a command on the command channel that -NOTIFY packets should be sent for the given zone. - - - - -XFROUT_PARSE_QUERY_ERROR error parsing query: %1 - -There was a parse error while reading an incoming query. The parse -error is shown in the log message. A remote client sent a packet we -do not understand or support. The xfrout request will be ignored. -In general, this should only occur for unexpected problems like -memory allocation failures, as the query should already have been -parsed by the b10-auth daemon, before it was passed here. - - - - -XFROUT_PROCESS_REQUEST_ERROR error processing transfer request: %1 - -There was an error in receiving a transfer request from b10-auth. -This is generally an unexpected event, but is possible when, for -example, b10-auth terminates in the middle of forwarding the request. -When this happens it's unlikely to be recoverable with the same -communication session with b10-auth, so b10-xfrout drops it and -waits for a new session. In any case, this error indicates that -there's something very wrong in the system, so it's advisable to check -the over all status of the BIND 10 system. - - - - -XFROUT_QUERY_DROPPED %1 client %2: request to transfer %3 dropped - -The xfrout process silently dropped a request to transfer zone to -given host. This is required by the ACLs. The %2 represents the IP -address and port of the peer requesting the transfer, and the %3 -represents the zone name and class. - - - - -XFROUT_QUERY_QUOTA_EXCCEEDED %1 client %2: request denied due to quota (%3) - -The xfr request was rejected because the server was already handling -the maximum number of allowable transfers as specified in the transfers_out -configuration parameter, which is also shown in the log message. The -request was immediately responded and terminated with an RCODE of REFUSED. -This can happen for a busy xfrout server, and you may want to increase -this parameter; if the server is being too busy due to requests from -unexpected clients you may want to restrict the legitimate clients -with ACL. - - - - -XFROUT_QUERY_REJECTED %1 client %2: request to transfer %3 rejected - -The xfrout process rejected (by REFUSED rcode) a request to transfer zone to -given host. This is because of ACLs. The %2 represents the IP -address and port of the peer requesting the transfer, and the %3 -represents the zone name and class. - - - - -XFROUT_RECEIVED_SHUTDOWN_COMMAND shutdown command received - -The xfrout daemon received a shutdown command from the command channel -and will now shut down. - - - - -XFROUT_RECEIVE_FILE_DESCRIPTOR_ERROR error receiving the file descriptor for an XFR connection - -There was an error receiving the file descriptor for the transfer -request from b10-auth. There can be several reasons for this, but -the most likely cause is that b10-auth terminates for some reason -(maybe it's a bug of b10-auth, maybe it's an intentional restart by -the administrator), so depending on how this happens it may or may not -be a serious error. But in any case this is not expected to happen -frequently, and it's advisable to figure out how this happened if -this message is logged. Even if this error happens xfrout will reset -its internal state and will keep receiving further requests. So -if it's just a temporary restart of b10-auth the administrator does -not have to do anything. - - - - -XFROUT_REMOVE_OLD_UNIX_SOCKET_FILE_ERROR error removing unix socket file %1: %2 - -The unix socket file xfrout needs for contact with the auth daemon -already exists, and needs to be removed first, but there is a problem -removing it. It is likely that we do not have permission to remove -this file. The specific error is show in the log message. The xfrout -daemon will shut down. - - - - -XFROUT_REMOVE_UNIX_SOCKET_FILE_ERROR error clearing unix socket file %1: %2 - -When shutting down, the xfrout daemon tried to clear the unix socket -file used for communication with the auth daemon. It failed to remove -the file. The reason for the failure is given in the error message. - - - - -XFROUT_SOCKET_SELECT_ERROR error while calling select() on request socket: %1 - -There was an error while calling select() on the socket that informs -the xfrout daemon that a new xfrout request has arrived. This should -be a result of rare local error such as memory allocation failure and -shouldn't happen under normal conditions. The error is included in the -log message. - - - - -XFROUT_STARTED xfrout started - -This informational message is output by xfrout when all initialization -has been completed and it is entering its main loop. - - - - -XFROUT_STOPPED_BY_KEYBOARD keyboard interrupt, shutting down - -There was a keyboard interrupt signal to stop the xfrout daemon. The -daemon will now shut down. - - - - -XFROUT_STOPPING the xfrout daemon is shutting down - -The current transfer is aborted, as the xfrout daemon is shutting down. - - - - -XFROUT_UNIX_SOCKET_FILE_IN_USE another xfrout process seems to be using the unix socket file %1 - -While starting up, the xfrout daemon tried to clear the unix domain -socket needed for contacting the b10-auth daemon to pass requests -on, but the file is in use. The most likely cause is that another -xfrout daemon process is still running. This xfrout daemon (the one -printing this message) will not start. - - - - -XFROUT_XFR_TRANSFER_CHECK_ERROR %1 client %2: check for transfer of %3 failed: %4 - -Pre-response check for an incomding XFR request failed unexpectedly. -The most likely cause of this is that some low level error in the data -source, but it may also be other general (more unlikely) errors such -as memory shortage. Some detail of the error is also included in the -message. The xfrout server tries to return a SERVFAIL response in this case. - - - - -XFROUT_XFR_TRANSFER_DONE %1 client %2: transfer of %3 complete - -The transfer of the given zone has been completed successfully, or was -aborted due to a shutdown event. - - - - -XFROUT_XFR_TRANSFER_ERROR %1 client %2: error transferring zone %3: %4 - -An uncaught exception was encountered while sending the response to -an AXFR query. The error message of the exception is included in the -log message, but this error most likely points to incomplete exception -handling in the code. - - - - -XFROUT_XFR_TRANSFER_FAILED %1 client %2: transfer of %3 failed, rcode: %4 - -A transfer out for the given zone failed. An error response is sent -to the client. The given rcode is the rcode that is set in the error -response. This is either NOTAUTH (we are not authoritative for the -zone), SERVFAIL (our internal database is missing the SOA record for -the zone), or REFUSED (the limit of simultaneous outgoing AXFR -transfers, as specified by the configuration value -Xfrout/max_transfers_out, has been reached). - - - - -XFROUT_XFR_TRANSFER_STARTED %1 client %2: transfer of zone %3 has started - -A transfer out of the given zone has started. - - - - -ZONEMGR_CCSESSION_ERROR command channel session error: %1 - -An error was encountered on the command channel. The message indicates -the nature of the error. - - - - -ZONEMGR_JITTER_TOO_BIG refresh_jitter is too big, setting to 0.5 - -The value specified in the configuration for the refresh jitter is too large -so its value has been set to the maximum of 0.5. - - - - -ZONEMGR_KEYBOARD_INTERRUPT exiting zonemgr process as result of keyboard interrupt - -An informational message output when the zone manager was being run at a -terminal and it was terminated via a keyboard interrupt signal. - - - - -ZONEMGR_LOAD_ZONE loading zone %1 (class %2) - -This is a debug message indicating that the zone of the specified class -is being loaded. - - - - -ZONEMGR_NO_MASTER_ADDRESS internal BIND 10 command did not contain address of master - -A command received by the zone manager from the Auth module did not -contain the address of the master server from which a NOTIFY message -was received. This may be due to an internal programming error; please -submit a bug report. - - - - -ZONEMGR_NO_SOA zone %1 (class %2) does not have an SOA record - -When loading the named zone of the specified class the zone manager -discovered that the data did not contain an SOA record. The load has -been abandoned. - - - - -ZONEMGR_NO_TIMER_THREAD trying to stop zone timer thread but it is not running - -An attempt was made to stop the timer thread (used to track when zones -should be refreshed) but it was not running. This may indicate an -internal program error. Please submit a bug report. - - - - -ZONEMGR_NO_ZONE_CLASS internal BIND 10 command did not contain class of zone - -A command received by the zone manager from another BIND 10 module did -not contain the class of the zone on which the zone manager should act. -This may be due to an internal programming error; please submit a -bug report. - - - - -ZONEMGR_NO_ZONE_NAME internal BIND 10 command did not contain name of zone - -A command received by the zone manager from another BIND 10 module did -not contain the name of the zone on which the zone manager should act. -This may be due to an internal programming error; please submit a -bug report. - - - - -ZONEMGR_RECEIVE_NOTIFY received NOTIFY command for zone %1 (class %2) - -This is a debug message indicating that the zone manager has received a -NOTIFY command over the command channel. The command is sent by the Auth -process when it is acting as a slave server for the zone and causes the -zone manager to record the master server for the zone and start a timer; -when the timer expires, the master will be polled to see if it contains -new data. - - - - -ZONEMGR_RECEIVE_SHUTDOWN received SHUTDOWN command - -This is a debug message indicating that the zone manager has received -a SHUTDOWN command over the command channel from the Boss process. -It will act on this command and shut down. - - - - -ZONEMGR_RECEIVE_UNKNOWN received unknown command '%1' - -This is a warning message indicating that the zone manager has received -the stated command over the command channel. The command is not known -to the zone manager and although the command is ignored, its receipt -may indicate an internal error. Please submit a bug report. - - - - -ZONEMGR_RECEIVE_XFRIN_FAILED received XFRIN FAILED command for zone %1 (class %2) - -This is a debug message indicating that the zone manager has received -an XFRIN FAILED command over the command channel. The command is sent -by the Xfrin process when a transfer of zone data into the system has -failed, and causes the zone manager to schedule another transfer attempt. - - - - -ZONEMGR_RECEIVE_XFRIN_SUCCESS received XFRIN SUCCESS command for zone %1 (class %2) - -This is a debug message indicating that the zone manager has received -an XFRIN SUCCESS command over the command channel. The command is sent -by the Xfrin process when the transfer of zone data into the system has -succeeded, and causes the data to be loaded and served by BIND 10. - - - - -ZONEMGR_REFRESH_ZONE refreshing zone %1 (class %2) - -The zone manager is refreshing the named zone of the specified class -with updated information. - - - - -ZONEMGR_SELECT_ERROR error with select(): %1 - -An attempt to wait for input from a socket failed. The failing operation -is a call to the operating system's select() function, which failed for -the given reason. - - - - -ZONEMGR_SEND_FAIL failed to send command to %1, session has been closed - -The zone manager attempted to send a command to the named BIND 10 module, -but the send failed. The session between the modules has been closed. - - - - -ZONEMGR_SESSION_ERROR unable to establish session to command channel daemon - -The zonemgr process was not able to be started because it could not -connect to the command channel daemon. The most usual cause of this -problem is that the daemon is not running. - - - - -ZONEMGR_SESSION_TIMEOUT timeout on session to command channel daemon - -The zonemgr process was not able to be started because it timed out when -connecting to the command channel daemon. The most usual cause of this -problem is that the daemon is not running. - - - - -ZONEMGR_SHUTDOWN zone manager has shut down - -A debug message, output when the zone manager has shut down completely. - - - - -ZONEMGR_STARTED zonemgr started - -This informational message is output by zonemgr when all initialization -has been completed and it is entering its main loop. - - - - -ZONEMGR_STARTING zone manager starting - -A debug message output when the zone manager starts up. - - - - -ZONEMGR_TIMER_THREAD_RUNNING trying to start timer thread but one is already running - -This message is issued when an attempt is made to start the timer -thread (which keeps track of when zones need a refresh) but one is -already running. It indicates either an error in the program logic or -a problem with stopping a previous instance of the timer. Please submit -a bug report. - - - - -ZONEMGR_UNKNOWN_ZONE_FAIL zone %1 (class %2) is not known to the zone manager - -An XFRIN operation has failed but the zone that was the subject of the -operation is not being managed by the zone manager. This can be either the -result of a bindctl command to transfer in a currently unknown (or mistyped) -zone, or, if this error appears without the administrator giving transfer -commands, it can indicate an error in the program, as it should not have -initiated transfers of unknown zones on its own. - - - - -ZONEMGR_UNKNOWN_ZONE_NOTIFIED notified zone %1 (class %2) is not known to the zone manager - -A NOTIFY was received but the zone that was the subject of the operation -is not being managed by the zone manager. This may indicate an error -in the program (as the operation should not have been initiated if this -were the case). Please submit a bug report. - - - - -ZONEMGR_UNKNOWN_ZONE_SUCCESS zone %1 (class %2) is not known to the zone manager - -An XFRIN operation has succeeded but the zone received is not being -managed by the zone manager. This may indicate an error in the program -(as the operation should not have been initiated if this were the case). -Please submit a bug report. - - - - - - diff --git a/src/bin/auth/.gitignore b/src/bin/auth/.gitignore index 64c3fd7def..fb06b833f5 100644 --- a/src/bin/auth/.gitignore +++ b/src/bin/auth/.gitignore @@ -5,3 +5,4 @@ /b10-auth /spec_config.h /spec_config.h.pre +/b10-auth.8 diff --git a/src/bin/auth/Makefile.am b/src/bin/auth/Makefile.am index 47bed1562b..9e24433d29 100644 --- a/src/bin/auth/Makefile.am +++ b/src/bin/auth/Makefile.am @@ -20,12 +20,19 @@ CLEANFILES = *.gcno *.gcda auth.spec spec_config.h CLEANFILES += auth_messages.h auth_messages.cc man_MANS = b10-auth.8 +DISTCLEANFILES = $(man_MANS) EXTRA_DIST = $(man_MANS) b10-auth.xml -if ENABLE_MAN +if GENERATE_DOCS b10-auth.8: b10-auth.xml - xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-auth.xml + @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-auth.xml + +else + +$(man_MANS): + @echo Man generation disabled. Creating dummy $@. Configure with --enable-generate-docs to enable it. + @echo Man generation disabled. Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@ endif diff --git a/src/bin/auth/auth.spec.pre.in b/src/bin/auth/auth.spec.pre.in index b9587e6127..a471b7a87f 100644 --- a/src/bin/auth/auth.spec.pre.in +++ b/src/bin/auth/auth.spec.pre.in @@ -90,6 +90,11 @@ } ] } + }, + { "item_name": "tcp_recv_timeout", + "item_type": "integer", + "item_optional": false, + "item_default": 5000 } ], "commands": [ diff --git a/src/bin/auth/auth_config.cc b/src/bin/auth/auth_config.cc index a67632f9cb..e8592ac553 100644 --- a/src/bin/auth/auth_config.cc +++ b/src/bin/auth/auth_config.cc @@ -116,6 +116,29 @@ private: */ AddrListPtr rollbackAddresses_; }; + +/// \brief Configuration for TCP receive timeouts +class TCPRecvTimeoutConfig : public AuthConfigParser { +public: + TCPRecvTimeoutConfig(AuthSrv& server) : server_(server), timeout_(0) + {} + + virtual void build(ConstElementPtr config) { + if (config->intValue() >= 0) { + timeout_ = config->intValue(); + } else { + isc_throw(AuthConfigError, "tcp_recv_timeout must be 0 or higher"); + } + } + + virtual void commit() { + server_.setTCPRecvTimeout(timeout_); + } +private: + AuthSrv& server_; + size_t timeout_; +}; + } // end of unnamed namespace AuthConfigParser* @@ -147,6 +170,8 @@ createAuthConfigParser(AuthSrv& server, const std::string& config_id) { // We need to return something. The VersionConfig is empty now, // so we may abuse that one, as it is a short-term solution only. return (new VersionConfig()); + } else if (config_id == "tcp_recv_timeout") { + return (new TCPRecvTimeoutConfig(server)); } else { isc_throw(AuthConfigError, "Unknown configuration identifier: " << config_id); diff --git a/src/bin/auth/auth_srv.cc b/src/bin/auth/auth_srv.cc index 6e5666f43f..ddb7466fe3 100644 --- a/src/bin/auth/auth_srv.cc +++ b/src/bin/auth/auth_srv.cc @@ -114,6 +114,18 @@ private: MessageRenderer& renderer_; }; +// Similar to Renderer holder, this is a very basic RAII-style class +// that calls clear(Message::PARSE) on the given Message upon destruction +class MessageHolder { +public: + MessageHolder(Message& message) : message_(message) {} + ~MessageHolder() { + message_.clear(Message::PARSE); + } +private: + Message& message_; +}; + // A helper container of socket session forwarder. // // This class provides a simple wrapper interface to SocketSessionForwarder @@ -344,6 +356,11 @@ public: OutputBufferPtr buffer, DNSServer* server) const { + // Keep a holder on the message, so that it is automatically + // cleared if processMessage() is done + // This is not done in processMessage itself (which would be + // equivalent), to allow tests to inspect the message handling. + MessageHolder message_holder(*message); server_->processMessage(io_message, *message, *buffer, server); } private: @@ -927,3 +944,8 @@ AuthSrv::getClientListClasses() const { } return (result); } + +void +AuthSrv::setTCPRecvTimeout(size_t timeout) { + dnss_->setTCPRecvTimeout(timeout); +} diff --git a/src/bin/auth/auth_srv.h b/src/bin/auth/auth_srv.h index 2c2b41566d..e2ffd71526 100644 --- a/src/bin/auth/auth_srv.h +++ b/src/bin/auth/auth_srv.h @@ -319,6 +319,16 @@ public: /// has been set by setClientList. std::vector getClientListClasses() const; + /// \brief Sets the timeout for incoming TCP connections + /// + /// Incoming TCP connections that have not sent their data + /// withing this time are dropped. + /// + /// \param timeout The timeout (in milliseconds). If se to + /// zero, no timeouts are used, and the connection will remain + /// open forever. + void setTCPRecvTimeout(size_t timeout); + private: AuthSrvImpl* impl_; isc::asiolink::SimpleCallback* checkin_; diff --git a/src/bin/auth/b10-auth.8 b/src/bin/auth/b10-auth.8 deleted file mode 100644 index 1c6222feb1..0000000000 --- a/src/bin/auth/b10-auth.8 +++ /dev/null @@ -1,213 +0,0 @@ -'\" t -.\" Title: b10-auth -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: June 20, 2012 -.\" Manual: BIND10 -.\" Source: BIND10 -.\" Language: English -.\" -.TH "B10\-AUTH" "8" "June 20, 2012" "BIND10" "BIND10" -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.SH "NAME" -b10-auth \- Authoritative DNS server -.SH "SYNOPSIS" -.HP \w'\fBb10\-auth\fR\ 'u -\fBb10\-auth\fR [\fB\-v\fR] -.SH "DESCRIPTION" -.PP -The -\fBb10\-auth\fR -daemon provides the BIND 10 authoritative DNS server\&. Normally it is started by the -\fBbind10\fR(8) -boss process\&. -.PP -This daemon communicates with other BIND 10 components over a -\fBb10-msgq\fR(8) -C\-Channel connection\&. If this connection is not established, -\fBb10\-auth\fR -will exit\&. -It receives its configurations from -\fBb10-cfgmgr\fR(8)\&. -.SH "OPTIONS" -.PP -The arguments are as follows: -.PP -\fB\-v\fR -.RS 4 -Enable verbose logging mode\&. This enables logging of diagnostic messages at the maximum debug level\&. -.RE -.SH "CONFIGURATION AND COMMANDS" -.PP -The configurable settings are: -.PP - -\fIdatabase_file\fR -defines the path to the SQLite3 zone file when using the sqlite datasource\&. The default is -/usr/local/var/bind10\-devel/zone\&.sqlite3\&. -.PP - -\fIdatasources\fR -configures data sources\&. The list items include: -\fItype\fR -to define the required data source type (such as -\(lqmemory\(rq); -\fIclass\fR -to optionally select the class (it defaults to -\(lqIN\(rq); and -\fIzones\fR -to define the -\fIfile\fR -path name, -\fIorigin\fR -(default domain), and optional -\fIfiletype\fR\&. By default, -\fIzones\fR -is empty\&. For the in\-memory data source (i\&.e\&., the -\fItype\fR -is -\(lqmemory\(rq), the optional -\fIfiletype\fR -configuration item for -\fIzones\fR -can be specified so the in\-memory zone data can be built from another data source that is based on a database backend (in practice with current implementation, it would be an SQLite3 database file for the SQLite3 data source)\&. See the -BIND 10 Guide -for configuration details\&. -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBNote\fR -.ps -1 -.br -.sp -Only the IN class is supported at this time\&. By default, the memory data source is disabled\&. Also, currently the zone file must be canonical such as generated by \fBnamed\-compilezone \-D\fR\&. -.sp .5v -.RE -.PP - -\fIlisten_on\fR -is a list of addresses and ports for -\fBb10\-auth\fR -to listen on\&. The list items are the -\fIaddress\fR -string and -\fIport\fR -number\&. By default, -\fBb10\-auth\fR -listens on port 53 on the IPv6 (::) and IPv4 (0\&.0\&.0\&.0) wildcard addresses\&. -.PP - -\fIstatistics\-interval\fR -is the timer interval in seconds for -\fBb10\-auth\fR -to share its statistics information to -\fBb10-stats\fR(8)\&. Statistics updates can be disabled by setting this to 0\&. The default is 60\&. -.PP -The configuration commands are: -.PP - -\fBloadzone\fR -tells -\fBb10\-auth\fR -to load or reload a zone file\&. The arguments include: -\fIclass\fR -which optionally defines the class (it defaults to -\(lqIN\(rq); -\fIorigin\fR -is the domain name of the zone; and -\fIdatasrc\fR -optionally defines the type of datasource (it defaults to -\(lqmemory\(rq)\&. -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBNote\fR -.ps -1 -.br -.sp -In this development version, currently this only supports the IN class and the memory data source\&. -.sp .5v -.RE -.PP - -\fBsendstats\fR -tells -\fBb10\-auth\fR -to send its statistics data to -\fBb10-stats\fR(8) -immediately\&. -.PP - -\fBshutdown\fR -exits -\fBb10\-auth\fR\&. This has an optional -\fIpid\fR -argument to select the process ID to stop\&. (Note that the BIND 10 boss process may restart this service if configured\&.) -.SH "STATISTICS DATA" -.PP -The statistics data collected by the -\fBb10\-stats\fR -daemon for -\(lqAuth\(rq -include: -.PP -queries\&.tcp -.RS 4 -Total count of queries received by the -\fBb10\-auth\fR -server over TCP since startup\&. -.RE -.PP -queries\&.udp -.RS 4 -Total count of queries received by the -\fBb10\-auth\fR -server over UDP since startup\&. -.RE -.SH "FILES" -.PP - -/usr/local/var/bind10\-devel/zone\&.sqlite3 -\(em Location for the SQLite3 zone database when -\fIdatabase_file\fR -configuration is not defined\&. -.SH "SEE ALSO" -.PP - -\fBb10-cfgmgr\fR(8), -\fBb10-loadzone\fR(8), -\fBb10-msgq\fR(8), -\fBb10-stats\fR(8), -\fBb10-zonemgr\fR(8), -\fBbind10\fR(8), -BIND 10 Guide\&. -.SH "HISTORY" -.PP -The -\fBb10\-auth\fR -daemon was first coded in October 2009\&. -.SH "COPYRIGHT" -.br -Copyright \(co 2010-2012 Internet Systems Consortium, Inc. ("ISC") -.br diff --git a/src/bin/auth/b10-auth.xml b/src/bin/auth/b10-auth.xml index 37843e3de8..b34009d039 100644 --- a/src/bin/auth/b10-auth.xml +++ b/src/bin/auth/b10-auth.xml @@ -152,6 +152,13 @@ The default is 60.
+ + tcp_recv_timeout is the timeout used on + incoming TCP connections, in milliseconds. If the query + is not sent within this time, the connection is closed. + Setting this to 0 will disable TCP timeouts completely. + + The configuration commands are: diff --git a/src/bin/auth/command.cc b/src/bin/auth/command.cc index 0658c17b0e..43b242269e 100644 --- a/src/bin/auth/command.cc +++ b/src/bin/auth/command.cc @@ -210,7 +210,7 @@ public: case ConfigurableClientList::ZONE_NOT_CACHED: isc_throw(AuthCommandError, "Zone " << origin << "/" << zone_class << " is not served from memory, but " - "direcly from the data source. It is not possible " + "directly from the data source. It is not possible " "to reload it into memory. Configure it to be cached " "first."); case ConfigurableClientList::CACHE_DISABLED: diff --git a/src/bin/auth/query.cc b/src/bin/auth/query.cc index 6ccd4d2538..69278d4e6d 100644 --- a/src/bin/auth/query.cc +++ b/src/bin/auth/query.cc @@ -562,8 +562,7 @@ Query::reset() { bool Query::processDSAtChild() { - const ClientList::FindResult zresult = - client_list_->find(*qname_, true); + const ClientList::FindResult zresult = client_list_->find(*qname_, true); if (zresult.dsrc_client_ == NULL) { return (false); diff --git a/src/bin/auth/tests/auth_srv_unittest.cc b/src/bin/auth/tests/auth_srv_unittest.cc index ca4247372b..e86cca4cb9 100644 --- a/src/bin/auth/tests/auth_srv_unittest.cc +++ b/src/bin/auth/tests/auth_srv_unittest.cc @@ -104,10 +104,6 @@ protected: } ~AuthSrvTest() { - // Clear the message now; depending on the RTTI implementation, - // type information may be lost if the message is cleared - // automatically later, so as a precaution we do it now. - parse_message->clear(Message::PARSE); server.destroyDDNSForwarder(); } @@ -833,6 +829,9 @@ TEST_F(AuthSrvTest, builtInQueryViaDNSServer) { response_obuffer->getData(), response_obuffer->getLength(), &response_data[0], response_data.size()); + + // After it has been run, the message should be cleared + EXPECT_EQ(0, parse_message->getRRCount(Message::SECTION_QUESTION)); } // In the following tests we confirm the response data is rendered in diff --git a/src/bin/auth/tests/config_syntax_unittest.cc b/src/bin/auth/tests/config_syntax_unittest.cc index 8caedfdd3f..a7d9bbce66 100644 --- a/src/bin/auth/tests/config_syntax_unittest.cc +++ b/src/bin/auth/tests/config_syntax_unittest.cc @@ -36,7 +36,8 @@ TEST_F(AuthConfigSyntaxTest, inmemoryDefaultFileType) { EXPECT_TRUE( mspec_.validateConfig( Element::fromJSON( - "{\"listen_on\": [], \"datasources\": " + "{\"tcp_recv_timeout\": 1000," + " \"listen_on\": [], \"datasources\": " " [{\"type\": \"memory\", \"class\": \"IN\", " " \"zones\": [{\"origin\": \"example.com\"," " \"file\": \"" @@ -48,7 +49,8 @@ TEST_F(AuthConfigSyntaxTest, inmemorySQLite3Backend) { EXPECT_TRUE( mspec_.validateConfig( Element::fromJSON( - "{\"datasources\": " + "{\"tcp_recv_timeout\": 1000," + " \"datasources\": " " [{\"type\": \"memory\"," " \"zones\": [{\"origin\": \"example.com\"," " \"file\": \"" @@ -58,14 +60,30 @@ TEST_F(AuthConfigSyntaxTest, inmemorySQLite3Backend) { TEST_F(AuthConfigSyntaxTest, badInmemoryFileType) { // filetype must be a string - EXPECT_FALSE( + ASSERT_FALSE( mspec_.validateConfig( Element::fromJSON( - "{\"datasources\": " + "{\"tcp_recv_timeout\": 1000," + " \"datasources\": " " [{\"type\": \"memory\"," " \"zones\": [{\"origin\": \"example.com\"," " \"file\": \"" TEST_DATA_DIR "/example.zone\"," " \"filetype\": 42}]}]}"), false)); } + +TEST_F(AuthConfigSyntaxTest, badTCPRecvTimeout) { + // tcp_recv_timeout must be int + EXPECT_FALSE( + mspec_.validateConfig( + Element::fromJSON( + "{\"tcp_recv_timeout\": \"foo\"," + " \"datasources\": " + " [{\"type\": \"memory\"," + " \"zones\": [{\"origin\": \"example.com\"," + " \"file\": \"" + TEST_DATA_DIR "/example.zone\"," + " \"filetype\": \"sqlite3\"}]}]}"), false)); +} + } diff --git a/src/bin/auth/tests/config_unittest.cc b/src/bin/auth/tests/config_unittest.cc index 73ab353fd2..830de0d92d 100644 --- a/src/bin/auth/tests/config_unittest.cc +++ b/src/bin/auth/tests/config_unittest.cc @@ -143,4 +143,17 @@ TEST_F(AuthConfigTest, listenAddressConfig) { EXPECT_EQ(DNSService::SERVER_SYNC_OK, dnss_.getUDPFdParams().at(1).options); } +// Try setting tcp receive timeout through config +TEST_F(AuthConfigTest, tcpRecvTimeoutConfig) { + configureAuthServer(server, Element::fromJSON( + "{ \"tcp_recv_timeout\": 123 }")); + EXPECT_EQ(123, dnss_.getTCPRecvTimeout()); + configureAuthServer(server, Element::fromJSON( + "{ \"tcp_recv_timeout\": 2000 }")); + EXPECT_EQ(2000, dnss_.getTCPRecvTimeout()); + EXPECT_THROW(configureAuthServer(server, Element::fromJSON( + "{ \"tcp_recv_timeout\": -123 }")), + AuthConfigError); +} + } diff --git a/src/bin/bind10/.gitignore b/src/bin/bind10/.gitignore index 8dc8a0496b..2cf6b5036f 100644 --- a/src/bin/bind10/.gitignore +++ b/src/bin/bind10/.gitignore @@ -1,3 +1,4 @@ /bind10 /bind10_src.py /run_bind10.sh +/bind10.8 diff --git a/src/bin/bind10/Makefile.am b/src/bin/bind10/Makefile.am index 69ea256157..86c6595424 100644 --- a/src/bin/bind10/Makefile.am +++ b/src/bin/bind10/Makefile.am @@ -17,12 +17,26 @@ bind10_DATA = bob.spec EXTRA_DIST = bob.spec man_MANS = bind10.8 +DISTCLEANFILES = $(man_MANS) EXTRA_DIST += $(man_MANS) bind10.xml bind10_messages.mes -if ENABLE_MAN +if GENERATE_DOCS bind10.8: bind10.xml - xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/bind10.xml + @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/bind10.xml + +#dist-local-check-mans-enabled: +# @if grep "Man generation disabled" $(man_MANS) >/dev/null; then $(RM) $(man_MANS); fi + +else + +$(man_MANS): + @echo Man generation disabled. Creating dummy $@. Configure with --enable-generate-docs to enable it. + @echo Man generation disabled. Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@ + +#dist-local-check-mans-enabled: +# @echo "*** --enable-generate-docs must be used in order to make dist" +# @false endif diff --git a/src/bin/bind10/bind10.8 b/src/bin/bind10/bind10.8 deleted file mode 100644 index 32394df9e3..0000000000 --- a/src/bin/bind10/bind10.8 +++ /dev/null @@ -1,288 +0,0 @@ -'\" t -.\" Title: bind10 -.\" Author: [see the "AUTHORS" section] -.\" Generator: DocBook XSL Stylesheets v1.77.1 -.\" Date: April 12, 2012 -.\" Manual: BIND10 -.\" Source: BIND10 -.\" Language: English -.\" -.TH "BIND10" "8" "April 12, 2012" "BIND10" "BIND10" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.SH "NAME" -bind10 \- BIND 10 boss process -.SH "SYNOPSIS" -.HP \w'\fBbind10\fR\ 'u -\fBbind10\fR [\fB\-c\ \fR\fB\fIconfig\-filename\fR\fR] [\fB\-i\fR] [\fB\-m\ \fR\fB\fIfile\fR\fR] [\fB\-p\ \fR\fB\fIdata_path\fR\fR] [\fB\-u\ \fR\fB\fIuser\fR\fR] [\fB\-v\fR] [\fB\-w\ \fR\fB\fIwait_time\fR\fR] [\fB\-\-clear\-config\fR] [\fB\-\-cmdctl\-port\fR\ \fIport\fR] [\fB\-\-config\-file\fR\ \fIconfig\-filename\fR] [\fB\-\-data\-path\fR\ \fIdirectory\fR] [\fB\-\-msgq\-socket\-file\ \fR\fB\fIfile\fR\fR] [\fB\-\-no\-kill\fR] [\fB\-\-pid\-file\fR\ \fIfilename\fR] [\fB\-\-pretty\-name\ \fR\fB\fIname\fR\fR] [\fB\-\-user\ \fR\fB\fIuser\fR\fR] [\fB\-\-verbose\fR] [\fB\-\-wait\ \fR\fB\fIwait_time\fR\fR] -.SH "DESCRIPTION" -.PP -The -\fBbind10\fR -daemon starts up other BIND 10 required daemons\&. It handles restarting of exiting programs and also the shutdown of all managed daemons\&. -.SH "ARGUMENTS" -.PP -The arguments are as follows: -.PP -\fB\-c\fR \fIconfig\-filename\fR, \fB\-\-config\-file\fR \fIconfig\-filename\fR -.RS 4 -The configuration filename to use\&. Can be either absolute or relative to data path\&. In case it is absolute, value of data path is not considered\&. Defaults to -b10\-config\&.db\&. -.RE -.PP -\fB\-\-clear\-config\fR -.RS 4 -This will create a backup of the existing configuration file, remove it and start -b10\-cfgmgr(8) -with the default configuration\&. The name of the backup file can be found in the logs (\fICFGMGR_BACKED_UP_CONFIG_FILE\fR)\&. (It will append a number to the backup filename if a previous backup file exists\&.) -.RE -.PP -\fB\-\-cmdctl\-port\fR \fIport\fR -.RS 4 -The -\fBb10\-cmdctl\fR -daemon will listen on this port\&. (See -b10\-cmdctl(8) -for the default\&.) -.RE -.PP -\fB\-p\fR \fIdirectory\fR, \fB\-\-data\-path\fR \fIdirectory\fR -.RS 4 -The path where BIND 10 programs look for various data files\&. Currently only -\fBb10-cfgmgr\fR(8) -uses it to locate the configuration file, but the usage might be extended for other programs and other types of files\&. -.RE -.PP -\fB\-m\fR \fIfile\fR, \fB\-\-msgq\-socket\-file\fR \fIfile\fR -.RS 4 -The UNIX domain socket file for the -\fBb10-msgq\fR(8) -daemon to use\&. The default is -/usr/local/var/bind10\-devel/msg_socket\&. -.RE -.PP -\fB\-i\fR, \fB\-\-no\-kill\fR -.RS 4 -When this option is passed, -\fBbind10\fR -does not send SIGTERM and SIGKILL signals to modules during shutdown\&. (This option was introduced for use during testing\&.) -.RE -.PP -\fB\-u\fR \fIuser\fR, \fB\-\-user\fR \fIname\fR -.RS 4 -The username for -\fBbind10\fR -to run as\&. -\fBbind10\fR -must be initially ran as the root user to use this option\&. The default is to run as the current user\&. -.RE -.PP -\fB\-\-pid\-file\fR \fIfilename\fR -.RS 4 -If defined, the PID of the -\fBbind10\fR -is stored in this file\&. -.RE -.PP -\fB\-\-pretty\-name \fR\fB\fIname\fR\fR -.RS 4 -The name this process should have in tools like -\fBps\fR -or -\fBtop\fR\&. This is handy if you have multiple versions/installations of -\fBbind10\fR\&. -.RE -.PP -\fB\-v\fR, \fB\-\-verbose\fR -.RS 4 -Display more about what is going on for -\fBbind10\fR -and its child processes\&. -.RE -.PP -\fB\-w\fR \fIwait_time\fR, \fB\-\-wait\fR \fIwait_time\fR -.RS 4 -Sets the amount of time that BIND 10 will wait for the configuration manager (a key component of BIND 10) to initialize itself before abandoning the start up and terminating with an error\&. The -\fIwait_time\fR -is specified in seconds and has a default value of 10\&. -.RE -.SH "CONFIGURATION AND COMMANDS" -.PP -The configuration provides settings for components for -\fBbind10\fR -to manage under -\fI/Boss/components/\fR\&. The default elements are: -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} - -\fI/Boss/components/b10\-cmdctl\fR -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} - -\fI/Boss/components/b10\-stats\fR -.RE -.PP -(Note that the startup of -\fBb10\-sockcreator\fR, -\fBb10\-cfgmgr\fR, and -\fBb10\-msgq\fR -is not configurable\&. They are hardcoded and -\fBbind10\fR -will not run without them\&.) -.PP -The named sets for components contain the following settings: -.PP -\fIaddress\fR -.RS 4 -The name used for communicating to it on the message bus\&. -.RE -.PP -\fIkind\fR -.RS 4 -This defines how required a component is\&. The possible settings for -\fIkind\fR -are: -\fIcore\fR -(system won\*(Aqt start if it won\*(Aqt start and -\fBbind10\fR -will shutdown if a -\(lqcore\(rq -component crashes), -\fIdispensable\fR -(\fBbind10\fR -will restart failing component), and -\fIneeded\fR -(\fBbind10\fR -will shutdown if component won\*(Aqt initially start, but if crashes later, it will attempt to restart)\&. This setting is required\&. -.RE -.PP -\fIpriority\fR -.RS 4 -This is an integer\&. -\fBbind10\fR -will start the components with largest priority numbers first\&. -.RE -.PP -\fIprocess\fR -.RS 4 -This is the filename of the executable to be started\&. If not defined, then -\fBbind10\fR -will use the component name instead\&. -.RE -.PP -\fIspecial\fR -.RS 4 -This defines if the component is started a special, hardcoded way\&. -.RE -.PP -The -\fIBoss\fR -configuration commands are: -.PP - -\fBgetstats\fR -tells -\fBbind10\fR -to send its statistics data to the -\fBb10\-stats\fR -daemon\&. This is an internal command and not exposed to the administrator\&. -.PP - -\fBping\fR -is used to check the connection with the -\fBbind10\fR -daemon\&. It returns the text -\(lqpong\(rq\&. -.PP - -\fBshow_processes\fR -lists the current processes managed by -\fBbind10\fR\&. The output is an array in JSON format containing the process ID, the name for each and the address name used on each message bus\&. - - -.PP - -\fBshutdown\fR -tells -\fBbind10\fR -to shutdown the BIND 10 servers\&. It will tell each process it manages to shutdown and, when complete, -\fBbind10\fR -will exit\&. -.SH "STATISTICS DATA" -.PP -The statistics data collected by the -\fBb10\-stats\fR -daemon for -\(lqBoss\(rq -include: -.PP -boot_time -.RS 4 -The date and time that the -\fBbind10\fR -process started\&. This is represented in ISO 8601 format\&. -.RE -.SH "FILES" -.PP -sockcreator\-XXXXXX/sockcreator -\(em the Unix Domain socket located in a temporary file directory for -\fBb10\-sockcreator\fR -communication\&. -.SH "SEE ALSO" -.PP - -\fBbindctl\fR(1), -\fBb10-auth\fR(8), -\fBb10-cfgmgr\fR(8), -\fBb10-cmdctl\fR(8), -\fBb10-msgq\fR(8), -\fBb10-xfrin\fR(8), -\fBb10-xfrout\fR(8), -\fBb10-zonemgr\fR(8), -BIND 10 Guide\&. -.SH "HISTORY" -.PP -The development of -\fBbind10\fR -was started in October 2009\&. -.SH "AUTHORS" -.PP -The -\fBbind10\fR -daemon was initially designed by Shane Kerr of ISC\&. -.SH "COPYRIGHT" -.br -Copyright \(co 2010-2012 Internet Systems Consortium, Inc. ("ISC") -.br diff --git a/src/bin/bindctl/.gitignore b/src/bin/bindctl/.gitignore index 71fba03ce1..2d4ffbaf28 100644 --- a/src/bin/bindctl/.gitignore +++ b/src/bin/bindctl/.gitignore @@ -1,3 +1,4 @@ /bindctl /bindctl_main.py /run_bindctl.sh +/bindctl.1 diff --git a/src/bin/bindctl/Makefile.am b/src/bin/bindctl/Makefile.am index 52a5145c85..1134240bf4 100644 --- a/src/bin/bindctl/Makefile.am +++ b/src/bin/bindctl/Makefile.am @@ -14,11 +14,18 @@ pythondir = $(pyexecdir)/bindctl bindctldir = $(pkgdatadir) CLEANFILES = bindctl bindctl_main.pyc +DISTCLEANFILES = $(man_MANS) -if ENABLE_MAN +if GENERATE_DOCS bindctl.1: bindctl.xml - xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/bindctl.xml + @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/bindctl.xml + +else + +$(man_MANS): + @echo Man generation disabled. Creating dummy $@. Configure with --enable-generate-docs to enable it. + @echo Man generation disabled. Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@ endif diff --git a/src/bin/bindctl/bindctl.1 b/src/bin/bindctl/bindctl.1 deleted file mode 100644 index dc20e61ae3..0000000000 --- a/src/bin/bindctl/bindctl.1 +++ /dev/null @@ -1,157 +0,0 @@ -'\" t -.\" Title: bindctl -.\" Author: [see the "AUTHORS" section] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: June 20, 2012 -.\" Manual: BIND10 -.\" Source: BIND10 -.\" Language: English -.\" -.TH "BINDCTL" "1" "June 20, 2012" "BIND10" "BIND10" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.SH "NAME" -bindctl \- control and configure BIND 10 -.SH "SYNOPSIS" -.HP \w'\fBbindctl\fR\ 'u -\fBbindctl\fR [\fB\-a\ \fR\fB\fIaddress\fR\fR] [\fB\-h\fR] [\fB\-c\ \fR\fB\fIfile\fR\fR] [\fB\-p\ \fR\fB\fInumber\fR\fR] [\fB\-\-address\ \fR\fB\fIaddress\fR\fR] [\fB\-\-help\fR] [\fB\-\-certificate\-chain\ \fR\fB\fIfile\fR\fR] [\fB\-\-csv\-file\-dir\fR\fB\fIfile\fR\fR] [\fB\-\-port\ \fR\fB\fInumber\fR\fR] [\fB\-\-version\fR] -.SH "DESCRIPTION" -.PP -The -\fBbindctl\fR -tool is a user interface to the BIND 10 services\&. The program can be used to control the components and configure the BIND 10 options\&. The options may be specified -via its interactive command interpreter\&. -.PP - -\fBbindctl\fR -communicates over a HTTPS REST\-ful interface provided by -\fBb10-cmdctl\fR(8)\&. The -\fBb10-cfgmgr\fR(8) -daemon stores the configurations\&. -.SH "ARGUMENTS" -.PP -The arguments are as follows: -.PP -\fB\-a\fR \fIaddress\fR, \fB\-\-address\fR \fIaddress\fR -.RS 4 -The IPv4 or IPv6 address to use to connect to the running -\fBb10-cmdctl\fR(8) -daemon\&. The default is 127\&.0\&.0\&.1\&. -.RE -.PP -\fB\-c\fR \fIfile\fR, \fB\-\-certificate\-chain\fR \fIfile\fR -.RS 4 -The PEM formatted server certificate validation chain file\&. -.RE -.PP -\fB\-\-csv\-file\-dir\fR\fIfile\fR -.RS 4 -The directory name in which the user/password CSV file is stored (see AUTHENTICATION)\&. By default this option doesn\*(Aqt have any value, in which case the "\&.bind10" directory under the user\*(Aqs home directory will be used\&. -.RE -.PP -\fB\-h\fR, \fB\-\-help\fR -.RS 4 -Display command usage\&. -.RE -.PP -\fB\-p\fR \fInumber\fR, \fB\-\-port\fR \fInumber\fR -.RS 4 -The port number to use to connect to the running -\fBb10-cmdctl\fR(8) -daemon\&. The default is 8080\&. -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBNote\fR -.ps -1 -.br -This default port number may change\&. -.sp .5v -.RE -.RE -.PP -\fB\-\-version\fR -.RS 4 -Display the version number and exit\&. -.RE -.SH "AUTHENTICATION" -.PP -The tool will authenticate using a username and password\&. On the first successful login, it will save the details to a comma\-separated\-value (CSV) file which will be used for later uses of -\fBbindctl\fR\&. The file name is "default_user\&.csv" located under the directory specified by the -\fB\-\-csv\-file\-dir\fR -option\&. -.SH "USAGE" -.PP -The -\fBbindctl\fR -prompt shows -\(lq> \(rq\&. The prompt will also display the location if changed\&. The options are based on the module in use\&. The usage is: -\fBmodule\fR -\fBcommand\fR -\fIparam1 = value1 , \fR\fI\fIparam2 = value2\fR\fR -.PP - -\fBbindctl\fR\*(Aqs interactive interface provides command\-line completion and hints\&. Press the Tab key to get a hint for the module, command, and/or parameters\&. -The arrow keys and Emacs\-style editing keys may be used to edit and recall previous lines\&. -.PP -You can use the -\fBhelp\fR -keyword to receive usage assistance for a module or a module\*(Aqs command\&. -.PP -The -\fBquit\fR -command is used to exit -\fBbindctl\fR\&. (It doesn\*(Aqt stop the BIND 10 services\&.) -.PP -The following module is available by default: -\fBconfig\fR -for Configuration commands\&. -Additional modules may be available, such as -\fBBoss\fR, -\fBXfrin\fR, and -\fBAuth\fR\&. -.SH "SEE ALSO" -.PP - -\fBb10-auth\fR(8), -\fBb10-cfgmgr\fR(8), -\fBb10-cmdctl\fR(8), -\fBb10-xfrin\fR(8), -\fBbind10\fR(8), -BIND 10 Guide\&. -.SH "AUTHORS" -.PP -The -\fBbindctl\fR -tool and library were initially coded by Zhang Likun of CNNIC for the BIND 10 project\&. The initial manual page was written by Jeremy C\&. Reed of ISC\&. -.SH "HISTORY" -.PP -The initial version (with internal name of -\fBBigTool\fR) was started in October 2009\&. -.SH "COPYRIGHT" -.br -Copyright \(co 2010 Internet Systems Consortium, Inc. ("ISC") -.br diff --git a/src/bin/cfgmgr/.gitignore b/src/bin/cfgmgr/.gitignore index aad54f4055..1ef37efd9f 100644 --- a/src/bin/cfgmgr/.gitignore +++ b/src/bin/cfgmgr/.gitignore @@ -1,2 +1,3 @@ /b10-cfgmgr /b10-cfgmgr.py +/b10-cfgmgr.8 diff --git a/src/bin/cfgmgr/Makefile.am b/src/bin/cfgmgr/Makefile.am index 4a6fc0d30a..e9e0ccaf85 100644 --- a/src/bin/cfgmgr/Makefile.am +++ b/src/bin/cfgmgr/Makefile.am @@ -10,12 +10,19 @@ b10_cfgmgrdir = @localstatedir@/@PACKAGE@ #B10_cfgmgr_DATA = man_MANS = b10-cfgmgr.8 +DISTCLEANFILES = $(man_MANS) EXTRA_DIST = $(man_MANS) b10-cfgmgr.xml -if ENABLE_MAN +if GENERATE_DOCS b10-cfgmgr.8: b10-cfgmgr.xml - xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-cfgmgr.xml + @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-cfgmgr.xml + +else + +$(man_MANS): + @echo Man generation disabled. Creating dummy $@. Configure with --enable-generate-docs to enable it. + @echo Man generation disabled. Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@ endif diff --git a/src/bin/cfgmgr/b10-cfgmgr.8 b/src/bin/cfgmgr/b10-cfgmgr.8 deleted file mode 100644 index e8ec567cc0..0000000000 --- a/src/bin/cfgmgr/b10-cfgmgr.8 +++ /dev/null @@ -1,82 +0,0 @@ -'\" t -.\" Title: b10-cfgmgr -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: June 20, 2012 -.\" Manual: BIND10 -.\" Source: BIND10 -.\" Language: English -.\" -.TH "B10\-CFGMGR" "8" "June 20, 2012" "BIND10" "BIND10" -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.SH "NAME" -b10-cfgmgr \- Configuration manager -.SH "SYNOPSIS" -.HP \w'\fBb10\-cfgmgr\fR\ 'u -\fBb10\-cfgmgr\fR [\fB\-c\ \fR\fB\fIconfig\-filename\fR\fR] [\fB\-p\ \fR\fB\fIdata_path\fR\fR] [\fB\-\-clear\-config\fR] [\fB\-\-config\-filename\ \fR\fB\fIconfig\-filename\fR\fR] [\fB\-\-data\-path\ \fR\fB\fIdata_path\fR\fR] -.SH "DESCRIPTION" -.PP -The -\fBb10\-cfgmgr\fR -daemon handles all BIND 10 system configuration\&. It provides persistent storage for configuration, and notifies running BIND 10 modules of configuration changes\&. -.PP -The -\fBbindctl\fR -can be used to talk to this configuration manager via a -\fBb10\-cmdctl\fR -connection\&. -.PP -This daemon communicates over a -\fBb10\-msgq\fR -C\-Channel connection\&. If this connection is not established, -\fBb10\-cfgmgr\fR -will exit\&. -.PP -The daemon may be cleanly stopped by sending the SIGTERM signal to the process\&. This shutdown does not notify the subscribers\&. -.SH "ARGUMENTS" -.PP -The arguments are as follows: -.PP -\fB\-\-clear\-config\fR -.RS 4 -This will create a backup of the existing configuration file, remove it, and -b10\-cfgmgr(8) -will use the default configurations\&. The name of the backup file can be found in the logs (\fICFGMGR_BACKED_UP_CONFIG_FILE\fR)\&. (It will append a number to the backup filename if a previous backup file exists\&.) -.RE -.PP -\fB\-c\fR \fIconfig\-filename\fR, \fB\-\-config\-filename\fR \fIconfig\-filename\fR -.RS 4 -The configuration database filename to use\&. Can be either absolute or relative to data path\&. It defaults to "b10\-config\&.db"\&. -.RE -.PP -\fB\-p\fR \fIdata\-path\fR, \fB\-\-data\-path\fR \fIdata\-path\fR -.RS 4 -The path where BIND 10 looks for files\&. The configuration file is looked for here, if it is relative\&. If it is absolute, the path is ignored\&. -.RE -.SH "FILES" -.PP -/usr/local/var/bind10\-devel/b10\-config\&.db -\(em Configuration storage file\&. -.SH "SEE ALSO" -.PP - -\fBbind10\fR(8), -\fBmsgq\fR(8)\&. -.SH "HISTORY" -.PP -The -\fBb10\-cfgmgr\fR -daemon and configuration specification were initially designed by Jelte Jansen of ISC\&. Its development began in October 2009\&. -.SH "COPYRIGHT" -.br -Copyright \(co 2010 Internet Systems Consortium, Inc. ("ISC") -.br diff --git a/src/bin/cmdctl/.gitignore b/src/bin/cmdctl/.gitignore index a194135a22..01e3ef054e 100644 --- a/src/bin/cmdctl/.gitignore +++ b/src/bin/cmdctl/.gitignore @@ -3,3 +3,4 @@ /cmdctl.spec /cmdctl.spec.pre /run_b10-cmdctl.sh +/b10-cmdctl.8 diff --git a/src/bin/cmdctl/Makefile.am b/src/bin/cmdctl/Makefile.am index e302fa6b87..3b88f4b6c3 100644 --- a/src/bin/cmdctl/Makefile.am +++ b/src/bin/cmdctl/Makefile.am @@ -26,12 +26,19 @@ CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/cmdctl_messages.py CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/cmdctl_messages.pyc man_MANS = b10-cmdctl.8 +DISTCLEANFILES = $(man_MANS) EXTRA_DIST += $(man_MANS) b10-cmdctl.xml cmdctl_messages.mes -if ENABLE_MAN +if GENERATE_DOCS b10-cmdctl.8: b10-cmdctl.xml - xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-cmdctl.xml + @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-cmdctl.xml + +else + +$(man_MANS): + @echo Man generation disabled. Creating dummy $@. Configure with --enable-generate-docs to enable it. + @echo Man generation disabled. Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@ endif diff --git a/src/bin/cmdctl/b10-cmdctl.8 b/src/bin/cmdctl/b10-cmdctl.8 deleted file mode 100644 index ab3ec61494..0000000000 --- a/src/bin/cmdctl/b10-cmdctl.8 +++ /dev/null @@ -1,133 +0,0 @@ -'\" t -.\" Title: b10-cmdctl -.\" Author: [see the "AUTHORS" section] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: February 28, 2012 -.\" Manual: BIND10 -.\" Source: BIND10 -.\" Language: English -.\" -.TH "B10\-CMDCTL" "8" "February 28, 2012" "BIND10" "BIND10" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.SH "NAME" -b10-cmdctl \- BIND 10 remote control daemon -.SH "SYNOPSIS" -.HP \w'\fBb10\-cmdctl\fR\ 'u -\fBb10\-cmdctl\fR [\fB\-a\ \fR\fB\fIstring\fR\fR] [\fB\-h\fR] [\fB\-i\ \fR\fB\fInumber\fR\fR] [\fB\-p\ \fR\fB\fInumber\fR\fR] [\fB\-v\fR] [\fB\-\-address\ \fR\fB\fIstring\fR\fR] [\fB\-\-help\fR] [\fB\-\-idle\-timeout\ \fR\fB\fInumber\fR\fR] [\fB\-\-port\ \fR\fB\fInumber\fR\fR] [\fB\-\-verbose\fR] [\fB\-\-version\fR] -.SH "DESCRIPTION" -.PP -The -\fBb10\-cmdctl\fR -daemon provides an entry for commands sent to the BIND 10 services\&. For example, the -\fBbindctl\fR -user interface communicates via -\fBb10\-cmdctl\fR\&. -.PP -It is a lightweight HTTPS server with HTTP Digest Authentication (username and password validation)\&. It offers a RESTful style interface\&. -.SH "OPTIONS" -.PP -The arguments are as follows: -.PP -\fB\-a \fR\fB\fIstring\fR\fR, \fB\-\-address \fR\fB\fIstring\fR\fR -.RS 4 -The IP address that -\fBb10\-cmdctl\fR -will listen on\&. The default is 127\&.0\&.0\&.1\&. -.RE -.PP -\fB\-h\fR, \fB\-\-help\fR -.RS 4 -Display command usage\&. -.RE -.PP -\fB\-i \fR\fB\fInumber\fR\fR, \fB\-\-idle\-timeout \fR\fB\fInumber\fR\fR -.RS 4 -The socket idle timeout for the HTTPS connection in seconds\&. The default is 1200 seconds\&. -.RE -.PP -\fB\-p \fR\fB\fInumber\fR\fR, \fB\-\-port \fR\fB\fInumber\fR\fR -.RS 4 -The port number -\fBb10\-cmdctl\fR -will listen on\&. The default is 8080\&. -.RE -.PP -\fB\-v\fR, \fB\-\-verbose\fR -.RS 4 -Enable verbose mode\&. -.RE -.PP -\fB\-\-version\fR -.RS 4 -Display the version number and exit\&. -.RE -.SH "CONFIGURATION AND COMMANDS" -.PP -The configurable settings are: -.PP - -\fIaccounts_file\fR -defines the path to the user accounts database\&. The default is -/usr/local/etc/bind10\-devel/cmdctl\-accounts\&.csv\&. -.PP - -\fIcert_file\fR -defines the path to the PEM certificate file\&. The default is -/usr/local/etc/bind10\-devel/cmdctl\-certfile\&.pem\&. -.PP - -\fIkey_file\fR -defines the path to the PEM private key file\&. The default is -/usr/local/etc/bind10\-devel/cmdctl\-keyfile\&.pem\&. -.PP -The configuration command is: -.PP - -\fBshutdown\fR -exits -\fBb10\-cmdctl\fR\&. This has an optional -\fIpid\fR -argument to select the process ID to stop\&. (Note that the BIND 10 boss process may restart this service if configured\&.) -.SH "FILES" -.PP -/usr/local/etc/bind10\-devel/cmdctl\-accounts\&.csv -\(em account database containing the name, hashed password, and the salt\&. -.PP -/usr/local/etc/bind10\-devel/cmdctl\-keyfile\&.pem -\(em contains the Private key\&. -.PP -/usr/local/etc/bind10\-devel/cmdctl\-certfile\&.pem -\(em contains the Certificate\&. -.SH "SEE ALSO" -.PP - -\fBb10-cfgmgr\fR(8), -\fBbind10\fR(8), -\fBbindctl\fR(1)\&. -.SH "AUTHORS" -.PP -The -\fBb10\-cmdctl\fR -daemon was initially designed and coded by Zhang Likun of CNNIC\&. -.SH "COPYRIGHT" -.br -Copyright \(co 2010-2012 Internet Systems Consortium, Inc. ("ISC") -.br diff --git a/src/bin/dbutil/.gitignore b/src/bin/dbutil/.gitignore index abb63d54eb..6348236930 100644 --- a/src/bin/dbutil/.gitignore +++ b/src/bin/dbutil/.gitignore @@ -1,3 +1,4 @@ /b10-dbutil /dbutil.py /run_dbutil.sh +/b10-dbutil.8 diff --git a/src/bin/dbutil/Makefile.am b/src/bin/dbutil/Makefile.am index e05055f8f9..4f6f1fa2d3 100644 --- a/src/bin/dbutil/Makefile.am +++ b/src/bin/dbutil/Makefile.am @@ -14,11 +14,18 @@ CLEANFILES = b10-dbutil b10-dbutil.pyc CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/dbutil_messages.py CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/dbutil_messages.pyc CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/dbutil_messages.pyo +DISTCLEANFILES = $(man_MANS) -if ENABLE_MAN +if GENERATE_DOCS b10-dbutil.8: b10-dbutil.xml - xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-dbutil.xml + @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-dbutil.xml + +else + +$(man_MANS): + @echo Man generation disabled. Creating dummy $@. Configure with --enable-generate-docs to enable it. + @echo Man generation disabled. Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@ endif diff --git a/src/bin/dbutil/b10-dbutil.8 b/src/bin/dbutil/b10-dbutil.8 deleted file mode 100644 index cb43fa382d..0000000000 --- a/src/bin/dbutil/b10-dbutil.8 +++ /dev/null @@ -1,89 +0,0 @@ -'\" t -.\" Title: b10-dbutil -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: June 20, 2012 -.\" Manual: BIND10 -.\" Source: BIND10 -.\" Language: English -.\" -.TH "B10\-DBUTIL" "8" "June 20, 2012" "BIND10" "BIND10" -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.SH "NAME" -b10-dbutil \- Zone Database Maintenance Utility -.SH "SYNOPSIS" -.HP \w'\fBb10\-dbutil\ \-\-check\fR\ 'u -\fBb10\-dbutil \-\-check\fR [\-\-verbose] [\-\-quiet] [\fIdbfile\fR] -.HP \w'\fBb10\-dbutil\ \-\-upgrade\fR\ 'u -\fBb10\-dbutil \-\-upgrade\fR [\-\-noconfirm] [\-\-verbose] [\-\-quiet] [\fIdbfile\fR] -.SH "DESCRIPTION" -.PP -The -\fBb10\-dbutil\fR -utility is a general administration utility for SQL databases for BIND 10\&. (Currently only SQLite is supported by BIND 10\&.) It can report the current verion of the schema, and upgrade an existing database to the latest version of the schema\&. -.PP - -\fBb10\-dbutil\fR -operates in one of two modesr: check mode or upgrade mode\&. -.PP -In check mode (\fBb10\-dbutil \-\-check\fR), the utility reads the version of the database schema from the database and prints it\&. It will tell you whether the schema is at the latest version supported by BIND 10\&. Exit status is 0 if the schema is at the correct version, 1 if the schema is at an older version, or 2 if the schema is at a version not yet supported by this version of -\fBb10\-dbutil\fR\&. Any higher value indicates an error during command\-line parsing or execution\&. -.PP -When the upgrade function is selected (\fBb10\-dbutil \-\-upgrade\fR), the utility takes a copy of the database, then upgrades it to the latest version of the schema\&. The contents of the database remain intact\&. (The backup file is a file in the same directory as the database file\&. It has the same name, with "\&.backup" appended to it\&. If a file of that name already exists, the file will have the suffix "\&.backup\-1"\&. If that exists, the file will be suffixed "\&.backup\-2", and so on)\&. Exit status is 0 if the upgrade is either succesful or aborted by the user, and non\-zero if there is an error\&. -.PP -When upgrading the database, it is -\fIstrongly\fR -recommended that BIND 10 not be running while the upgrade is in progress\&. -.SH "ARGUMENTS" -.PP -The arguments are as follows: -.PP -\fB\-\-check\fR -.RS 4 -Selects the version check function, which reports the current version of the database\&. This is mutually exclusive with the -\fB\-\-upgrade\fR -option\&. -.RE -.PP -\fB\-\-noconfirm\fR -.RS 4 -Only valid with -\fB\-\-upgrade\fR, this disables the prompt\&. Normally the utility will print a warning that an upgrade is about to take place and request that you type "Yes" to continue\&. If this switch is given on the command line, no prompt will be issued and the utility will just perform the upgrade\&. -.RE -.PP -\fB\-\-upgrade\fR -.RS 4 -Selects the upgrade function, which upgrades the database to the latest version of the schema\&. This is mutually exclusive with the -\fB\-\-check\fR -option\&. -.sp -The upgrade function will upgrade a BIND 10 database \(em no matter how old the schema \(em preserving all data\&. A backup file is created before the upgrade (with the same name as the database, but with "\&.backup" suffixed to it)\&. If the upgrade fails, this file can be copied back to restore the original database\&. -.RE -.PP -\fB\-\-verbose\fR -.RS 4 -Enable verbose mode\&. Each SQL command issued by the utility will be printed to STDERR before it is executed\&. -.RE -.PP -\fB\-\-quiet\fR -.RS 4 -Enable quiet mode\&. No output is printed, except errors during command\-line argument parsing, or the user confirmation dialog\&. -.RE -.PP -\fB\fIdbfile\fR\fR -.RS 4 -Name of the database file to check or upgrade\&. -.RE -.SH "COPYRIGHT" -.br -Copyright \(co 2012 Internet Systems Consortium, Inc. ("ISC") -.br diff --git a/src/bin/ddns/.gitignore b/src/bin/ddns/.gitignore index 92b86f3098..fff8c5f311 100644 --- a/src/bin/ddns/.gitignore +++ b/src/bin/ddns/.gitignore @@ -1,2 +1,3 @@ /b10-ddns /ddns.py +/b10-ddns.8 diff --git a/src/bin/ddns/Makefile.am b/src/bin/ddns/Makefile.am index 0b014cb1ad..be2da552b7 100644 --- a/src/bin/ddns/Makefile.am +++ b/src/bin/ddns/Makefile.am @@ -15,13 +15,21 @@ CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/ddns_messages.py CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/ddns_messages.pyc EXTRA_DIST = ddns_messages.mes ddns.spec + man_MANS = b10-ddns.8 +DISTCLEANFILES = $(man_MANS) EXTRA_DIST += $(man_MANS) b10-ddns.xml -if ENABLE_MAN +if GENERATE_DOCS b10-ddns.8: b10-ddns.xml - xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-ddns.xml + @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-ddns.xml + +else + +$(man_MANS): + @echo Man generation disabled. Creating dummy $@. Configure with --enable-generate-docs to enable it. + @echo Man generation disabled. Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@ endif diff --git a/src/bin/ddns/b10-ddns.8 b/src/bin/ddns/b10-ddns.8 deleted file mode 100644 index 95d82f4555..0000000000 --- a/src/bin/ddns/b10-ddns.8 +++ /dev/null @@ -1,115 +0,0 @@ -'\" t -.\" Title: b10-ddns -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: June 18, 2012 -.\" Manual: BIND10 -.\" Source: BIND10 -.\" Language: English -.\" -.TH "B10\-DDNS" "8" "June 18, 2012" "BIND10" "BIND10" -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.SH "NAME" -b10-ddns \- Dynamic DNS update service -.SH "SYNOPSIS" -.HP \w'\fBb10\-ddns\fR\ 'u -\fBb10\-ddns\fR [\fB\-v\fR | \fB\-\-verbose\fR] -.SH "DESCRIPTION" -.PP -The -\fBb10\-ddns\fR -daemon provides the BIND 10 Dynamic Update (DDNS) service, as specified in RFC 2136\&. Normally it is started by the -\fBbind10\fR(8) -boss process\&. -.PP -When the -\fBb10\-auth\fR -authoritative DNS server receives an UPDATE request, it internally forwards the request to -\fBb10\-ddns\fR, which handles the rest of the request processing\&. When the processing is completed -\fBb10\-ddns\fR -will send a response to the client with the RCODE set to the value as specified in RFC 2136\&. If the zone has been changed as a result, it will internally notify -\fBb10\-auth\fR -and -\fBb10\-xfrout\fR -so the new version of the zone will be served, and other secondary servers will be notified via the DNS notify protocol\&. -.PP -This daemon communicates with BIND 10 over a -\fBb10-msgq\fR(8) -C\-Channel connection\&. If this connection is not established, -\fBb10\-ddns\fR -will exit\&. The -\fBb10\-ddns\fR -daemon also depends on some other BIND 10 components (either directly or indirectly): -\fBb10-auth\fR(8), -\fBb10-xfrout\fR(8), and -\fBb10-zonemgr\fR(8)\&. -.PP - -\fBb10\-ddns\fR -receives its configurations from -\fBb10-cfgmgr\fR(8)\&. -.SH "ARGUMENTS" -.PP -The arguments are as follows: -.PP -\fB\-h\fR, \fB\-\-help\fR -.RS 4 -Print the command line arguments and exit\&. -.RE -.PP -\fB\-v\fR, \fB\-\-verbose\fR -.RS 4 -This value is ignored at this moment, but is provided for compatibility with the -\fBbind10\fR -Boss process\&. -.RE -.SH "CONFIGURATION AND COMMANDS" -.PP -The configurable settings are: -.PP - -\fIzones\fR -The zones option is a list of configuration items for specific zones that can be updated with DDNS\&. Each entry is a map that can contain the following items: -\fIorigin\fR -is a textual domain name of the zone; -\fIclass\fR -(text) is the RR class of the zone; and -\fIupdate_acl\fR -is an ACL that controls permission for updates\&. See the BIND 10 Guide for configuration details\&. Note that not listing a zone in this list does not directly mean update requests for the zone are rejected, but the end result is the same because the default ACL for updates is to deny all requests\&. -.PP -The module commands are: -.PP - -\fBshutdown\fR -exits -\fBb10\-ddns\fR\&. This has an optional -\fIpid\fR -argument to select the process ID to stop\&. (Note that the BIND 10 boss process may restart this service if configured\&.) -.SH "SEE ALSO" -.PP - -\fBb10-auth\fR(8), -\fBb10-cfgmgr\fR(8), -\fBb10-msgq\fR(8), -\fBb10-xfrout\fR(8), -\fBb10-zonemgr\fR(8), -\fBbind10\fR(8), -BIND 10 Guide\&. -.SH "HISTORY" -.PP -The -\fBb10\-ddns\fR -daemon was first implemented in December 2011 for the ISC BIND 10 project\&. The first functional version was released in June 2012\&. -.SH "COPYRIGHT" -.br -Copyright \(co 2011-2012 Internet Systems Consortium, Inc. ("ISC") -.br diff --git a/src/bin/dhcp4/.gitignore b/src/bin/dhcp4/.gitignore index f7e9973b9f..952db06e0e 100644 --- a/src/bin/dhcp4/.gitignore +++ b/src/bin/dhcp4/.gitignore @@ -1,3 +1,4 @@ /b10-dhcp4 /spec_config.h /spec_config.h.pre +/b10-dhcp4.8 diff --git a/src/bin/dhcp4/Makefile.am b/src/bin/dhcp4/Makefile.am index dcf9ca0d5f..e0c97d17b8 100644 --- a/src/bin/dhcp4/Makefile.am +++ b/src/bin/dhcp4/Makefile.am @@ -12,26 +12,43 @@ endif pkglibexecdir = $(libexecdir)/@PACKAGE@ -CLEANFILES = spec_config.h +CLEANFILES = *.gcno *.gcda spec_config.h dhcp4_messages.h dhcp4_messages.cc man_MANS = b10-dhcp4.8 +DISTCLEANFILES = $(man_MANS) EXTRA_DIST = $(man_MANS) b10-dhcp4.xml dhcp4.spec -if ENABLE_MAN +if GENERATE_DOCS b10-dhcp4.8: b10-dhcp4.xml - xsltproc --novalid --xinclude --nonet -o $@ \ + @XSLTPROC@ --novalid --xinclude --nonet -o $@ \ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl \ $(srcdir)/b10-dhcp4.xml + +else + +$(man_MANS): + @echo Man generation disabled. Creating dummy $@. Configure with --enable-generate-docs to enable it. + @echo Man generation disabled. Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@ + endif spec_config.h: spec_config.h.pre $(SED) -e "s|@@LOCALSTATEDIR@@|$(localstatedir)|" spec_config.h.pre >$@ -BUILT_SOURCES = spec_config.h +dhcp4_messages.h dhcp4_messages.cc: dhcp4_messages.mes + $(top_builddir)/src/lib/log/compiler/message $(top_srcdir)/src/bin/dhcp4/dhcp4_messages.mes + +BUILT_SOURCES = spec_config.h dhcp4_messages.h dhcp4_messages.cc + pkglibexec_PROGRAMS = b10-dhcp4 -b10_dhcp4_SOURCES = main.cc dhcp4_srv.cc dhcp4_srv.h +b10_dhcp4_SOURCES = main.cc b10_dhcp4_SOURCES += ctrl_dhcp4_srv.cc ctrl_dhcp4_srv.h +b10_dhcp4_SOURCES += dhcp4_log.cc dhcp4_log.h +b10_dhcp4_SOURCES += dhcp4_srv.cc dhcp4_srv.h + +nodist_b10_dhcp4_SOURCES = dhcp4_messages.h dhcp4_messages.cc +EXTRA_DIST += dhcp4_messages.mes if USE_CLANGPP # Disable unused parameter warning caused by some of the @@ -39,7 +56,7 @@ if USE_CLANGPP b10_dhcp4_CXXFLAGS = -Wno-unused-parameter endif -b10_dhcp4_LDADD = $(top_builddir)/src/lib/dhcp/libb10-dhcp++.la +b10_dhcp4_LDADD = $(top_builddir)/src/lib/dhcp/libb10-dhcp++.la b10_dhcp4_LDADD += $(top_builddir)/src/lib/exceptions/libb10-exceptions.la b10_dhcp4_LDADD += $(top_builddir)/src/lib/asiolink/libb10-asiolink.la b10_dhcp4_LDADD += $(top_builddir)/src/lib/log/libb10-log.la diff --git a/src/bin/dhcp4/b10-dhcp4.8 b/src/bin/dhcp4/b10-dhcp4.8 deleted file mode 100644 index 97bdeb8b73..0000000000 --- a/src/bin/dhcp4/b10-dhcp4.8 +++ /dev/null @@ -1,60 +0,0 @@ -'\" t -.\" Title: b10-dhcp4 -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: October 27, 2011 -.\" Manual: BIND10 -.\" Source: BIND10 -.\" Language: English -.\" -.TH "B10\-DHCP4" "8" "October 27, 2011" "BIND10" "BIND10" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.SH "NAME" -b10-dhcp4 \- DHCPv4 server in BIND 10 architecture -.SH "SYNOPSIS" -.HP \w'\fBb10\-dhcp4\fR\ 'u -\fBb10\-dhcp4\fR [\fB\-v\fR] -.SH "DESCRIPTION" -.PP -The -\fBb10\-dhcp4\fR -daemon will provide the DHCPv4 server implementation when it becomes functional\&. -.SH "ARGUMENTS" -.PP -The arguments are as follows: -.PP -\fB\-v\fR -.RS 4 -Enable verbose mode\&. -.RE -.SH "SEE ALSO" -.PP - -\fBbind10\fR(8)\&. -.SH "HISTORY" -.PP -The -\fBb10\-dhcp4\fR -daemon was first coded in November 2011 by Tomek Mrugalski\&. -.SH "COPYRIGHT" -.br -Copyright \(co 2011 Internet Systems Consortium, Inc. ("ISC") -.br diff --git a/src/bin/dhcp4/ctrl_dhcp4_srv.cc b/src/bin/dhcp4/ctrl_dhcp4_srv.cc index 724ddf2de5..4bd3103b6b 100644 --- a/src/bin/dhcp4/ctrl_dhcp4_srv.cc +++ b/src/bin/dhcp4/ctrl_dhcp4_srv.cc @@ -13,28 +13,30 @@ // PERFORMANCE OF THIS SOFTWARE. #include + #include #include -#include +#include #include -#include +#include #include #include -#include -#include #include +#include +#include #include -#include +#include +#include -using namespace std; -using namespace isc::util; -using namespace isc::dhcp; -using namespace isc::util; -using namespace isc::data; +using namespace isc::asiolink; using namespace isc::cc; using namespace isc::config; -using namespace isc::asiolink; +using namespace isc::data; +using namespace isc::dhcp; +using namespace isc::log; +using namespace isc::util; +using namespace std; namespace isc { namespace dhcp { @@ -43,7 +45,8 @@ ControlledDhcpv4Srv* ControlledDhcpv4Srv::server_ = NULL; ConstElementPtr ControlledDhcpv4Srv::dhcp4ConfigHandler(ConstElementPtr new_config) { - cout << "b10-dhcp4: Received new config:" << new_config->str() << endl; + LOG_DEBUG(dhcp4_logger, DBG_DHCP4_COMMAND, DHCP4_CONFIG_UPDATE) + .arg(new_config->str()); ConstElementPtr answer = isc::config::createAnswer(0, "Thank you for sending config."); return (answer); @@ -51,13 +54,14 @@ ControlledDhcpv4Srv::dhcp4ConfigHandler(ConstElementPtr new_config) { ConstElementPtr ControlledDhcpv4Srv::dhcp4CommandHandler(const string& command, ConstElementPtr args) { - cout << "b10-dhcp4: Received new command: [" << command << "], args=" - << args->str() << endl; + LOG_DEBUG(dhcp4_logger, DBG_DHCP4_COMMAND, DHCP4_COMMAND_RECEIVED) + .arg(command).arg(args->str()); + if (command == "shutdown") { if (ControlledDhcpv4Srv::server_) { ControlledDhcpv4Srv::server_->shutdown(); } else { - cout << "Server not initialized yet or already shut down." << endl; + LOG_WARN(dhcp4_logger, DHCP4_NOT_RUNNING); ConstElementPtr answer = isc::config::createAnswer(1, "Shutdown failure."); return (answer); @@ -93,10 +97,9 @@ void ControlledDhcpv4Srv::establishSession() { /// @todo: Check if session is not established already. Throw, if it is. - cout << "b10-dhcp4: my specfile is " << specfile << endl; - + LOG_DEBUG(dhcp4_logger, DBG_DHCP4_START, DHCP4_CCSESSION_STARTING) + .arg(specfile); cc_session_ = new Session(io_service_.get_io_service()); - config_session_ = new ModuleCCSession(specfile, *cc_session_, dhcp4ConfigHandler, dhcp4CommandHandler, false); @@ -106,8 +109,8 @@ void ControlledDhcpv4Srv::establishSession() { /// control with the "select" model of the DHCP server. This is /// fully explained in \ref dhcpv4Session. int ctrl_socket = cc_session_->getSocketDesc(); - cout << "b10-dhcp4: Control session started, socket=" - << ctrl_socket << endl; + LOG_DEBUG(dhcp4_logger, DBG_DHCP4_START, DHCP4_CCSESSION_STARTED) + .arg(ctrl_socket); IfaceMgr::instance().set_session_socket(ctrl_socket, sessionReader); } diff --git a/src/bin/dhcp4/dhcp4_log.cc b/src/bin/dhcp4/dhcp4_log.cc new file mode 100644 index 0000000000..678223b134 --- /dev/null +++ b/src/bin/dhcp4/dhcp4_log.cc @@ -0,0 +1,26 @@ +// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC") +// +// Permission to use, copy, modify, and/or distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +// PERFORMANCE OF THIS SOFTWARE. + +/// Defines the logger used by the top-level component of b10-dhcp4. + +#include "dhcp4_log.h" + +namespace isc { +namespace dhcp { + +isc::log::Logger dhcp4_logger("dhcp4"); + +} // namespace dhcp +} // namespace isc + diff --git a/src/bin/dhcp4/dhcp4_log.h b/src/bin/dhcp4/dhcp4_log.h new file mode 100644 index 0000000000..3717b62d92 --- /dev/null +++ b/src/bin/dhcp4/dhcp4_log.h @@ -0,0 +1,59 @@ +// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC") +// +// Permission to use, copy, modify, and/or distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +// PERFORMANCE OF THIS SOFTWARE. + +#ifndef __DHCP4_LOG__H +#define __DHCP4_LOG__H + +#include +#include +#include + +namespace isc { +namespace dhcp { + +/// \brief DHCP4 Logging +/// +/// Defines the levels used to output debug messages in the non-library part of +/// the b10-dhcp4 program. Higher numbers equate to more verbose (and detailed) +/// output. + +// Debug levels used to log information during startup and shutdown. +const int DBG_DHCP4_START = DBGLVL_START_SHUT; +const int DBG_DHCP4_SHUT = DBGLVL_START_SHUT; + +// Debug level used to log setting information (such as configuration changes). +const int DBG_DHCP4_COMMAND = DBGLVL_COMMAND; + +// Trace basic operations within the code. +const int DBG_DHCP4_BASIC = DBGLVL_TRACE_BASIC; + +// Trace detailed operations, including errors raised when processing invalid +// packets. (These are not logged at severities of WARN or higher for fear +// that a set of deliberately invalid packets set to the server could overwhelm +// the logging.) +const int DBG_DHCP4_DETAIL = DBGLVL_TRACE_DETAIL; + +// This level is used to log the contents of packets received and sent. +const int DBG_DHCP4_DETAIL_DATA = DBGLVL_TRACE_DETAIL_DATA; + +/// Define the logger for the "dhcp4" module part of b10-dhcp4. We could define +/// a logger in each file, but we would want to define a common name to avoid +/// spelling mistakes, so it is just one small step from there to define a +/// module-common logger. +extern isc::log::Logger dhcp4_logger; + +} // namespace dhcp4 +} // namespace isc + +#endif // __DHCP4_LOG__H diff --git a/src/bin/dhcp4/dhcp4_messages.mes b/src/bin/dhcp4/dhcp4_messages.mes new file mode 100644 index 0000000000..98e402da84 --- /dev/null +++ b/src/bin/dhcp4/dhcp4_messages.mes @@ -0,0 +1,98 @@ +# Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC") +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. + +$NAMESPACE isc::dhcp + +% DHCP4_CCSESSION_STARTED control channel session started on socket %1 +A debug message issued during startup after the IPv4 DHCP server has +successfully established a session with the BIND 10 control channel. + +% DHCP4_CCSESSION_STARTING starting control channel session, specfile: %1 +This debug message is issued just before the IPv4 DHCP server attempts +to establish a session with the BIND 10 control channel. + +% DHCP4_COMMAND_RECEIVED received command %1, arguments: %2 +A debug message listing the command (and possible arguments) received +from the BIND 10 control system by the IPv4 DHCP server. + +% DHCP4_CONFIG_UPDATE updated configuration received: %1 +A debug message indicating that the IPv4 DHCP server has received an +updated configuration from the BIND 10 configuration system. + +% DHCP4_NOT_RUNNING IPv4 DHCP server is not running +A warning message is issued when an attempt is made to shut down the +IPv4 DHCP server but it is not running. + +% DHCP4_OPEN_SOCKET opening sockets on port %1 +A debug message issued during startup, this indicates that the IPv4 DHCP +server is about to open sockets on the specified port. + +% DHCP4_PACKET_PARSE_FAIL failed to parse incoming packet: %1 +The IPv4 DHCP server has received a packet that it is unable to +interpret. The reason why the packet is invalid is included in the message. + +% DHCP4_PACKET_RECEIVED %1 (type %2) packet received on interface %3 +A debug message noting that the server has received the specified type of +packet on the specified interface. Note that a packet marked as UNKNOWN +may well be a valid DHCP packet, just a type not expected by the server +(e.g. it will report a received OFFER packet as UNKNOWN). + +% DHCP4_PACK_FAIL failed to assemble response correctly +This error is output if the server failed to assemble the data to be +returned to the client into a valid packet. The cause is most likely +to be a programming error: please raise a bug report. + +% DHCP4_QUERY_DATA received packet type %1, data is <%2> +A debug message listing the data received from the client. + +% DHCP4_RESPONSE_DATA responding with packet type %1, data is <%2> +A debug message listing the data returned to the client. + +% DHCP4_SERVER_FAILED server failed: %1 +The IPv4 DHCP server has encountered a fatal error and is terminating. +The reason for the failure is included in the message. + +% DHCP4_SESSION_FAIL failed to establish BIND 10 session (%1), running stand-alone +The server has failed to establish communication with the rest of BIND +10 and is running in stand-alone mode. (This behavior will change once +the IPv4 DHCP server is properly integrated with the rest of BIND 10.) + +% DHCP4_SHUTDOWN server shutdown +The IPv4 DHCP server has terminated normally. + +% DHCP4_SHUTDOWN_REQUEST shutdown of server requested +This debug message indicates that a shutdown of the IPv4 server has +been requested via a call to the 'shutdown' method of the core Dhcpv4Srv +object. + +% DHCP4_SRV_CONSTRUCT_ERROR error creating Dhcpv4Srv object, reason: %1 +This error message indicates that during startup, the construction of a +core component within the IPv4 DHCP server (the Dhcpv4 server object) +has failed. As a result, the server will exit. The reason for the +failure is given within the message. + +% DHCP4_STANDALONE skipping message queue, running standalone +This is a debug message indicating that the IPv4 server is running in +standalone mode, not connected to the message queue. Standalone mode +is only useful during program development, and should not be used in a +production environment. + +% DHCP4_STARTING server starting +This informational message indicates that the IPv4 DHCP server has +processed any command-line switches and is starting. + +% DHCP4_START_INFO pid: %1, port: %2, verbose: %3, standalone: %4 +This is a debug message issued during the IPv4 DHCP server startup. +It lists some information about the parameters with which the server +is running. diff --git a/src/bin/dhcp4/dhcp4_srv.cc b/src/bin/dhcp4/dhcp4_srv.cc index a86b010792..2bbc0758ef 100644 --- a/src/bin/dhcp4/dhcp4_srv.cc +++ b/src/bin/dhcp4/dhcp4_srv.cc @@ -16,13 +16,15 @@ #include #include #include +#include #include #include -using namespace std; using namespace isc; -using namespace isc::dhcp; using namespace isc::asiolink; +using namespace isc::dhcp; +using namespace isc::log; +using namespace std; // These are hardcoded parameters. Currently this is a skeleton server that only // grants those options and a single, fixed, hardcoded lease. @@ -35,20 +37,19 @@ const std::string HARDCODED_DOMAIN_NAME = "isc.example.com"; const std::string HARDCODED_SERVER_ID = "192.0.2.1"; Dhcpv4Srv::Dhcpv4Srv(uint16_t port) { - cout << "Initialization: opening sockets on port " << port << endl; - + LOG_DEBUG(dhcp4_logger, DBG_DHCP4_START, DHCP4_OPEN_SOCKET).arg(port); try { - // first call to instance() will create IfaceMgr (it's a singleton) + // First call to instance() will create IfaceMgr (it's a singleton) // it may throw something if things go wrong IfaceMgr::instance(); /// @todo: instantiate LeaseMgr here once it is imlpemented. - IfaceMgr::instance().openSockets4(port); setServerID(); + } catch (const std::exception &e) { - cerr << "Error during DHCPv4 server startup: " << e.what() << endl; + LOG_ERROR(dhcp4_logger, DHCP4_SRV_CONSTRUCT_ERROR).arg(e.what()); shutdown_ = true; return; } @@ -57,12 +58,11 @@ Dhcpv4Srv::Dhcpv4Srv(uint16_t port) { } Dhcpv4Srv::~Dhcpv4Srv() { - cout << "b10-dhcp4: DHCPv4 server terminating." << endl; IfaceMgr::instance().closeSockets(); } void Dhcpv4Srv::shutdown() { - cout << "b10-dhcp4: DHCPv4 server shutdown." << endl; + LOG_DEBUG(dhcp4_logger, DBG_DHCP4_BASIC, DHCP4_SHUTDOWN_REQUEST); shutdown_ = true; } @@ -79,39 +79,48 @@ Dhcpv4Srv::run() { if (query) { try { query->unpack(); + } catch (const std::exception& e) { - /// TODO: Printout reasons of failed parsing - cout << "Failed to parse incoming packet " << endl; + // Failed to parse the packet. + LOG_DEBUG(dhcp4_logger, DBG_DHCP4_DETAIL, + DHCP4_PACKET_PARSE_FAIL).arg(e.what()); continue; } + LOG_DEBUG(dhcp4_logger, DBG_DHCP4_DETAIL, DHCP4_PACKET_RECEIVED) + .arg(serverReceivedPacketName(query->getType())) + .arg(query->getType()) + .arg(query->getIface()); + LOG_DEBUG(dhcp4_logger, DBG_DHCP4_DETAIL_DATA, DHCP4_QUERY_DATA) + .arg(query->toText()); switch (query->getType()) { case DHCPDISCOVER: rsp = processDiscover(query); break; + case DHCPREQUEST: rsp = processRequest(query); break; + case DHCPRELEASE: processRelease(query); break; + case DHCPDECLINE: processDecline(query); break; + case DHCPINFORM: processInform(query); break; + default: - cout << "Unknown pkt type received:" - << query->getType() << endl; + // Only action is to output a message if debug is enabled, + // and that will be covered by the debug statement before + // the "switch" statement. + ; } - cout << "Received message type " << int(query->getType()) << endl; - - // TODO: print out received packets only if verbose (or debug) - // mode is enabled - cout << query->toText(); - if (rsp) { if (rsp->getRemoteAddr().toText() == "0.0.0.0") { rsp->setRemoteAddr(query->getRemoteAddr()); @@ -127,14 +136,15 @@ Dhcpv4Srv::run() { rsp->setIface(query->getIface()); rsp->setIndex(query->getIndex()); - cout << "Replying with message type " - << static_cast(rsp->getType()) << ":" << endl; - cout << rsp->toText(); - cout << "----" << endl; + LOG_DEBUG(dhcp4_logger, DBG_DHCP4_DETAIL_DATA, + DHCP4_RESPONSE_DATA) + .arg(rsp->getType()).arg(rsp->toText()); + if (rsp->pack()) { - cout << "Packet assembled correctly." << endl; + IfaceMgr::instance().send(rsp); + } else { + LOG_ERROR(dhcp4_logger, DHCP4_PACK_FAIL); } - IfaceMgr::instance().send(rsp); } } @@ -266,15 +276,44 @@ Pkt4Ptr Dhcpv4Srv::processRequest(Pkt4Ptr& request) { void Dhcpv4Srv::processRelease(Pkt4Ptr& release) { /// TODO: Implement this. - cout << "Received RELEASE on " << release->getIface() << " interface." << endl; } void Dhcpv4Srv::processDecline(Pkt4Ptr& decline) { /// TODO: Implement this. - cout << "Received DECLINE on " << decline->getIface() << " interface." << endl; } Pkt4Ptr Dhcpv4Srv::processInform(Pkt4Ptr& inform) { /// TODO: Currently implemented echo mode. Implement this for real return (inform); } + +const char* +Dhcpv4Srv::serverReceivedPacketName(uint8_t type) { + static const char* DISCOVER = "DISCOVER"; + static const char* REQUEST = "REQUEST"; + static const char* RELEASE = "RELEASE"; + static const char* DECLINE = "DECLINE"; + static const char* INFORM = "INFORM"; + static const char* UNKNOWN = "UNKNOWN"; + + switch (type) { + case DHCPDISCOVER: + return (DISCOVER); + + case DHCPREQUEST: + return (REQUEST); + + case DHCPRELEASE: + return (RELEASE); + + case DHCPDECLINE: + return (DECLINE); + + case DHCPINFORM: + return (INFORM); + + default: + ; + } + return (UNKNOWN); +} diff --git a/src/bin/dhcp4/dhcp4_srv.h b/src/bin/dhcp4/dhcp4_srv.h index dc087ff072..f677259947 100644 --- a/src/bin/dhcp4/dhcp4_srv.h +++ b/src/bin/dhcp4/dhcp4_srv.h @@ -44,7 +44,7 @@ class Dhcpv4Srv : public boost::noncopyable { public: /// @brief Default constructor. /// - /// Instantiates necessary services, required to run DHCPv6 server. + /// Instantiates necessary services, required to run DHCPv4 server. /// In particular, creates IfaceMgr that will be responsible for /// network interaction. Will instantiate lease manager, and load /// old or create new DUID. It is possible to specify alternate @@ -54,7 +54,7 @@ class Dhcpv4Srv : public boost::noncopyable { /// @param port specifies port number to listen on Dhcpv4Srv(uint16_t port = DHCP4_SERVER_PORT); - /// @brief Destructor. Used during DHCPv6 service shutdown. + /// @brief Destructor. Used during DHCPv4 service shutdown. ~Dhcpv4Srv(); /// @brief Main server processing loop. @@ -70,6 +70,23 @@ class Dhcpv4Srv : public boost::noncopyable { /// @brief Instructs the server to shut down. void shutdown(); + /// @brief Return textual type of packet received by server + /// + /// Returns the name of valid packet received by the server (e.g. DISCOVER). + /// If the packet is unknown - or if it is a valid DHCP packet but not one + /// expected to be received by the server (such as an OFFER), the string + /// "UNKNOWN" is returned. This method is used in debug messages. + /// + /// As the operation of the method does not depend on any server state, it + /// is declared static. + /// + /// @param type DHCPv4 packet type + /// + /// @return Pointer to "const" string containing the packet name. + /// Note that this string is statically allocated and MUST NOT + /// be freed by the caller. + static const char* serverReceivedPacketName(uint8_t type); + protected: /// @brief Processes incoming DISCOVER and returns response. /// @@ -89,11 +106,11 @@ protected: /// is valid, not expired, not reserved, not used by other client and /// that requesting client is allowed to use it. /// - /// Returns ACK message, NACK message, or NULL + /// Returns ACK message, NAK message, or NULL /// /// @param request a message received from client /// - /// @return ACK or NACK message + /// @return ACK or NAK message Pkt4Ptr processRequest(Pkt4Ptr& request); /// @brief Stub function that will handle incoming RELEASE messages. diff --git a/src/bin/dhcp4/main.cc b/src/bin/dhcp4/main.cc index 1087cc7fb6..31f0b0251b 100644 --- a/src/bin/dhcp4/main.cc +++ b/src/bin/dhcp4/main.cc @@ -14,13 +14,15 @@ #include #include -#include -#include -#include + #include -using namespace std; +#include +#include +#include + using namespace isc::dhcp; +using namespace std; /// This file contains entry point (main() function) for standard DHCPv4 server /// component for BIND10 framework. It parses command-line arguments and @@ -37,11 +39,10 @@ const char* const DHCP4_NAME = "b10-dhcp4"; void usage() { - cerr << "Usage: b10-dhcp4 [-v]" - << endl; - cerr << "\t-v: verbose output" << endl; - cerr << "\t-s: stand-alone mode (don't connect to BIND10)" << endl; - cerr << "\t-p number: specify non-standard port number 1-65535 " + cerr << "Usage: " << DHCP4_NAME << " [-v] [-s] [-p number]" << endl; + cerr << " -v: verbose output" << endl; + cerr << " -s: stand-alone mode (don't connect to BIND10)" << endl; + cerr << " -p number: specify non-standard port number 1-65535 " << "(useful for testing only)" << endl; exit(EXIT_FAILURE); } @@ -50,20 +51,21 @@ usage() { int main(int argc, char* argv[]) { int ch; - bool verbose_mode = false; // should server be verbose? int port_number = DHCP4_SERVER_PORT; // The default. any other values are // useful for testing only. - bool stand_alone = false; // should be connect to BIND10 msgq? + bool stand_alone = false; // Should be connect to BIND10 msgq? + bool verbose_mode = false; // Should server be verbose? while ((ch = getopt(argc, argv, "vsp:")) != -1) { switch (ch) { case 'v': verbose_mode = true; - isc::log::denabled = true; break; + case 's': stand_alone = true; break; + case 'p': try { port_number = boost::lexical_cast(optarg); @@ -78,50 +80,46 @@ main(int argc, char* argv[]) { usage(); } break; - case ':': + default: usage(); } } + // Check for extraneous parameters. + if (argc > optind) { + usage(); + } + // Initialize logging. If verbose, we'll use maximum verbosity. isc::log::initLogger(DHCP4_NAME, (verbose_mode ? isc::log::DEBUG : isc::log::INFO), isc::log::MAX_DEBUG_LEVEL, NULL); + LOG_INFO(dhcp4_logger, DHCP4_STARTING); + LOG_DEBUG(dhcp4_logger, DBG_DHCP4_START, DHCP4_START_INFO) + .arg(getpid()).arg(port_number).arg(verbose_mode ? "yes" : "no") + .arg(stand_alone ? "yes" : "no" ); - cout << "b10-dhcp4: My pid=" << getpid() << ", binding to port " - << port_number << ", verbose " << (verbose_mode?"yes":"no") - << ", stand-alone=" << (stand_alone?"yes":"no") << endl; - - if (argc - optind > 0) { - usage(); - } int ret = EXIT_SUCCESS; - try { - - cout << "[b10-dhcp4] Initiating DHCPv4 server operation." << endl; - - /// @todo: pass verbose to the actul server once logging is implemented ControlledDhcpv4Srv server(port_number); - if (!stand_alone) { try { server.establishSession(); } catch (const std::exception& ex) { - cerr << "Failed to establish BIND10 session. " - "Running in stand-alone mode:" << ex.what() << endl; + LOG_ERROR(dhcp4_logger, DHCP4_SESSION_FAIL).arg(ex.what()); // Let's continue. It is useful to have the ability to run // DHCP server in stand-alone mode, e.g. for testing } } else { - cout << "Skipping connection to the BIND10 msgq." << endl; + LOG_DEBUG(dhcp4_logger, DBG_DHCP4_START, DHCP4_STANDALONE); } - server.run(); + LOG_INFO(dhcp4_logger, DHCP4_SHUTDOWN); + } catch (const std::exception& ex) { - cerr << "[b10-dhcp4] Server failed: " << ex.what() << endl; + LOG_FATAL(dhcp4_logger, DHCP4_SERVER_FAILED).arg(ex.what()); ret = EXIT_FAILURE; } diff --git a/src/bin/dhcp4/tests/Makefile.am b/src/bin/dhcp4/tests/Makefile.am index 402af604f6..0e96d70017 100644 --- a/src/bin/dhcp4/tests/Makefile.am +++ b/src/bin/dhcp4/tests/Makefile.am @@ -47,6 +47,8 @@ if HAVE_GTEST TESTS += dhcp4_unittests dhcp4_unittests_SOURCES = ../dhcp4_srv.h ../dhcp4_srv.cc ../ctrl_dhcp4_srv.cc +dhcp4_unittests_SOURCES += ../dhcp4_log.h ../dhcp4_log.cc +dhcp4_unittests_SOURCES += ../dhcp4_messages.h ../dhcp4_messages.cc dhcp4_unittests_SOURCES += dhcp4_unittests.cc dhcp4_unittests_SOURCES += dhcp4_srv_unittest.cc dhcp4_unittests_SOURCES += ctrl_dhcp4_srv_unittest.cc diff --git a/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc b/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc index cfc12fb844..fca06ad988 100644 --- a/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc +++ b/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2011-2012 Internet Systems Consortium, Inc. ("ISC") // // Permission to use, copy, modify, and/or distribute this software for any // purpose with or without fee is hereby granted, provided that the above @@ -271,4 +271,36 @@ TEST_F(Dhcpv4SrvTest, processInform) { delete srv; } +TEST_F(Dhcpv4SrvTest, serverReceivedPacketName) { + // Check all possible packet types + for (int itype = 0; itype < 256; ++itype) { + uint8_t type = itype; + + switch (type) { + case DHCPDECLINE: + EXPECT_STREQ("DECLINE", Dhcpv4Srv::serverReceivedPacketName(type)); + break; + + case DHCPDISCOVER: + EXPECT_STREQ("DISCOVER", Dhcpv4Srv::serverReceivedPacketName(type)); + break; + + case DHCPINFORM: + EXPECT_STREQ("INFORM", Dhcpv4Srv::serverReceivedPacketName(type)); + break; + + case DHCPRELEASE: + EXPECT_STREQ("RELEASE", Dhcpv4Srv::serverReceivedPacketName(type)); + break; + + case DHCPREQUEST: + EXPECT_STREQ("REQUEST", Dhcpv4Srv::serverReceivedPacketName(type)); + break; + + default: + EXPECT_STREQ("UNKNOWN", Dhcpv4Srv::serverReceivedPacketName(type)); + } + } +} + } // end of anonymous namespace diff --git a/src/bin/dhcp4/tests/dhcp4_test.py b/src/bin/dhcp4/tests/dhcp4_test.py index 935bba645a..444dfcfd2a 100644 --- a/src/bin/dhcp4/tests/dhcp4_test.py +++ b/src/bin/dhcp4/tests/dhcp4_test.py @@ -27,16 +27,27 @@ import fcntl class TestDhcpv4Daemon(unittest.TestCase): def setUp(self): - # don't redirect stdout/stderr here as we want to print out things + # Don't redirect stdout/stderr here as we want to print out things # during the test - pass + # + # However, we do want to set the logging lock directory to somewhere + # to which we can write - use the current working directory. We then + # set the appropriate environment variable. os.putenv() may be not + # supported on some platforms as suggested in + # http://docs.python.org/release/3.2/library/os.html?highlight=putenv#os.environ: + # "If the platform supports the putenv() function...". It was checked + # that it does not work on Ubuntu. To overcome this problem we access + # os.environ directly. + lockdir_envvar = "B10_LOCKFILE_DIR_FROM_BUILD" + if lockdir_envvar not in os.environ: + os.environ[lockdir_envvar] = os.getcwd() def tearDown(self): pass def runCommand(self, params, wait=1): """ - This method runs dhcp4 and returns a touple: (returncode, stdout, stderr) + This method runs dhcp4 and returns a tuple: (returncode, stdout, stderr) """ ## @todo: Convert this into generic method and reuse it in dhcp6 @@ -79,9 +90,9 @@ class TestDhcpv4Daemon(unittest.TestCase): fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK) # There's potential problem if b10-dhcp4 prints out more - # than 4k of text + # than 16kB of text try: - output = os.read(self.stdout_pipes[0], 4096) + output = os.read(self.stdout_pipes[0], 16384) except OSError: print("No data available from stdout") output = "" @@ -91,7 +102,7 @@ class TestDhcpv4Daemon(unittest.TestCase): output = "" try: - error = os.read(self.stderr_pipes[0], 4096) + error = os.read(self.stderr_pipes[0], 16384) except OSError: print("No data available on stderr") error = "" @@ -128,13 +139,13 @@ class TestDhcpv4Daemon(unittest.TestCase): print(" not that is can bind sockets correctly. Please ignore binding errors.") (returncode, output, error) = self.runCommand(["../b10-dhcp4", "-v"]) - - self.assertEqual( str(output).count("[b10-dhcp4] Initiating DHCPv4 server operation."), 1) + output_text = str(output) + str(error) + self.assertEqual(output_text.count("DHCP4_STARTING"), 1) def test_portnumber_0(self): print("Check that specifying port number 0 is not allowed.") - (returncode, output, error) = self.runCommand(['../b10-dhcp4', '-p', '0']) + (returncode, output, error) = self.runCommand(['../b10-dhcp4', '-v', '-p', '0']) # When invalid port number is specified, return code must not be success self.assertTrue(returncode != 0) @@ -178,28 +189,19 @@ class TestDhcpv4Daemon(unittest.TestCase): def test_portnumber_nonroot(self): print("Check that specifying unprivileged port number will work.") - (returncode, output, error) = self.runCommand(['../b10-dhcp4', '-s', '-p', '10057']) - - # When invalid port number is specified, return code must not be success - # TODO: Temporarily commented out as socket binding on systems that do not have - # interface detection implemented currently fails. - # self.assertTrue(returncode == 0) - - # Check that there is an error message about invalid port number printed on stderr - self.assertEqual( str(output).count("opening sockets on port 10057"), 1) + # Check that there is a message about running with an unprivileged port + (returncode, output, error) = self.runCommand(['../b10-dhcp4', '-v', '-s', '-p', '10057']) + output_text = str(output) + str(error) + self.assertEqual(output_text.count("DHCP4_OPEN_SOCKET opening sockets on port 10057"), 1) def test_skip_msgq(self): print("Check that connection to BIND10 msgq can be disabled.") - (returncode, output, error) = self.runCommand(['../b10-dhcp4', '-s', '-p', '10057']) - - # When invalid port number is specified, return code must not be success - # TODO: Temporarily commented out as socket binding on systems that do not have - # interface detection implemented currently fails. - # self.assertTrue(returncode == 0) - - # Check that there is an error message about invalid port number printed on stderr - self.assertEqual( str(output).count("Skipping connection to the BIND10 msgq."), 1) + # Check that the system outputs a message on one of its streams about running + # standalone. + (returncode, output, error) = self.runCommand(['../b10-dhcp4', '-v', '-s', '-p', '10057']) + output_text = str(output) + str(error) + self.assertEqual(output_text.count("DHCP4_STANDALONE"), 1) if __name__ == '__main__': unittest.main() diff --git a/src/bin/dhcp6/.gitignore b/src/bin/dhcp6/.gitignore index e4e8f2df6a..eedbb846cb 100644 --- a/src/bin/dhcp6/.gitignore +++ b/src/bin/dhcp6/.gitignore @@ -8,3 +8,4 @@ b10-dhcp6 spec_config.h spec_config.h.pre tests/dhcp6_unittests +/b10-dhcp6.8 diff --git a/src/bin/dhcp6/Makefile.am b/src/bin/dhcp6/Makefile.am index 7fcd3fe727..4dec4e7da6 100644 --- a/src/bin/dhcp6/Makefile.am +++ b/src/bin/dhcp6/Makefile.am @@ -13,27 +13,44 @@ endif pkglibexecdir = $(libexecdir)/@PACKAGE@ -CLEANFILES = spec_config.h +CLEANFILES = spec_config.h dhcp6_messages.h dhcp6_messages.cc man_MANS = b10-dhcp6.8 +DISTCLEANFILES = $(man_MANS) EXTRA_DIST = $(man_MANS) b10-dhcp6.xml dhcp6.spec -if ENABLE_MAN +if GENERATE_DOCS b10-dhcp6.8: b10-dhcp6.xml - xsltproc --novalid --xinclude --nonet -o $@ \ + @XSLTPROC@ --novalid --xinclude --nonet -o $@ \ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl \ $(srcdir)/b10-dhcp6.xml + +else + +$(man_MANS): + @echo Man generation disabled. Creating dummy $@. Configure with --enable-generate-docs to enable it. + @echo Man generation disabled. Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@ + endif spec_config.h: spec_config.h.pre $(SED) -e "s|@@LOCALSTATEDIR@@|$(localstatedir)|" spec_config.h.pre >$@ -BUILT_SOURCES = spec_config.h +dhcp6_messages.h dhcp6_messages.cc: dhcp6_messages.mes + $(top_builddir)/src/lib/log/compiler/message $(top_srcdir)/src/bin/dhcp6/dhcp6_messages.mes + +BUILT_SOURCES = spec_config.h dhcp6_messages.h dhcp6_messages.cc + pkglibexec_PROGRAMS = b10-dhcp6 -b10_dhcp6_SOURCES = main.cc dhcp6_srv.cc dhcp6_srv.h +b10_dhcp6_SOURCES = main.cc b10_dhcp6_SOURCES += ctrl_dhcp6_srv.cc ctrl_dhcp6_srv.h +b10_dhcp6_SOURCES += dhcp6_log.cc dhcp6_log.h +b10_dhcp6_SOURCES += dhcp6_srv.cc dhcp6_srv.h + +nodist_b10_dhcp6_SOURCES = dhcp6_messages.h dhcp6_messages.cc +EXTRA_DIST += dhcp6_messages.mes if USE_CLANGPP # Disable unused parameter warning caused by some of the @@ -41,7 +58,7 @@ if USE_CLANGPP b10_dhcp6_CXXFLAGS = -Wno-unused-parameter endif -b10_dhcp6_LDADD = $(top_builddir)/src/lib/exceptions/libb10-exceptions.la +b10_dhcp6_LDADD = $(top_builddir)/src/lib/exceptions/libb10-exceptions.la b10_dhcp6_LDADD += $(top_builddir)/src/lib/asiolink/libb10-asiolink.la b10_dhcp6_LDADD += $(top_builddir)/src/lib/log/libb10-log.la b10_dhcp6_LDADD += $(top_builddir)/src/lib/dhcp/libb10-dhcp++.la diff --git a/src/bin/dhcp6/b10-dhcp6.8 b/src/bin/dhcp6/b10-dhcp6.8 deleted file mode 100644 index 1f34a9a2a1..0000000000 --- a/src/bin/dhcp6/b10-dhcp6.8 +++ /dev/null @@ -1,51 +0,0 @@ -'\" t -.\" Title: b10-dhcp6 -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: October 27, 2011 -.\" Manual: BIND10 -.\" Source: BIND10 -.\" Language: English -.\" -.TH "B10\-DHCP6" "8" "October 27, 2011" "BIND10" "BIND10" -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.SH "NAME" -b10-dhcp6 \- DHCPv6 server in BIND 10 architecture -.SH "SYNOPSIS" -.HP \w'\fBb10\-dhcp6\fR\ 'u -\fBb10\-dhcp6\fR [\fB\-v\fR] -.SH "DESCRIPTION" -.PP -The -\fBb10\-dhcp6\fR -daemon will provide the DHCPv6 server implementation when it becomes functional\&. -.SH "ARGUMENTS" -.PP -The arguments are as follows: -.PP -\fB\-v\fR -.RS 4 -Enable verbose mode\&. -.RE -.SH "SEE ALSO" -.PP - -\fBbind10\fR(8)\&. -.SH "HISTORY" -.PP -The -\fBb10\-dhcp6\fR -daemon was first coded in June 2011 by Tomek Mrugalski\&. -.SH "COPYRIGHT" -.br -Copyright \(co 2011 Internet Systems Consortium, Inc. ("ISC") -.br diff --git a/src/bin/dhcp6/ctrl_dhcp6_srv.cc b/src/bin/dhcp6/ctrl_dhcp6_srv.cc index 461d5f1d64..4afb2039fd 100644 --- a/src/bin/dhcp6/ctrl_dhcp6_srv.cc +++ b/src/bin/dhcp6/ctrl_dhcp6_srv.cc @@ -13,28 +13,30 @@ // PERFORMANCE OF THIS SOFTWARE. #include + #include #include -#include +#include #include -#include +#include #include #include -#include -#include #include +#include +#include #include -#include +#include +#include -using namespace std; -using namespace isc::util; -using namespace isc::dhcp; -using namespace isc::util; -using namespace isc::data; +using namespace isc::asiolink; using namespace isc::cc; using namespace isc::config; -using namespace isc::asiolink; +using namespace isc::data; +using namespace isc::dhcp; +using namespace isc::log; +using namespace isc::util; +using namespace std; namespace isc { namespace dhcp { @@ -43,7 +45,8 @@ ControlledDhcpv6Srv* ControlledDhcpv6Srv::server_ = NULL; ConstElementPtr ControlledDhcpv6Srv::dhcp6ConfigHandler(ConstElementPtr new_config) { - cout << "b10-dhcp6: Received new config:" << new_config->str() << endl; + LOG_DEBUG(dhcp6_logger, DBG_DHCP6_COMMAND, DHCP6_CONFIG_UPDATE) + .arg(new_config->str()); ConstElementPtr answer = isc::config::createAnswer(0, "Thank you for sending config."); return (answer); @@ -51,13 +54,14 @@ ControlledDhcpv6Srv::dhcp6ConfigHandler(ConstElementPtr new_config) { ConstElementPtr ControlledDhcpv6Srv::dhcp6CommandHandler(const string& command, ConstElementPtr args) { - cout << "b10-dhcp6: Received new command: [" << command << "], args=" - << args->str() << endl; + LOG_DEBUG(dhcp6_logger, DBG_DHCP6_COMMAND, DHCP6_COMMAND_RECEIVED) + .arg(command).arg(args->str()); + if (command == "shutdown") { if (ControlledDhcpv6Srv::server_) { ControlledDhcpv6Srv::server_->shutdown(); } else { - cout << "Server not initialized yet or already shut down." << endl; + LOG_WARN(dhcp6_logger, DHCP6_NOT_RUNNING); ConstElementPtr answer = isc::config::createAnswer(1, "Shutdown failure."); return (answer); @@ -93,10 +97,9 @@ void ControlledDhcpv6Srv::establishSession() { /// @todo: Check if session is not established already. Throw, if it is. - cout << "b10-dhcp6: my specfile is " << specfile << endl; - + LOG_DEBUG(dhcp6_logger, DBG_DHCP6_START, DHCP6_CCSESSION_STARTING) + .arg(specfile); cc_session_ = new Session(io_service_.get_io_service()); - config_session_ = new ModuleCCSession(specfile, *cc_session_, dhcp6ConfigHandler, dhcp6CommandHandler, false); @@ -106,8 +109,8 @@ void ControlledDhcpv6Srv::establishSession() { /// control with the "select" model of the DHCP server. This is /// fully explained in \ref dhcpv6Session. int ctrl_socket = cc_session_->getSocketDesc(); - cout << "b10-dhcp6: Control session started, socket=" - << ctrl_socket << endl; + LOG_DEBUG(dhcp6_logger, DBG_DHCP6_START, DHCP6_CCSESSION_STARTED) + .arg(ctrl_socket); IfaceMgr::instance().set_session_socket(ctrl_socket, sessionReader); } diff --git a/src/bin/dhcp6/dhcp6_log.cc b/src/bin/dhcp6/dhcp6_log.cc new file mode 100644 index 0000000000..d89383492c --- /dev/null +++ b/src/bin/dhcp6/dhcp6_log.cc @@ -0,0 +1,26 @@ +// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC") +// +// Permission to use, copy, modify, and/or distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +// PERFORMANCE OF THIS SOFTWARE. + +/// Defines the logger used by the top-level component of b10-dhcp6. + +#include "dhcp6_log.h" + +namespace isc { +namespace dhcp { + +isc::log::Logger dhcp6_logger("dhcp6"); + +} // namespace dhcp +} // namespace isc + diff --git a/src/bin/dhcp6/dhcp6_log.h b/src/bin/dhcp6/dhcp6_log.h new file mode 100644 index 0000000000..6d7f4e33b0 --- /dev/null +++ b/src/bin/dhcp6/dhcp6_log.h @@ -0,0 +1,59 @@ +// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC") +// +// Permission to use, copy, modify, and/or distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +// PERFORMANCE OF THIS SOFTWARE. + +#ifndef __DHCP6_LOG__H +#define __DHCP6_LOG__H + +#include +#include +#include + +namespace isc { +namespace dhcp { + +/// \brief DHCP6 Logging +/// +/// Defines the levels used to output debug messages in the non-library part of +/// the b10-dhcp6 program. Higher numbers equate to more verbose (and detailed) +/// output. + +// Debug levels used to log information during startup and shutdown. +const int DBG_DHCP6_START = DBGLVL_START_SHUT; +const int DBG_DHCP6_SHUT = DBGLVL_START_SHUT; + +// Debug level used to log setting information (such as configuration changes). +const int DBG_DHCP6_COMMAND = DBGLVL_COMMAND; + +// Trace basic operations within the code. +const int DBG_DHCP6_BASIC = DBGLVL_TRACE_BASIC; + +// Trace detailed operations, including errors raised when processing invalid +// packets. (These are not logged at severities of WARN or higher for fear +// that a set of deliberately invalid packets set to the server could overwhelm +// the logging.) +const int DBG_DHCP6_DETAIL = DBGLVL_TRACE_DETAIL; + +// This level is used to log the contents of packets received and sent. +const int DBG_DHCP6_DETAIL_DATA = DBGLVL_TRACE_DETAIL_DATA; + +/// Define the logger for the "dhcp6" module part of b10-dhcp6. We could define +/// a logger in each file, but we would want to define a common name to avoid +/// spelling mistakes, so it is just one small step from there to define a +/// module-common logger. +extern isc::log::Logger dhcp6_logger; + +} // namespace dhcp6 +} // namespace isc + +#endif // __DHCP6_LOG__H diff --git a/src/bin/dhcp6/dhcp6_messages.mes b/src/bin/dhcp6/dhcp6_messages.mes new file mode 100644 index 0000000000..a3615319a7 --- /dev/null +++ b/src/bin/dhcp6/dhcp6_messages.mes @@ -0,0 +1,101 @@ +# Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC") +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. + +$NAMESPACE isc::dhcp + +% DHCP6_CCSESSION_STARTED control channel session started on socket %1 +A debug message issued during startup after the IPv6 DHCP server has +successfully established a session with the BIND 10 control channel. + +% DHCP6_CCSESSION_STARTING starting control channel session, specfile: %1 +This debug message is issued just before the IPv6 DHCP server attempts +to establish a session with the BIND 10 control channel. + +% DHCP6_COMMAND_RECEIVED received command %1, arguments: %2 +A debug message listing the command (and possible arguments) received +from the BIND 10 control system by the IPv6 DHCP server. + +% DHCP6_CONFIG_UPDATE updated configuration received: %1 +A debug message indicating that the IPv6 DHCP server has received an +updated configuration from the BIND 10 configuration system. + +% DHCP6_NOT_RUNNING IPv6 DHCP server is not running +A warning message is issued when an attempt is made to shut down the +IPv6 DHCP server but it is not running. + +% DHCP6_NO_INTERFACES failed to detect any network interfaces +During startup the IPv6 DHCP server failed to detect any network +interfaces and is therefore shutting down. + +% DHCP6_OPEN_SOCKET opening sockets on port %1 +A debug message issued during startup, this indicates that the IPv6 DHCP +server is about to open sockets on the specified port. + +% DHCP6_PACKET_PARSE_FAIL failed to parse incoming packet +The IPv6 DHCP server has received a packet that it is unable to interpret. + +% DHCP6_PACKET_RECEIVED %1 (type %2) packet received +A debug message noting that the server has received the specified type +of packet. Note that a packet marked as UNKNOWN may well be a valid +DHCP packet, just a type not expected by the server (e.g. it will report +a received OFFER packet as UNKNOWN). + +% DHCP6_PACK_FAIL failed to assemble response correctly +This error is output if the server failed to assemble the data to be +returned to the client into a valid packet. The reason is most likely +to be to a programming error: please raise a bug report. + +% DHCP6_QUERY_DATA received packet length %1, data length %2, data is <%3> +A debug message listing the data received from the client or relay. + +% DHCP6_RESPONSE_DATA responding with packet type %1 data is <%2> +A debug message listing the data returned to the client. + +% DHCP6_SERVER_FAILED server failed: %1 +The IPv6 DHCP server has encountered a fatal error and is terminating. +The reason for the failure is included in the message. + +% DHCP6_SESSION_FAIL failed to establish BIND 10 session (%1), running stand-alone +The server has failed to establish communication with the rest of BIND +10 and is running in stand-alone mode. (This behavior will change once +the IPv6 DHCP server is properly integrated with the rest of BIND 10.) + +% DHCP6_SHUTDOWN server shutdown +The IPv6 DHCP server has terminated normally. + +% DHCP6_SHUTDOWN_REQUEST shutdown of server requested +This debug message indicates that a shutdown of the IPv6 server has +been requested via a call to the 'shutdown' method of the core Dhcpv6Srv +object. + +% DHCP6_SRV_CONSTRUCT_ERROR error creating Dhcpv6Srv object, reason: %1 +This error message indicates that during startup, the construction of a +core component within the IPv6 DHCP server (the Dhcpv6 server object) +has failed. As a result, the server will exit. The reason for the +failure is given within the message. + +% DHCP6_STANDALONE skipping message queue, running standalone +This is a debug message indicating that the IPv6 server is running in +standalone mode, not connected to the message queue. Standalone mode +is only useful during program development, and should not be used in a +production environment. + +% DHCP6_STARTING server starting +This informational message indicates that the IPv6 DHCP server has +processed any command-line switches and is starting. + +% DHCP6_START_INFO pid: %1, port: %2, verbose: %3, standalone: %4 +This is a debug message issued during the IPv6 DHCP server startup. +It lists some information about the parameters with which the server +is running. diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc index 9b43f5374f..7c21941d4d 100644 --- a/src/bin/dhcp6/dhcp6_srv.cc +++ b/src/bin/dhcp6/dhcp6_srv.cc @@ -14,23 +14,25 @@ #include #include -#include -#include -#include -#include -#include -#include -#include + #include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include -using namespace std; using namespace isc; -using namespace isc::dhcp; using namespace isc::asiolink; +using namespace isc::dhcp; using namespace isc::util; +using namespace std; const std::string HARDCODED_LEASE = "2001:db8:1::1234:abcd"; const uint32_t HARDCODED_T1 = 1500; // in seconds @@ -40,14 +42,14 @@ const uint32_t HARDCODED_VALID_LIFETIME = 7200; // in seconds const std::string HARDCODED_DNS_SERVER = "2001:db8:1::1"; Dhcpv6Srv::Dhcpv6Srv(uint16_t port) { - cout << "Initialization: opening sockets on port " << port << endl; + LOG_DEBUG(dhcp6_logger, DBG_DHCP6_START, DHCP6_OPEN_SOCKET).arg(port); - // first call to instance() will create IfaceMgr (it's a singleton) + // First call to instance() will create IfaceMgr (it's a singleton) // it may throw something if things go wrong try { if (IfaceMgr::instance().countIfaces() == 0) { - cout << "Failed to detect any network interfaces. Aborting." << endl; + LOG_ERROR(dhcp6_logger, DHCP6_NO_INTERFACES); shutdown_ = true; return; } @@ -59,7 +61,7 @@ Dhcpv6Srv::Dhcpv6Srv(uint16_t port) { /// @todo: instantiate LeaseMgr here once it is imlpemented. } catch (const std::exception &e) { - cerr << "Error during DHCPv4 server startup: " << e.what() << endl; + LOG_ERROR(dhcp6_logger, DHCP6_SRV_CONSTRUCT_ERROR).arg(e.what()); shutdown_ = true; return; } @@ -68,13 +70,11 @@ Dhcpv6Srv::Dhcpv6Srv(uint16_t port) { } Dhcpv6Srv::~Dhcpv6Srv() { - cout << "DHCPv6 Srv shutdown." << endl; - IfaceMgr::instance().closeSockets(); } void Dhcpv6Srv::shutdown() { - cout << "b10-dhcp6: DHCPv6 server shutdown." << endl; + LOG_DEBUG(dhcp6_logger, DBG_DHCP6_BASIC, DHCP6_SHUTDOWN_REQUEST); shutdown_ = true; } @@ -89,42 +89,58 @@ bool Dhcpv6Srv::run() { if (query) { if (!query->unpack()) { - cout << "Failed to parse incoming packet" << endl; + LOG_DEBUG(dhcp6_logger, DBG_DHCP6_DETAIL, + DHCP6_PACKET_PARSE_FAIL); continue; } + LOG_DEBUG(dhcp6_logger, DBG_DHCP6_DETAIL, DHCP6_PACKET_RECEIVED) + .arg(serverReceivedPacketName(query->getType())) + .arg(query->getType()); + LOG_DEBUG(dhcp6_logger, DBG_DHCP6_DETAIL_DATA, DHCP6_QUERY_DATA) + .arg(query->getType()) + .arg(query->getBuffer().getLength()) + .arg(query->toText()); + switch (query->getType()) { case DHCPV6_SOLICIT: rsp = processSolicit(query); break; + case DHCPV6_REQUEST: rsp = processRequest(query); break; + case DHCPV6_RENEW: rsp = processRenew(query); break; + case DHCPV6_REBIND: rsp = processRebind(query); break; + case DHCPV6_CONFIRM: rsp = processConfirm(query); break; + case DHCPV6_RELEASE: rsp = processRelease(query); break; + case DHCPV6_DECLINE: rsp = processDecline(query); break; + case DHCPV6_INFORMATION_REQUEST: rsp = processInfRequest(query); break; + default: - cout << "Unknown pkt type received:" - << query->getType() << endl; + // Only action is to output a message if debug is enabled, + // and that will be covered by the debug statement before + // the "switch" statement. + ; } - cout << "Received " << query->getBuffer().getLength() << " bytes packet type=" - << query->getType() << endl; - cout << query->toText(); if (rsp) { rsp->setRemoteAddr(query->getRemoteAddr()); rsp->setLocalAddr(query->getLocalAddr()); @@ -132,14 +148,16 @@ bool Dhcpv6Srv::run() { rsp->setLocalPort(DHCP6_SERVER_PORT); rsp->setIndex(query->getIndex()); rsp->setIface(query->getIface()); - cout << "Replying with:" << rsp->getType() << endl; - cout << rsp->toText(); - cout << "----" << endl; - if (!rsp->pack()) { - cout << "Failed to assemble response packet." << endl; - continue; + + LOG_DEBUG(dhcp6_logger, DBG_DHCP6_DETAIL_DATA, + DHCP6_RESPONSE_DATA) + .arg(rsp->getType()).arg(rsp->toText()); + + if (rsp->pack()) { + IfaceMgr::instance().send(rsp); + } else { + LOG_ERROR(dhcp6_logger, DHCP6_PACK_FAIL); } - IfaceMgr::instance().send(rsp); } } @@ -350,3 +368,46 @@ Pkt6Ptr Dhcpv6Srv::processInfRequest(const Pkt6Ptr& infRequest) { Pkt6Ptr reply(new Pkt6(DHCPV6_REPLY, infRequest->getTransid())); return reply; } + +const char* +Dhcpv6Srv::serverReceivedPacketName(uint8_t type) { + static const char* CONFIRM = "CONFIRM"; + static const char* DECLINE = "DECLINE"; + static const char* INFORMATION_REQUEST = "INFORMATION_REQUEST"; + static const char* REBIND = "REBIND"; + static const char* RELEASE = "RELEASE"; + static const char* RENEW = "RENEW"; + static const char* REQUEST = "REQUEST"; + static const char* SOLICIT = "SOLICIT"; + static const char* UNKNOWN = "UNKNOWN"; + + switch (type) { + case DHCPV6_CONFIRM: + return (CONFIRM); + + case DHCPV6_DECLINE: + return (DECLINE); + + case DHCPV6_INFORMATION_REQUEST: + return (INFORMATION_REQUEST); + + case DHCPV6_REBIND: + return (REBIND); + + case DHCPV6_RELEASE: + return (RELEASE); + + case DHCPV6_RENEW: + return (RENEW); + + case DHCPV6_REQUEST: + return (REQUEST); + + case DHCPV6_SOLICIT: + return (SOLICIT); + + default: + ; + } + return (UNKNOWN); +} diff --git a/src/bin/dhcp6/dhcp6_srv.h b/src/bin/dhcp6/dhcp6_srv.h index 9d1bf19497..1cb323657a 100644 --- a/src/bin/dhcp6/dhcp6_srv.h +++ b/src/bin/dhcp6/dhcp6_srv.h @@ -69,6 +69,24 @@ public: /// @brief Instructs the server to shut down. void shutdown(); + + /// @brief Return textual type of packet received by server + /// + /// Returns the name of valid packet received by the server (e.g. SOLICIT). + /// If the packet is unknown - or if it is a valid DHCP packet but not one + /// expected to be received by the server (such as an ADVERTISE), the string + /// "UNKNOWN" is returned. This method is used in debug messages. + /// + /// As the operation of the method does not depend on any server state, it + /// is declared static. + /// + /// @param type DHCPv4 packet type + /// + /// @return Pointer to "const" string containing the packet name. + /// Note that this string is statically allocated and MUST NOT + /// be freed by the caller. + static const char* serverReceivedPacketName(uint8_t type); + protected: /// @brief Processes incoming SOLICIT and returns response. /// diff --git a/src/bin/dhcp6/main.cc b/src/bin/dhcp6/main.cc index aebee90699..8eaf60cb97 100644 --- a/src/bin/dhcp6/main.cc +++ b/src/bin/dhcp6/main.cc @@ -14,13 +14,15 @@ #include #include -#include -#include -#include + #include -using namespace std; +#include +#include +#include + using namespace isc::dhcp; +using namespace std; /// This file contains entry point (main() function) for standard DHCPv6 server /// component for BIND10 framework. It parses command-line arguments and @@ -37,11 +39,10 @@ const char* const DHCP6_NAME = "b10-dhcp6"; void usage() { - cerr << "Usage: b10-dhcp6 [-v]" - << endl; - cerr << "\t-v: verbose output" << endl; - cerr << "\t-s: stand-alone mode (don't connect to BIND10)" << endl; - cerr << "\t-p number: specify non-standard port number 1-65535 " + cerr << "Usage: " << DHCP6_NAME << " [-v] [-s] [-p number]" << endl; + cerr << " -v: verbose output" << endl; + cerr << " -s: stand-alone mode (don't connect to BIND10)" << endl; + cerr << " -p number: specify non-standard port number 1-65535 " << "(useful for testing only)" << endl; exit(EXIT_FAILURE); } @@ -52,18 +53,19 @@ main(int argc, char* argv[]) { int ch; int port_number = DHCP6_SERVER_PORT; // The default. Any other values are // useful for testing only. + bool stand_alone = false; // Should be connect to BIND10 msgq? bool verbose_mode = false; // Should server be verbose? - bool stand_alone = false; // should be connect to BIND10 msgq? while ((ch = getopt(argc, argv, "vsp:")) != -1) { switch (ch) { case 'v': verbose_mode = true; - isc::log::denabled = true; break; + case 's': stand_alone = true; break; + case 'p': try { port_number = boost::lexical_cast(optarg); @@ -78,51 +80,45 @@ main(int argc, char* argv[]) { usage(); } break; - case ':': + default: usage(); } } + // Check for extraneous parameters. + if (argc > optind) { + usage(); + } + // Initialize logging. If verbose, we'll use maximum verbosity. isc::log::initLogger(DHCP6_NAME, (verbose_mode ? isc::log::DEBUG : isc::log::INFO), isc::log::MAX_DEBUG_LEVEL, NULL); - - cout << "b10-dhcp6: My pid=" << getpid() << ", binding to port " - << port_number << ", verbose " << (verbose_mode?"yes":"no") - << ", stand-alone=" << (stand_alone?"yes":"no") << endl; - - if (argc - optind > 0) { - usage(); - } + LOG_INFO(dhcp6_logger, DHCP6_STARTING); + LOG_DEBUG(dhcp6_logger, DBG_DHCP6_START, DHCP6_START_INFO) + .arg(getpid()).arg(port_number).arg(verbose_mode ? "yes" : "no") + .arg(stand_alone ? "yes" : "no" ); int ret = EXIT_SUCCESS; - try { - - cout << "b10-dhcp6: Initiating DHCPv6 server operation." << endl; - - /// @todo: pass verbose to the actual server once logging is implemented ControlledDhcpv6Srv server(port_number); - if (!stand_alone) { try { server.establishSession(); } catch (const std::exception& ex) { - cerr << "Failed to establish BIND10 session. " - "Running in stand-alone mode:" << ex.what() << endl; + LOG_ERROR(dhcp6_logger, DHCP6_SESSION_FAIL).arg(ex.what()); // Let's continue. It is useful to have the ability to run // DHCP server in stand-alone mode, e.g. for testing } } else { - cout << "Skipping connection to the BIND10 msgq." << endl; + LOG_DEBUG(dhcp6_logger, DBG_DHCP6_START, DHCP6_STANDALONE); } - server.run(); + LOG_INFO(dhcp6_logger, DHCP6_SHUTDOWN); } catch (const std::exception& ex) { - cerr << "[b10-dhcp6] Server failed: " << ex.what() << endl; + LOG_FATAL(dhcp6_logger, DHCP6_SERVER_FAILED).arg(ex.what()); ret = EXIT_FAILURE; } diff --git a/src/bin/dhcp6/tests/Makefile.am b/src/bin/dhcp6/tests/Makefile.am index 66dc252830..97d2d08572 100644 --- a/src/bin/dhcp6/tests/Makefile.am +++ b/src/bin/dhcp6/tests/Makefile.am @@ -42,10 +42,13 @@ if HAVE_GTEST TESTS += dhcp6_unittests -dhcp6_unittests_SOURCES = ../dhcp6_srv.h ../dhcp6_srv.cc ../ctrl_dhcp6_srv.cc -dhcp6_unittests_SOURCES += dhcp6_unittests.cc +dhcp6_unittests_SOURCES = dhcp6_unittests.cc dhcp6_unittests_SOURCES += dhcp6_srv_unittest.cc dhcp6_unittests_SOURCES += ctrl_dhcp6_srv_unittest.cc +dhcp6_unittests_SOURCES += ../dhcp6_srv.h ../dhcp6_srv.cc +dhcp6_unittests_SOURCES += ../dhcp6_log.h ../dhcp6_log.cc +dhcp6_unittests_SOURCES += ../dhcp6_messages.h ../dhcp6_messages.cc +dhcp6_unittests_SOURCES += ../ctrl_dhcp6_srv.cc if USE_CLANGPP # Disable unused parameter warning caused by some of the diff --git a/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc b/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc index 5e98e18ed2..20287066da 100644 --- a/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc +++ b/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2011-2012 Internet Systems Consortium, Inc. ("ISC") // // Permission to use, copy, modify, and/or distribute this software for any // purpose with or without fee is hereby granted, provided that the above @@ -223,4 +223,49 @@ TEST_F(Dhcpv6SrvTest, Solicit_basic) { // more checks to be implemented } +TEST_F(Dhcpv6SrvTest, serverReceivedPacketName) { + // Check all possible packet types + for (int itype = 0; itype < 256; ++itype) { + uint8_t type = itype; + + switch (type) { + case DHCPV6_CONFIRM: + EXPECT_STREQ("CONFIRM", Dhcpv6Srv::serverReceivedPacketName(type)); + break; + + case DHCPV6_DECLINE: + EXPECT_STREQ("DECLINE", Dhcpv6Srv::serverReceivedPacketName(type)); + break; + + case DHCPV6_INFORMATION_REQUEST: + EXPECT_STREQ("INFORMATION_REQUEST", + Dhcpv6Srv::serverReceivedPacketName(type)); + break; + + case DHCPV6_REBIND: + EXPECT_STREQ("REBIND", Dhcpv6Srv::serverReceivedPacketName(type)); + break; + + case DHCPV6_RELEASE: + EXPECT_STREQ("RELEASE", Dhcpv6Srv::serverReceivedPacketName(type)); + break; + + case DHCPV6_RENEW: + EXPECT_STREQ("RENEW", Dhcpv6Srv::serverReceivedPacketName(type)); + break; + + case DHCPV6_REQUEST: + EXPECT_STREQ("REQUEST", Dhcpv6Srv::serverReceivedPacketName(type)); + break; + + case DHCPV6_SOLICIT: + EXPECT_STREQ("SOLICIT", Dhcpv6Srv::serverReceivedPacketName(type)); + break; + + default: + EXPECT_STREQ("UNKNOWN", Dhcpv6Srv::serverReceivedPacketName(type)); + } + } } + +} // end of anonymous namespace diff --git a/src/bin/dhcp6/tests/dhcp6_test.py b/src/bin/dhcp6/tests/dhcp6_test.py index 399c370742..f3099b9a83 100644 --- a/src/bin/dhcp6/tests/dhcp6_test.py +++ b/src/bin/dhcp6/tests/dhcp6_test.py @@ -27,16 +27,27 @@ import fcntl class TestDhcpv6Daemon(unittest.TestCase): def setUp(self): - # don't redirect stdout/stderr here as we want to print out things + # Don't redirect stdout/stderr here as we want to print out things # during the test - pass + # + # However, we do want to set the logging lock directory to somewhere + # to which we can write - use the current working directory. We then + # set the appropriate environment variable. os.putenv() may be not + # supported on some platforms as suggested in + # http://docs.python.org/release/3.2/library/os.html?highlight=putenv#os.environ: + # "If the platform supports the putenv() function...". It was checked + # that it does not work on Ubuntu. To overcome this problem we access + # os.environ directly. + lockdir_envvar = "B10_LOCKFILE_DIR_FROM_BUILD" + if lockdir_envvar not in os.environ: + os.environ[lockdir_envvar] = os.getcwd() def tearDown(self): pass def runCommand(self, params, wait=1): """ - This method runs a command and returns a touple: (returncode, stdout, stderr) + This method runs a command and returns a tuple: (returncode, stdout, stderr) """ ## @todo: Convert this into generic method and reuse it in dhcp4 and dhcp6 @@ -79,9 +90,9 @@ class TestDhcpv6Daemon(unittest.TestCase): fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK) # There's potential problem if b10-dhcp4 prints out more - # than 4k of text + # than 16k of text try: - output = os.read(self.stdout_pipes[0], 4096) + output = os.read(self.stdout_pipes[0], 16384) except OSError: print("No data available from stdout") output = "" @@ -91,7 +102,7 @@ class TestDhcpv6Daemon(unittest.TestCase): output = "" try: - error = os.read(self.stderr_pipes[0], 4096) + error = os.read(self.stderr_pipes[0], 16384) except OSError: print("No data available on stderr") error = "" @@ -130,8 +141,8 @@ class TestDhcpv6Daemon(unittest.TestCase): print("Note: Purpose of some of the tests is to check if DHCPv6 server can be started,") print(" not that is can bind sockets correctly. Please ignore binding errors.") (returncode, output, error) = self.runCommand(["../b10-dhcp6", "-v"]) - - self.assertEqual( str(output).count("b10-dhcp6: Initiating DHCPv6 server operation."), 1) + output_text = str(output) + str(error) + self.assertEqual(output_text.count("DHCP6_STARTING"), 1) def test_portnumber_0(self): print("Check that specifying port number 0 is not allowed.") @@ -180,27 +191,19 @@ class TestDhcpv6Daemon(unittest.TestCase): def test_portnumber_nonroot(self): print("Check that specifying unprivileged port number will work.") - (returncode, output, error) = self.runCommand(['../b10-dhcp6', '-s', '-p', '10547']) - - # When invalid port number is specified, return code must not be success - # TODO: Temporarily commented out as socket binding on systems that do not have - # interface detection implemented currently fails. - # self.assertTrue(returncode == 0) - - self.assertEqual( str(output).count("opening sockets on port 10547"), 1) + # Check that there is a message about running with an unprivileged port + (returncode, output, error) = self.runCommand(['../b10-dhcp6', '-v', '-s', '-p', '10547']) + output_text = str(output) + str(error) + self.assertEqual(output_text.count("DHCP6_OPEN_SOCKET opening sockets on port 10547"), 1) def test_skip_msgq(self): print("Check that connection to BIND10 msgq can be disabled.") - (returncode, output, error) = self.runCommand(['../b10-dhcp6', '-s', '-p', '10547']) - - # When invalid port number is specified, return code must not be success - # TODO: Temporarily commented out as socket binding on systems that do not have - # interface detection implemented currently fails. - # self.assertTrue(returncode == 0) - - self.assertEqual( str(output).count("Skipping connection to the BIND10 msgq."), 1) - + # Check that the system outputs a message on one of its streams about running + # standalone. + (returncode, output, error) = self.runCommand(['../b10-dhcp6', '-v', '-s', '-p', '10547']) + output_text = str(output) + str(error) + self.assertEqual(output_text.count("DHCP6_STANDALONE"), 1) if __name__ == '__main__': unittest.main() diff --git a/src/bin/host/.gitignore b/src/bin/host/.gitignore index 0073523b39..01ef357a26 100644 --- a/src/bin/host/.gitignore +++ b/src/bin/host/.gitignore @@ -1 +1,2 @@ /b10-host +/b10-host.1 diff --git a/src/bin/host/Makefile.am b/src/bin/host/Makefile.am index 22fba652bc..42ef954ce1 100644 --- a/src/bin/host/Makefile.am +++ b/src/bin/host/Makefile.am @@ -17,14 +17,21 @@ b10_host_LDADD += $(top_builddir)/src/lib/util/libb10-util.la b10_host_LDADD += $(top_builddir)/src/lib/exceptions/libb10-exceptions.la man_MANS = b10-host.1 +DISTCLEANFILES = $(man_MANS) EXTRA_DIST = $(man_MANS) b10-host.xml .PHONY: man -if ENABLE_MAN +if GENERATE_DOCS man: b10-host.1 b10-host.1: b10-host.xml - xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-host.xml + @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-host.xml + +else + +$(man_MANS): + @echo Man generation disabled. Creating dummy $@. Configure with --enable-generate-docs to enable it. + @echo Man generation disabled. Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@ endif diff --git a/src/bin/host/b10-host.1 b/src/bin/host/b10-host.1 deleted file mode 100644 index 050f6a3185..0000000000 --- a/src/bin/host/b10-host.1 +++ /dev/null @@ -1,118 +0,0 @@ -'\" t -.\" Title: b10-host -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: May 4, 2011 -.\" Manual: BIND10 -.\" Source: BIND10 -.\" Language: English -.\" -.TH "B10\-HOST" "1" "May 4, 2011" "BIND10" "BIND10" -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.SH "NAME" -b10-host \- DNS lookup utility -.SH "SYNOPSIS" -.HP \w'\fBb10\-host\fR\ 'u -\fBb10\-host\fR [\fB\-a\fR] [\fB\-c\ \fR\fB\fIclass\fR\fR] [\fB\-d\fR] [\fB\-p\ \fR\fB\fIport\fR\fR] [\fB\-r\fR] [\fB\-t\ \fR\fB\fItype\fR\fR] [\fB\-v\fR] [\fIname\fR] [\fB\fIserver\fR\fR] -.SH "DESCRIPTION" -.PP -The -\fBb10\-host\fR -utility does DNS lookups\&. Its initial goal is to be a -\fBhost\fR(1) -clone, but also add a few features useful for BIND 10 development testing\&. -.PP -By default, it looks up the A, AAAA, and MX record sets for the -\fIname\fR\&. Optionally, you may select a name server to query against by adding the -\fIserver\fR -argument\&. -.SH "OPTIONS" -.PP -The arguments are as follows: -.PP -\fB\-a\fR -.RS 4 -Enable verbose mode and do a query for type ANY\&. (If the -\fB\-t\fR -option is also set, then the ANY query is not done, but it still uses verbose mode\&.) -.RE -.PP -\fB\-c \fR\fB\fIclass\fR\fR -.RS 4 -Define the class for the query\&. The default is IN (Internet)\&. -.RE -.PP -\fB\-d\fR -.RS 4 -Enable verbose output mode, including elapsed time in milliseconds\&. Verbose mode shows the header, question, answer, authority, and additional sections (if provided)\&. (Same as -\fB\-v\fR\&.) -.RE -.PP -\fB\-p \fR\fB\fIport\fR\fR -.RS 4 -Select an alternative port for the query\&. This may be a number or a service name\&. The default is 53 (domain)\&. This is not a standard feature of -\fBhost\fR(1)\&. -.RE -.PP -\fB\-r\fR -.RS 4 -Disable recursive processing by not setting the Recursion Desired flag in the query\&. -.RE -.PP -\fB\-t \fR\fB\fItype\fR\fR -.RS 4 -Select a specific resource record type for the query\&. By default, it looks up the A, AAAA, and MX record sets\&. -(This overrides the -\fB\-a\fR -option\&.) -.RE -.PP -\fB\-v\fR -.RS 4 -Same as -\fB\-d\fR -option\&. -.RE -.SH "COMPATIBILITY / BUGS" -.PP - -\fBb10\-host\fR -does not do reverse lookups by default yet (by detecting if name is a IPv4 or IPv6 address)\&. -.PP -Unknown -\fB\-c\fR -class or -\fB\-t\fR -type causes -\fBb10\-host\fR -to Abort\&. -.PP -Not all types are supported yet for formatting\&. Not all switches are supported yet\&. -.PP -It doesn\'t use -/etc/resolv\&.conf -at this time\&. The default name server used is 127\&.0\&.0\&.1\&. -.PP - -\fB\-p\fR -is not a standard feature\&. -.SH "HISTORY" -.PP -The C++ version of -\fBb10\-host\fR -was started in October 2009 by Jeremy C\&. Reed of ISC\&. Its usage and output were based on the standard -\fBhost\fR -command\&. -.SH "COPYRIGHT" -.br -Copyright \(co 2011 Internet Systems Consortium, Inc. ("ISC") -.br diff --git a/src/bin/loadzone/.gitignore b/src/bin/loadzone/.gitignore index 86761ee814..59f0bb58e1 100644 --- a/src/bin/loadzone/.gitignore +++ b/src/bin/loadzone/.gitignore @@ -1,3 +1,4 @@ /b10-loadzone /b10-loadzone.py /run_loadzone.sh +/b10-loadzone.8 diff --git a/src/bin/loadzone/Makefile.am b/src/bin/loadzone/Makefile.am index 74386ae891..790f75722f 100644 --- a/src/bin/loadzone/Makefile.am +++ b/src/bin/loadzone/Makefile.am @@ -5,12 +5,19 @@ noinst_SCRIPTS = run_loadzone.sh CLEANFILES = b10-loadzone man_MANS = b10-loadzone.8 +DISTCLEANFILES = $(man_MANS) EXTRA_DIST = $(man_MANS) b10-loadzone.xml -if ENABLE_MAN +if GENERATE_DOCS b10-loadzone.8: b10-loadzone.xml - xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-loadzone.xml + @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-loadzone.xml + +else + +$(man_MANS): + @echo Man generation disabled. Creating dummy $@. Configure with --enable-generate-docs to enable it. + @echo Man generation disabled. Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@ endif diff --git a/src/bin/loadzone/b10-loadzone.8 b/src/bin/loadzone/b10-loadzone.8 deleted file mode 100644 index cf1c26bfb1..0000000000 --- a/src/bin/loadzone/b10-loadzone.8 +++ /dev/null @@ -1,80 +0,0 @@ -'\" t -.\" Title: b10-loadzone -.\" Author: [see the "AUTHORS" section] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: March 26, 2012 -.\" Manual: BIND10 -.\" Source: BIND10 -.\" Language: English -.\" -.TH "B10\-LOADZONE" "8" "March 26, 2012" "BIND10" "BIND10" -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.SH "NAME" -b10-loadzone \- Load DNS Zone File -.SH "SYNOPSIS" -.HP \w'\fBb10\-loadzone\fR\ 'u -\fBb10\-loadzone\fR [\fB\-d\ \fR\fB\fIdatabase\fR\fR] [\fB\-o\ \fR\fB\fIorigin\fR\fR] {filename} -.SH "DESCRIPTION" -.PP -The -\fBb10\-loadzone\fR -utility loads a RFC 1035 style DNS master zone file and stores it in a BIND 10 ready data source format\&. Master files are text files that contain DNS Resource Records in text form\&. -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBNote\fR -.ps -1 -.br -.sp -Currently only the SQLITE3 data source is supported\&. -.sp .5v -.RE -.PP -Some control entries (aka directives) are supported\&. $ORIGIN is followed by a domain name, and sets the the origin that will be used for relative domain names in subsequent records\&. $INCLUDE is followed by a filename to load\&. -The previous origin is restored after the file is included\&. -$TTL is followed by a time\-to\-live value which is used by any following records that don\'t specify a TTL\&. -.PP -When re\-loading an existing zone, the prior version is completely removed\&. While the new version of the zone is being loaded, the old version remains accessible to queries\&. After the new version is completely loaded, the old version is swapped out and replaced with the new one in a single operation\&. -.SH "ARGUMENTS" -.PP -\-d \fIdatabase\fR -.RS 4 -Defines the filename for the database\&. The default is -/usr/local/var/bind10\-devel/zone\&.sqlite3\&. -.RE -.PP -\-o \fIorigin\fR -.RS 4 -Defines the default origin for the zone file records\&. -.RE -.SH "FILES" -.PP -.SH "SEE ALSO" -.PP - -\fBb10-auth\fR(8), -\fBbind10\fR(8)\&. -.SH "AUTHORS" -.PP -The -\fBb10\-loadzone\fR -tool was initial written by Evan Hunt of ISC\&. -.SH "COPYRIGHT" -.br -Copyright \(co 2010 Internet Systems Consortium, Inc. ("ISC") -.br diff --git a/src/bin/loadzone/tests/correct/Makefile.am b/src/bin/loadzone/tests/correct/Makefile.am index fb882bae4b..a3c67d4a9c 100644 --- a/src/bin/loadzone/tests/correct/Makefile.am +++ b/src/bin/loadzone/tests/correct/Makefile.am @@ -12,6 +12,7 @@ EXTRA_DIST += ttl1.db EXTRA_DIST += ttl2.db EXTRA_DIST += ttlext.db EXTRA_DIST += example.db +EXTRA_DIST += comment.db noinst_SCRIPTS = correct_test.sh diff --git a/src/bin/loadzone/tests/correct/comment.db b/src/bin/loadzone/tests/correct/comment.db new file mode 100644 index 0000000000..79ce9b76a8 --- /dev/null +++ b/src/bin/loadzone/tests/correct/comment.db @@ -0,0 +1,8 @@ +; Test removal of comments and not removal from strings. +; We had a bug - see #2188. +comment.example.com. 60 IN SOA ns1.example.com. hostmaster.example.com. 1 43200 900 1814400 7200 +comment.example.com. 60 IN NS ns1.example.com. +comment.example.com. 60 IN TXT "Simple text" +comment.example.com. 60 IN TXT "; No comment" +comment.example.com. 60 IN TXT "Also no comment here" ; But here it is a comment +comment.example.com. 60 IN TXT "A combination ; see?" ; This is a "comment diff --git a/src/bin/loadzone/tests/correct/correct_test.sh.in b/src/bin/loadzone/tests/correct/correct_test.sh.in index d944451034..e3f6a8414a 100755 --- a/src/bin/loadzone/tests/correct/correct_test.sh.in +++ b/src/bin/loadzone/tests/correct/correct_test.sh.in @@ -48,6 +48,9 @@ ${LOADZONE_PATH}/b10-loadzone -d ${TEST_OUTPUT_PATH}/zone.sqlite3 ttlext.db >> / echo "loadzone example.com. from example.db" ${LOADZONE_PATH}/b10-loadzone -d ${TEST_OUTPUT_PATH}/zone.sqlite3 example.db >> /dev/null +echo "loadzone comment.example.com. from comment.db" +${LOADZONE_PATH}/b10-loadzone -d ${TEST_OUTPUT_PATH}/zone.sqlite3 comment.db >> /dev/null + echo "I:test master file \$INCLUDE semantics" echo "I:test master file BIND 8 compatibility TTL and \$TTL semantics" echo "I:test master file RFC1035 TTL and \$TTL semantics" @@ -55,6 +58,7 @@ echo "I:test master file BIND8 compatibility and mixed \$INCLUDE with \$TTL sema echo "I:test master file RFC1035 TTL and mixed \$INCLUDE with \$TTL semantics" echo "I:test master file BIND9 extenstion of TTL" echo "I:test master file RFC1035 missing CLASS, TTL, NAME semantics" +echo "I:test master file comments" ${PYTHON_EXEC} ${TEST_FILE_PATH}/get_zonedatas.py ${TEST_OUTPUT_PATH}/zone.sqlite3 > ${TEST_OUTPUT_PATH}/test.out echo "Compare test results." diff --git a/src/bin/loadzone/tests/correct/get_zonedatas.py b/src/bin/loadzone/tests/correct/get_zonedatas.py index faa563449c..5bef90d9fe 100644 --- a/src/bin/loadzone/tests/correct/get_zonedatas.py +++ b/src/bin/loadzone/tests/correct/get_zonedatas.py @@ -1,7 +1,7 @@ from isc.datasrc import sqlite3_ds import sys ZONE_FILE = sys.argv[1] -zonename_set = ["include.", "ttl1.", "ttl2.", "mix1.", "mix2.", "ttlext.", "example.com."] +zonename_set = ["include.", "ttl1.", "ttl2.", "mix1.", "mix2.", "ttlext.", "example.com.", "comment.example.com."] for zone_name in zonename_set: for rr_data in sqlite3_ds.get_zone_datas(zone_name, ZONE_FILE): data_len = len(rr_data[2]) diff --git a/src/bin/loadzone/tests/correct/known.test.out b/src/bin/loadzone/tests/correct/known.test.out index 8e2fe3cf3c..eec692e976 100644 --- a/src/bin/loadzone/tests/correct/known.test.out +++ b/src/bin/loadzone/tests/correct/known.test.out @@ -77,3 +77,9 @@ ns2.example.com. 80 IN A 1.1.1.1 ns3.example.com. 60 IN A 2.2.2.2 ns4.example.com. 60 IN A 3.3.3.3 ns5.example.com. 90 IN A 4.4.4.4 +comment.example.com. 60 IN SOA ns1.example.com. hostmaster.example.com. 1 43200 900 1814400 7200 +comment.example.com. 60 IN NS ns1.example.com. +comment.example.com. 60 IN TXT "Simple text" +comment.example.com. 60 IN TXT "; No comment" +comment.example.com. 60 IN TXT "Also no comment here" +comment.example.com. 60 IN TXT "A combination ; see?" diff --git a/src/bin/msgq/.gitignore b/src/bin/msgq/.gitignore index ee1d94228d..ecd1bad2cb 100644 --- a/src/bin/msgq/.gitignore +++ b/src/bin/msgq/.gitignore @@ -1,3 +1,4 @@ /b10-msgq /msgq.py /run_msgq.sh +/b10-msgq.8 diff --git a/src/bin/msgq/Makefile.am b/src/bin/msgq/Makefile.am index 908cab5dfd..4244d07c42 100644 --- a/src/bin/msgq/Makefile.am +++ b/src/bin/msgq/Makefile.am @@ -7,12 +7,19 @@ pkglibexec_SCRIPTS = b10-msgq CLEANFILES = b10-msgq msgq.pyc man_MANS = b10-msgq.8 +DISTCLEANFILES = $(man_MANS) EXTRA_DIST = $(man_MANS) msgq.xml -if ENABLE_MAN +if GENERATE_DOCS b10-msgq.8: msgq.xml - xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/msgq.xml + @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/msgq.xml + +else + +$(man_MANS): + @echo Man generation disabled. Creating dummy $@. Configure with --enable-generate-docs to enable it. + @echo Man generation disabled. Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@ endif diff --git a/src/bin/msgq/b10-msgq.8 b/src/bin/msgq/b10-msgq.8 deleted file mode 100644 index b3184911bd..0000000000 --- a/src/bin/msgq/b10-msgq.8 +++ /dev/null @@ -1,125 +0,0 @@ -'\" t -.\" Title: b10-msgq -.\" Author: [see the "AUTHORS" section] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: June 25, 2012 -.\" Manual: BIND10 -.\" Source: BIND10 -.\" Language: English -.\" -.TH "B10\-MSGQ" "8" "June 25, 2012" "BIND10" "BIND10" -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.SH "NAME" -b10-msgq \- message routing daemon for the Command Channel -.SH "SYNOPSIS" -.HP \w'\fBb10\-msgq\fR\ 'u -\fBb10\-msgq\fR [\fB\-s\ \fR\fB\fIfile\fR\fR] [\fB\-v\fR] [\fB\-\-socket\-file\ \fR\fB\fIfile\fR\fR] [\fB\-\-verbose\fR] -.SH "DESCRIPTION" -.PP -The -\fBb10\-msgq\fR -daemon provides message routing for the Command Channel\&. -.PP -The Command Channel is a message bus and subscription manager\&. Programs may subscribe to certain groups to receive messages for that group\&. Every new connection to -\fBb10\-msgq\fR -is assigned a unique identifier \-\- this is the local name\&. The commands it handles are: -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} - -\fBgetlname\fR -\(em receive local name\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} - -\fBsend\fR -\(em send a message to defined subscribers\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} - -\fBsubscribe\fR -\(em add a subscription\&. This means it is a listener for messages for a specific group\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} - -\fBunsubscribe\fR -\(em remove a subscription\&. -.RE -.sp -.RE -.PP -The -\fBb10\-msgq\fR -daemon may be cleanly stopped by sending the SIGTERM signal to the process\&. This shutdown does not notify the subscribers\&. -.SH "OPTIONS" -.PP -The arguments are as follows: -.PP -\fB\-s \fR\fB\fIfile\fR\fR, \fB\-\-socket\-file \fR\fB\fIfile\fR\fR -.RS 4 -The UNIX domain socket file this daemon will use\&. The default is -/usr/local/var/bind10\-devel/msg_socket\&. -.RE -.PP -\fB\-v\fR, \fB\-\-verbose\fR -.RS 4 -Enabled verbose mode\&. This enables diagnostic messages to STDERR\&. Displays more about what -\fBb10\-msgq\fR -is doing\&. -.RE -.SH "SEE ALSO" -.PP - -\fBbind10\fR(8), -BIND 10 Guide\&. -.SH "AUTHORS" -.PP -The -\fBb10\-msgq\fR -daemon and Control Channel specification were initially designed by Michael Graff of ISC\&. -.SH "HISTORY" -.PP -The python version was first coded in December 2009\&. The C version with now deprecated wire format was coded in September 2009\&. -.SH "COPYRIGHT" -.br -Copyright \(co 2010 Internet Systems Consortium, Inc. ("ISC") -.br diff --git a/src/bin/resolver/.gitignore b/src/bin/resolver/.gitignore index 95abd500c2..b3abbc9b7c 100644 --- a/src/bin/resolver/.gitignore +++ b/src/bin/resolver/.gitignore @@ -5,3 +5,4 @@ /resolver_messages.h /spec_config.h /spec_config.h.pre +/b10-resolver.8 diff --git a/src/bin/resolver/Makefile.am b/src/bin/resolver/Makefile.am index 83bf8b30a2..47e242c1b4 100644 --- a/src/bin/resolver/Makefile.am +++ b/src/bin/resolver/Makefile.am @@ -23,12 +23,19 @@ CLEANFILES += resolver.spec spec_config.h CLEANFILES += resolver_messages.cc resolver_messages.h man_MANS = b10-resolver.8 +DISTCLEANFILES = $(man_MANS) EXTRA_DIST = $(man_MANS) b10-resolver.xml resolver_messages.mes -if ENABLE_MAN +if GENERATE_DOCS b10-resolver.8: b10-resolver.xml - xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-resolver.xml + @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-resolver.xml + +else + +$(man_MANS): + @echo Man generation disabled. Creating dummy $@. Configure with --enable-generate-docs to enable it. + @echo Man generation disabled. Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@ endif diff --git a/src/bin/resolver/b10-resolver.8 b/src/bin/resolver/b10-resolver.8 deleted file mode 100644 index 34eb61015b..0000000000 --- a/src/bin/resolver/b10-resolver.8 +++ /dev/null @@ -1,149 +0,0 @@ -'\" t -.\" Title: b10-resolver -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: February 28, 2012 -.\" Manual: BIND10 -.\" Source: BIND10 -.\" Language: English -.\" -.TH "B10\-RESOLVER" "8" "February 28, 2012" "BIND10" "BIND10" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.SH "NAME" -b10-resolver \- Recursive DNS server -.SH "SYNOPSIS" -.HP \w'\fBb10\-resolver\fR\ 'u -\fBb10\-resolver\fR [\fB\-v\fR] -.SH "DESCRIPTION" -.PP -The -\fBb10\-resolver\fR -daemon provides the BIND 10 recursive DNS server\&. Normally it is started by the -\fBbind10\fR(8) -boss process\&. -.PP -This daemon communicates with other BIND 10 components over a -\fBb10-msgq\fR(8) -C\-Channel connection\&. If this connection is not established, -\fBb10\-resolver\fR -will exit\&. -.PP -It also receives its configurations from -\fBb10-cfgmgr\fR(8)\&. -.SH "OPTIONS" -.PP -The arguments are as follows: -.PP -\fB\-v\fR -.RS 4 -Enable verbose mode\&. This sets logging to the maximum debugging level\&. -.RE -.SH "CONFIGURATION AND COMMANDS" -.PP -The configurable settings are: -.PP - -\fIforward_addresses\fR -defines the list of addresses and ports that -\fBb10\-resolver\fR -should forward queries to\&. Defining this enables forwarding\&. -.PP - -\fIlisten_on\fR -is a list of addresses and ports for -\fBb10\-resolver\fR -to listen on\&. The list items are the -\fIaddress\fR -string and -\fIport\fR -number\&. The defaults are address ::1 port 53 and address 127\&.0\&.0\&.1 port 53\&. -.PP - - - - - - -\fIquery_acl\fR -is a list of query access control rules\&. The list items are the -\fIaction\fR -string and the -\fIfrom\fR -or -\fIkey\fR -strings\&. The possible actions are ACCEPT, REJECT and DROP\&. The -\fIfrom\fR -is a remote (source) IPv4 or IPv6 address or special keyword\&. The -\fIkey\fR -is a TSIG key name\&. The default configuration accepts queries from 127\&.0\&.0\&.1 and ::1\&. -.PP - -\fIretries\fR -is the number of times to retry (resend query) after a query timeout (\fItimeout_query\fR)\&. The default is 3\&. -.PP - -\fIroot_addresses\fR -is a list of addresses and ports for -\fBb10\-resolver\fR -to use directly as root servers to start resolving\&. The list items are the -\fIaddress\fR -string and -\fIport\fR -number\&. By default, a hardcoded address for l\&.root\-servers\&.net (199\&.7\&.83\&.42 or 2001:500:3::42) is used\&. -.PP - -\fItimeout_client\fR -is the number of milliseconds to wait before timing out the incoming client query\&. If set to \-1, this timeout is disabled\&. The default is 4000\&. After this timeout, a SERVFAIL is sent back to the client asking the question\&. (The lookup may continue after the timeout, but a later answer is not returned for the now\-past query\&.) -.PP - -\fItimeout_lookup\fR -is the number of milliseconds before it stops trying the query\&. If set to \-1, this timeout is disabled\&. The default is 30000\&. -.PP - - -\fItimeout_query\fR -is the number of milliseconds to wait before it retries a query\&. If set to \-1, this timeout is disabled\&. The default is 2000\&. -.PP -The configuration command is: -.PP - -\fBshutdown\fR -exits -\fBb10\-resolver\fR\&. This has an optional -\fIpid\fR -argument to select the process ID to stop\&. (Note that the BIND 10 boss process may restart this service if configured\&.) -.SH "SEE ALSO" -.PP - -\fBb10-cfgmgr\fR(8), -\fBb10-cmdctl\fR(8), -\fBb10-msgq\fR(8), -\fBbind10\fR(8), -BIND 10 Guide\&. -.SH "HISTORY" -.PP -The -\fBb10\-resolver\fR -daemon was first coded in September 2010\&. The initial implementation only provided forwarding\&. Iteration was introduced in January 2011\&. Caching was implemented in February 2011\&. Access control was introduced in June 2011\&. -.SH "COPYRIGHT" -.br -Copyright \(co 2010-2012 Internet Systems Consortium, Inc. ("ISC") -.br diff --git a/src/bin/sockcreator/.gitignore b/src/bin/sockcreator/.gitignore index 29851849cd..6d9d0514dd 100644 --- a/src/bin/sockcreator/.gitignore +++ b/src/bin/sockcreator/.gitignore @@ -1 +1,2 @@ /b10-sockcreator +/b10-sockcreator.8 diff --git a/src/bin/sockcreator/Makefile.am b/src/bin/sockcreator/Makefile.am index 42b8c34961..4e66eb7154 100644 --- a/src/bin/sockcreator/Makefile.am +++ b/src/bin/sockcreator/Makefile.am @@ -12,6 +12,23 @@ pkglibexecdir = $(libexecdir)/@PACKAGE@ CLEANFILES = *.gcno *.gcda +man_MANS = b10-sockcreator.8 +DISTCLEANFILES = $(man_MANS) +EXTRA_DIST = $(man_MANS) b10-sockcreator.xml + +if GENERATE_DOCS + +b10-sockcreator.8: b10-sockcreator.xml + @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-sockcreator.xml + +else + +$(man_MANS): + @echo Man generation disabled. Creating dummy $@. Configure with --enable-generate-docs to enable it. + @echo Man generation disabled. Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@ + +endif + pkglibexec_PROGRAMS = b10-sockcreator b10_sockcreator_SOURCES = sockcreator.cc sockcreator.h main.cc diff --git a/src/bin/sockcreator/b10-sockcreator.xml b/src/bin/sockcreator/b10-sockcreator.xml new file mode 100644 index 0000000000..6c51debd2b --- /dev/null +++ b/src/bin/sockcreator/b10-sockcreator.xml @@ -0,0 +1,96 @@ +]> + + + + + + February 28, 2012 + + + + b10-sockcreator + 8 + BIND10 + + + + b10-sockcreator + socket creation daemon + + + + + 2012 + Internet Systems Consortium, Inc. ("ISC") + + + + + + b10-sockcreator + + + + + DESCRIPTION + + The b10-sockcreator daemon's entire job + is to create sockets and assign names to them. + It is started by + bind108 + and communicates with it. + The new socket is sent over a file descriptor. + + + + + + The b10-sockcreator daemon will exit + if there is an unrecoverable error or unknown command. + + + + + + SEE ALSO + + + bind108 + , + BIND 10 Guide. + + + + + + AUTHORS + + The b10-sockcreator daemon + was initially designed by Michal Vaner of CZNIC. + + + + + + + diff --git a/src/bin/stats/.gitignore b/src/bin/stats/.gitignore index 7ff3797fde..8dacd7e47a 100644 --- a/src/bin/stats/.gitignore +++ b/src/bin/stats/.gitignore @@ -2,3 +2,5 @@ /b10-stats-httpd /stats.py /stats_httpd.py +/b10-stats-httpd.8 +/b10-stats.8 diff --git a/src/bin/stats/Makefile.am b/src/bin/stats/Makefile.am index 63e2a3b38b..ef678d4181 100644 --- a/src/bin/stats/Makefile.am +++ b/src/bin/stats/Makefile.am @@ -20,18 +20,25 @@ CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/stats_httpd_messages.py CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/stats_httpd_messages.pyc man_MANS = b10-stats.8 b10-stats-httpd.8 +DISTCLEANFILES = $(man_MANS) EXTRA_DIST = $(man_MANS) b10-stats.xml b10-stats-httpd.xml EXTRA_DIST += stats.spec stats-httpd.spec EXTRA_DIST += stats-httpd-xml.tpl stats-httpd-xsd.tpl stats-httpd-xsl.tpl EXTRA_DIST += stats_messages.mes stats_httpd_messages.mes -if ENABLE_MAN +if GENERATE_DOCS b10-stats.8: b10-stats.xml - xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-stats.xml + @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-stats.xml b10-stats-httpd.8: b10-stats-httpd.xml - xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-stats-httpd.xml + @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-stats-httpd.xml + +else + +$(man_MANS): + @echo Man generation disabled. Creating dummy $@. Configure with --enable-generate-docs to enable it. + @echo Man generation disabled. Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@ endif diff --git a/src/bin/stats/b10-stats-httpd.8 b/src/bin/stats/b10-stats-httpd.8 deleted file mode 100644 index 27b5f4df4b..0000000000 --- a/src/bin/stats/b10-stats-httpd.8 +++ /dev/null @@ -1,126 +0,0 @@ -'\" t -.\" Title: b10-stats-httpd -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: February 28, 2012 -.\" Manual: BIND10 -.\" Source: BIND10 -.\" Language: English -.\" -.TH "B10\-STATS\-HTTPD" "8" "February 28, 2012" "BIND10" "BIND10" -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.SH "NAME" -b10-stats-httpd \- BIND 10 HTTP server for HTTP/XML interface of statistics -.SH "SYNOPSIS" -.HP \w'\fBb10\-stats\-httpd\fR\ 'u -\fBb10\-stats\-httpd\fR [\fB\-v\fR]| [\fB\-\-verbose\fR] -.SH "DESCRIPTION" -.PP - -\fBb10\-stats\-httpd\fR -is a standalone HTTP server\&. It is intended for HTTP/XML interface for statistics module\&. This server process runs as a process separated from the process of the BIND 10 Stats daemon (\fBb10\-stats\fR)\&. The server is initially executed by the BIND 10 boss process (\fBbind10\fR) and eventually exited by it\&. The server is intended to serve requests by HTTP clients like web browsers and third\-party modules\&. When the server is asked, it requests BIND 10 statistics data or its schema from -\fBb10\-stats\fR -which sends the data back in Python dictionary format, and the server converts it into XML format\&. The server sends it to the HTTP client\&. The server can send three types of documents, which are XML (Extensible Markup Language), XSD (XML Schema definition) and XSL (Extensible Stylesheet Language)\&. The XML document is the statistics data of BIND 10, the XSD document is the data schema of it, and the XSL document is the style sheet to be showed for the web browsers\&. There is different URL for each document\&. But please note that you would be redirected to the URL of XML document if you request the URL of the root document\&. For example, you would be redirected to http://127\&.0\&.0\&.1:8000/bind10/statistics/xml if you request http://127\&.0\&.0\&.1:8000/\&. Please see the manual and the spec file of -\fBb10\-stats\fR -for more details about the items of BIND 10 statistics\&. The server uses CC session in communication with -\fBb10\-stats\fR\&. CC session is provided by -\fBb10\-msgq\fR -which is started by -\fBbind10\fR -in advance\&. The server is implemented by HTTP\-server libraries included in Python 3\&. The server obtains the configuration from the config manager (\fBb10\-cfgmgr\fR) in runtime\&. Please see below for more details about this spec file and configuration of the server\&. -.SH "OPTIONS" -.PP -The argument is as follow: -.PP -\fB\-v\fR, \fB\-\-verbose\fR -.RS 4 - -\fBb10\-stats\-httpd\fR -switches to verbose mode and sends verbose messages to STDOUT\&. -.RE -.SH "FILES" -.PP - -/usr/local/share/bind10\-devel/stats\-httpd\&.spec -\(em the spec file of -\fBb10\-stats\-httpd\fR\&. This file contains configurable settings of -\fBb10\-stats\-httpd\fR\&. This setting can be configured in runtime via -bindctl(1)\&. Please see the manual of -bindctl(1) -about how to configure the settings\&. -.PP - -/usr/local/share/bind10\-devel/stats\-httpd\-xml\&.tpl -\(em the template file of XML document\&. -.PP - -/usr/local/share/bind10\-devel/stats\-httpd\-xsd\&.tpl -\(em the template file of XSD document\&. -.PP - -/usr/local/share/bind10\-devel/stats\-httpd\-xsl\&.tpl -\(em the template file of XSL document\&. -.SH "CONFIGURATION AND COMMANDS" -.PP -The configurable setting in -stats\-httpd\&.spec -is: -.PP -\fIlisten_on\fR -.RS 4 -a list of pairs of address and port for -\fBb10\-stats\-httpd\fR -to listen HTTP requests on\&. The pair consists of the -\fIaddress\fR -string and -\fIport\fR -number\&. The default setting is the list of address 127\&.0\&.0\&.1 port 8000\&. If the server is started by the default setting being left, for example, the URL for XML document is http://127\&.0\&.0\&.1:8000/bind10/statistics/xml\&. And also IPv6 addresses can be configured and they works in the runtime environment for dual stack\&. You can change the settings through -bindctl(8)\&. -.RE -.PP -The commands in -stats\-httpd\&.spec -are: -.PP -\fBstatus\fR -.RS 4 -shows the status of -\fBb10\-stats\-httpd\fR -with its PID\&. -.RE -.PP -\fBshutdown\fR -.RS 4 -exits the -\fBb10\-stats\-httpd\fR -process\&. This has an optional -\fIpid\fR -argument to select the process ID to stop\&. (Note that the BIND 10 boss process may restart this service if configured\&.) -.RE -.SH "SEE ALSO" -.PP - -\fBb10-stats\fR(8), -\fBb10-msgq\fR(8), -\fBb10-cfgmgr\fR(8), -\fBbind10\fR(8), -\fBbindctl\fR(1), -BIND 10 Guide\&. -.SH "HISTORY" -.PP - -\fBb10\-stats\-httpd\fR -was designed and implemented by Naoki Kambe of JPRS in March 2011\&. -.SH "COPYRIGHT" -.br -Copyright \(co 2011-2012 Internet Systems Consortium, Inc. ("ISC") -.br diff --git a/src/bin/stats/b10-stats.8 b/src/bin/stats/b10-stats.8 deleted file mode 100644 index 56ee4d0821..0000000000 --- a/src/bin/stats/b10-stats.8 +++ /dev/null @@ -1,170 +0,0 @@ -'\" t -.\" Title: b10-stats -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.77.1 -.\" Date: June 20, 2012 -.\" Manual: BIND10 -.\" Source: BIND10 -.\" Language: English -.\" -.TH "B10\-STATS" "8" "June 20, 2012" "BIND10" "BIND10" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.SH "NAME" -b10-stats \- BIND 10 statistics module -.SH "SYNOPSIS" -.HP \w'\fBb10\-stats\fR\ 'u -\fBb10\-stats\fR [\fB\-v\fR] [\fB\-\-verbose\fR] -.SH "DESCRIPTION" -.PP -The -\fBb10\-stats\fR -daemon collects statistics data from each BIND 10 module\&. Its statistics information may be reported via -\fBbindctl\fR -or -\fBb10\-stats\-httpd\fR\&. It is started by -\fBbind10\fR -and communicates by using the Command Channel by -\fBb10\-msgq\fR -with other modules like -\fBbind10\fR, -\fBb10\-auth\fR -and so on\&. -\fBb10\-stats\fR -periodically requests statistics data to each module and receives\&. The interval time can be configured via -\fBbindctl\fR\&. -\fBb10\-stats\fR -cannot accept any command from other modules for updating statistics data\&. The stats module collects data and aggregates it\&. -\fBb10\-stats\fR -invokes an internal command for -\fBbind10\fR -after its initial starting to make sure it collects statistics data from -\fBbind10\fR\&. -.SH "OPTIONS" -.PP -The arguments are as follows: -.PP -\fB\-v\fR, \fB\-\-verbose\fR -.RS 4 -This enables maximum debug logging\&. -.RE -.SH "CONFIGURATION AND COMMANDS" -.PP -The configurable setting in -stats\&.spec -is: -.PP -\fIpoll\-interval\fR -.RS 4 -is a timer interval in seconds for -\fBb10\-stats\fR -to polling each module for its statistics data\&. The default is 60 second\&. Polling can be disabled by setting to 0\&. The type of the value should be an unsigned integer\&. Setting to a negative integer is ignored\&. -.RE -.PP -The configuration commands are: -.PP - -\fBshow\fR -will send the statistics data in JSON format\&. By default, it outputs all the statistics data it has collected\&. An optional item name may be specified to receive individual output\&. -.PP - -\fBshowschema\fR -will send the schema of the statistics data in JSON format\&. The output is equivalent to the statistics part of -stats\&.spec\&. -.PP - -\fBshutdown\fR -will shutdown the -\fBb10\-stats\fR -process\&. This has an optional -\fIpid\fR -argument to select the process ID to stop\&. (Note that the BIND 10 boss process may restart this service if configured\&.) -.PP - -\fBstatus\fR -simply indicates that the daemon is running\&. -.SH "STATISTICS DATA" -.PP -The -\fBb10\-stats\fR -daemon contains these -\(lqStats\(rq -statistics: -.PP -boot_time -.RS 4 -The date and time when this daemon was started in ISO 8601 format\&. This is a constant which can\*(Aqt be reset except by restarting -\fBb10\-stats\fR\&. -.RE -.PP -last_update_time -.RS 4 -The date and time (in ISO 8601 format) when this daemon last received data from another component\&. -.RE -.PP -lname -.RS 4 -This is the name used for the -\fBb10\-msgq\fR -command\-control channel\&. (This is a constant which can\*(Aqt be reset except by restarting -\fBb10\-stats\fR\&.) -.RE -.PP -report_time -.RS 4 -The latest report date and time in ISO 8601 format\&. -.RE -.PP -start_time -.RS 4 -This is the date and time (in ISO 8601 format) when this daemon started collecting data\&. -.RE -.PP -timestamp -.RS 4 -The current date and time represented in seconds since UNIX epoch (1970\-01\-01T00:00:00Z) with precision (delimited with a period) up to one hundred thousandth of second\&. -.RE -.PP -See other manual pages for explanations for their statistics that are kept track by -\fBb10\-stats\fR\&. -.SH "FILES" -.PP -/usr/local/share/bind10\-devel/stats\&.spec -\(em This is a spec file for -\fBb10\-stats\fR\&. It contains commands for -\fBb10\-stats\fR\&. They can be invoked via -bindctl(1)\&. -.SH "SEE ALSO" -.PP - -\fBb10-stats-httpd\fR(8), -\fBbind10\fR(8), -\fBbindctl\fR(1), -\fBb10-auth\fR(8), -BIND 10 Guide\&. -.SH "HISTORY" -.PP -The -\fBb10\-stats\fR -daemon was initially designed and implemented by Naoki Kambe of JPRS in October 2010\&. -.SH "COPYRIGHT" -.br -Copyright \(co 2010-2012 Internet Systems Consortium, Inc. ("ISC") -.br diff --git a/src/bin/sysinfo/.gitignore b/src/bin/sysinfo/.gitignore index 7a91274249..9194aff8ec 100644 --- a/src/bin/sysinfo/.gitignore +++ b/src/bin/sysinfo/.gitignore @@ -1,2 +1,3 @@ /isc-sysinfo /sysinfo.py +/isc-sysinfo.1 diff --git a/src/bin/sysinfo/Makefile.am b/src/bin/sysinfo/Makefile.am index 8023f51543..25a3556b09 100644 --- a/src/bin/sysinfo/Makefile.am +++ b/src/bin/sysinfo/Makefile.am @@ -12,11 +12,18 @@ MAN1_FILES = \ man_MANS = \ $(MAN1_FILES:.xml=.1) +DISTCLEANFILES = $(man_MANS) -if ENABLE_MAN +if GENERATE_DOCS .xml.1: - xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< + @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< + +else + +$(man_MANS): + @echo Man generation disabled. Creating dummy $@. Configure with --enable-generate-docs to enable it. + @echo Man generation disabled. Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@ endif diff --git a/src/bin/sysinfo/isc-sysinfo.1 b/src/bin/sysinfo/isc-sysinfo.1 deleted file mode 100644 index e923fdd752..0000000000 --- a/src/bin/sysinfo/isc-sysinfo.1 +++ /dev/null @@ -1,66 +0,0 @@ -'\" t -.\" Title: isc-sysinfo -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: June 26, 2012 -.\" Manual: BIND10 -.\" Source: BIND10 -.\" Language: English -.\" -.TH "ISC\-SYSINFO" "1" "June 26, 2012" "BIND10" "BIND10" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.SH "NAME" -isc-sysinfo \- BIND 10 system information display tool -.SH "SYNOPSIS" -.HP \w'\fBisc\-sysinfo\fR\ 'u -\fBisc\-sysinfo\fR -.SH "DESCRIPTION" -.PP -The -\fBisc\-sysinfo\fR -program collects and outputs a variety of information about the system that BIND 10 is running on\&. This information can be useful to people involved in debugging and technical support\&. -.SH "ARGUMENTS" -.PP -\-h -.RS 4 -Displays usage instructions\&. -.RE -.PP -\-o \fIoutput\-file\fR -.RS 4 -If an output file is specified, the output of -\fBisc\-sysinfo\fR -is written to this file\&. By default, the output is written to standard output\&. -.RE -.SH "SEE ALSO" -.PP - -\fBbind10\fR(8), -BIND 10 Guide\&. -.SH "HISTORY" -.PP -The -\fBisc\-sysinfo\fR -daemon was initially implemented by ISC staff in June, 2012\&. -.SH "COPYRIGHT" -.br -Copyright \(co 2012 Internet Systems Consortium, Inc. ("ISC") -.br diff --git a/src/bin/usermgr/.gitignore b/src/bin/usermgr/.gitignore index e116052663..36e32a09be 100644 --- a/src/bin/usermgr/.gitignore +++ b/src/bin/usermgr/.gitignore @@ -1,3 +1,4 @@ /b10-cmdctl-usermgr /b10-cmdctl-usermgr.py /run_b10-cmdctl-usermgr.sh +/b10-cmdctl-usermgr.8 diff --git a/src/bin/usermgr/Makefile.am b/src/bin/usermgr/Makefile.am index 7ebb1cd6c2..ce7977f94e 100644 --- a/src/bin/usermgr/Makefile.am +++ b/src/bin/usermgr/Makefile.am @@ -5,12 +5,19 @@ b10_cmdctl_usermgrdir = $(pkgdatadir) CLEANFILES= b10-cmdctl-usermgr man_MANS = b10-cmdctl-usermgr.8 +DISTCLEANFILES = $(man_MANS) EXTRA_DIST = $(man_MANS) b10-cmdctl-usermgr.xml -if ENABLE_MAN +if GENERATE_DOCS b10-cmdctl-usermgr.8: b10-cmdctl-usermgr.xml - xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-cmdctl-usermgr.xml + @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-cmdctl-usermgr.xml + +else + +$(man_MANS): + @echo Man generation disabled. Creating dummy $@. Configure with --enable-generate-docs to enable it. + @echo Man generation disabled. Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@ endif diff --git a/src/bin/usermgr/b10-cmdctl-usermgr.8 b/src/bin/usermgr/b10-cmdctl-usermgr.8 deleted file mode 100644 index 874ee8f2c0..0000000000 --- a/src/bin/usermgr/b10-cmdctl-usermgr.8 +++ /dev/null @@ -1,74 +0,0 @@ -'\" t -.\" Title: b10-cmdctl-usermgr -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: March 17, 2010 -.\" Manual: BIND10 -.\" Source: BIND10 -.\" Language: English -.\" -.TH "B10\-CMDCTL\-USERMGR" "8" "March 17, 2010" "BIND10" "BIND10" -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.SH "NAME" -b10-cmdctl-usermgr \- cmdctl user maintenance tool -.SH "SYNOPSIS" -.HP \w'\fBb10\-cmdctl\-usermgr\fR\ 'u -\fBb10\-cmdctl\-usermgr\fR [\fB\-f\ \fR\fB\fIfilename\fR\fR] [\fB\-h\fR] [\fB\-v\fR] [\fB\-\-file\ \fR\fB\fIfilename\fR\fR] [\fB\-\-help\fR] [\fB\-\-version\fR] -.SH "DESCRIPTION" -.PP -The -\fBb10\-cmdctl\-usermgr\fR -tool may be used to add accounts with passwords for the -\fBb10-cmdctl\fR(8) -daemon\&. -.PP -By default, the accounts are saved in the -cmdctl\-accounts\&.csv -file in the current directory, unless the -\fB\-\-filename\fR -switch is used\&. The entry is appended to the file\&. -.PP -The tool can\'t remove or replace existing entries\&. -.SH "OPTIONS" -.PP -The arguments are as follows: -.PP -\fB\-h\fR, \fB\-\-help\fR -.RS 4 -Report the usage statement and exit\&. -.RE -.PP -\fB\-f \fR\fB\fIfilename\fR\fR, \fB\-\-file \fR\fB\fIfilename\fR\fR -.RS 4 -Define the filename to append the account to\&. The default is -cmdctl\-accounts\&.csv -in the current directory\&. -.RE -.PP -\fB\-v\fR, \fB\-\-version\fR -.RS 4 -Report the version and exit\&. -.RE -.SH "SEE ALSO" -.PP - -\fBb10-cmdctl\fR(8), -BIND 10 Guide\&. -.SH "HISTORY" -.PP -The -\fBb10\-cmdctl\-usermgr\fR -tool was implemented in January 2010 by Zhang Likun of CNNIC for the ISC BIND 10 project\&. -.SH "COPYRIGHT" -.br -Copyright \(co 2010 Internet Systems Consortium, Inc. ("ISC") -.br diff --git a/src/bin/xfrin/.gitignore b/src/bin/xfrin/.gitignore index 5ac19425e2..a1c78ccdf3 100644 --- a/src/bin/xfrin/.gitignore +++ b/src/bin/xfrin/.gitignore @@ -1,3 +1,4 @@ /b10-xfrin /run_b10-xfrin.sh /xfrin.py +/b10-xfrin.8 diff --git a/src/bin/xfrin/Makefile.am b/src/bin/xfrin/Makefile.am index 8d80b220fb..d68f1f9adf 100644 --- a/src/bin/xfrin/Makefile.am +++ b/src/bin/xfrin/Makefile.am @@ -15,13 +15,20 @@ CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/xfrin_messages.py CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/xfrin_messages.pyc man_MANS = b10-xfrin.8 +DISTCLEANFILES = $(man_MANS) EXTRA_DIST = $(man_MANS) b10-xfrin.xml EXTRA_DIST += xfrin.spec xfrin_messages.mes -if ENABLE_MAN +if GENERATE_DOCS b10-xfrin.8: b10-xfrin.xml - xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-xfrin.xml + @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-xfrin.xml + +else + +$(man_MANS): + @echo Man generation disabled. Creating dummy $@. Configure with --enable-generate-docs to enable it. + @echo Man generation disabled. Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@ endif diff --git a/src/bin/xfrin/b10-xfrin.8 b/src/bin/xfrin/b10-xfrin.8 deleted file mode 100644 index 056103a1b5..0000000000 --- a/src/bin/xfrin/b10-xfrin.8 +++ /dev/null @@ -1,161 +0,0 @@ -'\" t -.\" Title: b10-xfrin -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: October 12, 2011 -.\" Manual: BIND10 -.\" Source: BIND10 -.\" Language: English -.\" -.TH "B10\-XFRIN" "8" "October 12, 2011" "BIND10" "BIND10" -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.SH "NAME" -b10-xfrin \- Incoming DNS zone transfer service -.SH "SYNOPSIS" -.HP \w'\fBb10\-xfrin\fR\ 'u -\fBb10\-xfrin\fR -.SH "DESCRIPTION" -.PP -The -\fBb10\-xfrin\fR -daemon provides the BIND 10 incoming DNS zone transfer service\&. Normally it is started by the -\fBbind10\fR(8) -boss process\&. When triggered it can request and receive a zone transfer and store the zone in a BIND 10 zone data source\&. -.PP -The -\fBb10\-xfrin\fR -daemon supports both AXFR and IXFR\&. Due to some implementation limitations of the current development release, however, it only tries AXFR by default, and care should be taken to enable IXFR\&. See the BIND 10 Guide for more details\&. -.PP -This daemon communicates with BIND 10 over a -\fBb10-msgq\fR(8) -C\-Channel connection\&. If this connection is not established, -\fBb10\-xfrin\fR -will exit\&. -.PP - -\fBb10\-xfrin\fR -receives its configurations from -\fBb10-cfgmgr\fR(8)\&. -.SH "CONFIGURATION AND COMMANDS" -.PP -The configurable settings are: -.PP -\fItransfers_in\fR -defines the maximum number of inbound zone transfers that can run concurrently\&. The default is 10\&. -.PP - -\fIzones\fR -is a list of zones known to the -\fBb10\-xfrin\fR -daemon\&. The list items are: -\fIname\fR -(the zone name), -\fIclass\fR -(defaults to -\(lqIN\(rq), -\fImaster_addr\fR -(the zone master to transfer from), -\fImaster_port\fR -(defaults to 53), -\fIuse_ixfr\fR -(defaults to false), and -\fItsig_key\fR -(optional TSIG key to use)\&. The -\fItsig_key\fR -is specified using a full string colon\-delimited name:key:algorithm representation (e\&.g\&. -\(lqfoo\&.example\&.org:EvABsfU2h7uofnmqaRCrhHunGsd=:hmac\-sha1\(rq)\&. -.PP -(The site\-wide -\fImaster_addr\fR -and -\fImaster_port\fR -configurations are deprecated; use the -\fIzones\fR -list configuration instead\&.) -.PP -The configuration commands are: -.PP - -\fBnotify\fR -is sent by -\fBb10-zonemgr\fR(8) -when a DNS NOTIFY message is received to initiate a zone transfer\&. -This is an internal command and not exposed to the administrator\&. -.PP - -\fBrefresh\fR -triggers the transfer in for a single zone\&. It is the same as -\fBretransfer\fR -except it checks the SOA serial first\&. -This is an internal command and not exposed to the administrator\&. - -.PP - -\fBrefresh_from_zonemgr\fR -is sent by -\fBb10-zonemgr\fR(8) -according to the SOA\'s REFRESH time to tell -\fBb10\-xfrin\fR -that the zone needs to do a zone refresh\&. This is an internal command and not exposed to the administrator\&. -.PP - -\fBretransfer\fR -triggers the transfer in for a single zone without checking the zone\'s serial number\&. It has the following arguments: -\fIzone_name\fR -to define the zone to request, -\fIzone_class\fR -to define the class (defaults to -\(lqIN\(rq), -\fImaster\fR -to define the IP address of the authoritative server to transfer from, and -\fIport\fR -to define the port number on the authoritative server (defaults to 53)\&. If the address or port is not specified, it will use the value previously defined in the -\fIzones\fR -configuration\&. -.PP - -\fBshutdown\fR -stops all incoming zone transfers and exits -\fBb10\-xfrin\fR\&. (Note that the BIND 10 boss process will restart this service\&.) -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBNote\fR -.ps -1 -.br -.PP -This prototype version uses SQLite3 as its data source backend\&. Future versions will be configurable, supporting multiple data storage types\&. -.sp .5v -.RE -.SH "SEE ALSO" -.PP - -\fBb10-cfgmgr\fR(8), -\fBb10-msgq\fR(8), -\fBb10-zonemgr\fR(8), -\fBbind10\fR(8), -BIND 10 Guide\&. -.SH "HISTORY" -.PP -The -\fBb10\-xfrin\fR -daemon was implemented in March 2010 by Zhang Likun of CNNIC for the ISC BIND 10 project\&. -.SH "COPYRIGHT" -.br -Copyright \(co 2010-2011 Internet Systems Consortium, Inc. ("ISC") -.br diff --git a/src/bin/xfrout/.gitignore b/src/bin/xfrout/.gitignore index 2ace679bb6..d2a69f30db 100644 --- a/src/bin/xfrout/.gitignore +++ b/src/bin/xfrout/.gitignore @@ -3,3 +3,4 @@ /xfrout.py /xfrout.spec /xfrout.spec.pre +/b10-xfrout.8 diff --git a/src/bin/xfrout/Makefile.am b/src/bin/xfrout/Makefile.am index 6100e64bf7..b612e35c09 100644 --- a/src/bin/xfrout/Makefile.am +++ b/src/bin/xfrout/Makefile.am @@ -15,12 +15,19 @@ CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/xfrout_messages.py CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/xfrout_messages.pyc man_MANS = b10-xfrout.8 +DISTCLEANFILES = $(man_MANS) EXTRA_DIST = $(man_MANS) b10-xfrout.xml xfrout_messages.mes -if ENABLE_MAN +if GENERATE_DOCS b10-xfrout.8: b10-xfrout.xml - xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-xfrout.xml + @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-xfrout.xml + +else + +$(man_MANS): + @echo Man generation disabled. Creating dummy $@. Configure with --enable-generate-docs to enable it. + @echo Man generation disabled. Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@ endif diff --git a/src/bin/xfrout/b10-xfrout.8 b/src/bin/xfrout/b10-xfrout.8 deleted file mode 100644 index b3200b588f..0000000000 --- a/src/bin/xfrout/b10-xfrout.8 +++ /dev/null @@ -1,149 +0,0 @@ -'\" t -.\" Title: b10-xfrout -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: March 16. 2012 -.\" Manual: BIND10 -.\" Source: BIND10 -.\" Language: English -.\" -.TH "B10\-XFROUT" "8" "March 16\&. 2012" "BIND10" "BIND10" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.SH "NAME" -b10-xfrout \- Outbound DNS zone transfer service -.SH "SYNOPSIS" -.HP \w'\fBb10\-xfrout\fR\ 'u -\fBb10\-xfrout\fR [\fB\-v\fR] [\fB\-\-verbose\fR] -.SH "DESCRIPTION" -.PP -The -\fBb10\-xfrout\fR -daemon provides the BIND 10 outgoing DNS zone transfer service using AXFR or IXFR\&. It is also used to send outgoing NOTIFY messages\&. Normally it is started by the -\fBbind10\fR(8) -boss process\&. When the -\fBb10\-auth\fR -DNS server receives a transfer request, -\fBb10\-xfrout\fR -sends the zone as found in the BIND 10 zone data store\&. -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBNote\fR -.ps -1 -.br -.sp -Currently IXFR only works if it gets the zone via \fBb10\-xfrin\fR and only on TCP\&. -.sp .5v -.RE -.PP -This daemon communicates with BIND 10 over a -\fBb10-msgq\fR(8) -C\-Channel connection\&. If this connection is not established, -\fBb10\-xfrout\fR -will exit\&. -.PP - -\fBb10\-xfrout\fR -receives its configurations from -\fBb10-cfgmgr\fR(8)\&. -.SH "CONFIGURATION AND COMMANDS" -.PP -The configurable settings are: -.PP - -\fItransfers_out\fR -defines the maximum number of outgoing zone transfers that can run concurrently\&. The default is 10\&. -.PP - -\fItransfer_acl\fR -A list of ACL elements that apply to all transfer requests by default (unless overridden in -\fIzone_config\fR)\&. See the -BIND 10 Guide -for configuration examples\&. The default is an element that allows any transfer requests\&. -.PP - -\fIzone_config\fR -A list of JSON objects (i\&.e\&. maps) that define per zone configuration concerning -\fBb10\-xfrout\fR\&. The supported names of each object are "origin" (the origin name of the zone), "class" (the RR class of the zone, optional, default to "IN"), and "transfer_acl" (ACL only applicable to transfer requests for that zone)\&. See the -BIND 10 Guide -for configuration examples\&. The default is an empty list, that is, no zone specific configuration\&. -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBNote\fR -.ps -1 -.br -.sp -This prototype version uses SQLite3 as its data source backend\&. Future versions will be configurable, supporting multiple data storage types\&. -.sp .5v -.RE -.PP -The configuration commands are: -.PP - -\fBnotify\fR -triggers -\fBb10\-xfrout\fR -to send NOTIFY message(s)\&. It has the following arguments: -\fIzone_name\fR -to define the zone to send notifies for and the optional -\fIzone_class\fR -to define the class (defaults to -\(lqIN\(rq)\&. -\fBb10-xfrin\fR(8) -sends this command when a zone transferred in successfully\&. -.PP - -\fBshutdown\fR -stops all outbound zone transfers and exits -\fBb10\-xfrout\fR\&. This has an optional -\fIpid\fR -argument to select the process ID to stop\&. (Note that the BIND 10 boss process may restart this service if configured\&.) -.SH "SEE ALSO" -.PP - -\fBb10-auth\fR(8), -\fBb10-cfgmgr\fR(8), -\fBb10-msgq\fR(8), -\fBb10-xfrin\fR(8), -\fBbind10\fR(8), -BIND 10 Guide\&. -.SH "HISTORY" -.PP -The -\fBb10\-xfrout\fR -daemon was first implemented in March 2010 by Zhang Likun of CNNIC for the ISC BIND 10 project\&. -.SH "COPYRIGHT" -.br -Copyright \(co 2010-2012 Internet Systems Consortium, Inc. ("ISC") -.br diff --git a/src/bin/zonemgr/.gitignore b/src/bin/zonemgr/.gitignore index 2d64f2d6c1..815de93445 100644 --- a/src/bin/zonemgr/.gitignore +++ b/src/bin/zonemgr/.gitignore @@ -3,3 +3,4 @@ /zonemgr.py /zonemgr.spec /zonemgr.spec.pre +/b10-zonemgr.8 diff --git a/src/bin/zonemgr/Makefile.am b/src/bin/zonemgr/Makefile.am index aa427fdf2e..6dbec03879 100644 --- a/src/bin/zonemgr/Makefile.am +++ b/src/bin/zonemgr/Makefile.am @@ -15,12 +15,19 @@ CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/zonemgr_messages.py CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/zonemgr_messages.pyc man_MANS = b10-zonemgr.8 +DISTCLEANFILES = $(man_MANS) EXTRA_DIST = $(man_MANS) b10-zonemgr.xml zonemgr_messages.mes -if ENABLE_MAN +if GENERATE_DOCS b10-zonemgr.8: b10-zonemgr.xml - xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-zonemgr.xml + @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-zonemgr.xml + +else + +$(man_MANS): + @echo Man generation disabled. Creating dummy $@. Configure with --enable-generate-docs to enable it. + @echo Man generation disabled. Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@ endif diff --git a/src/bin/zonemgr/b10-zonemgr.8 b/src/bin/zonemgr/b10-zonemgr.8 deleted file mode 100644 index 99bd8ea982..0000000000 --- a/src/bin/zonemgr/b10-zonemgr.8 +++ /dev/null @@ -1,143 +0,0 @@ -'\" t -.\" Title: b10-zonemgr -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: February 28, 2012 -.\" Manual: BIND10 -.\" Source: BIND10 -.\" Language: English -.\" -.TH "B10\-ZONEMGR" "8" "February 28, 2012" "BIND10" "BIND10" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.SH "NAME" -b10-zonemgr \- BIND 10 Secondary zone manager -.SH "SYNOPSIS" -.HP \w'\fBb10\-zonemgr\fR\ 'u -\fBb10\-zonemgr\fR [\fB\-v\fR] [\fB\-\-verbose\fR] -.SH "DESCRIPTION" -.PP -The -\fBb10\-zonemgr\fR -daemon, also known as the BIND 10 secondary manager, keeps track of timers and other information necessary for BIND 10 to act as a DNS slave\&. Normally it is started by the -\fBbind10\fR(8) -boss process\&. -.PP -This daemon communicates with BIND 10 over a -\fBb10-msgq\fR(8) -C\-Channel connection\&. If this connection is not established, -\fBb10\-zonemgr\fR -will exit\&. -.PP - -\fBb10\-zonemgr\fR -receives its configurations from -\fBb10-cfgmgr\fR(8)\&. -.SH "CONFIGURATION AND COMMANDS" -.PP -The configurable settings are: -.PP - -\fIlowerbound_refresh\fR -defines the minimum SOA REFRESH time in seconds\&. The default is 10\&. -.PP - -\fIlowerbound_retry\fR -defines the minimum SOA RETRY time in seconds\&. The default is 5\&. -.PP - -\fIrefresh_jitter\fR -is used to provide a time range for randomizing the refresh and retry timers to help avoid many zones needing to do a refresh or retry at the same time\&. This value is a real number\&. The maximum amount is 0\&.5 (the new timer will be within half the original time)\&. The default is 0\&.25 (up to a quarter sooner)\&. Set to 0 to disable this jitter\&. -.PP - -\fIreload_jitter\fR - -This value is a real number\&. The default is 0\&.75\&. -.PP - -\fImax_transfer_timeout\fR -defines the maximum amount of time in seconds for a transfer\&. -The default is 14400 (4 hours)\&. -.PP - -\fIsecondary_zones\fR -is a list of slave zones that the -\fBb10\-zonemgr\fR -should keep timers for\&. The list items include the -\fIname\fR -(which defines the zone name) and the -\fIclass\fR -(which defaults to -\(lqIN\(rq)\&. -.PP -(A deprecated configuration is -\fIjitter_scope\fR -which is superceded by -\fIrefresh_jitter\fR -and -\fIreload_jitter\fR\&.) -.PP -The configuration commands are: -.PP - -\fBnotify\fR -(sent by -\fBb10-auth\fR(8)) tells -\fBb10\-zonemgr\fR -the zone name and class, and the IP address for the master (source of the NOTIFY message)\&. This will set the zone\*(Aqs refresh time to now\&. -This is an internal command and not exposed to the administrator\&. -.PP - -\fBshutdown\fR -exits -\fBb10\-zonemgr\fR\&. This has an optional -\fIpid\fR -argument to select the process ID to stop\&. (Note that the BIND 10 boss process may restart this service if configured\&.) -.PP - -\fBzone_new_data_ready\fR -is sent from -\fBb10-xfrin\fR(8) -to indicate that the zone transferred in successfully\&. This is an internal command and not exposed to the administrator\&. -.PP - -\fBzone_xfrin_failed\fR -is sent from -\fBb10-xfrin\fR(8) -to indicate a failure (such as a transfer\-in was incomplete)\&. The refresh timer for the zone is reset\&. -This is an internal command and not exposed to the administrator\&. -.SH "SEE ALSO" -.PP - -\fBb10-auth\fR(8), -\fBb10-cfgmgr\fR(8), -\fBb10-msgq\fR(8), -\fBb10-xfrin\fR(8), -\fBbind10\fR(8), -BIND 10 Guide\&. -.SH "HISTORY" -.PP -The -\fBb10\-zonemgr\fR -daemon was designed in July 2010 by CNNIC for the ISC BIND 10 project\&. -.SH "COPYRIGHT" -.br -Copyright \(co 2010-2012 Internet Systems Consortium, Inc. ("ISC") -.br diff --git a/src/lib/asiodns/dns_server.h b/src/lib/asiodns/dns_server.h index 119aa66608..bc398056c4 100644 --- a/src/lib/asiodns/dns_server.h +++ b/src/lib/asiodns/dns_server.h @@ -81,7 +81,7 @@ public: /// \brief Stop current running server virtual void stop() { self_->stop();} - /// \brief Resume processing of the server coroutine after an + /// \brief Resume processing of the server coroutine after an /// asynchronous call (e.g., to the DNS Lookup provider) has completed. /// /// \param done If true, this signals the system there is an answer @@ -99,6 +99,18 @@ public: virtual DNSServer* clone() { return (self_->clone()); } //@} + /// \brief Set timeout for incoming TCP connections + /// + /// Since this value is not relevant for every type of DNSServer + /// (like UDPServer), it has a no-op default implementation. + /// It is in the base class because the AuthSrv's DNSService has + /// no direct access to the derived API's after initialization, + /// and it does need to update running servers if the timeout + /// setting is changed. + /// + /// \param timeout The timeout in milliseconds + virtual void setTCPRecvTimeout(size_t) {} + protected: /// \brief Lookup handler object. /// diff --git a/src/lib/asiodns/dns_service.cc b/src/lib/asiodns/dns_service.cc index 2cfdea570e..f72d24b493 100644 --- a/src/lib/asiodns/dns_service.cc +++ b/src/lib/asiodns/dns_service.cc @@ -40,7 +40,7 @@ public: DNSServiceImpl(IOService& io_service, SimpleCallback* checkin, DNSLookup* lookup, DNSAnswer* answer) : io_service_(io_service), checkin_(checkin), lookup_(lookup), - answer_(answer) + answer_(answer), tcp_recv_timeout_(5000) {} IOService& io_service_; @@ -53,13 +53,25 @@ public: SimpleCallback* checkin_; DNSLookup* lookup_; DNSAnswer* answer_; + size_t tcp_recv_timeout_; template void addServerFromFD(int fd, int af) { Ptr server(new Server(io_service_.get_io_service(), fd, af, checkin_, lookup_, answer_)); + server->setTCPRecvTimeout(tcp_recv_timeout_); (*server)(); servers_.push_back(server); } + + void setTCPRecvTimeout(size_t timeout) { + // Store it for future tcp connections + tcp_recv_timeout_ = timeout; + // Update existing (TCP) Servers + std::vector::iterator it = servers_.begin(); + for (; it != servers_.end(); ++it) { + (*it)->setTCPRecvTimeout(timeout); + } + } }; DNSService::DNSService(IOService& io_service, SimpleCallback* checkin, @@ -99,5 +111,10 @@ DNSService::clearServers() { impl_->servers_.clear(); } +void +DNSService::setTCPRecvTimeout(size_t timeout) { + impl_->setTCPRecvTimeout(timeout); +} + } // namespace asiodns } // namespace isc diff --git a/src/lib/asiodns/dns_service.h b/src/lib/asiodns/dns_service.h index 8f2f6d7fee..0b578fbd9b 100644 --- a/src/lib/asiodns/dns_service.h +++ b/src/lib/asiodns/dns_service.h @@ -84,6 +84,21 @@ public: ServerFlag options = SERVER_DEFAULT) = 0; virtual void clearServers() = 0; + /// \brief Set the timeout for TCP DNS services + /// + /// The timeout is used for incoming TCP connections, so + /// that the connection is dropped if not all query data + /// is read. + /// + /// For existing DNSServer objects, where the timeout is + /// relevant (i.e. TCPServer instances), the timeout value + /// is updated. + /// The given value is also kept to use for DNSServer instances + /// which are created later + /// + /// \param timeout The timeout in milliseconds + virtual void setTCPRecvTimeout(size_t timeout) = 0; + virtual asiolink::IOService& getIOService() = 0; }; @@ -187,6 +202,7 @@ public: /// \return IOService object for this DNS service. virtual asiolink::IOService& getIOService() { return (io_service_);} + virtual void setTCPRecvTimeout(size_t timeout); private: DNSServiceImpl* impl_; asiolink::IOService& io_service_; diff --git a/src/lib/asiodns/sync_udp_server.cc b/src/lib/asiodns/sync_udp_server.cc index a31301d0df..0c577f2474 100644 --- a/src/lib/asiodns/sync_udp_server.cc +++ b/src/lib/asiodns/sync_udp_server.cc @@ -114,9 +114,13 @@ SyncUDPServer::handleRead(const asio::error_code& ec, const size_t length) { return; } - // Make sure the buffers are fresh + // Make sure the buffers are fresh. Note that we don't touch query_ + // because it's supposed to be cleared in lookup_callback_. We should + // eventually even remove this member variable (and remove it from + // the lookup_callback_ interface, but until then, any callback + // implementation should be careful that it's the responsibility of + // the callback implementation. See also #2239). output_buffer_->clear(); - query_->clear(isc::dns::Message::PARSE); answer_->clear(isc::dns::Message::RENDER); // Mark that we don't have an answer yet. diff --git a/src/lib/asiodns/tcp_server.cc b/src/lib/asiodns/tcp_server.cc index 8e4b4d6f05..3442de9ae7 100644 --- a/src/lib/asiodns/tcp_server.cc +++ b/src/lib/asiodns/tcp_server.cc @@ -70,6 +70,23 @@ TCPServer::TCPServer(io_service& io_service, int fd, int af, // it isc_throw(IOError, exception.what()); } + // Set it to some value. It should be set to the right one + // immediately, but set it to something non-zero just in case. + tcp_recv_timeout_.reset(new size_t(5000)); +} + +namespace { + // Called by the timeout_ deadline timer if the client takes too long. + // If not aborted, cancels the given socket + // (in which case TCPServer::operator() will be called to continue, + // with an 'aborted' error code + void do_timeout(asio::ip::tcp::socket& socket, + const asio::error_code& error) + { + if (error != asio::error::operation_aborted) { + socket.cancel(); + } + } } void @@ -114,6 +131,15 @@ TCPServer::operator()(asio::error_code ec, size_t length) { /// asynchronous read call. data_.reset(new char[MAX_LENGTH]); + /// Start a timer to drop the connection if it is idle + if (*tcp_recv_timeout_ > 0) { + timeout_.reset(new asio::deadline_timer(io_)); + timeout_->expires_from_now( + boost::posix_time::milliseconds(*tcp_recv_timeout_)); + timeout_->async_wait(boost::bind(&do_timeout, boost::ref(*socket_), + asio::placeholders::error)); + } + /// Read the message, in two parts. First, the message length: CORO_YIELD async_read(*socket_, asio::buffer(data_.get(), TCP_MESSAGE_LENGTHSIZE), *this); @@ -135,6 +161,13 @@ TCPServer::operator()(asio::error_code ec, size_t length) { CORO_YIELD return; } + // Due to possible timeouts and other bad behaviour, after the + // timely reads are done, there is a chance the socket has + // been closed already. So before we move on to the actual + // processing, check that, and stop if so. + if (!socket_->is_open()) { + CORO_YIELD return; + } // Create an \c IOMessage object to store the query. // @@ -209,6 +242,9 @@ TCPServer::operator()(asio::error_code ec, size_t length) { // will simply exit at that time). CORO_YIELD async_write(*socket_, bufs, *this); + // All done, cancel the timeout timer + timeout_->cancel(); + // TODO: should we keep the connection open for a short time // to see if new requests come in? socket_->close(); diff --git a/src/lib/asiodns/tcp_server.h b/src/lib/asiodns/tcp_server.h index 01695e4093..7675daf332 100644 --- a/src/lib/asiodns/tcp_server.h +++ b/src/lib/asiodns/tcp_server.h @@ -34,7 +34,7 @@ namespace asiodns { /// \brief A TCP-specific \c DNSServer object. /// /// This class inherits from both \c DNSServer and from \c coroutine, -/// defined in coroutine.h. +/// defined in coroutine.h. class TCPServer : public virtual DNSServer, public virtual coroutine { public: /// \brief Constructor @@ -61,6 +61,16 @@ public: return (s); } + /// \brief Set the read timeout + /// + /// If the client does not send (all) query data within this + /// timeframe, the connection is dropped + /// + /// \param timeout in milliseconds + virtual void setTCPRecvTimeout(size_t timeout) { + *tcp_recv_timeout_ = timeout; + } + private: enum { MAX_LENGTH = 65535 }; static const size_t TCP_MESSAGE_LENGTHSIZE = 2; @@ -122,6 +132,17 @@ private: boost::shared_ptr peer_; boost::shared_ptr iosock_; + + // Timer used to timeout on tcp connections + // This is a shared pointer because we need to have something + // that outlives the operator() call and is copyable (for CORO_FORK) + // even though it is only set after fork + boost::shared_ptr timeout_; + + // Timeout value to use in the timer; + // this, too, is a pointer, so that it can be updated whithout restarting + // the server + boost::shared_ptr tcp_recv_timeout_; }; } // namespace asiodns diff --git a/src/lib/asiodns/tests/dns_server_unittest.cc b/src/lib/asiodns/tests/dns_server_unittest.cc index a5e83c7757..c05a34b1ad 100644 --- a/src/lib/asiodns/tests/dns_server_unittest.cc +++ b/src/lib/asiodns/tests/dns_server_unittest.cc @@ -258,7 +258,8 @@ class TCPClient : public SimpleClient { // this includes connect, send message and recevice message static const unsigned int SERVER_TIME_OUT = 2; TCPClient(asio::io_service& service, const ip::tcp::endpoint& server) - : SimpleClient(service, SERVER_TIME_OUT) + : SimpleClient(service, SERVER_TIME_OUT), + send_data_delay_(0), send_data_len_delay_(0) { server_ = server; socket_.reset(new ip::tcp::socket(service)); @@ -280,6 +281,20 @@ class TCPClient : public SimpleClient { std::string(received_data_ + 2)); } + /// Set the delay before the data len is sent (in seconds) + /// If this is non-zero, the actual data is never sent + /// (it is used to test timeout, in which case the connection + /// should have been closed by the other side anyway) + void setSendDataLenDelay(size_t send_data_len_delay) { + send_data_len_delay_ = send_data_len_delay; + } + + /// Set the delay before the packet data itself is sent + /// (in seconds) + void setSendDataDelay(size_t send_data_delay) { + send_data_delay_ = send_data_delay; + } + private: void stopWaitingforResponse() { socket_->close(); @@ -288,6 +303,7 @@ class TCPClient : public SimpleClient { void connectHandler(const asio::error_code& error) { if (!error) { data_to_send_len_ = htons(data_to_send_len_); + sleep(send_data_len_delay_); socket_->async_send(buffer(&data_to_send_len_, 2), boost::bind(&TCPClient::sendMessageBodyHandler, this, _1, _2)); @@ -297,7 +313,8 @@ class TCPClient : public SimpleClient { void sendMessageBodyHandler(const asio::error_code& error, size_t send_bytes) { - if (!error && send_bytes == 2) { + if (!error && send_bytes == 2 && send_data_len_delay_ == 0) { + sleep(send_data_delay_); socket_->async_send(buffer(data_to_send_.c_str(), data_to_send_.size() + 1), boost::bind(&TCPClient::finishSendHandler, this, _1, _2)); @@ -316,6 +333,9 @@ class TCPClient : public SimpleClient { ip::tcp::endpoint server_; std::string data_to_send_; uint16_t data_to_send_len_; + + size_t send_data_delay_; + size_t send_data_len_delay_; }; // \brief provide the context which including two clients and @@ -565,6 +585,34 @@ TYPED_TEST(DNSServerTest, stopTCPServerAfterOneQuery) { EXPECT_TRUE(this->serverStopSucceed()); } +TYPED_TEST(DNSServerTest, TCPTimeoutOnLen) { + this->tcp_server_->setTCPRecvTimeout(100); + this->tcp_client_->setSendDataLenDelay(2); + this->testStopServerByStopper(this->tcp_server_, this->tcp_client_, + this->tcp_client_); + EXPECT_EQ("", this->tcp_client_->getReceivedData()); + EXPECT_FALSE(this->serverStopSucceed()); +} + +TYPED_TEST(DNSServerTest, TCPTimeout) { + // set delay higher than timeout + this->tcp_server_->setTCPRecvTimeout(100); + this->tcp_client_->setSendDataDelay(2); + this->testStopServerByStopper(this->tcp_server_, this->tcp_client_, + this->tcp_client_); + EXPECT_EQ("", this->tcp_client_->getReceivedData()); + EXPECT_TRUE(this->serverStopSucceed()); +} + +TYPED_TEST(DNSServerTest, TCPNoTimeout) { + // set delay lower than timeout + this->tcp_server_->setTCPRecvTimeout(3000); + this->tcp_client_->setSendDataDelay(1); + this->testStopServerByStopper(this->tcp_server_, this->tcp_client_, + this->tcp_client_); + EXPECT_EQ("BIND10 is awesome", this->tcp_client_->getReceivedData()); + EXPECT_TRUE(this->serverStopSucceed()); +} // Test whether tcp server stopped successfully before server start to serve TYPED_TEST(DNSServerTest, stopTCPServerBeforeItStartServing) { diff --git a/src/lib/cache/tests/negative_cache_unittest.cc b/src/lib/cache/tests/negative_cache_unittest.cc index 4935e4a6af..78537631a3 100644 --- a/src/lib/cache/tests/negative_cache_unittest.cc +++ b/src/lib/cache/tests/negative_cache_unittest.cc @@ -98,8 +98,9 @@ TEST_F(NegativeCacheTest, testNXDOMAIN){ rrset_ptr = *iter; // The TTL should equal to the TTL of negative response SOA record + // Allow for three second range. const RRTTL& nxdomain_ttl2 = rrset_ptr->getTTL(); - EXPECT_GE(nxdomain_ttl2.getValue(), 86397); + EXPECT_GE(nxdomain_ttl2.getValue(), 86396); EXPECT_LE(nxdomain_ttl2.getValue(), 86398); // No RRset in ANSWER section EXPECT_TRUE(msg_nxdomain2.getRRCount(Message::SECTION_ANSWER) == 0); @@ -120,7 +121,8 @@ TEST_F(NegativeCacheTest, testNXDOMAIN){ rrset_ptr = *iter; const RRTTL& soa_ttl2 = rrset_ptr->getTTL(); // The TTL should equal to the TTL of SOA record in answer section - EXPECT_GE(soa_ttl2.getValue(), 172797); + // Allow for three second range. + EXPECT_GE(soa_ttl2.getValue(), 172796); EXPECT_LE(soa_ttl2.getValue(), 172798); } diff --git a/src/lib/config/ccsession.cc b/src/lib/config/ccsession.cc index d4c6653b6c..daec005dda 100644 --- a/src/lib/config/ccsession.cc +++ b/src/lib/config/ccsession.cc @@ -456,7 +456,7 @@ ModuleCCSession::ModuleCCSession( ConstElementPtr answer, env; session_.group_recvmsg(env, answer, false, seq); - int rcode; + int rcode = -1; ConstElementPtr err = parseAnswer(rcode, answer); if (rcode != 0) { LOG_ERROR(config_logger, CONFIG_MOD_SPEC_REJECT).arg(answer->str()); @@ -535,7 +535,7 @@ ModuleCCSession::handleConfigUpdate(ConstElementPtr new_config) { ConstElementPtr diff = removeIdentical(new_config, getLocalConfig()); // handle config update answer = config_handler_(diff); - int rcode; + int rcode = -1; parseAnswer(rcode, answer); if (rcode == 0) { ElementPtr local_config = getLocalConfig(); @@ -652,7 +652,7 @@ ModuleCCSession::fetchRemoteSpec(const std::string& module, bool is_filename) { unsigned int seq = session_.group_sendmsg(cmd, "ConfigManager"); ConstElementPtr env, answer; session_.group_recvmsg(env, answer, false, seq); - int rcode; + int rcode = -1; ConstElementPtr spec_data = parseAnswer(rcode, answer); if (rcode == 0 && spec_data) { // received OK, construct the spec out of it @@ -689,7 +689,7 @@ ModuleCCSession::addRemoteConfig(const std::string& spec_name, ConstElementPtr env, answer; session_.group_recvmsg(env, answer, false, seq); - int rcode; + int rcode = -1; ConstElementPtr new_config = parseAnswer(rcode, answer); ElementPtr local_config; if (rcode == 0 && new_config) { diff --git a/src/lib/datasrc/datasrc_messages.mes b/src/lib/datasrc/datasrc_messages.mes index 6837476243..94b4d4249e 100644 --- a/src/lib/datasrc/datasrc_messages.mes +++ b/src/lib/datasrc/datasrc_messages.mes @@ -787,10 +787,20 @@ example.com). However, this name is not contained in any zone in the data source. This is an error since it indicates a problem in the earlier processing of the query. -% DATASRC_SQLITE_SETUP setting up SQLite database +% DATASRC_SQLITE_SETUP setting up new SQLite3 database in '%1' The database for SQLite data source was found empty. It is assumed this is the first run and it is being initialized with current schema. It'll still contain -no data, but it will be ready for use. +no data, but it will be ready for use. If this is indeed the first run of +BIND 10, it is to be expected and completely harmless. If you just configured +a data source to point to an existing file and you see this, you may have +misspelled the file name. + +% DATASRC_SQLITE_SETUP_OLD_API setting up new SQLite database +The database for SQLite data source was found empty. It is assumed this is the +first run and it is being initialized with current schema. It'll still contain +no data, but it will be ready for use. This is similar to DATASRC_SQLITE_SETUP +message, but it is logged from the old API. You should never see it, since the +API is deprecated. % DATASRC_STATIC_CLASS_NOT_CH static data source can handle CH class only An error message indicating that a query requesting a RR for a class other diff --git a/src/lib/datasrc/memory/Makefile.am b/src/lib/datasrc/memory/Makefile.am index d34633d342..168c2ab46d 100644 --- a/src/lib/datasrc/memory/Makefile.am +++ b/src/lib/datasrc/memory/Makefile.am @@ -15,6 +15,7 @@ libdatasrc_memory_la_SOURCES += rdataset.h rdataset.cc libdatasrc_memory_la_SOURCES += treenode_rrset.h treenode_rrset.cc libdatasrc_memory_la_SOURCES += rdata_serialization.h rdata_serialization.cc libdatasrc_memory_la_SOURCES += zone_data.h zone_data.cc +libdatasrc_memory_la_SOURCES += segment_object_holder.h libdatasrc_memory_la_SOURCES += zone_table.h zone_table.cc libdatasrc_memory_la_SOURCES += memory_client.h memory_client.cc libdatasrc_memory_la_SOURCES += logger.h logger.cc diff --git a/src/lib/datasrc/memory/benchmarks/Makefile.am b/src/lib/datasrc/memory/benchmarks/Makefile.am index f4ae3eefc5..9ed18af76d 100644 --- a/src/lib/datasrc/memory/benchmarks/Makefile.am +++ b/src/lib/datasrc/memory/benchmarks/Makefile.am @@ -13,8 +13,12 @@ noinst_PROGRAMS = rdata_reader_bench rrset_render_bench rdata_reader_bench_SOURCES = rdata_reader_bench.cc rdata_reader_bench_LDADD = $(top_builddir)/src/lib/datasrc/memory/libdatasrc_memory.la +rdata_reader_bench_LDADD += $(top_builddir)/src/lib/exceptions/libb10-exceptions.la +rdata_reader_bench_LDADD += $(top_builddir)/src/lib/util/libb10-util.la rdata_reader_bench_LDADD += $(top_builddir)/src/lib/dns/libb10-dns++.la rrset_render_bench_SOURCES = rrset_render_bench.cc rrset_render_bench_LDADD = $(top_builddir)/src/lib/datasrc/memory/libdatasrc_memory.la +rrset_render_bench_LDADD += $(top_builddir)/src/lib/exceptions/libb10-exceptions.la +rrset_render_bench_LDADD += $(top_builddir)/src/lib/util/libb10-util.la rrset_render_bench_LDADD += $(top_builddir)/src/lib/dns/libb10-dns++.la diff --git a/src/lib/datasrc/memory/benchmarks/rrset_render_bench.cc b/src/lib/datasrc/memory/benchmarks/rrset_render_bench.cc index c5cdef6675..bc418e85c9 100644 --- a/src/lib/datasrc/memory/benchmarks/rrset_render_bench.cc +++ b/src/lib/datasrc/memory/benchmarks/rrset_render_bench.cc @@ -151,6 +151,7 @@ buildZone(isc::util::MemorySegmentLocal& mem_sgmt, if ((it + 1) != rrsets.end() && (*(it + 1))->getType() == RRType::RRSIG()) { sig_rrset = *(++it); + assert(it != rrsets.end()); // to be safe, and silence cppcheck } RdataSet* rdataset = RdataSet::create(mem_sgmt, encoder, rrset, sig_rrset); diff --git a/src/lib/datasrc/memory/rdata_serialization.cc b/src/lib/datasrc/memory/rdata_serialization.cc index 6c3e06c35b..6ac18d0e6a 100644 --- a/src/lib/datasrc/memory/rdata_serialization.cc +++ b/src/lib/datasrc/memory/rdata_serialization.cc @@ -250,6 +250,7 @@ public: virtual void setCompressMode(CompressMode) {} virtual void writeName(const LabelSequence&, bool) { // We don't need this version of writeName + isc_throw(Unexpected, "unexpected version of writeName is called"); } // Called for each domain name in the RDATA, from the RDATA's toWire() diff --git a/src/lib/datasrc/memory/tests/treenode_rrset_unittest.cc b/src/lib/datasrc/memory/tests/treenode_rrset_unittest.cc index c83c034366..182cca6820 100644 --- a/src/lib/datasrc/memory/tests/treenode_rrset_unittest.cc +++ b/src/lib/datasrc/memory/tests/treenode_rrset_unittest.cc @@ -25,6 +25,8 @@ #include +#include + #include #include @@ -70,7 +72,10 @@ protected: "match.example.com. 3600 IN RRSIG " "A 5 2 3600 20120814220826 20120715220826 " "1234 example.com. FAKE")), - zone_data_(NULL) + zone_data_(NULL), origin_node_(NULL), www_node_(NULL), + wildcard_node_(NULL), ns_rdataset_(NULL), dname_rdataset_(NULL), + a_rdataset_(NULL), aaaa_rdataset_(NULL), rrsig_only_rdataset_(NULL), + wildcard_rdataset_(NULL) {} void SetUp() { // We create some common test data here in SetUp() so it will be @@ -149,64 +154,123 @@ checkBasicFields(const AbstractRRset& actual_rrset, const Name& expected_name, EXPECT_EQ(expected_sigcount, actual_rrset.getRRsigDataCount()); } +// The following two are trivial wrapper to create a shared pointer +// version of TreeNodeRRset object in order to work around dubious +// behavior of some C++ compiler: they reject getting a const reference to +// a temporary non-copyable object. +boost::shared_ptr +createRRset(const RRClass& rrclass, const ZoneNode* node, + const RdataSet* rdataset, bool dnssec_ok) +{ + return (boost::shared_ptr( + new TreeNodeRRset(rrclass, node, rdataset, dnssec_ok))); +} + +boost::shared_ptr +createRRset(const Name& realname, const RRClass& rrclass, const ZoneNode* node, + const RdataSet* rdataset, bool dnssec_ok) +{ + return (boost::shared_ptr( + new TreeNodeRRset(realname, rrclass, node, rdataset, + dnssec_ok))); +} + TEST_F(TreeNodeRRsetTest, create) { // Constructed with RRSIG, and it should be visible. - checkBasicFields(TreeNodeRRset(rrclass_, www_node_, a_rdataset_, true), + checkBasicFields(*createRRset(rrclass_, www_node_, a_rdataset_, true), www_name_, rrclass_, RRType::A(), 3600, 2, 1); // Constructed with RRSIG, and it should be invisible. - checkBasicFields(TreeNodeRRset(rrclass_, www_node_, a_rdataset_, false), + checkBasicFields(*createRRset(rrclass_, www_node_, a_rdataset_, false), www_name_, rrclass_, RRType::A(), 3600, 2, 0); // Constructed without RRSIG, and it would be visible (but of course won't) - checkBasicFields(TreeNodeRRset(rrclass_, origin_node_, ns_rdataset_, true), + checkBasicFields(*createRRset(rrclass_, origin_node_, ns_rdataset_, true), origin_name_, rrclass_, RRType::NS(), 3600, 1, 0); // Constructed without RRSIG, and it should be visible - checkBasicFields(TreeNodeRRset(rrclass_, origin_node_, ns_rdataset_, - false), + checkBasicFields(*createRRset(rrclass_, origin_node_, ns_rdataset_, false), origin_name_, rrclass_, RRType::NS(), 3600, 1, 0); // RRSIG-only case (note the RRset's type is covered type) - checkBasicFields(TreeNodeRRset(rrclass_, www_node_, rrsig_only_rdataset_, - true), + checkBasicFields(*createRRset(rrclass_, www_node_, rrsig_only_rdataset_, + true), www_name_, rrclass_, RRType::TXT(), 3600, 0, 1); // RRSIG-only case (note the RRset's type is covered type), but it's // invisible - checkBasicFields(TreeNodeRRset(rrclass_, www_node_, rrsig_only_rdataset_, - false), + checkBasicFields(*createRRset(rrclass_, www_node_, rrsig_only_rdataset_, + false), www_name_, rrclass_, RRType::TXT(), 3600, 0, 0); // Wildcard substitution - checkBasicFields(TreeNodeRRset(match_name_, rrclass_, - wildcard_node_, wildcard_rdataset_, - true), + checkBasicFields(*createRRset(match_name_, rrclass_, + wildcard_node_, wildcard_rdataset_, + true), match_name_, rrclass_, RRType::A(), 3600, 2, 1); } -// Templated if and when we support OutputBuffer version of toWire(). -// Right now, we take a minimalist approach, only implementing testing the -// renderer version. +// The following two templated functions are helper to encapsulate the +// concept truncation and handle MessageRenderer and OutputBuffer transparently +// in templated test cases. +template +void +setOutputLengthLimit(OutputType& output, size_t len_limit) { + output.setLengthLimit(len_limit); +} +template <> +void +setOutputLengthLimit(OutputBuffer&, size_t) { +} + +template +bool +isOutputTruncated(OutputType& output) { + return (output.isTruncated()); +} +template <> +bool +isOutputTruncated(OutputBuffer&) { + return (false); +} + +// Templated so we so can support OutputBuffer version of toWire(). +// We use the above helper templated functions for some renderer only methods. +// We test two sets of cases: normal rendering case and case when truncation +// is expected. The latter is effectively for MessageRenderer only. +// If len_limit == 0, we consider it the normal case; otherwise it's for +// truncation. prepended_name isn't used for the truncation case. template void checkToWireResult(OutputType& expected_output, OutputType& actual_output, const AbstractRRset& actual_rrset, const Name& prepended_name, ConstRRsetPtr rrset, ConstRRsetPtr rrsig_rrset, - bool dnssec_ok) + bool dnssec_ok, + size_t len_limit = 0, + size_t expected_result = 0) { expected_output.clear(); actual_output.clear(); - // Prepare "actual" rendered data. We prepend a name to confirm the - // owner name should be compressed in both cases. - prepended_name.toWire(actual_output); - const size_t rdata_count = rrset ? rrset->getRdataCount() : 0; - const int expected_ret = (dnssec_ok && rrsig_rrset) ? - rdata_count + rrsig_rrset->getRdataCount() : rdata_count; - EXPECT_EQ(expected_ret, actual_rrset.toWire(actual_output)); + if (len_limit == 0) { // normal rendering + // Prepare "actual" rendered data. We prepend a name to confirm the + // owner name should be compressed in both cases. + prepended_name.toWire(actual_output); + const size_t rdata_count = rrset ? rrset->getRdataCount() : 0; + const int expected_ret = (dnssec_ok && rrsig_rrset) ? + rdata_count + rrsig_rrset->getRdataCount() : rdata_count; + EXPECT_EQ(expected_ret, actual_rrset.toWire(actual_output)); + } else { // truncation + setOutputLengthLimit(actual_output, len_limit); + EXPECT_EQ(expected_result, actual_rrset.toWire(actual_output)); + EXPECT_TRUE(isOutputTruncated(actual_output)); // always true here + } // Prepare "expected" data. - prepended_name.toWire(expected_output); + if (len_limit == 0) { // normal rendering + prepended_name.toWire(expected_output); + } else { // truncation + setOutputLengthLimit(expected_output, len_limit); + } if (rrset) { rrset->toWire(expected_output); } - if (dnssec_ok && rrsig_rrset) { + if (!isOutputTruncated(expected_output) && dnssec_ok && rrsig_rrset) { rrsig_rrset->toWire(expected_output); } @@ -217,33 +281,39 @@ checkToWireResult(OutputType& expected_output, OutputType& actual_output, TEST_F(TreeNodeRRsetTest, toWire) { MessageRenderer expected_renderer, actual_renderer; + OutputBuffer expected_buffer(0), actual_buffer(0); { SCOPED_TRACE("with RRSIG, DNSSEC OK"); - const TreeNodeRRset rrset1(rrclass_, www_node_, a_rdataset_, true); - checkToWireResult(expected_renderer, actual_renderer, rrset1, + const TreeNodeRRset rrset(rrclass_, www_node_, a_rdataset_, true); + checkToWireResult(expected_renderer, actual_renderer, rrset, www_name_, a_rrset_, a_rrsig_rrset_, true); + // Currently the buffer version throws + EXPECT_THROW( + checkToWireResult(expected_buffer, actual_buffer, rrset, + www_name_, a_rrset_, a_rrsig_rrset_, true), + isc::Unexpected); } { SCOPED_TRACE("with RRSIG, DNSSEC not OK"); - const TreeNodeRRset rrset2(rrclass_, www_node_, a_rdataset_, false); - checkToWireResult(expected_renderer, actual_renderer, rrset2, + const TreeNodeRRset rrset(rrclass_, www_node_, a_rdataset_, false); + checkToWireResult(expected_renderer, actual_renderer, rrset, www_name_, a_rrset_, a_rrsig_rrset_, false); } { SCOPED_TRACE("without RRSIG, DNSSEC OK"); - const TreeNodeRRset rrset3(rrclass_, origin_node_, ns_rdataset_, true); - checkToWireResult(expected_renderer, actual_renderer, rrset3, + const TreeNodeRRset rrset(rrclass_, origin_node_, ns_rdataset_, true); + checkToWireResult(expected_renderer, actual_renderer, rrset, origin_name_, ns_rrset_, ConstRRsetPtr(), true); } { SCOPED_TRACE("without RRSIG, DNSSEC not OK"); - const TreeNodeRRset rrset4(rrclass_, origin_node_, ns_rdataset_, - false); - checkToWireResult(expected_renderer, actual_renderer, rrset4, + const TreeNodeRRset rrset(rrclass_, origin_node_, ns_rdataset_, + false); + checkToWireResult(expected_renderer, actual_renderer, rrset, origin_name_, ns_rrset_, ConstRRsetPtr(), false); } @@ -251,9 +321,9 @@ TEST_F(TreeNodeRRsetTest, toWire) { // RDATA of DNAME DR shouldn't be compressed. Prepending "example.org" // will check that. SCOPED_TRACE("uncompressed RDATA"); - const TreeNodeRRset rrset5(rrclass_, origin_node_, dname_rdataset_, - false); - checkToWireResult(expected_renderer, actual_renderer, rrset5, + const TreeNodeRRset rrset(rrclass_, origin_node_, dname_rdataset_, + false); + checkToWireResult(expected_renderer, actual_renderer, rrset, Name("example.org"), dname_rrset_, ConstRRsetPtr(), false); } @@ -261,8 +331,8 @@ TEST_F(TreeNodeRRsetTest, toWire) { { SCOPED_TRACE("wildcard with RRSIG"); checkToWireResult(expected_renderer, actual_renderer, - TreeNodeRRset(match_name_, rrclass_, wildcard_node_, - wildcard_rdataset_, true), + *createRRset(match_name_, rrclass_, wildcard_node_, + wildcard_rdataset_, true), origin_name_, wildmatch_rrset_, wildmatch_rrsig_rrset_, true); } @@ -270,8 +340,8 @@ TEST_F(TreeNodeRRsetTest, toWire) { { SCOPED_TRACE("wildcard without RRSIG"); checkToWireResult(expected_renderer, actual_renderer, - TreeNodeRRset(match_name_, rrclass_, wildcard_node_, - wildcard_rdataset_, false), + *createRRset(match_name_, rrclass_, wildcard_node_, + wildcard_rdataset_, false), origin_name_, wildmatch_rrset_, wildmatch_rrsig_rrset_, false); } @@ -282,9 +352,9 @@ TEST_F(TreeNodeRRsetTest, toWire) { // ANY or type-RRSIG queries, which are rare also). But can still // happen. SCOPED_TRACE("RRSIG only, DNSSEC OK"); - const TreeNodeRRset rrset6(rrclass_, www_node_, rrsig_only_rdataset_, - true); - checkToWireResult(expected_renderer, actual_renderer, rrset6, + const TreeNodeRRset rrset(rrclass_, www_node_, rrsig_only_rdataset_, + true); + checkToWireResult(expected_renderer, actual_renderer, rrset, www_name_, ConstRRsetPtr(), txt_rrsig_rrset_,true); } @@ -293,60 +363,34 @@ TEST_F(TreeNodeRRsetTest, toWire) { // In practice this case wouldn't happen, but API-wise possible, so // we test it explicitly. SCOPED_TRACE("RRSIG only, DNSSEC not OK"); - const TreeNodeRRset rrset7(rrclass_, www_node_, rrsig_only_rdataset_, - false); - checkToWireResult(expected_renderer, actual_renderer, rrset7, + const TreeNodeRRset rrset(rrclass_, www_node_, rrsig_only_rdataset_, + false); + checkToWireResult(expected_renderer, actual_renderer, rrset, www_name_, ConstRRsetPtr(), txt_rrsig_rrset_,false); } } -void -checkTruncationResult(MessageRenderer& expected_renderer, - MessageRenderer& actual_renderer, - const AbstractRRset& actual_rrset, - ConstRRsetPtr rrset, ConstRRsetPtr rrsig_rrset, - bool dnssec_ok, size_t len_limit, size_t expected_result) -{ - expected_renderer.clear(); - actual_renderer.clear(); - - actual_renderer.setLengthLimit(len_limit); - EXPECT_EQ(expected_result, actual_rrset.toWire(actual_renderer)); - EXPECT_TRUE(actual_renderer.isTruncated()); // always true in this test - - expected_renderer.setLengthLimit(len_limit); - if (rrset) { - rrset->toWire(expected_renderer); - } - if (!expected_renderer.isTruncated() && dnssec_ok && rrsig_rrset) { - rrsig_rrset->toWire(expected_renderer); - } - - matchWireData(expected_renderer.getData(), expected_renderer.getLength(), - actual_renderer.getData(), actual_renderer.getLength()); -} - TEST_F(TreeNodeRRsetTest, toWireTruncated) { MessageRenderer expected_renderer, actual_renderer; + // dummy parameter to checkToWireResult (unused for the this test case) + const Name& name = Name::ROOT_NAME(); // Set the truncation limit to name len + 14 bytes of fixed data for A RR // (type, class, TTL, rdlen, and 4-byte IPv4 address). Then we can only // render just one RR, without any garbage trailing data. - checkTruncationResult(expected_renderer, actual_renderer, - TreeNodeRRset(rrclass_, www_node_, a_rdataset_, - true), - a_rrset_, a_rrsig_rrset_, true, - www_name_.getLength() + 14, - 1); // 1 main RR, no RRSIG + checkToWireResult(expected_renderer, actual_renderer, + *createRRset(rrclass_, www_node_, a_rdataset_, true), + name, a_rrset_, a_rrsig_rrset_, true, + www_name_.getLength() + 14, + 1); // 1 main RR, no RRSIG // The first main RRs should fit in the renderer (the name will be // fully compressed, so its size is 2 bytes), but the RRSIG doesn't. - checkTruncationResult(expected_renderer, actual_renderer, - TreeNodeRRset(rrclass_, www_node_, a_rdataset_, - true), - a_rrset_, a_rrsig_rrset_, true, - www_name_.getLength() + 14 + 2 + 14, - 2); // 2 main RR, no RRSIG + checkToWireResult(expected_renderer, actual_renderer, + *createRRset(rrclass_, www_node_, a_rdataset_, true), + name, a_rrset_, a_rrsig_rrset_, true, + www_name_.getLength() + 14 + 2 + 14, + 2); // 2 main RR, no RRSIG // This RRset has one main RR and two RRSIGs. Rendering the second RRSIG // causes truncation. @@ -358,19 +402,18 @@ TEST_F(TreeNodeRRsetTest, toWireTruncated) { a_rrsig_rrset_->toWire(expected_renderer); const size_t limit_len = expected_renderer.getLength(); // Then perform the test - checkTruncationResult(expected_renderer, actual_renderer, - TreeNodeRRset(rrclass_, www_node_, aaaa_rdataset_, - true), - aaaa_rrset_, aaaa_rrsig_rrset_, true, limit_len, - 2); // 1 main RR, 1 RRSIG + checkToWireResult(expected_renderer, actual_renderer, + *createRRset(rrclass_, www_node_, aaaa_rdataset_, true), + name, aaaa_rrset_, aaaa_rrsig_rrset_, true, limit_len, + 2); // 1 main RR, 1 RRSIG // RRSIG only case. Render length limit being 1, so it won't fit, // and will cause truncation. - checkTruncationResult(expected_renderer, actual_renderer, - TreeNodeRRset(rrclass_, www_node_, - rrsig_only_rdataset_, true), - ConstRRsetPtr(), txt_rrsig_rrset_, true, 1, - 0); // no RR + checkToWireResult(expected_renderer, actual_renderer, + *createRRset(rrclass_, www_node_, rrsig_only_rdataset_, + true), + name, ConstRRsetPtr(), txt_rrsig_rrset_, true, 1, + 0); // no RR } void @@ -436,32 +479,32 @@ checkToText(const AbstractRRset& actual_rrset, TEST_F(TreeNodeRRsetTest, toText) { // Constructed with RRSIG, and it should be visible. - checkToText(TreeNodeRRset(rrclass_, www_node_, a_rdataset_, true), + checkToText(*createRRset(rrclass_, www_node_, a_rdataset_, true), a_rrset_, a_rrsig_rrset_); // Constructed with RRSIG, and it should be invisible. - checkToText(TreeNodeRRset(rrclass_, www_node_, a_rdataset_, false), + checkToText(*createRRset(rrclass_, www_node_, a_rdataset_, false), a_rrset_, ConstRRsetPtr()); // Constructed without RRSIG, and it would be visible (but of course won't) - checkToText(TreeNodeRRset(rrclass_, origin_node_, ns_rdataset_, true), + checkToText(*createRRset(rrclass_, origin_node_, ns_rdataset_, true), ns_rrset_, ConstRRsetPtr()); // Constructed without RRSIG, and it should be visible - checkToText(TreeNodeRRset(rrclass_, origin_node_, ns_rdataset_, false), + checkToText(*createRRset(rrclass_, origin_node_, ns_rdataset_, false), ns_rrset_, ConstRRsetPtr()); // Wildcard expanded name with RRSIG - checkToText(TreeNodeRRset(match_name_, rrclass_, wildcard_node_, - wildcard_rdataset_, true), + checkToText(*createRRset(match_name_, rrclass_, wildcard_node_, + wildcard_rdataset_, true), wildmatch_rrset_, wildmatch_rrsig_rrset_); // Wildcard expanded name without RRSIG - checkToText(TreeNodeRRset(match_name_, rrclass_, wildcard_node_, - wildcard_rdataset_, false), + checkToText(*createRRset(match_name_, rrclass_, wildcard_node_, + wildcard_rdataset_, false), wildmatch_rrset_, ConstRRsetPtr()); // RRSIG case - checkToText(TreeNodeRRset(rrclass_, www_node_, rrsig_only_rdataset_, - true), + checkToText(*createRRset(rrclass_, www_node_, rrsig_only_rdataset_, + true), ConstRRsetPtr(), txt_rrsig_rrset_); // Similar to the previous case, but completely empty. - checkToText(TreeNodeRRset(rrclass_, www_node_, rrsig_only_rdataset_, - false), + checkToText(*createRRset(rrclass_, www_node_, rrsig_only_rdataset_, + false), ConstRRsetPtr(), ConstRRsetPtr()); } @@ -469,22 +512,22 @@ TEST_F(TreeNodeRRsetTest, isSameKind) { const TreeNodeRRset rrset(rrclass_, www_node_, a_rdataset_, true); // Same name (node), same type (rdataset) => same kind - EXPECT_TRUE(rrset.isSameKind(TreeNodeRRset(rrclass_, www_node_, - a_rdataset_, true))); + EXPECT_TRUE(rrset.isSameKind(*createRRset(rrclass_, www_node_, + a_rdataset_, true))); // Same name (node), different type (rdataset) => not same kind - EXPECT_FALSE(rrset.isSameKind(TreeNodeRRset(rrclass_, www_node_, - aaaa_rdataset_, true))); + EXPECT_FALSE(rrset.isSameKind(*createRRset(rrclass_, www_node_, + aaaa_rdataset_, true))); // Different name, different type => not same kind - EXPECT_FALSE(rrset.isSameKind(TreeNodeRRset(rrclass_, origin_node_, - ns_rdataset_, true))); + EXPECT_FALSE(rrset.isSameKind(*createRRset(rrclass_, origin_node_, + ns_rdataset_, true))); // Different name, same type => not same kind. // Note: this shouldn't happen in our in-memory data source implementation, // but API doesn't prohibit it. - EXPECT_FALSE(rrset.isSameKind(TreeNodeRRset(rrclass_, origin_node_, - a_rdataset_, true))); + EXPECT_FALSE(rrset.isSameKind(*createRRset(rrclass_, origin_node_, + a_rdataset_, true))); // Wildcard and expanded RRset const TreeNodeRRset wildcard_rrset(rrclass_, wildcard_node_, @@ -516,8 +559,8 @@ TEST_F(TreeNodeRRsetTest, isSameKind) { // tree node, they must belong to the same RR class. This case is // a caller's bug, and the isSameKind() implementation returns the // "wrong" (= true) answer. - EXPECT_TRUE(rrset.isSameKind(TreeNodeRRset(RRClass::CH(), www_node_, - a_rdataset_, true))); + EXPECT_TRUE(rrset.isSameKind(*createRRset(RRClass::CH(), www_node_, + a_rdataset_, true))); // Same kind of different RRset class EXPECT_TRUE(rrset.isSameKind(*a_rrset_)); @@ -525,4 +568,24 @@ TEST_F(TreeNodeRRsetTest, isSameKind) { // Different kind of different RRset class EXPECT_FALSE(rrset.isSameKind(*aaaa_rrset_)); } + +TEST_F(TreeNodeRRsetTest, unexpectedMethods) { + // Note: buffer version of toWire() is checked in the toWire test. + + TreeNodeRRset rrset(rrclass_, www_node_, a_rdataset_, true); + + EXPECT_THROW(rrset.setTTL(RRTTL(0)), isc::Unexpected); + EXPECT_THROW(rrset.setName(Name("example")), isc::Unexpected); + EXPECT_THROW(rrset.addRdata(createRdata(RRType::A(), rrclass_, "0.0.0.0")), + isc::Unexpected); + EXPECT_THROW(rrset.getRRsig(), isc::Unexpected); + RdataPtr sig_rdata = createRdata( + RRType::RRSIG(), rrclass_, + "A 5 2 3600 20120814220826 20120715220826 5300 example.com. FAKE"); + EXPECT_THROW(rrset.addRRsig(sig_rdata), isc::Unexpected); + EXPECT_THROW(rrset.addRRsig(*a_rrsig_rrset_), isc::Unexpected); + EXPECT_THROW(rrset.addRRsig(a_rrsig_rrset_), isc::Unexpected); + EXPECT_THROW(rrset.addRRsig(RRsetPtr()), isc::Unexpected); + EXPECT_THROW(rrset.removeRRsig(), isc::Unexpected); +} } diff --git a/src/lib/datasrc/memory/treenode_rrset.cc b/src/lib/datasrc/memory/treenode_rrset.cc index 1f4bc1d02e..fb7cafc4fd 100644 --- a/src/lib/datasrc/memory/treenode_rrset.cc +++ b/src/lib/datasrc/memory/treenode_rrset.cc @@ -40,22 +40,11 @@ namespace isc { namespace datasrc { namespace memory { -TreeNodeRRset::TreeNodeRRset(const dns::Name& realname, - const dns::RRClass& rrclass, - const ZoneNode* node, const RdataSet* rdataset, - bool dnssec_ok) : - node_(node), rdataset_(rdataset), - rrsig_count_(rdataset_->getSigRdataCount()), rrclass_(rrclass), - dnssec_ok_(dnssec_ok), name_(NULL), ttl_(NULL) -{ - const LabelSequence labels(realname); - const size_t labels_storangelen = labels.getSerializedLength(); - realname_buf_ = new uint8_t[labels_storangelen]; - labels.serialize(realname_buf_, labels_storangelen); -} - const Name& TreeNodeRRset::getName() const { + if (realname_ != NULL) { + return (*realname_); + } if (name_ == NULL) { uint8_t labels_buf[LabelSequence::MAX_SERIALIZED_LENGTH]; const LabelSequence name_labels = getOwnerLabels(labels_buf); @@ -212,7 +201,7 @@ TreeNodeRRset::toWire(AbstractMessageRenderer& renderer) const { } unsigned int -TreeNodeRRset::toWire(isc::util::OutputBuffer& /*buffer*/) const { +TreeNodeRRset::toWire(isc::util::OutputBuffer&) const { isc_throw(Unexpected, "unexpected method called on TreeNodeRRset"); } @@ -345,12 +334,22 @@ TreeNodeRRset::isSameKind(const AbstractRRset& abs_other) const { if (rdataset_ != other->rdataset_) { return (false); } - // Same for the owner name (note: in practice this method would be - // called for rrsets at different nodes, so we check that condition - // first). Note also that based on the basic assumption of the - // ZoneTree, if the nodes are different their RR classes must be - // different. - if (node_ != other->node_ || !hasSameRealName(*other)) { + // Same for the owner name. Comparing the nodes also detect + // the case where RR classes are different (see the method description + // of the header for details). + if (node_ != other->node_ ) { + return (false); + } + // If one is constructed with a "real name" and the other isn't + // *we consider* them different. + if ((realname_ == NULL && other->realname_ != NULL) || + (realname_ != NULL && other->realname_ == NULL)) { + return (false); + } + // If both are constructed with a "real name", we compare their names + // explicitly. + if (realname_ != NULL && other->realname_ != NULL && + realname_->nequals(*other->realname_)) { return (false); } return (true); @@ -358,29 +357,6 @@ TreeNodeRRset::isSameKind(const AbstractRRset& abs_other) const { return (AbstractRRset::isSameKind(abs_other)); } -bool -TreeNodeRRset::hasSameRealName(const TreeNodeRRset& other) const { - // If one is constructed with a "real name" and the other isn't - // *we consider* them different. - if ((realname_buf_ == NULL && other.realname_buf_ != NULL) || - (realname_buf_ != NULL && other.realname_buf_ == NULL)) { - return (false); - } - - // If both are constructed with a "real name", we compare their names - // (as label sequences) explicitly. - if (realname_buf_ != NULL && other.realname_buf_ != NULL) { - uint8_t labels_buf[LabelSequence::MAX_SERIALIZED_LENGTH]; - uint8_t other_labels_buf[LabelSequence::MAX_SERIALIZED_LENGTH]; - if (!getOwnerLabels(labels_buf).equals( - other.getOwnerLabels(other_labels_buf))) { - return (false); - } - } - - return (true); -} - } // namespace memory } // namespace datasrc } // datasrc isc diff --git a/src/lib/datasrc/memory/treenode_rrset.h b/src/lib/datasrc/memory/treenode_rrset.h index 91f81e859b..bbaeff516b 100644 --- a/src/lib/datasrc/memory/treenode_rrset.h +++ b/src/lib/datasrc/memory/treenode_rrset.h @@ -28,6 +28,8 @@ #include #include +#include + #include namespace isc { @@ -65,17 +67,22 @@ namespace memory { /// it should be safe, but we should eventually provide complete /// implementations of these methods. /// +/// This class can internally maintain dynamically allocated resource. +/// It would cause copying a class object complicated while objects of +/// this class are not expected to be copyable in the usage, so it's +/// explicitly defined non copyable. +/// /// \note This class is exposed in this separate header file so that other /// part of the in-memory data source implementation and test code /// can refer to its definition, and only for that purpose. Otherwise this is /// essentially a private class of the in-memory data source implementation, /// and an application shouldn't directly refer to this class. -class TreeNodeRRset : public dns::AbstractRRset { +class TreeNodeRRset : boost::noncopyable, public dns::AbstractRRset { public: /// \brief Normal case constructor. /// /// This class object is basically defined with a \c ZoneNode and - /// \c RdataSet. The former determine the owner name of the RRset, + /// \c RdataSet. The former determines the owner name of the RRset, /// and the latter provides the rest of the RRset parameters. /// Since the RR class is maintained outside of the \c ZoneData, /// it must be explicitly given as a constructor parameter. @@ -105,7 +112,7 @@ public: const RdataSet* rdataset, bool dnssec_ok) : node_(node), rdataset_(rdataset), rrsig_count_(rdataset_->getSigRdataCount()), rrclass_(rrclass), - dnssec_ok_(dnssec_ok), name_(NULL), realname_buf_(NULL), ttl_(NULL) + dnssec_ok_(dnssec_ok), name_(NULL), realname_(NULL), ttl_(NULL) {} /// \brief Constructor for wildcard-expanded owner name. @@ -122,10 +129,15 @@ public: /// \throw std::bad_alloc Memory allocation fails TreeNodeRRset(const dns::Name& realname, const dns::RRClass& rrclass, const ZoneNode* node, const RdataSet* rdataset, - bool dnssec_ok); + bool dnssec_ok) : + node_(node), rdataset_(rdataset), + rrsig_count_(rdataset_->getSigRdataCount()), rrclass_(rrclass), + dnssec_ok_(dnssec_ok), name_(NULL), realname_(new dns::Name(realname)), + ttl_(NULL) + {} virtual ~TreeNodeRRset() { - delete[] realname_buf_; + delete realname_; delete ttl_; delete name_; } @@ -234,24 +246,19 @@ private: dns::LabelSequence getOwnerLabels( uint8_t labels_buf[dns::LabelSequence::MAX_SERIALIZED_LENGTH]) const { - if (realname_buf_ != NULL) { - return (dns::LabelSequence(realname_buf_)); + if (realname_ != NULL) { + return (dns::LabelSequence(*realname_)); } return (node_->getAbsoluteLabels(labels_buf)); } - // A helper for isSameKind() to check if 'this' and 'other' has - // the same "real" name in case at least either is constructed with - // a real name. - bool hasSameRealName(const TreeNodeRRset& other) const; - const ZoneNode* node_; const RdataSet* rdataset_; const size_t rrsig_count_; const dns::RRClass rrclass_; const bool dnssec_ok_; mutable dns::Name* name_; - uint8_t* realname_buf_; + const dns::Name* const realname_; mutable dns::RRTTL* ttl_; }; diff --git a/src/lib/datasrc/memory/zone_data.cc b/src/lib/datasrc/memory/zone_data.cc index 033af150c3..e2cbdef141 100644 --- a/src/lib/datasrc/memory/zone_data.cc +++ b/src/lib/datasrc/memory/zone_data.cc @@ -27,6 +27,7 @@ #include #include +#include #include // for the placement new #include @@ -94,7 +95,7 @@ NSEC3Data::create(util::MemorySegment& mem_sgmt, uint8_t hashalg, uint8_t* dp = param_data->getSaltBuf(); *dp++ = salt_len; if (salt_len > 0) { - memcpy(dp, &salt.at(0), salt_len); // use at for safety + std::memcpy(dp, &salt.at(0), salt_len); // use at for safety } return (param_data); diff --git a/src/lib/datasrc/sqlite3_accessor.cc b/src/lib/datasrc/sqlite3_accessor.cc index ba21de8912..24d7b3f72a 100644 --- a/src/lib/datasrc/sqlite3_accessor.cc +++ b/src/lib/datasrc/sqlite3_accessor.cc @@ -394,16 +394,19 @@ int checkSchemaVersionElement(sqlite3* db, const char* const query) { if (rc == SQLITE_ERROR) { // this is the error that is returned when the table does not // exist + sqlite3_finalize(prepared); return (-1); } else if (rc == SQLITE_OK) { break; } else if (rc != SQLITE_BUSY || i == 50) { + sqlite3_finalize(prepared); isc_throw(SQLite3Error, "Unable to prepare version query: " << rc << " " << sqlite3_errmsg(db)); } doSleep(); } if (sqlite3_step(prepared) != SQLITE_ROW) { + sqlite3_finalize(prepared); isc_throw(SQLite3Error, "Unable to query version: " << sqlite3_errmsg(db)); } @@ -474,8 +477,8 @@ private: // return db version pair -createDatabase(sqlite3* db) { - logger.info(DATASRC_SQLITE_SETUP); +createDatabase(sqlite3* db, const std::string& name) { + logger.warn(DATASRC_SQLITE_SETUP).arg(name); // try to get an exclusive lock. Once that is obtained, do the version // check *again*, just in case this process was racing another @@ -501,12 +504,12 @@ createDatabase(sqlite3* db) { } void -checkAndSetupSchema(Initializer* initializer) { +checkAndSetupSchema(Initializer* initializer, const std::string& name) { sqlite3* const db = initializer->params_.db_; pair schema_version = checkSchemaVersion(db); if (schema_version.first == -1) { - schema_version = createDatabase(db); + schema_version = createDatabase(db, name); } else if (schema_version.first != SQLITE_SCHEMA_MAJOR_VERSION) { LOG_ERROR(logger, DATASRC_SQLITE_INCOMPATIBLE_VERSION) .arg(schema_version.first).arg(schema_version.second) @@ -540,7 +543,7 @@ SQLite3Accessor::open(const std::string& name) { isc_throw(SQLite3Error, "Cannot open SQLite database file: " << name); } - checkAndSetupSchema(&initializer); + checkAndSetupSchema(&initializer, name); initializer.move(dbparameters_.get()); } diff --git a/src/lib/datasrc/sqlite3_datasrc.cc b/src/lib/datasrc/sqlite3_datasrc.cc index b450cd5b56..bced1ae5b1 100644 --- a/src/lib/datasrc/sqlite3_datasrc.cc +++ b/src/lib/datasrc/sqlite3_datasrc.cc @@ -788,7 +788,7 @@ private: // return db version pair create_database(sqlite3* db) { - logger.info(DATASRC_SQLITE_SETUP); + logger.info(DATASRC_SQLITE_SETUP_OLD_API); // try to get an exclusive lock. Once that is obtained, do the version // check *again*, just in case this process was racing another diff --git a/src/lib/datasrc/tests/Makefile.am b/src/lib/datasrc/tests/Makefile.am index f3be2e1967..b73a64a703 100644 --- a/src/lib/datasrc/tests/Makefile.am +++ b/src/lib/datasrc/tests/Makefile.am @@ -103,8 +103,10 @@ endif EXTRA_DIST = testdata/brokendb.sqlite3 EXTRA_DIST += testdata/contexttest.zone EXTRA_DIST += testdata/diffs.sqlite3 +EXTRA_DIST += testdata/duplicate_rrset.zone EXTRA_DIST += testdata/example2.com EXTRA_DIST += testdata/example2.com.sqlite3 +EXTRA_DIST += testdata/example.com.flattened EXTRA_DIST += testdata/example.com.signed EXTRA_DIST += testdata/example.org EXTRA_DIST += testdata/example.org.nsec3-signed diff --git a/src/lib/datasrc/tests/database_unittest.cc b/src/lib/datasrc/tests/database_unittest.cc index 56ee5dd171..dda4de2b29 100644 --- a/src/lib/datasrc/tests/database_unittest.cc +++ b/src/lib/datasrc/tests/database_unittest.cc @@ -2153,7 +2153,7 @@ TYPED_TEST(DatabaseClientTest, findDelegation) { this->rrttl_, ZoneFinder::DELEGATION, this->expected_rdatas_, this->expected_sig_rdatas_); - // And when we ask direcly for the NS, we should still get delegation + // And when we ask directly for the NS, we should still get delegation doFindTest(*finder, isc::dns::Name("delegation.example.org."), isc::dns::RRType::NS(), isc::dns::RRType::NS(), this->rrttl_, ZoneFinder::DELEGATION, this->expected_rdatas_, @@ -2184,7 +2184,7 @@ TYPED_TEST(DatabaseClientTest, findDelegation) { this->expected_sig_rdatas_, ZoneFinder::RESULT_DEFAULT, isc::dns::Name("dname.example.org.")); - // Asking direcly for DNAME should give SUCCESS + // Asking directly for DNAME should give SUCCESS doFindTest(*finder, isc::dns::Name("dname.example.org."), isc::dns::RRType::DNAME(), isc::dns::RRType::DNAME(), this->rrttl_, ZoneFinder::SUCCESS, this->expected_rdatas_, diff --git a/src/lib/datasrc/tests/memory_datasrc_unittest.cc b/src/lib/datasrc/tests/memory_datasrc_unittest.cc index 5abe2702a2..fcdca16a86 100644 --- a/src/lib/datasrc/tests/memory_datasrc_unittest.cc +++ b/src/lib/datasrc/tests/memory_datasrc_unittest.cc @@ -1511,7 +1511,7 @@ InMemoryZoneFinderTest::anyWildcardCheck( // First try directly the name (normal match) { - SCOPED_TRACE("Asking direcly for *"); + SCOPED_TRACE("Asking directly for *"); expected_sets.push_back(rr_wild_); findAllTest(Name("*.wild.example.org"), ZoneFinder::SUCCESS, expected_sets); diff --git a/src/lib/dhcp/iface_mgr.cc b/src/lib/dhcp/iface_mgr.cc index 90f6353622..a2f807e8c1 100644 --- a/src/lib/dhcp/iface_mgr.cc +++ b/src/lib/dhcp/iface_mgr.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2011-2012 Internet Systems Consortium, Inc. ("ISC") // // Permission to use, copy, modify, and/or distribute this software for any // purpose with or without fee is hereby granted, provided that the above @@ -50,6 +50,15 @@ IfaceMgr::Iface::Iface(const std::string& name, int ifindex) memset(mac_, 0, sizeof(mac_)); } +void +IfaceMgr::Iface::closeSockets() { + for (SocketCollection::iterator sock = sockets_.begin(); + sock != sockets_.end(); ++sock) { + close(sock->sockfd_); + } + sockets_.clear(); +} + std::string IfaceMgr::Iface::getFullName() const { ostringstream tmp; @@ -138,15 +147,8 @@ IfaceMgr::IfaceMgr() void IfaceMgr::closeSockets() { for (IfaceCollection::iterator iface = ifaces_.begin(); iface != ifaces_.end(); ++iface) { - - for (SocketCollection::iterator sock = iface->sockets_.begin(); - sock != iface->sockets_.end(); ++sock) { - cout << "Closing socket " << sock->sockfd_ << endl; - close(sock->sockfd_); - } - iface->sockets_.clear(); + iface->closeSockets(); } - } IfaceMgr::~IfaceMgr() { @@ -477,11 +479,34 @@ IfaceMgr::getLocalAddress(const IOAddress& remote_addr, const uint16_t port) { asio::io_service io_service; asio::ip::udp::socket sock(io_service); - // Try to connect to remote endpoint and check if attempt is successful. asio::error_code err_code; + // If remote address is broadcast address we have to + // allow this on the socket. + if (remote_addr.getAddress().is_v4() && + (remote_addr == IOAddress("255.255.255.255"))) { + // Socket has to be open prior to setting the broadcast + // option. Otherwise set_option will complain about + // bad file descriptor. + + // @todo: We don't specify interface in any way here. 255.255.255.255 + // We can very easily end up with a socket working on a different + // interface. + sock.open(asio::ip::udp::v4(), err_code); + if (err_code) { + isc_throw(Unexpected, "failed to open UDPv4 socket"); + } + sock.set_option(asio::socket_base::broadcast(true), err_code); + if (err_code) { + sock.close(); + isc_throw(Unexpected, "failed to enable broadcast on the socket"); + } + } + + // Try to connect to remote endpoint and check if attempt is successful. sock.connect(remote_endpoint->getASIOEndpoint(), err_code); if (err_code) { - isc_throw(Unexpected,"Failed to connect to remote endpoint."); + sock.close(); + isc_throw(Unexpected,"failed to connect to remote endpoint."); } // Once we are connected socket object holds local endpoint. @@ -489,6 +514,9 @@ IfaceMgr::getLocalAddress(const IOAddress& remote_addr, const uint16_t port) { sock.local_endpoint(); asio::ip::address local_address(local_endpoint.address()); + // Close the socket. + sock.close(); + // Return address of local endpoint. return IOAddress(local_address); } @@ -546,8 +574,9 @@ int IfaceMgr::openSocket6(Iface& iface, const IOAddress& addr, uint16_t port) { memset(&addr6, 0, sizeof(addr6)); addr6.sin6_family = AF_INET6; addr6.sin6_port = htons(port); - if (addr.toText() != "::1") - addr6.sin6_scope_id = if_nametoindex(iface.getName().c_str()); + if (addr.toText() != "::1") { + addr6.sin6_scope_id = if_nametoindex(iface.getName().c_str()); + } memcpy(&addr6.sin6_addr, addr.getAddress().to_v6().to_bytes().data(), @@ -698,6 +727,13 @@ IfaceMgr::send(const Pkt6Ptr& pkt) { m.msg_control = &control_buf_[0]; m.msg_controllen = control_buf_len_; struct cmsghdr *cmsg = CMSG_FIRSTHDR(&m); + + // FIXME: Code below assumes that cmsg is not NULL, but + // CMSG_FIRSTHDR() is coded to return NULL as a possibility. The + // following assertion should never fail, but if it did and you came + // here, fix the code. :) + assert(cmsg != NULL); + cmsg->cmsg_level = IPPROTO_IPV6; cmsg->cmsg_type = IPV6_PKTINFO; cmsg->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo)); @@ -724,7 +760,6 @@ IfaceMgr::send(const Pkt6Ptr& pkt) { bool IfaceMgr::send(const Pkt4Ptr& pkt) { - Iface* iface = getIface(pkt->getIface()); if (!iface) { isc_throw(BadValue, "Unable to send Pkt4. Invalid interface (" @@ -785,8 +820,12 @@ IfaceMgr::send(const Pkt4Ptr& pkt) boost::shared_ptr -IfaceMgr::receive4(uint32_t timeout) { - +IfaceMgr::receive4(uint32_t timeout_sec, uint32_t timeout_usec /* = 0 */) { + // Sanity check for microsecond timeout. + if (timeout_usec >= 1000000) { + isc_throw(BadValue, "fractional timeout must be shorter than" + " one million microseconds"); + } const SocketInfo* candidate = 0; IfaceCollection::const_iterator iface; fd_set sockets; @@ -800,8 +839,9 @@ IfaceMgr::receive4(uint32_t timeout) { /// provided set to indicated which sockets have something to read. for (iface = ifaces_.begin(); iface != ifaces_.end(); ++iface) { - for (SocketCollection::const_iterator s = iface->sockets_.begin(); - s != iface->sockets_.end(); ++s) { + const SocketCollection& socket_collection = iface->getSockets(); + for (SocketCollection::const_iterator s = socket_collection.begin(); + s != socket_collection.end(); ++s) { // Only deal with IPv4 addresses. if (s->addr_.getFamily() == AF_INET) { @@ -825,13 +865,13 @@ IfaceMgr::receive4(uint32_t timeout) { names << session_socket_ << "(session)"; } - /// @todo: implement sub-second precision one day struct timeval select_timeout; - select_timeout.tv_sec = timeout; - select_timeout.tv_usec = 0; + select_timeout.tv_sec = timeout_sec; + select_timeout.tv_usec = timeout_usec; cout << "Trying to receive data on sockets: " << names.str() - << ". Timeout is " << timeout << " seconds." << endl; + << ". Timeout is " << timeout_sec << "." << setw(6) << setfill('0') + << timeout_usec << " seconds." << endl; int result = select(maxfd + 1, &sockets, NULL, NULL, &select_timeout); cout << "select returned " << result << endl; @@ -864,8 +904,9 @@ IfaceMgr::receive4(uint32_t timeout) { // Let's find out which interface/socket has the data for (iface = ifaces_.begin(); iface != ifaces_.end(); ++iface) { - for (SocketCollection::const_iterator s = iface->sockets_.begin(); - s != iface->sockets_.end(); ++s) { + const SocketCollection& socket_collection = iface->getSockets(); + for (SocketCollection::const_iterator s = socket_collection.begin(); + s != socket_collection.end(); ++s) { if (FD_ISSET(s->sockfd_, &sockets)) { candidate = &(*s); break; @@ -953,7 +994,12 @@ IfaceMgr::receive4(uint32_t timeout) { return (pkt); } -Pkt6Ptr IfaceMgr::receive6(uint32_t timeout) { +Pkt6Ptr IfaceMgr::receive6(uint32_t timeout_sec, uint32_t timeout_usec /* = 0 */ ) { + // Sanity check for microsecond timeout. + if (timeout_usec >= 1000000) { + isc_throw(BadValue, "fractional timeout must be shorter than" + " one million microseconds"); + } const SocketInfo* candidate = 0; fd_set sockets; @@ -967,9 +1013,9 @@ Pkt6Ptr IfaceMgr::receive6(uint32_t timeout) { /// provided set to indicated which sockets have something to read. IfaceCollection::const_iterator iface; for (iface = ifaces_.begin(); iface != ifaces_.end(); ++iface) { - - for (SocketCollection::const_iterator s = iface->sockets_.begin(); - s != iface->sockets_.end(); ++s) { + const SocketCollection& socket_collection = iface->getSockets(); + for (SocketCollection::const_iterator s = socket_collection.begin(); + s != socket_collection.end(); ++s) { // Only deal with IPv4 addresses. if (s->addr_.getFamily() == AF_INET6) { @@ -993,13 +1039,13 @@ Pkt6Ptr IfaceMgr::receive6(uint32_t timeout) { names << session_socket_ << "(session)"; } - cout << "Trying to receive data on sockets:" << names.str() - << ".Timeout is " << timeout << " seconds." << endl; + cout << "Trying to receive data on sockets: " << names.str() + << ". Timeout is " << timeout_sec << "." << setw(6) << setfill('0') + << timeout_usec << " seconds." << endl; - /// @todo: implement sub-second precision one day struct timeval select_timeout; - select_timeout.tv_sec = timeout; - select_timeout.tv_usec = 0; + select_timeout.tv_sec = timeout_sec; + select_timeout.tv_usec = timeout_usec; int result = select(maxfd + 1, &sockets, NULL, NULL, &select_timeout); @@ -1032,8 +1078,9 @@ Pkt6Ptr IfaceMgr::receive6(uint32_t timeout) { // Let's find out which interface/socket has the data for (iface = ifaces_.begin(); iface != ifaces_.end(); ++iface) { - for (SocketCollection::const_iterator s = iface->sockets_.begin(); - s != iface->sockets_.end(); ++s) { + const SocketCollection& socket_collection = iface->getSockets(); + for (SocketCollection::const_iterator s = socket_collection.begin(); + s != socket_collection.end(); ++s) { if (FD_ISSET(s->sockfd_, &sockets)) { candidate = &(*s); break; @@ -1168,8 +1215,9 @@ uint16_t IfaceMgr::getSocket(const isc::dhcp::Pkt6& pkt) { << pkt.getIface()); } + const SocketCollection& socket_collection = iface->getSockets(); SocketCollection::const_iterator s; - for (s = iface->sockets_.begin(); s != iface->sockets_.end(); ++s) { + for (s = socket_collection.begin(); s != socket_collection.end(); ++s) { if ((s->family_ == AF_INET6) && (!s->addr_.getAddress().to_v6().is_multicast())) { return (s->sockfd_); @@ -1190,8 +1238,9 @@ uint16_t IfaceMgr::getSocket(isc::dhcp::Pkt4 const& pkt) { << pkt.getIface()); } + const SocketCollection& socket_collection = iface->getSockets(); SocketCollection::const_iterator s; - for (s = iface->sockets_.begin(); s != iface->sockets_.end(); ++s) { + for (s = socket_collection.begin(); s != socket_collection.end(); ++s) { if (s->family_ == AF_INET) { return (s->sockfd_); } diff --git a/src/lib/dhcp/iface_mgr.h b/src/lib/dhcp/iface_mgr.h index 36ad0eada2..98ce6729c1 100644 --- a/src/lib/dhcp/iface_mgr.h +++ b/src/lib/dhcp/iface_mgr.h @@ -1,4 +1,4 @@ -// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2011-2012 Internet Systems Consortium, Inc. ("ISC") // // Permission to use, copy, modify, and/or distribute this software for any // purpose with or without fee is hereby granted, provided that the above @@ -72,8 +72,10 @@ public: }; /// type that holds a list of socket informations + /// @todo: Add SocketCollectionConstIter type typedef std::list SocketCollection; + /// @brief represents a single network interface /// /// Iface structure represents network interface with all useful @@ -89,6 +91,9 @@ public: /// @param ifindex interface index (unique integer identifier) Iface(const std::string& name, int ifindex); + /// @brief Closes all open sockets on interface. + void closeSockets(); + /// @brief Returns full interface name as "ifname/ifindex" string. /// /// @return string with interface name @@ -192,11 +197,25 @@ public: /// @return true if there was such socket, false otherwise bool delSocket(uint16_t sockfd); - /// socket used to sending data - /// TODO: this should be protected - SocketCollection sockets_; + /// @brief Returns collection of all sockets added to interface. + /// + /// When new socket is created with @ref IfaceMgr::openSocket + /// it is added to sockets collection on particular interface. + /// If socket is opened by other means (e.g. function that does + /// not use @ref IfaceMgr::openSocket) it will not be available + /// in this collection. Note that functions like + /// @ref IfaceMgr::openSocketFromIface use + /// @ref IfaceMgr::openSocket internally. + /// The returned reference is only valid during the lifetime of + /// the IfaceMgr object that returned it. + /// + /// @return collection of sockets added to interface + const SocketCollection& getSockets() const { return sockets_; } protected: + /// socket used to sending data + SocketCollection sockets_; + /// network interface name std::string name_; @@ -345,10 +364,13 @@ public: /// to not wait infinitely, but rather do something useful /// (e.g. remove expired leases) /// - /// @param timeout specifies timeout (in seconds) + /// @param timeout_sec specifies integral part of the timeout (in seconds) + /// @param timeout_usec specifies fractional part of the timeout + /// (in microseconds) /// + /// @throw isc::BadValue if timeout_usec is greater than one million /// @return Pkt6 object representing received packet (or NULL) - Pkt6Ptr receive6(uint32_t timeout); + Pkt6Ptr receive6(uint32_t timeout_sec, uint32_t timeout_usec = 0); /// @brief Tries to receive IPv4 packet over open IPv4 sockets. /// @@ -356,10 +378,13 @@ public: /// If reception is successful and all information about its sender /// are obtained, Pkt4 object is created and returned. /// - /// @param timeout specifies timeout (in seconds) + /// @param timeout_sec specifies integral part of the timeout (in seconds) + /// @param timeout_usec specifies fractional part of the timeout + /// (in microseconds) /// + /// @throw isc::BadValue if timeout_usec is greater than one million /// @return Pkt4 object representing received packet (or NULL) - Pkt4Ptr receive4(uint32_t timeout); + Pkt4Ptr receive4(uint32_t timeout_sec, uint32_t timeout_usec = 0); /// Opens UDP/IP socket and binds it to address, interface and port. /// diff --git a/src/lib/dhcp/libdhcp++.cc b/src/lib/dhcp/libdhcp++.cc index c054a4b0a5..22cd47bb6e 100644 --- a/src/lib/dhcp/libdhcp++.cc +++ b/src/lib/dhcp/libdhcp++.cc @@ -15,6 +15,7 @@ #include #include #include +#include #include #include "config.h" #include @@ -34,6 +35,31 @@ std::map LibDHCP::v4factories_; std::map LibDHCP::v6factories_; +OptionPtr +LibDHCP::optionFactory(Option::Universe u, + uint16_t type, + const OptionBuffer& buf) { + FactoryMap::iterator it; + if (u == Option::V4) { + it = v4factories_.find(type); + if (it == v4factories_.end()) { + isc_throw(BadValue, "factory function not registered " + "for DHCP v4 option type " << type); + } + } else if (u == Option::V6) { + it = v6factories_.find(type); + if (it == v6factories_.end()) { + isc_throw(BadValue, "factory function not registered " + "for DHCPv6 option type " << type); + } + } else { + isc_throw(BadValue, "invalid universe specified (expected " + "Option::V4 or Option::V6"); + } + return (it->second(u, type, buf)); +} + + size_t LibDHCP::unpackOptions6(const OptionBuffer& buf, isc::dhcp::Option::OptionCollection& options) { size_t offset = 0; diff --git a/src/lib/dhcp/libdhcp++.h b/src/lib/dhcp/libdhcp++.h index c7935c8ff3..ae907012cc 100644 --- a/src/lib/dhcp/libdhcp++.h +++ b/src/lib/dhcp/libdhcp++.h @@ -25,6 +25,26 @@ namespace dhcp { class LibDHCP { public: + + /// Map of factory functions. + typedef std::map FactoryMap; + + /// @brief Factory function to create instance of option. + /// + /// Factory method creates instance of specified option. The option + /// to be created has to have corresponding factory function + /// registered with \ref LibDHCP::OptionFactoryRegister. + /// + /// @param u universe of the option (V4 or V6) + /// @param type option-type + /// @param buf option-buffer + /// @throw isc::InvalidOperation if there is no factory function + /// registered for specified option type. + /// @return instance of option. + static isc::dhcp::OptionPtr optionFactory(isc::dhcp::Option::Universe u, + uint16_t type, + const OptionBuffer& buf); + /// Builds collection of options. /// /// Builds raw (on-wire) data for provided collection of options. @@ -84,10 +104,10 @@ public: Option::Factory * factory); protected: /// pointers to factories that produce DHCPv6 options - static std::map v4factories_; + static FactoryMap v4factories_; /// pointers to factories that produce DHCPv6 options - static std::map v6factories_; + static FactoryMap v6factories_; }; } diff --git a/src/lib/dhcp/option.cc b/src/lib/dhcp/option.cc index 0c71606b6c..fb441f93d1 100644 --- a/src/lib/dhcp/option.cc +++ b/src/lib/dhcp/option.cc @@ -29,6 +29,14 @@ using namespace isc::util; namespace isc { namespace dhcp { +OptionPtr +Option::factory(Option::Universe u, + uint16_t type, + const OptionBuffer& buf) { + return(LibDHCP::optionFactory(u, type, buf)); +} + + Option::Option(Universe u, uint16_t type) :universe_(u), type_(type) { diff --git a/src/lib/dhcp/option.h b/src/lib/dhcp/option.h index 066296704e..080a869996 100644 --- a/src/lib/dhcp/option.h +++ b/src/lib/dhcp/option.h @@ -63,9 +63,45 @@ public: /// @param type option type /// @param buf pointer to a buffer /// + /// @todo Passing a separate buffer for each option means that a copy + /// was done. We can avoid it by passing 2 iterators. + /// /// @return a pointer to a created option object typedef OptionPtr Factory(Option::Universe u, uint16_t type, const OptionBuffer& buf); + /// @brief Factory function to create instance of option. + /// + /// Factory method creates instance of specified option. The option + /// to be created has to have corresponding factory function + /// registered with \ref LibDHCP::OptionFactoryRegister. + /// + /// @param u universe of the option (V4 or V6) + /// @param type option-type + /// @param buf option-buffer + /// @throw isc::InvalidOperation if there is no factory function + /// registered for specified option type. + /// @return instance of option. + static OptionPtr factory(Option::Universe u, + uint16_t type, + const OptionBuffer& buf); + + /// @brief Factory function to create instance of option. + /// + /// Factory method creates instance of specified option. The option + /// to be created has to have corresponding factory function + /// registered with \ref LibDHCP::OptionFactoryRegister. + /// This method creates empty \ref OptionBuffer object. Use this + /// factory function if it is not needed to pass custom buffer. + /// + /// @param u universe of the option (V4 or V6) + /// @param type option-type + /// @throw isc::InvalidOperation if there is no factory function + /// registered for specified option type. + /// @return instance of option. + static OptionPtr factory(Option::Universe u, uint16_t type) { + return factory(u, type, OptionBuffer()); + } + /// @brief ctor, used for options constructed, usually during transmission /// /// @param u option universe (DHCPv4 or DHCPv6) diff --git a/src/lib/dhcp/tests/iface_mgr_unittest.cc b/src/lib/dhcp/tests/iface_mgr_unittest.cc index 5562551a0e..8db8706bec 100644 --- a/src/lib/dhcp/tests/iface_mgr_unittest.cc +++ b/src/lib/dhcp/tests/iface_mgr_unittest.cc @@ -59,6 +59,7 @@ public: ~IfaceMgrTest() { } + }; // We need some known interface to work reliably. Loopback interface @@ -217,6 +218,194 @@ TEST_F(IfaceMgrTest, getIface) { } +TEST_F(IfaceMgrTest, receiveTimeout6) { + using namespace boost::posix_time; + std::cout << "Testing DHCPv6 packet reception timeouts." + << " Test will block for a few seconds when waiting" + << " for timeout to occur." << std::endl; + + boost::scoped_ptr ifacemgr(new NakedIfaceMgr()); + // Open socket on the lo interface. + IOAddress loAddr("::1"); + int socket1 = 0; + ASSERT_NO_THROW( + socket1 = ifacemgr->openSocket(LOOPBACK, loAddr, 10547) + ); + // Socket is open if its descriptor is greater than zero. + ASSERT_GT(socket1, 0); + + // Remember when we call receive6(). + ptime start_time = microsec_clock::universal_time(); + // Call receive with timeout of 1s + 400000us = 1.4s. + Pkt6Ptr pkt; + ASSERT_NO_THROW(pkt = ifacemgr->receive6(1, 400000)); + // Remember when call to receive6() ended. + ptime stop_time = microsec_clock::universal_time(); + // We did not send a packet to lo interface so we expect that + // nothing has been received and timeout has been reached. + ASSERT_FALSE(pkt); + // Calculate duration of call to receive6(). + time_duration duration = stop_time - start_time; + // We stop the clock when the call completes so it does not + // precisely reflect the receive timeout. However the + // uncertainity should be low enough to expect that measured + // value is in the range <1.4s; 1.7s>. + EXPECT_GE(duration.total_microseconds(), 1400000); + EXPECT_LE(duration.total_microseconds(), 1700000); + + // Test timeout shorter than 1s. + start_time = microsec_clock::universal_time(); + ASSERT_NO_THROW(pkt = ifacemgr->receive6(0, 500000)); + stop_time = microsec_clock::universal_time(); + ASSERT_FALSE(pkt); + duration = stop_time - start_time; + // Check if measured duration is within <0.5s; 0.8s>. + EXPECT_GE(duration.total_microseconds(), 500000); + EXPECT_LE(duration.total_microseconds(), 800000); + + // Test with invalid fractional timeout values. + EXPECT_THROW(ifacemgr->receive6(0, 1000000), isc::BadValue); + EXPECT_THROW(ifacemgr->receive6(1, 1000010), isc::BadValue); +} + +TEST_F(IfaceMgrTest, receiveTimeout4) { + using namespace boost::posix_time; + std::cout << "Testing DHCPv6 packet reception timeouts." + << " Test will block for a few seconds when waiting" + << " for timeout to occur." << std::endl; + + boost::scoped_ptr ifacemgr(new NakedIfaceMgr()); + // Open socket on the lo interface. + IOAddress loAddr("127.0.0.1"); + int socket1 = 0; + ASSERT_NO_THROW( + socket1 = ifacemgr->openSocket(LOOPBACK, loAddr, 10067) + ); + // Socket is open if its descriptor is greater than zero. + ASSERT_GT(socket1, 0); + + Pkt4Ptr pkt; + // Remember when we call receive4(). + ptime start_time = microsec_clock::universal_time(); + // Call receive with timeout of 2s + 300000us = 2.3s. + ASSERT_NO_THROW(pkt = ifacemgr->receive4(2, 300000)); + // Remember when call to receive4() ended. + ptime stop_time = microsec_clock::universal_time(); + // We did not send a packet to lo interface so we expect that + // nothing has been received and timeout has been reached. + ASSERT_FALSE(pkt); + // Calculate duration of call to receive4(). + time_duration duration = stop_time - start_time; + // We stop the clock when the call completes so it does not + // precisely reflect the receive timeout. However the + // uncertainity should be low enough to expect that measured + // value is in the range <2.3s; 2.6s>. + EXPECT_GE(duration.total_microseconds(), 2300000); + EXPECT_LE(duration.total_microseconds(), 2600000); + + // Test timeout shorter than 1s. + start_time = microsec_clock::universal_time(); + ASSERT_NO_THROW(pkt = ifacemgr->receive4(0, 400000)); + stop_time = microsec_clock::universal_time(); + ASSERT_FALSE(pkt); + duration = stop_time - start_time; + // Check if measured duration is within <0.4s; 0.7s>. + EXPECT_GE(duration.total_microseconds(), 400000); + EXPECT_LE(duration.total_microseconds(), 700000); + + // Test with invalid fractional timeout values. + EXPECT_THROW(ifacemgr->receive6(0, 1000000), isc::BadValue); + EXPECT_THROW(ifacemgr->receive6(2, 1000005), isc::BadValue); +} + +TEST_F(IfaceMgrTest, multipleSockets) { + boost::scoped_ptr ifacemgr(new NakedIfaceMgr()); + + // container for initialized socket descriptors + std::list init_sockets; + + // create socket #1 + int socket1 = 0; + ASSERT_NO_THROW( + socket1 = ifacemgr->openSocketFromIface(LOOPBACK, PORT1, AF_INET); + ); + ASSERT_GT(socket1, 0); + init_sockets.push_back(socket1); + + // create socket #2 + IOAddress loAddr("127.0.0.1"); + int socket2 = 0; + ASSERT_NO_THROW( + socket2 = ifacemgr->openSocketFromRemoteAddress(loAddr, PORT2); + ); + ASSERT_GT(socket2, 0); + init_sockets.push_back(socket2); + + // Get loopback interface. If we don't find one we are unable to run + // this test but we don't want to fail. + IfaceMgr::Iface* iface_ptr = ifacemgr->getIface(LOOPBACK); + if (iface_ptr == NULL) { + cout << "Local loopback interface not found. Skipping test. " << endl; + return; + } + // Once sockets have been sucessfully opened, they are supposed to + // be on the list. Here we start to test if all expected sockets + // are on the list and no other (unexpected) socket is there. + IfaceMgr::SocketCollection sockets = iface_ptr->getSockets(); + int matched_sockets = 0; + for (std::list::iterator init_sockets_it = + init_sockets.begin(); + init_sockets_it != init_sockets.end(); ++init_sockets_it) { + // Set socket descriptors non blocking in order to be able + // to call recv() on them without hang. + int flags = fcntl(*init_sockets_it, F_GETFL, 0); + ASSERT_GE(flags, 0); + ASSERT_GE(fcntl(*init_sockets_it, F_SETFL, flags | O_NONBLOCK), 0); + // recv() is expected to result in EWOULDBLOCK error on non-blocking + // socket in case socket is valid but simply no data are coming in. + char buf; + recv(*init_sockets_it, &buf, 1, MSG_PEEK); + EXPECT_EQ(EWOULDBLOCK, errno); + // Apart from the ability to use the socket we want to make + // sure that socket on the list is the one that we created. + for (IfaceMgr::SocketCollection::const_iterator socket_it = + sockets.begin(); socket_it != sockets.end(); ++socket_it) { + if (*init_sockets_it == socket_it->sockfd_) { + // This socket is the one that we created. + ++matched_sockets; + break; + } + } + } + // all created sockets have been matched if this condition works. + EXPECT_EQ(sockets.size(), matched_sockets); + + // closeSockets() is the other function that we want to test. It + // is supposed to close all sockets so as we will not be able to use + // them anymore communication. + ifacemgr->closeSockets(); + + // closed sockets are supposed to be removed from the list + sockets = iface_ptr->getSockets(); + ASSERT_EQ(0, sockets.size()); + + // We are still in posession of socket descriptors that we created + // on the beginning of this test. We can use them to check whether + // closeSockets() only removed them from the list or they have been + // really closed. + for (std::list::const_iterator init_sockets_it = + init_sockets.begin(); + init_sockets_it != init_sockets.end(); ++init_sockets_it) { + // recv() must result in error when using invalid socket. + char buf; + recv(*init_sockets_it, &buf, 1, MSG_PEEK); + // EWOULDBLOCK would mean that socket is valid/open but + // simply no data is received so we have to check for + // other errors. + EXPECT_NE(EWOULDBLOCK, errno); + } +} + TEST_F(IfaceMgrTest, sockets6) { // testing socket operation in a portable way is tricky // without interface detection implemented @@ -317,6 +506,21 @@ TEST_F(IfaceMgrTest, socketsFromRemoteAddress) { ); EXPECT_GT(socket2, 0); close(socket2); + + // The following test is currently disabled for OSes other than + // Linux because interface detection is not implemented on them. + // @todo enable this test for all OSes once interface detection + // is implemented. +#if defined(OS_LINUX) + // Open v4 socket to connect to broadcast address. + int socket3 = 0; + IOAddress bcastAddr("255.255.255.255"); + EXPECT_NO_THROW( + socket3 = ifacemgr->openSocketFromRemoteAddress(bcastAddr, PORT2); + ); + EXPECT_GT(socket3, 0); + close(socket3); +#endif } // TODO: disabled due to other naming on various systems diff --git a/src/lib/dhcp/tests/libdhcp++_unittest.cc b/src/lib/dhcp/tests/libdhcp++_unittest.cc index 7e18be6889..d17eb6537f 100644 --- a/src/lib/dhcp/tests/libdhcp++_unittest.cc +++ b/src/lib/dhcp/tests/libdhcp++_unittest.cc @@ -18,6 +18,8 @@ #include #include #include +#include +#include #include #include "config.h" @@ -31,6 +33,19 @@ class LibDhcpTest : public ::testing::Test { public: LibDhcpTest() { } + + /// @brief Generic factory function to create any option. + /// + /// Generic factory function to create any option. + /// + /// @param u universe (V4 or V6) + /// @param type option-type + /// @param buf option-buffer + static OptionPtr genericOptionFactory(Option::Universe u, uint16_t type, + const OptionBuffer& buf) { + Option* option = new Option(u, type, buf); + return OptionPtr(option); + } }; static const uint8_t packed[] = { @@ -41,6 +56,78 @@ static const uint8_t packed[] = { 1, 1, 0, 1, 114 // opt5 (5 bytes) }; +TEST(LibDhcpTest, optionFactory) { + OptionBuffer buf; + // Factory functions for specific options must be registered before + // they can be used to create options instances. Otherwise exception + // is rised. + EXPECT_THROW(LibDHCP::optionFactory(Option::V4, DHO_SUBNET_MASK, buf), + isc::BadValue); + + // Let's register some factory functions (two v4 and one v6 function). + // Registration may trigger exception if function for the specified + // option has been registered already. + ASSERT_NO_THROW( + LibDHCP::OptionFactoryRegister(Option::V4, DHO_SUBNET_MASK, + &LibDhcpTest::genericOptionFactory); + ); + ASSERT_NO_THROW( + LibDHCP::OptionFactoryRegister(Option::V4, DHO_TIME_OFFSET, + &LibDhcpTest::genericOptionFactory); + ); + ASSERT_NO_THROW( + LibDHCP::OptionFactoryRegister(Option::V6, D6O_CLIENTID, + &LibDhcpTest::genericOptionFactory); + ); + + // Invoke factory functions for all options (check if registration + // was successful). + OptionPtr opt_subnet_mask; + opt_subnet_mask = LibDHCP::optionFactory(Option::V4, + DHO_SUBNET_MASK, + buf); + // Check if non-NULL DHO_SUBNET_MASK option pointer has been returned. + ASSERT_TRUE(opt_subnet_mask); + // Validate if type and universe is correct. + EXPECT_EQ(Option::V4, opt_subnet_mask->getUniverse()); + EXPECT_EQ(DHO_SUBNET_MASK, opt_subnet_mask->getType()); + // Expect that option does not have content.. + EXPECT_EQ(0, opt_subnet_mask->len() - opt_subnet_mask->getHeaderLen()); + + // Fill the time offset buffer with 4 bytes of data. Each byte set to 1. + OptionBuffer time_offset_buf(4, 1); + OptionPtr opt_time_offset; + opt_time_offset = LibDHCP::optionFactory(Option::V4, + DHO_TIME_OFFSET, + time_offset_buf); + // Check if non-NULL DHO_TIME_OFFSET option pointer has been returned. + ASSERT_TRUE(opt_time_offset); + // Validate if option length, type and universe is correct. + EXPECT_EQ(Option::V4, opt_time_offset->getUniverse()); + EXPECT_EQ(DHO_TIME_OFFSET, opt_time_offset->getType()); + EXPECT_EQ(time_offset_buf.size(), + opt_time_offset->len() - opt_time_offset->getHeaderLen()); + // Validate data in the option. + EXPECT_TRUE(std::equal(time_offset_buf.begin(), time_offset_buf.end(), + opt_time_offset->getData().begin())); + + // Fill the client id buffer with 20 bytes of data. Each byte set to 2. + OptionBuffer clientid_buf(20, 2); + OptionPtr opt_clientid; + opt_clientid = LibDHCP::optionFactory(Option::V6, + D6O_CLIENTID, + clientid_buf); + // Check if non-NULL D6O_CLIENTID option pointer has been returned. + ASSERT_TRUE(opt_clientid); + // Validate if option length, type and universe is correct. + EXPECT_EQ(Option::V6, opt_clientid->getUniverse()); + EXPECT_EQ(D6O_CLIENTID, opt_clientid->getType()); + EXPECT_EQ(clientid_buf.size(), opt_clientid->len() - opt_clientid->getHeaderLen()); + // Validate data in the option. + EXPECT_TRUE(std::equal(clientid_buf.begin(), clientid_buf.end(), + opt_clientid->getData().begin())); +} + TEST(LibDhcpTest, packOptions6) { OptionBuffer buf(512); isc::dhcp::Option::OptionCollection opts; // list of options diff --git a/src/lib/dns/benchmarks/message_renderer_bench.cc b/src/lib/dns/benchmarks/message_renderer_bench.cc index 752b1f664c..6376498087 100644 --- a/src/lib/dns/benchmarks/message_renderer_bench.cc +++ b/src/lib/dns/benchmarks/message_renderer_bench.cc @@ -116,7 +116,11 @@ public: virtual void writeName(const Name& name, const bool = false) { name.toWire(getBuffer()); } - virtual void writeName(const LabelSequence&, const bool) {} // unused + virtual void writeName(const LabelSequence&, const bool) { + // We shouldn't use this version of writeName (and we internally + // control it, so we simply assert it here) + assert(false); + } }; void diff --git a/src/lib/dns/benchmarks/oldmessagerenderer.cc b/src/lib/dns/benchmarks/oldmessagerenderer.cc index a6c7990115..ed575a083f 100644 --- a/src/lib/dns/benchmarks/oldmessagerenderer.cc +++ b/src/lib/dns/benchmarks/oldmessagerenderer.cc @@ -277,7 +277,9 @@ OldMessageRenderer::writeName(const Name& name, const bool compress) { void OldMessageRenderer::writeName(const LabelSequence&, const bool) { - // we don't use this mode for the benchmark + // We shouldn't use this version of writeName (and we internally + // control it, so we simply assert it here) + assert(false); } } diff --git a/src/lib/dns/labelsequence.h b/src/lib/dns/labelsequence.h index 545ce12133..3f6a03aea7 100644 --- a/src/lib/dns/labelsequence.h +++ b/src/lib/dns/labelsequence.h @@ -53,6 +53,14 @@ public: static const size_t MAX_SERIALIZED_LENGTH = Name::MAX_WIRE + Name::MAX_LABELS + 1; + /// + /// \name Well-known LabelSequence constants + /// + //@{ + /// Wildcard label ("*") + static const LabelSequence& WILDCARD(); + //@} + /// \brief Constructs a LabelSequence for the given name /// /// \note The associated Name MUST remain in scope during the lifetime @@ -410,6 +418,13 @@ private: std::ostream& operator<<(std::ostream& os, const LabelSequence& label_sequence); +inline const LabelSequence& +LabelSequence::WILDCARD() { + static const uint8_t wildcard_buf[4] = { 0x01, 0x00, 0x01, '*' }; + static const LabelSequence wild_ls(wildcard_buf); + return (wild_ls); +} + } // end namespace dns } // end namespace isc diff --git a/src/lib/dns/python/serial_python.cc b/src/lib/dns/python/serial_python.cc index e2bd809219..f4f4720df5 100644 --- a/src/lib/dns/python/serial_python.cc +++ b/src/lib/dns/python/serial_python.cc @@ -259,19 +259,11 @@ createSerialObject(const Serial& source) { bool PySerial_Check(PyObject* obj) { - if (obj == NULL) { - isc_throw(PyCPPWrapperException, - "obj argument NULL in Serial typecheck"); - } return (PyObject_TypeCheck(obj, &serial_type)); } const Serial& PySerial_ToSerial(const PyObject* serial_obj) { - if (serial_obj == NULL) { - isc_throw(PyCPPWrapperException, - "obj argument NULL in Serial PyObject conversion"); - } const s_Serial* serial = static_cast(serial_obj); return (*serial->cppobj); } diff --git a/src/lib/dns/tests/labelsequence_unittest.cc b/src/lib/dns/tests/labelsequence_unittest.cc index 5eb49416d0..b7463b2460 100644 --- a/src/lib/dns/tests/labelsequence_unittest.cc +++ b/src/lib/dns/tests/labelsequence_unittest.cc @@ -180,6 +180,7 @@ TEST_F(LabelSequenceTest, equals_insensitive) { // operator==(). This is mostly trivial wrapper, so it should suffice to // check some basic cases. TEST_F(LabelSequenceTest, operatorEqual) { + // cppcheck-suppress duplicateExpression EXPECT_TRUE(ls1 == ls1); // self equivalence EXPECT_TRUE(ls1 == LabelSequence(n1)); // equivalent two different objects EXPECT_FALSE(ls1 == ls2); // non equivalent objects @@ -1173,4 +1174,10 @@ TEST_F(ExtendableLabelSequenceTest, extendBadData) { check_equal(full_ls2, els); } +// Check the static fixed 'wildcard' LabelSequence +TEST(WildCardLabelSequence, wildcard) { + ASSERT_FALSE(LabelSequence::WILDCARD().isAbsolute()); + ASSERT_EQ("*", LabelSequence::WILDCARD().toText()); +} + } diff --git a/src/lib/log/logger_impl.cc b/src/lib/log/logger_impl.cc index 6cd3da532e..689795d537 100644 --- a/src/lib/log/logger_impl.cc +++ b/src/lib/log/logger_impl.cc @@ -151,6 +151,15 @@ LoggerImpl::outputRaw(const Severity& severity, const string& message) { case FATAL: LOG4CPLUS_FATAL(logger_, message); + break; + + case NONE: + break; + + default: + LOG4CPLUS_ERROR(logger_, + "Unsupported severity in LoggerImpl::outputRaw(): " + << severity); } if (!locker.unlock()) { diff --git a/src/lib/log/tests/logger_example.cc b/src/lib/log/tests/logger_example.cc index 853d48a73f..6f95e5d1a3 100644 --- a/src/lib/log/tests/logger_example.cc +++ b/src/lib/log/tests/logger_example.cc @@ -146,7 +146,7 @@ int main(int argc, char** argv) { if (c_found || f_found || y_found) { cur_spec.addOutputOption(cur_opt); cur_opt = def_opt; - c_found = f_found = y_found = false; + f_found = y_found = false; } // Set the output option for this switch. @@ -174,7 +174,7 @@ int main(int argc, char** argv) { if (c_found || f_found || y_found) { cur_spec.addOutputOption(cur_opt); cur_opt = def_opt; - c_found = f_found = y_found = false; + c_found = y_found = false; } // Set the output option for this switch. @@ -236,7 +236,7 @@ int main(int argc, char** argv) { if (c_found || f_found || y_found) { cur_spec.addOutputOption(cur_opt); cur_opt = def_opt; - c_found = f_found = y_found = false; + c_found = f_found = false; } y_found = true; cur_opt.destination = OutputOption::DEST_SYSLOG; diff --git a/src/lib/python/isc/datasrc/master.py b/src/lib/python/isc/datasrc/master.py index bba080544d..2c22190899 100644 --- a/src/lib/python/isc/datasrc/master.py +++ b/src/lib/python/isc/datasrc/master.py @@ -46,11 +46,16 @@ def pop(line): # whitespace removed, and all other whitespace compressed to # single spaces ######################################################################### -decomment = re.compile('\s*(?:;.*)+') +decomment = re.compile('^\s*((?:[^;"]|"[^"]*")*)\s*(?:|;.*)$') +# Regular expression explained: +# First, ignore any whitespace at the start. Then take the content, +# each bit is either a harmless character (no ; nor ") or a string - +# sequence between " " not containing double quotes. Then there may +# be a comment at the end. def cleanup(s): global decomment s = s.strip().expandtabs() - s = decomment.sub('', s) + s = decomment.search(s).group(1) return ' '.join(s.split()) ######################################################################### diff --git a/src/lib/testutils/mockups.h b/src/lib/testutils/mockups.h index b5def4badb..3028d7f077 100644 --- a/src/lib/testutils/mockups.h +++ b/src/lib/testutils/mockups.h @@ -138,9 +138,18 @@ public: return (udp_fd_params_); } + virtual void setTCPRecvTimeout(size_t timeout) { + tcp_recv_timeout_ = timeout; + } + + size_t getTCPRecvTimeout() { + return tcp_recv_timeout_; + } + private: std::vector > tcp_fd_params_; std::vector udp_fd_params_; + size_t tcp_recv_timeout_; }; // A nonoperative DNSServer object to be used in calls to processMessage(). diff --git a/tests/tools/dhcp-ubench/Makefile b/tests/tools/dhcp-ubench/Makefile index 4be8fe773b..16735e9972 100644 --- a/tests/tools/dhcp-ubench/Makefile +++ b/tests/tools/dhcp-ubench/Makefile @@ -1,5 +1,5 @@ # Linux switches -CFLAGS=-g -O0 -Wall -pedantic -Wextra +CFLAGS= -Ofast -Wall -pedantic -Wextra # Mac OS: We don't use pedantic as Mac OS version of MySQL (5.5.24) does use long long (not part of ISO C++) #CFLAGS=-g -O0 -Wall -Wextra -I/opt/local/include @@ -62,4 +62,4 @@ dhcp-perf-guide.html: dhcp-perf-guide.xml version.ent dhcp-perf-guide.xml dhcp-perf-guide.pdf: dhcp-perf-guide.xml - docbook2pdf $< + dblatex -P doc.collab.show=0 -P latex.output.revhistory=0 $< diff --git a/tests/tools/dhcp-ubench/dhcp-perf-guide.html b/tests/tools/dhcp-ubench/dhcp-perf-guide.html index fd1929e901..df2308341f 100644 --- a/tests/tools/dhcp-ubench/dhcp-perf-guide.html +++ b/tests/tools/dhcp-ubench/dhcp-perf-guide.html @@ -1,69 +1,70 @@ -DHCP Performance Guide

DHCP Performance Guide

Tomasz Mrugalski

This is a companion document for BIND 10 version +DHCP Performance Guide

DHCP Performance Guide

Tomasz Mrugalski

This is a companion document for BIND 10 version 20120712.

Abstract

BIND 10 is a framework that features Domain Name System - (DNS) suite and Dynamic Host Configuration Protocol (DHCP) - servers with development managed by Internet Systems Consortium (ISC). + (DNS) and Dynamic Host Configuration Protocol (DHCP) + software with development managed by Internet Systems Consortium (ISC). This document describes various aspects of DHCP performance, measurements and tuning. It covers BIND 10 DHCP (codename Kea), existing ISC DHCP4 software, perfdhcp (a DHCP performance - measurement tool) and other related topics.


Preface

Table of Contents

1. Acknowledgements

1. Acknowledgements

ISC would like to acknowledge generous support for + measurement tool) and other related topics.


Preface

Table of Contents

1. Acknowledgements

1. Acknowledgements

ISC would like to acknowledge generous support for BIND 10 development of DHCPv4 and DHCPv6 components provided by Comcast.

Chapter 1. Introduction

- This document is in its early stages of development. It is - expected to grow significantly in a near future. It will + This document is in the early stages of development. It is + expected to grow significantly in the near future. It will cover topics like database backend perfomance measurements, - pros an cons of various optimization techniques and - tools. + tools, and the pros an cons of various optimization techniques.

Chapter 2. ISC DHCP 4.x

TODO: Write something about ISC DHCP4 here. -

Chapter 3. Kea

-

3.1. Backend performance evaluation

+

3.1. Backend performance evaluation

Kea will support several different database backends, using both popular databases (like MySQL or SQLite) and - custom-developed solutions (like in-memory database). BIND 10 - source code features set of performance microbenchmarks. - These are small tools written in C/C++ that simulate expected + custom-developed solutions (such as an in-memory database). + To aid in the choice of backend, the BIND 10 + source code features a set of performance microbenchmarks. + Written in C/C++, these are small tools that simulate expected DHCP server behaviour and evaluate the performance of - considered databases. As implemented benchmarks are not really + considered databases. As implemented, the benchmarks are not really simulating DHCP operation, but rather use set of primitives - that can be used by a real server, they are called + that can be used by a real server. For this reason, they are called micro-benchmarks.

Although there are many operations and data types that server could store in a database, the most frequently used data - type is lease information. Although lease information for IPv4 - and IPv6 differs slightly, it is expected that the performance + type is lease information. Although the information held for IPv4 + and IPv6 leases differs slightly, it is expected that the performance differences will be minimal between IPv4 and IPv6 lease operations. - Therefore each test uses lease4 table for performance measurements. + Therefore each test uses the lease4 table (in which IPv4 leases are stored) + for performance measurements.

All benchmarks are implemented as single threaded applications that take advantage of a single database connection.

- Those benchmarks are stored in tests/tools/dhcp-ubench - directory. This directory contains simplified prototypes for - various DB back-ends that are planned or considered as a - backend engine for BIND10 DHCP. Athough trivial now, they are - expected to evolve into useful tools that will allow users to - measure performance in their specific environment. + Those benchmarks are stored in tests/tools/dhcp-ubench directory of the + BIND 10 source tree. This directory contains simplified prototypes for + the various database back-ends that are planned or considered as a + possibly for BIND10 DHCP. These benchmarks are expected to evolve into + useful tools that will allow users to measure performance in their + specific environment.

Currently the following benchmarks are implemented: -

  • in memory+flat file

  • SQLite

  • MySQL

+

  • In memory + flat file

  • SQLite

  • MySQL

- As they require additional (sometimes heavy) dependencies, they are not - built by default. Actually, their build system is completely separated. - It will be eventually merged with the main BIND10 makefile system, but - that is a low priority for now. + As the benchmarks require additional (sometimes heavy) dependencies, they + are not built by default. Actually, their build system is completely + separate from that of the rest of BIND 10. It will be eventually merged + with the main BIND 10 build system.

All benchmarks will follow the same pattern: -

  1. prepare operation (connect to a database, create a file etc.)

  2. Measure timestamp 0

  3. Commit new lease4 (repeated X times)

  4. Measure timestamp 1

  5. Search for random lease4 (repeated X times)

  6. Measure timestamp 2

  7. Update existing lease4 (repeated X times)

  8. Measure timestamp 3

  9. Delete existing lease4 (repeated X times)

  10. Measure timestamp 4

  11. Print out statistics, based on X and measured timestamps.

+

  1. Prepare operation (connect to a database, create a file etc.)

  2. Measure timestamp 0

  3. Commit new lease4 record (repeated N times)

  4. Measure timestamp 1

  5. Search for random lease4 record (repeated N times)

  6. Measure timestamp 2

  7. Update existing lease4 record (repeated N times)

  8. Measure timestamp 3

  9. Delete existing lease4 record (repeated N times)

  10. Measure timestamp 4

  11. Print out statistics, based on N and measured timestamps.

Although this approach does not attempt to simulate actual DHCP server - operation that has mix of all steps intervening, it answers the - questions about basic database strenghts and weak points. In particular - it can show what is the impact of specific DB optimizations, like + operation that has mix of all steps, it answers the + questions about basic database strengths and weak points. In particular + it can show what is the impact of specific database optimizations, such as changing engine, optimizing for writes/reads etc.

- The framework attempts to do the same amount of operations for every + The framework attempts to do the same amount of work for every backend thus allowing fair complarison between them. -

3.2. MySQL backend

MySQL backend requires MySQL client development libraries. It uses - mysql_config tool (that works similar to pkg-config) to discover required +

3.2. MySQL backend

The MySQL backend requires the MySQL client development libraries. It uses + the mysql_config tool (similar to pkg-config) to discover required compilation and linking options. To install required packages on Ubuntu, use the following command: @@ -71,53 +72,54 @@ Make sure that MySQL server is running. Make sure that you have your setup configured so there is a user that is able to modify used database.

Before running tests, you need to initialize your database. You can - use mysql.schema script for that purpose. WARNING: It will drop existing - Kea database. Do not run this on your production server. Assuming your - MySQL user is kea, you can initialize your test database by: + use mysql.schema script for that purpose.

WARNING: It will drop existing + Kea database. Do not run this on your production server.

Assuming your + MySQL user is "kea", you can initialize your test database by:

$ mysql -u kea -p < mysql.schema

-

After database is initialized, you are ready to run the test: +

After the database is initialized, you are ready to run the test:

$ ./mysql_ubench

or -

$ ./mysql_ubench > results->mysql.txt

+

$ ./mysql_ubench > results-mysql.txt

Redirecting output to a file is important, because for each operation there is a single character printed to show progress. If you have a slow - terminal, this may considerably affect test perfromance. On the other hand, - printing something after each operation is required, as poor DB setting - may slow down operations to around 20 per second. Observant user is expected - to note that initial dots are printed too slowly and abort the test.

Currently all default parameters are hardcoded. Default values can be - overwritten using command line switches. Although all benchmarks take - the same list of parameters, some of them are specific to a given backend - type. To get a list of supported parameters, run your benchmark with -h option: + terminal, this may considerably affect test performance. On the other hand, + printing something after each operation is required as poor database settings + may slow down operations to around 20 per second. (The observant user is expected + to note that the initial dots are printed too slowly and abort the test.)

Currently all default parameters are hardcoded. Default values can be + overridden using command line switches. Although all benchmarks take + the same list of parameters, some of them are specific to a given backend. + To get a list of supported parameters, run the benchmark with the "-h" option: -

$ ./mysql_ubench -h
-This is a benchmark designed to measure expected performance
-of several backends. This particular version identifies itself
-as following:
-MySQL client version is 5.5.24
-
-Possible command-line parameters:
- -h - help (you are reading this)
- -m hostname - specifies MySQL server to connect (MySQL backend only)
- -u username - specifies MySQL user name (MySQL backend only)
- -p password - specifies MySQL passwod (MySQL backend only)
- -f name - database or filename (MySQL, SQLite and memfile)
- -n integer - number of test repetitions (MySQL, SQLite and memfile)
- -s yes|no - synchronous/asynchronous operation (MySQL, SQLite and memfile)
- -v yes|no - verbose mode (MySQL, SQLite and memfile)
- -c yes|no - should compiled statements be used (MySQL only)
-

- -

3.2.1. MySQL tweaks

One parameter that has huge impact on performance is a a backend engine. +

$ ./mysql_ubench -h

+

Synchronous operation requires database backend to + physically store changes to disk before proceeding. This + property ensures that no data is lost in case of the server + failure. Unfortunately, it slows operation + considerably. Asynchronous mode allows database to write data at + a later time (usually controlled by the database engine on OS + disk buffering mechanism).

3.2.1. MySQL tweaks

To modify the default mysql_ubench parameters, command line + switches can be used. The currently supported switches are + (default values specified in brackets): +

  1. -f name - name of the database ("kea")

  2. -m hostname - name of the database host ("localhost")

  3. -u user - MySQL username ("root")

  4. -p password - MySQL password ("secret")

  5. -n num - number of iterations (100)

  6. -s yes|no - should the operations be performed in a synchronous (yes) + or asynchronous (no) manner (yes)

  7. -v yes|no - verbose mode. Should the test print out progress? (yes)

  8. -c yes|no - precompiled statements. Should the SQL statements be precompiled? (yes)

+

One parameter that has huge impact on performance is the choice of backend engine. You can get a list of engines of your MySQL implementation by using

> show engines;

- in your mysql client. Two notable engines are MyISAM and InnoDB. mysql_ubench will - use MyISAM for synchronous mode and InnoDB for asynchronous.

3.3. SQLite-ubench

SQLite backend requires both sqlite3 development and run-time package. Their + in your mysql client. Two notable engines are MyISAM and InnoDB. mysql_ubench uses + use MyISAM for synchronous mode and InnoDB for asynchronous. Please use + '-s yes|no' to choose whether you want synchronous or asynchronous operations.

Another parameter that affects performance are precompiled statements. + In a basic approach, the actual SQL query is passed as a text string that is + then parsed by the database engine. Alternative is a so called precompiled + statement. In this approach the SQL query is compiled an specific values are being + bound to it. In the next iteration the query remains the same, only bound values + are changing (e.g. searching for a different address). Usage of basic or precompiled + statements is controlled with '-c no|yes'.

3.3. SQLite-ubench

The SQLite backend requires both the sqlite3 development and run-time packages. Their names may vary from system to system, but on Ubuntu 12.04 they are called sqlite3 libsqlite3-dev. To install them, use the following command: @@ -133,63 +135,151 @@ Possible command-line parameters: or

> ./sqlite_ubench > results-sqlite.txt

3.3.1. SQLite tweaks

To modify default sqlite_ubench parameters, command line - switches can be used. Currently supported parameters are + switches can be used. The currently supported switches are (default values specified in brackets): -

  1. -f filename - name of the database file ("sqlite.db")

  2. -n num - number of iterations (100)

  3. -s yes|no - should the operations be performend in synchronous (yes) - or asynchronous (no) manner (yes)

  4. -v yes|no - verbose mode. Should the test print out progress? (yes)

  5. -c yes|no - compiled statements. Should the SQL statements be precompiled?

+

  1. -f filename - name of the database file ("sqlite.db")

  2. -n num - number of iterations (100)

  3. -s yes|no - should the operations be performed in a synchronous (yes) + or asynchronous (no) manner (yes)

  4. -v yes|no - verbose mode. Should the test print out progress? (yes)

  5. -c yes|no - precompiled statements. Should the SQL statements be precompiled? (yes)

SQLite can run in asynchronous or synchronous mode. This - mode can be controlled by using sync parameter. It is set - using (PRAGMA synchronous = ON or OFF).

Another tweakable feature is journal mode. It can be + mode can be controlled by using "synchronous" parameter. It is set + using the SQLite command:

PRAGMA synchronous = ON|OFF

Another tweakable feature is journal mode. It can be turned to several modes of operation. Its value can be modified in SQLite_uBenchmark::connect(). See http://www.sqlite.org/pragma.html#pragma_journal_mode for - detailed explanantion.

3.4. memfile-ubench

Memfile backend is custom developed prototype backend that - somewhat mimics operation of ISC DHCP4. It uses in-memory - storage using standard C++ and boost mechanisms (std::map and - boost::shared_ptr<>). All database changes are also - written to a lease file. That file is strictly write-only. This - approach takes advantage of the fact that simple append is faster - than edition with potential whole file relocation.

3.4.1. memfile tweaks

To modify default memfile_ubench parameters, command line - switches can be used. Currently supported parameters are + detailed explanantion.

sqlite_bench supports precompiled statements. Please use + '-c no|yes' to define which should be used: basic SQL query (no) or + precompiled statement (yes).

3.4. memfile-ubench

The memfile backend is a + custom backend that somewhat mimics operation of ISC DHCP4. It + implements in-memory storage using standard C++ and boost + mechanisms (std::map and boost::shared_ptr<>). All + database changes are also written to a lease file, which is + strictly write-only. This approach takes advantage of the fact + that file append operation is faster than modifications introduced + in the middle of the file (as it often requires moving all data + after modified point, effectively requiring writing large parts of + the whole file, not just changed fragment).

There are no preparatory steps required for memfile benchmark. + The only requirement is the ability to create and write specified lease + file (dhcpd.leases in the current directory). The tests can be run + as follows: +

> ./memfile_ubench

+ or +

> ./memfile_ubench > results-memfile.txt

+

3.4.1. memfile tweaks

To modify default memfile_ubench parameters, command line + switches can be used. Currently supported switches are (default values specified in brackets): -

  1. -f filename - name of the database file ("dhcpd.leases")

  2. -n num - number of iterations (100)

  3. -s yes|no - should the operations be performend in synchronous (yes) +

    1. -f filename - name of the database file ("dhcpd.leases")

    2. -n num - number of iterations (100)

    3. -s yes|no - should the operations be performend in a synchronous (yes) or asynchronous (no) manner (yes)

    4. -v yes|no - verbose mode. Should the test print out progress? (yes)

    memfile can run in asynchronous or synchronous mode. This mode can be controlled by using sync parameter. It uses fflush() and fsync() in synchronous mode to make sure that - data is not buffered and physically stored on disk.

3.5. Performance measurements

This section contains sample results for backend performance measurements, + data is not buffered and physically stored on disk.

3.5. Basic performance measurements

This section contains sample results for backend performance measurements, taken using microbenchmarks. Tests were conducted on reasonably powerful machine:

 CPU: Quad-core Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz (8 logical cores)
-HDD: 1,5TB Seagate Barracuda ST31500341AS 7200rpm (used only one of them), ext4 partition
+HDD: 1,5TB Seagate Barracuda ST31500341AS 7200rpm, ext4 partition
 OS: Ubuntu 12.04, running kernel 3.2.0-26-generic SMP x86_64
 compiler: g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
 MySQL version: 5.5.24
 SQLite version: 3.7.9sourceid version is 2011-11-01 00:52:41 c7c6050ef060877ebe77b41d959e9df13f8c9b5e

-

Benchmarks were run in two series: synchronous and +

The benchmarks were run without using precompiled statements. + The code was compiled with the -O0 flag (no code optimizations). + Each run was executed once.

Two series of measures were made, synchronous and asynchronous. As those modes offer radically different - performances, synchronous mode was conducted for 1000 (one - thousand) repetitions and asynchronous mode was conducted for - 100000 (hundred thousand) repetitions.

Table 3.1. Synchronous results

BackendOperationsCreateSearchUpdateDeleteAverage
MySQL100031.603978s 0.116612s27.964191s27.695209s21.844998s
SQLite100061.421356s 0.033283s59.476638s56.034150s44.241357s
memfile100041.711886s 0.000724s42.267578s42.169679s31.537467s

Following parameters were measured for asynchronous mode. - MySQL and SQLite were run with 100 thousand repetitions. Memfile - was run for 1 million repetitions due to much larger performance.

Table 3.2. Asynchronous results

BackendOperationsCreate [s]Search [s]Update [s]Delete [s]Average [s]
MySQL10000010.584842s10.386402s10.062384s 8.890197s 9.980956s
SQLite100000 3.710356s 3.159129s 2.865354s 2.439406s 3.043561s
memfile1000000 (sic!) 6.084131s 0.862667s 6.018585s 5.146704s 4.528022s

Presented performance results can be computed into operations per second metrics. + performances, synchronous mode was conducted for one + thousand repetitions and asynchronous mode was conducted for + one hundred thousand repetitions.

Table 3.1. Synchronous results (basic)

BackendOperationsCreate [s]Search [s]Update [s]Delete [s]Average [s]
MySQL1,00031.604 0.11727.96427.69521.845
SQLite1,00061.421 0.03359.47756.03444.241
memfile1,00038.224 0.00138.04138.01728.571

The following parameters were measured for asynchronous mode. + MySQL and SQLite were run with one hundred thousand repetitions.

Table 3.2. Asynchronous results (basic)

BackendOperationsCreate [s]Search [s]Update [s]Delete [s]Average [s]
MySQL100,00010.58510.38610.062 8.890 9.981
SQLite100,000 3.710 3.159 2.865 2.439 3.044
memfile100,000 1.300 0.039 1.307 1.278 0.981

The presented performance results can be converted into operations per second metrics. + It should be noted that due to large differences between various operations (sometimes + over three orders of magnitude), it is difficult to create a simple, readable chart with + that data.

Table 3.3. Estimated basic performance

BackendCreate [oper/s]Search [oper/s]Update [oper/s]Delete [oper/s]Average [oper/s]
MySQL (async)9447.479627.979938.0011248.3410065.45
SQLite (async)26951.5931654.2934899.7040993.5933624.79
memfile (async)76944.272542588.3576504.5478269.25693576.60
MySQL (sync)31.648575.4535.7636.112169.74
SQLite (sync)16.2820045.3716.8117.857524.08
memfile (sync)26.161223990.2126.2926.30306017.24

Graphical representation of the basic performance results + presented in table Table 3.3, “Estimated basic performance”.

3.6. Optimized performance measurements

This section contains sample results for backend performance measurements, + taken using microbenchmarks. Tests were conducted on reasonably powerful machine: +

+CPU: Quad-core Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz (8 logical cores)
+HDD: 1,5TB Seagate Barracuda ST31500341AS 7200rpm, ext4 partition
+OS: Ubuntu 12.04, running kernel 3.2.0-26-generic SMP x86_64
+compiler: g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
+MySQL version: 5.5.24
+SQLite version: 3.7.9sourceid version is 2011-11-01 00:52:41 c7c6050ef060877ebe77b41d959e9df13f8c9b5e

+

The benchmarks were run with precompiled statements enabled. + The code was compiled with the -Ofast flag (optimize compilation for speed). + Each run was repeated three times and measured values were averaged.

Again the benchmarks were run in two series, synchronous and + asynchronous. As those modes offer radically different + performances, synchronous mode was conducted for one + thousand repetitions and asynchronous mode was conducted for + one hundred thousand repetitions.

Table 3.4. Synchronous results (optimized)

BackendOperationsCreate [s]Search [s]Update [s]Delete [s]Average [s]
MySQL1,00027.887 0.10628.22327.69620.978
SQLite1,00061.299 0.01559.64861.09845.626
memfile1,00039.564 0.00139.54339.32629.608

The following parameters were measured for asynchronous mode. + MySQL and SQLite were run with one hundred thousand repetitions.

Table 3.5. Asynchronous results (optimized)

BackendOperationsCreate [s]Search [s]Update [s]Delete [s]Average [s]
MySQL100,0008.5079.6987.7858.3268.579
SQLite100,000 1.562 0.949 1.513 1.502 1.382
memfile100,0001.3020.0381.3061.2630.977

The presented performance results can be converted into operations per second metrics. It should be noted that due to large differences between various operations (sometime - over 3 orders of magnitude), it is difficult to create a simple, readable chart with - that data.

Table 3.3. Estimated performance

BackendCreate [oper/s]Search [oper/s]Update [oper/s]Delete [oper/s]Average [oper/s]
MySQL (async)9447.479627.979938.0011248.3410065.45
SQLite (async)26951.5931654.2934899.7040993.5933624.79
memfile (async)164362.011159195.84166152.01194299.11421002.24
MySQL (sync)31.648575.4535.7636.112169.74
SQLite (sync)16.2820045.3716.8117.857524.08
memfile (sync)23.971381215.4723.6623.71345321.70

Performance measurements

Graphical representation of the performance results - presented in table Table 3.3, “Estimated performance”.

3.6. Possible further optimizations

- For debugging purposes the code was compiled with -g -O0 - flags. While majority of the time was spent in backend - functions (that was probably compiled with -O2 flags), the - benchmark code could perform faster, when compiled with -O2, - rather than -O0. That is expected to affect memfile benchmark. + over three orders of magnitude), it is difficult to create a simple, readable chart with + the data.

Table 3.6. Estimated optimized performance

BackendCreate [oper/s]Search [oper/s]Update [oper/s]Delete [oper/s]Average [oper/s]
MySQL (async)11754.8410311.3412845.3512010.2411730.44
SQLite (async)64005.90105391.2966075.5166566.4375509.78
memfile (async)76832.162636018.5676542.5079188.81717145.51
MySQL (sync)35.869461.1035.4336.112392.12
SQLite (sync)16.3167036.1116.7616.3716771.39
memfile (sync)25.283460207.6125.2925.43865070.90

Optimized performance measurements

Graphical representation of the optimized performance + results presented in table Table 3.6, “Estimated optimized performance”.

3.7. Conclusions

+ Improvements gained by introducing support for precompiled + statements in MySQL is somewhat disappointing - between 6 and + 29%. On the other hand, the improvement in SQLite is + surprisingly high - the efficiency is more than doubled.

- Currently all operations were conducted on one by one - basis. Each operation was treated as a separate - transaction. Grouping X operations together will potentially - bring almost X fold increase in synchronous operations. - Extension for this benchmark in this regard should be considered. - That affects only write operations (insert, update and delete). Read - operations (search) are expected to be barely affected. + Compiled statements do not have any measureable impact on + synchronous operations. That is as expected, because the major + bottleneck is the disk performance. +

+ Compilation flags yield surprisingly high improvements for C++ + STL code. The memfile backend is in some operations is almost + twice as fast. +

+ If synchronous operation is required, the current performance + results are likely to be deemed inadequate. The limiting + factor here is a disk access time. Even migrating to high + performance 15,000 rpm disk is expected to only roughly double + number of leases per second, compared to the current results. + The reason is that to write a file to disk, at least two disk + sector writes + are required: the new content and i-node modification of the + file. The easiest way to boost synchronous performance is to + switch to SSD disks. Memory-backed RAM disks are also a viable + solution. However, care should be taken to properly engineer + backup strategy for such RAM disks. +

+ While the custom made backend (memfile) provides the best + perfomance, it carries over all the limitations existing in + the ISC DHCP4 code: there are no external tools to query or + change database, the maintenance requires deep knowledge etc. + Those flaws are not shared by usage of a proper database + backend, like MySQL and SQLite. They both offer third party + tools for administrative tasks, they are well documented and + maintained. However, SQLite support for concurrent access is + limiting in certain cases. Since all three investigated + backends more than meet expected performance results, it is + recommended to use MySQL as a first concrete database backend. + Should this choice be rejected for any reason, the second + recommended choice is SQLite. +

+ It should be emphaisized that obtained measurements indicate + only database performance and they cannot be directly + translated to expected leases per second or queries per second + performance by an actual server. The DHCP server must do much + more than just query the database to properly process client's + message. The provided results should be considered as only rough + estimates. They can also be used for relative comparisons + between backends. +

3.8. Possible further optimizations

+ For basic measurements the code was compiled with -g -O0 + flags. For optimized measurements the benchmarking code was + compiled with -Ofast (optimize for speed). In both cases, the + same backend (MySQL or SQLite) library was used. It may be + useful to recompile the libraries (or the whole server in case + of MySQL) with -Ofast. +

+ There are many MySQL parameters that various sources recommend + to improve performance. They were not investigated further. +

+ Currently all operations are conducted on one by one + basis. Each operation is treated as a separate + transaction. Grouping N operations together will potentially + bring almost N fold increase in synchronous operations. Such a + feature is present in ISC DHCP4 and is called cache-threshold. + Extension for this benchmark in this regard should be + considered. That affects only write operations (insert, + update and delete). Read operations (search) are expected to + be barely affected.

Multi-threaded or multi-process benchmark may be considered in the future. It may be somewhat difficult as only some backends diff --git a/tests/tools/dhcp-ubench/dhcp-perf-guide.xml b/tests/tools/dhcp-ubench/dhcp-perf-guide.xml index 16bbd63fa9..2bfe9bff90 100644 --- a/tests/tools/dhcp-ubench/dhcp-perf-guide.xml +++ b/tests/tools/dhcp-ubench/dhcp-perf-guide.xml @@ -40,8 +40,8 @@ BIND 10 is a framework that features Domain Name System - (DNS) suite and Dynamic Host Configuration Protocol (DHCP) - servers with development managed by Internet Systems Consortium (ISC). + (DNS) and Dynamic Host Configuration Protocol (DHCP) + software with development managed by Internet Systems Consortium (ISC). This document describes various aspects of DHCP performance, measurements and tuning. It covers BIND 10 DHCP (codename Kea), existing ISC DHCP4 software, perfdhcp (a DHCP performance @@ -70,11 +70,10 @@ Introduction - This document is in its early stages of development. It is - expected to grow significantly in a near future. It will + This document is in the early stages of development. It is + expected to grow significantly in the near future. It will cover topics like database backend perfomance measurements, - pros an cons of various optimization techniques and - tools. + tools, and the pros an cons of various optimization techniques. @@ -97,85 +96,87 @@ Kea will support several different database backends, using both popular databases (like MySQL or SQLite) and - custom-developed solutions (like in-memory database). BIND 10 - source code features set of performance microbenchmarks. - These are small tools written in C/C++ that simulate expected + custom-developed solutions (such as an in-memory database). + To aid in the choice of backend, the BIND 10 + source code features a set of performance microbenchmarks. + Written in C/C++, these are small tools that simulate expected DHCP server behaviour and evaluate the performance of - considered databases. As implemented benchmarks are not really + considered databases. As implemented, the benchmarks are not really simulating DHCP operation, but rather use set of primitives - that can be used by a real server, they are called + that can be used by a real server. For this reason, they are called micro-benchmarks. Although there are many operations and data types that server could store in a database, the most frequently used data - type is lease information. Although lease information for IPv4 - and IPv6 differs slightly, it is expected that the performance + type is lease information. Although the information held for IPv4 + and IPv6 leases differs slightly, it is expected that the performance differences will be minimal between IPv4 and IPv6 lease operations. - Therefore each test uses lease4 table for performance measurements. + Therefore each test uses the lease4 table (in which IPv4 leases are stored) + for performance measurements. All benchmarks are implemented as single threaded applications that take advantage of a single database connection. - Those benchmarks are stored in tests/tools/dhcp-ubench - directory. This directory contains simplified prototypes for - various DB back-ends that are planned or considered as a - backend engine for BIND10 DHCP. Athough trivial now, they are - expected to evolve into useful tools that will allow users to - measure performance in their specific environment. + Those benchmarks are stored in tests/tools/dhcp-ubench directory of the + BIND 10 source tree. This directory contains simplified prototypes for + the various database back-ends that are planned or considered as a + possibly for BIND10 DHCP. These benchmarks are expected to evolve into + useful tools that will allow users to measure performance in their + specific environment. Currently the following benchmarks are implemented: - in memory+flat file + In memory + flat file SQLite MySQL - As they require additional (sometimes heavy) dependencies, they are not - built by default. Actually, their build system is completely separated. - It will be eventually merged with the main BIND10 makefile system, but - that is a low priority for now. + As the benchmarks require additional (sometimes heavy) dependencies, they + are not built by default. Actually, their build system is completely + separate from that of the rest of BIND 10. It will be eventually merged + with the main BIND 10 build system. All benchmarks will follow the same pattern: - prepare operation (connect to a database, create a file etc.) + Prepare operation (connect to a database, create a file etc.) Measure timestamp 0 - Commit new lease4 (repeated X times) + Commit new lease4 record (repeated N times) Measure timestamp 1 - Search for random lease4 (repeated X times) + Search for random lease4 record (repeated N times) Measure timestamp 2 - Update existing lease4 (repeated X times) + Update existing lease4 record (repeated N times) Measure timestamp 3 - Delete existing lease4 (repeated X times) + Delete existing lease4 record (repeated N times) Measure timestamp 4 - Print out statistics, based on X and measured timestamps. + Print out statistics, based on N and measured timestamps. Although this approach does not attempt to simulate actual DHCP server - operation that has mix of all steps intervening, it answers the - questions about basic database strenghts and weak points. In particular - it can show what is the impact of specific DB optimizations, like + operation that has mix of all steps, it answers the + questions about basic database strengths and weak points. In particular + it can show what is the impact of specific database optimizations, such as changing engine, optimizing for writes/reads etc. - The framework attempts to do the same amount of operations for every + The framework attempts to do the same amount of work for every backend thus allowing fair complarison between them.

MySQL backend - MySQL backend requires MySQL client development libraries. It uses - mysql_config tool (that works similar to pkg-config) to discover required + The MySQL backend requires the MySQL client development libraries. It uses + the mysql_config tool (similar to pkg-config) to discover required compilation and linking options. To install required packages on Ubuntu, use the following command: @@ -185,69 +186,90 @@ configured so there is a user that is able to modify used database. Before running tests, you need to initialize your database. You can - use mysql.schema script for that purpose. WARNING: It will drop existing - Kea database. Do not run this on your production server. Assuming your - MySQL user is kea, you can initialize your test database by: + use mysql.schema script for that purpose. + + WARNING: It will drop existing + Kea database. Do not run this on your production server. + + Assuming your + MySQL user is "kea", you can initialize your test database by: $ mysql -u kea -p < mysql.schema - After database is initialized, you are ready to run the test: + After the database is initialized, you are ready to run the test: $ ./mysql_ubench or - $ ./mysql_ubench > results->mysql.txt + $ ./mysql_ubench > results-mysql.txt Redirecting output to a file is important, because for each operation there is a single character printed to show progress. If you have a slow - terminal, this may considerably affect test perfromance. On the other hand, - printing something after each operation is required, as poor DB setting - may slow down operations to around 20 per second. Observant user is expected - to note that initial dots are printed too slowly and abort the test. + terminal, this may considerably affect test performance. On the other hand, + printing something after each operation is required as poor database settings + may slow down operations to around 20 per second. (The observant user is expected + to note that the initial dots are printed too slowly and abort the test.) Currently all default parameters are hardcoded. Default values can be - overwritten using command line switches. Although all benchmarks take - the same list of parameters, some of them are specific to a given backend - type. To get a list of supported parameters, run your benchmark with -h option: - - $ ./mysql_ubench -h -This is a benchmark designed to measure expected performance -of several backends. This particular version identifies itself -as following: -MySQL client version is 5.5.24 - -Possible command-line parameters: - -h - help (you are reading this) - -m hostname - specifies MySQL server to connect (MySQL backend only) - -u username - specifies MySQL user name (MySQL backend only) - -p password - specifies MySQL passwod (MySQL backend only) - -f name - database or filename (MySQL, SQLite and memfile) - -n integer - number of test repetitions (MySQL, SQLite and memfile) - -s yes|no - synchronous/asynchronous operation (MySQL, SQLite and memfile) - -v yes|no - verbose mode (MySQL, SQLite and memfile) - -c yes|no - should compiled statements be used (MySQL only) - + overridden using command line switches. Although all benchmarks take + the same list of parameters, some of them are specific to a given backend. + To get a list of supported parameters, run the benchmark with the "-h" option: + $ ./mysql_ubench -h + Synchronous operation requires database backend to + physically store changes to disk before proceeding. This + property ensures that no data is lost in case of the server + failure. Unfortunately, it slows operation + considerably. Asynchronous mode allows database to write data at + a later time (usually controlled by the database engine on OS + disk buffering mechanism). +
MySQL tweaks - One parameter that has huge impact on performance is a a backend engine. + To modify the default mysql_ubench parameters, command line + switches can be used. The currently supported switches are + (default values specified in brackets): + + -f name - name of the database ("kea") + -m hostname - name of the database host ("localhost") + -u user - MySQL username ("root") + -p password - MySQL password ("secret") + -n num - number of iterations (100) + -s yes|no - should the operations be performed in a synchronous (yes) + or asynchronous (no) manner (yes) + -v yes|no - verbose mode. Should the test print out progress? (yes) + -c yes|no - precompiled statements. Should the SQL statements be precompiled? (yes) + + + + + One parameter that has huge impact on performance is the choice of backend engine. You can get a list of engines of your MySQL implementation by using > show engines; - in your mysql client. Two notable engines are MyISAM and InnoDB. mysql_ubench will - use MyISAM for synchronous mode and InnoDB for asynchronous. + in your mysql client. Two notable engines are MyISAM and InnoDB. mysql_ubench uses + use MyISAM for synchronous mode and InnoDB for asynchronous. Please use + '-s yes|no' to choose whether you want synchronous or asynchronous operations. + + Another parameter that affects performance are precompiled statements. + In a basic approach, the actual SQL query is passed as a text string that is + then parsed by the database engine. Alternative is a so called precompiled + statement. In this approach the SQL query is compiled an specific values are being + bound to it. In the next iteration the query remains the same, only bound values + are changing (e.g. searching for a different address). Usage of basic or precompiled + statements is controlled with '-c no|yes'.
SQLite-ubench - SQLite backend requires both sqlite3 development and run-time package. Their + The SQLite backend requires both the sqlite3 development and run-time packages. Their names may vary from system to system, but on Ubuntu 12.04 they are called sqlite3 libsqlite3-dev. To install them, use the following command: @@ -269,49 +291,66 @@ Possible command-line parameters:
SQLite tweaks To modify default sqlite_ubench parameters, command line - switches can be used. Currently supported parameters are + switches can be used. The currently supported switches are (default values specified in brackets): -f filename - name of the database file ("sqlite.db") -n num - number of iterations (100) - -s yes|no - should the operations be performend in synchronous (yes) + -s yes|no - should the operations be performed in a synchronous (yes) or asynchronous (no) manner (yes) -v yes|no - verbose mode. Should the test print out progress? (yes) - -c yes|no - compiled statements. Should the SQL statements be precompiled? + -c yes|no - precompiled statements. Should the SQL statements be precompiled? (yes) SQLite can run in asynchronous or synchronous mode. This - mode can be controlled by using sync parameter. It is set - using (PRAGMA synchronous = ON or OFF). + mode can be controlled by using "synchronous" parameter. It is set + using the SQLite command: + + PRAGMA synchronous = ON|OFF Another tweakable feature is journal mode. It can be turned to several modes of operation. Its value can be modified in SQLite_uBenchmark::connect(). See http://www.sqlite.org/pragma.html#pragma_journal_mode for detailed explanantion. + + sqlite_bench supports precompiled statements. Please use + '-c no|yes' to define which should be used: basic SQL query (no) or + precompiled statement (yes).
- memfile-ubench - Memfile backend is custom developed prototype backend that - somewhat mimics operation of ISC DHCP4. It uses in-memory - storage using standard C++ and boost mechanisms (std::map and - boost::shared_ptr<>). All database changes are also - written to a lease file. That file is strictly write-only. This - approach takes advantage of the fact that simple append is faster - than edition with potential whole file relocation. + memfile-ubench The memfile backend is a + custom backend that somewhat mimics operation of ISC DHCP4. It + implements in-memory storage using standard C++ and boost + mechanisms (std::map and boost::shared_ptr<>). All + database changes are also written to a lease file, which is + strictly write-only. This approach takes advantage of the fact + that file append operation is faster than modifications introduced + in the middle of the file (as it often requires moving all data + after modified point, effectively requiring writing large parts of + the whole file, not just changed fragment). + + There are no preparatory steps required for memfile benchmark. + The only requirement is the ability to create and write specified lease + file (dhcpd.leases in the current directory). The tests can be run + as follows: + > ./memfile_ubench + or + > ./memfile_ubench > results-memfile.txt +
memfile tweaks To modify default memfile_ubench parameters, command line - switches can be used. Currently supported parameters are + switches can be used. Currently supported switches are (default values specified in brackets): -f filename - name of the database file ("dhcpd.leases") -n num - number of iterations (100) - -s yes|no - should the operations be performend in synchronous (yes) + -s yes|no - should the operations be performend in a synchronous (yes) or asynchronous (no) manner (yes) -v yes|no - verbose mode. Should the test print out progress? (yes) @@ -325,86 +364,30 @@ Possible command-line parameters:
- Performance measurements + Basic performance measurements This section contains sample results for backend performance measurements, taken using microbenchmarks. Tests were conducted on reasonably powerful machine: CPU: Quad-core Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz (8 logical cores) -HDD: 1,5TB Seagate Barracuda ST31500341AS 7200rpm (used only one of them), ext4 partition +HDD: 1,5TB Seagate Barracuda ST31500341AS 7200rpm, ext4 partition OS: Ubuntu 12.04, running kernel 3.2.0-26-generic SMP x86_64 compiler: g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 MySQL version: 5.5.24 SQLite version: 3.7.9sourceid version is 2011-11-01 00:52:41 c7c6050ef060877ebe77b41d959e9df13f8c9b5e - Benchmarks were run in two series: synchronous and + The benchmarks were run without using precompiled statements. + The code was compiled with the -O0 flag (no code optimizations). + Each run was executed once. + + Two series of measures were made, synchronous and asynchronous. As those modes offer radically different - performances, synchronous mode was conducted for 1000 (one - thousand) repetitions and asynchronous mode was conducted for - 100000 (hundred thousand) repetitions. + performances, synchronous mode was conducted for one + thousand repetitions and asynchronous mode was conducted for + one hundred thousand repetitions. - Synchronous results - - - - - - - - - - - Backend - Operations - Create - Search - Update - Delete - Average - - - - - MySQL - 1000 - 31.603978s - 0.116612s - 27.964191s - 27.695209s - 21.844998s - - - - SQLite - 1000 - 61.421356s - 0.033283s - 59.476638s - 56.034150s - 44.241357s - - - - memfile - 1000 - 41.711886s - 0.000724s - 42.267578s - 42.169679s - 31.537467s - - - - -
- - Following parameters were measured for asynchronous mode. - MySQL and SQLite were run with 100 thousand repetitions. Memfile - was run for 1 million repetitions due to much larger performance. - - - Asynchronous results +
Synchronous results (basic) @@ -427,44 +410,103 @@ SQLite version: 3.7.9sourceid version is 2011-11-01 00:52:41 c7c6050ef060877ebe7 MySQL - 100000 - 10.584842s - 10.386402s - 10.062384s - 8.890197s - 9.980956s + 1,000 + 31.604 + 0.117 + 27.964 + 27.695 + 21.845 SQLite - 100000 - 3.710356s - 3.159129s - 2.865354s - 2.439406s - 3.043561s + 1,000 + 61.421 + 0.033 + 59.477 + 56.034 + 44.241 memfile - 1000000 (sic!) - 6.084131s - 0.862667s - 6.018585s - 5.146704s - 4.528022s + 1,000 + 38.224 + 0.001 + 38.041 + 38.017 + 28.571
- Presented performance results can be computed into operations per second metrics. - It should be noted that due to large differences between various operations (sometime - over 3 orders of magnitude), it is difficult to create a simple, readable chart with + The following parameters were measured for asynchronous mode. + MySQL and SQLite were run with one hundred thousand repetitions. + + + Asynchronous results (basic) + + + + + + + + + + + Backend + Operations + Create [s] + Search [s] + Update [s] + Delete [s] + Average [s] + + + + + MySQL + 100,000 + 10.585 + 10.386 + 10.062 + 8.890 + 9.981 + + + + SQLite + 100,000 + 3.710 + 3.159 + 2.865 + 2.439 + 3.044 + + + + memfile + 100,000 + 1.300 + 0.039 + 1.307 + 1.278 + 0.981 + + + + +
+ + The presented performance results can be converted into operations per second metrics. + It should be noted that due to large differences between various operations (sometimes + over three orders of magnitude), it is difficult to create a simple, readable chart with that data. - Estimated performance +
Estimated basic performance @@ -503,11 +545,11 @@ SQLite version: 3.7.9sourceid version is 2011-11-01 00:52:41 c7c6050ef060877ebe7 memfile (async) - 164362.01 - 1159195.84 - 166152.01 - 194299.11 - 421002.24 + 76944.27 + 2542588.35 + 76504.54 + 78269.25 + 693576.60 @@ -531,11 +573,255 @@ SQLite version: 3.7.9sourceid version is 2011-11-01 00:52:41 c7c6050ef060877ebe7 memfile (sync) - 23.97 - 1381215.47 - 23.66 - 23.71 - 345321.70 + 26.16 + 1223990.21 + 26.29 + 26.30 + 306017.24 + + + + +
+ + + + + + + + + + + Graphical representation of the basic performance results + presented in table . + + + +
+ +
+ Optimized performance measurements + This section contains sample results for backend performance measurements, + taken using microbenchmarks. Tests were conducted on reasonably powerful machine: + +CPU: Quad-core Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz (8 logical cores) +HDD: 1,5TB Seagate Barracuda ST31500341AS 7200rpm, ext4 partition +OS: Ubuntu 12.04, running kernel 3.2.0-26-generic SMP x86_64 +compiler: g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 +MySQL version: 5.5.24 +SQLite version: 3.7.9sourceid version is 2011-11-01 00:52:41 c7c6050ef060877ebe77b41d959e9df13f8c9b5e + + + The benchmarks were run with precompiled statements enabled. + The code was compiled with the -Ofast flag (optimize compilation for speed). + Each run was repeated three times and measured values were averaged. + + Again the benchmarks were run in two series, synchronous and + asynchronous. As those modes offer radically different + performances, synchronous mode was conducted for one + thousand repetitions and asynchronous mode was conducted for + one hundred thousand repetitions. + + + Synchronous results (optimized) + + + + + + + + + + + Backend + Operations + Create [s] + Search [s] + Update [s] + Delete [s] + Average [s] + + + + + MySQL + 1,000 + 27.887 + 0.106 + 28.223 + 27.696 + 20.978 + + + + SQLite + 1,000 + 61.299 + 0.015 + 59.648 + 61.098 + 45.626 + + + + memfile + 1,000 + 39.564 + 0.001 + 39.543 + 39.326 + 29.608 + + + + +
+ + The following parameters were measured for asynchronous mode. + MySQL and SQLite were run with one hundred thousand repetitions. + + + Asynchronous results (optimized) + + + + + + + + + + + Backend + Operations + Create [s] + Search [s] + Update [s] + Delete [s] + Average [s] + + + + + MySQL + 100,000 + 8.507 + 9.698 + 7.785 + 8.326 + 8.579 + + + + SQLite + 100,000 + 1.562 + 0.949 + 1.513 + 1.502 + 1.382 + + + + memfile + 100,000 + 1.302 + 0.038 + 1.306 + 1.263 + 0.977 + + + + +
+ + The presented performance results can be converted into operations per second metrics. + It should be noted that due to large differences between various operations (sometime + over three orders of magnitude), it is difficult to create a simple, readable chart with + the data. + + Estimated optimized performance + + + + + + + + + + Backend + Create [oper/s] + Search [oper/s] + Update [oper/s] + Delete [oper/s] + Average [oper/s] + + + + + MySQL (async) + 11754.84 + 10311.34 + 12845.35 + 12010.24 + 11730.44 + + + + SQLite (async) + 64005.90 + 105391.29 + 66075.51 + 66566.43 + 75509.78 + + + + memfile (async) + 76832.16 + 2636018.56 + 76542.50 + 79188.81 + 717145.51 + + + + + MySQL (sync) + 35.86 + 9461.10 + 35.43 + 36.11 + 2392.12 + + + + SQLite (sync) + 16.31 + 67036.11 + 16.76 + 16.37 + 16771.39 + + + + memfile (sync) + 25.28 + 3460207.61 + 25.29 + 25.43 + 865070.90 @@ -544,36 +830,107 @@ SQLite version: 3.7.9sourceid version is 2011-11-01 00:52:41 c7c6050ef060877ebe7 - + - Performance measurements + Optimized performance measurements
- Possible further optimizations + Conclusions - For debugging purposes the code was compiled with -g -O0 - flags. While majority of the time was spent in backend - functions (that was probably compiled with -O2 flags), the - benchmark code could perform faster, when compiled with -O2, - rather than -O0. That is expected to affect memfile benchmark. + Improvements gained by introducing support for precompiled + statements in MySQL is somewhat disappointing - between 6 and + 29%. On the other hand, the improvement in SQLite is + surprisingly high - the efficiency is more than doubled. - Currently all operations were conducted on one by one - basis. Each operation was treated as a separate - transaction. Grouping X operations together will potentially - bring almost X fold increase in synchronous operations. - Extension for this benchmark in this regard should be considered. - That affects only write operations (insert, update and delete). Read - operations (search) are expected to be barely affected. + Compiled statements do not have any measureable impact on + synchronous operations. That is as expected, because the major + bottleneck is the disk performance. + + + Compilation flags yield surprisingly high improvements for C++ + STL code. The memfile backend is in some operations is almost + twice as fast. + + + + If synchronous operation is required, the current performance + results are likely to be deemed inadequate. The limiting + factor here is a disk access time. Even migrating to high + performance 15,000 rpm disk is expected to only roughly double + number of leases per second, compared to the current results. + The reason is that to write a file to disk, at least two disk + sector writes + are required: the new content and i-node modification of the + file. The easiest way to boost synchronous performance is to + switch to SSD disks. Memory-backed RAM disks are also a viable + solution. However, care should be taken to properly engineer + backup strategy for such RAM disks. + + + + While the custom made backend (memfile) provides the best + perfomance, it carries over all the limitations existing in + the ISC DHCP4 code: there are no external tools to query or + change database, the maintenance requires deep knowledge etc. + Those flaws are not shared by usage of a proper database + backend, like MySQL and SQLite. They both offer third party + tools for administrative tasks, they are well documented and + maintained. However, SQLite support for concurrent access is + limiting in certain cases. Since all three investigated + backends more than meet expected performance results, it is + recommended to use MySQL as a first concrete database backend. + Should this choice be rejected for any reason, the second + recommended choice is SQLite. + + + + It should be emphaisized that obtained measurements indicate + only database performance and they cannot be directly + translated to expected leases per second or queries per second + performance by an actual server. The DHCP server must do much + more than just query the database to properly process client's + message. The provided results should be considered as only rough + estimates. They can also be used for relative comparisons + between backends. + + +
+ +
+ Possible further optimizations + + For basic measurements the code was compiled with -g -O0 + flags. For optimized measurements the benchmarking code was + compiled with -Ofast (optimize for speed). In both cases, the + same backend (MySQL or SQLite) library was used. It may be + useful to recompile the libraries (or the whole server in case + of MySQL) with -Ofast. + + + There are many MySQL parameters that various sources recommend + to improve performance. They were not investigated further. + + + Currently all operations are conducted on one by one + basis. Each operation is treated as a separate + transaction. Grouping N operations together will potentially + bring almost N fold increase in synchronous operations. Such a + feature is present in ISC DHCP4 and is called cache-threshold. + Extension for this benchmark in this regard should be + considered. That affects only write operations (insert, + update and delete). Read operations (search) are expected to + be barely affected. Multi-threaded or multi-process benchmark may be considered in diff --git a/tests/tools/dhcp-ubench/mysql_ubench.cc b/tests/tools/dhcp-ubench/mysql_ubench.cc index a3076597c4..b2f58c2e72 100644 --- a/tests/tools/dhcp-ubench/mysql_ubench.cc +++ b/tests/tools/dhcp-ubench/mysql_ubench.cc @@ -34,6 +34,15 @@ MySQL_uBenchmark::MySQL_uBenchmark(const string& hostname, const string& user, } +void MySQL_uBenchmark::stmt_failure(MYSQL_STMT * stmt, const char* operation) { + stringstream tmp; + tmp << "Error " << mysql_stmt_errno(stmt) << " during " << operation + << ": " << mysql_stmt_error(stmt); + throw tmp.str(); +} + + + void MySQL_uBenchmark::failure(const char* operation) { stringstream tmp; tmp << "Error " << mysql_errno(conn_) << " during " << operation @@ -408,6 +417,7 @@ void MySQL_uBenchmark::searchLease4Test() { // 4th parameter: Client-id response[3].buffer_type = MYSQL_TYPE_STRING; response[3].buffer = &client_id; + response[3].buffer_length = sizeof(client_id); // 5th parameter: valid-lifetime response[4].buffer_type = MYSQL_TYPE_LONG; @@ -444,11 +454,24 @@ void MySQL_uBenchmark::searchLease4Test() { } int num_rows = 0; - if (!mysql_stmt_fetch(stmt)) { + int result = mysql_stmt_fetch(stmt); + switch (result) { + case 0: { if (lease_addr != addr) { failure("Returned data is bogus!"); } num_rows++; + break; + } + case MYSQL_NO_DATA: + { + // that's ok. We randomized non-existing address + break; + + } + default: { + stmt_failure(stmt, "RETRIEVE (mysql_stmt_fetch())"); + } } // we could call mysql_stmt_fetch again to check that there are no diff --git a/tests/tools/dhcp-ubench/mysql_ubench.h b/tests/tools/dhcp-ubench/mysql_ubench.h index c9fcc7c39a..be12fd6fd1 100644 --- a/tests/tools/dhcp-ubench/mysql_ubench.h +++ b/tests/tools/dhcp-ubench/mysql_ubench.h @@ -80,8 +80,25 @@ protected: /// Compared to its base version in uBenchmark class, this one logs additional /// MySQL specific information using mysql_errno() and mysql_error() functions. /// The outcome is the same: exception is thrown. + /// + /// @param operation brief description of the operation that caused error + /// + /// @sa stmt_failure() void failure(const char* operation); + /// @brief Used to report compiled statement failures. + /// + /// Compared to its base version in uBenchmark class, this one logs additional + /// MySQL specific information using mysql_stmt_errno() and mysql_stmt_error() + /// functions that are used for compiled statements error reporting. + /// + /// @param stmt MySQL compiled statement structure + /// @param operation brief description of the operation that caused error + /// + /// @sa failure() + void stmt_failure(MYSQL_STMT * stmt, const char* operation); + + /// Handle to MySQL database connection. MYSQL* conn_; }; diff --git a/tests/tools/dhcp-ubench/performance-results-graph1.png b/tests/tools/dhcp-ubench/performance-results-graph1.png index 290816f16b..a173aa6a83 100644 Binary files a/tests/tools/dhcp-ubench/performance-results-graph1.png and b/tests/tools/dhcp-ubench/performance-results-graph1.png differ diff --git a/tests/tools/dhcp-ubench/performance-results-graph2.png b/tests/tools/dhcp-ubench/performance-results-graph2.png new file mode 100644 index 0000000000..b53263bf71 Binary files /dev/null and b/tests/tools/dhcp-ubench/performance-results-graph2.png differ diff --git a/tests/tools/dhcp-ubench/performance-results.ods b/tests/tools/dhcp-ubench/performance-results.ods index 918b739cc2..b9c68bf93a 100644 Binary files a/tests/tools/dhcp-ubench/performance-results.ods and b/tests/tools/dhcp-ubench/performance-results.ods differ diff --git a/tests/tools/perfdhcp/Makefile.am b/tests/tools/perfdhcp/Makefile.am index 7c8064ea14..0532f27dcc 100644 --- a/tests/tools/perfdhcp/Makefile.am +++ b/tests/tools/perfdhcp/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = . tests +SUBDIRS = . tests templates AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib AM_CPPFLAGS += -I$(top_srcdir)/src/lib/log -I$(top_builddir)/src/lib/log @@ -18,25 +18,27 @@ if USE_STATIC_LINK AM_LDFLAGS += -static endif -lib_LTLIBRARIES = libb10_perfdhcp++.la -libb10_perfdhcp___la_SOURCES = command_options.cc command_options.h -libb10_perfdhcp___la_SOURCES += localized_option.h -libb10_perfdhcp___la_SOURCES += perf_pkt6.cc perf_pkt6.h -libb10_perfdhcp___la_SOURCES += perf_pkt4.cc perf_pkt4.h -libb10_perfdhcp___la_SOURCES += pkt_transform.cc pkt_transform.h -libb10_perfdhcp___la_SOURCES += stats_mgr.h - +pkglibexec_PROGRAMS = perfdhcp2 +perfdhcp2_SOURCES = main.cc +perfdhcp2_SOURCES += command_options.cc command_options.h +perfdhcp2_SOURCES += localized_option.h +perfdhcp2_SOURCES += perf_pkt6.cc perf_pkt6.h +perfdhcp2_SOURCES += perf_pkt4.cc perf_pkt4.h +perfdhcp2_SOURCES += pkt_transform.cc pkt_transform.h +perfdhcp2_SOURCES += stats_mgr.h +perfdhcp2_SOURCES += test_control.cc test_control.h libb10_perfdhcp___la_CXXFLAGS = $(AM_CXXFLAGS) +perfdhcp2_CXXFLAGS = $(AM_CXXFLAGS) if USE_CLANGPP # Disable unused parameter warning caused by some of the # Boost headers when compiling with clang. -libb10_perfdhcp___la_CXXFLAGS += -Wno-unused-parameter +perfdhcp2_CXXFLAGS += -Wno-unused-parameter endif -libb10_perfdhcp___la_LIBADD = $(top_builddir)/src/lib/exceptions/libb10-exceptions.la -libb10_perfdhcp___la_LIBADD += $(top_builddir)/src/lib/dhcp/libb10-dhcp++.la -libb10_perfdhcp___la_LIBADD += $(top_builddir)/src/lib/asiolink/libb10-asiolink.la +perfdhcp2_LDADD = $(top_builddir)/src/lib/exceptions/libb10-exceptions.la +perfdhcp2_LDADD += $(top_builddir)/src/lib/dhcp/libb10-dhcp++.la +perfdhcp2_LDADD += $(top_builddir)/src/lib/asiolink/libb10-asiolink.la -pkglibexec_PROGRAMS = perfdhcp -perfdhcp_SOURCES = perfdhcp.c +#pkglibexec_PROGRAMS = perfdhcp +#perfdhcp_SOURCES = perfdhcp.c diff --git a/tests/tools/perfdhcp/command_options.cc b/tests/tools/perfdhcp/command_options.cc index 09393bbc3d..24e7e790dc 100644 --- a/tests/tools/perfdhcp/command_options.cc +++ b/tests/tools/perfdhcp/command_options.cc @@ -12,6 +12,7 @@ // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. +#include #include #include #include @@ -20,9 +21,11 @@ #include #include #include +#include -#include "exceptions/exceptions.h" - +#include +#include +#include #include "command_options.h" using namespace std; @@ -54,9 +57,10 @@ CommandOptions::reset() { rate_ = 0; report_delay_ = 0; clients_num_ = 0; - mac_prefix_.assign(mac, mac + 6); - base_.resize(0); - num_request_.resize(0); + mac_template_.assign(mac, mac + 6); + duid_template_.clear(); + base_.clear(); + num_request_.clear(); period_ = 0; drop_time_set_ = 0; drop_time_.assign(dt, dt + 2); @@ -81,6 +85,8 @@ CommandOptions::reset() { diags_.clear(); wrapped_.clear(); server_name_.clear(); + generateDuidTemplate(); + commandline_.clear(); } void @@ -127,9 +133,16 @@ CommandOptions::initialize(int argc, char** argv) { int offset_arg = 0; // Temporary variable holding offset arguments std::string sarg; // Temporary variable for string args + std::ostringstream stream; + stream << "perfdhcp"; + // In this section we collect argument values from command line // they will be tuned and validated elsewhere while((opt = getopt(argc, argv, "hv46r:t:R:b:n:p:d:D:l:P:a:L:s:iBc1T:X:O:E:S:I:x:w:")) != -1) { + stream << " -" << opt; + if (optarg) { + stream << " " << optarg; + } switch (opt) { case 'v': version(); @@ -219,6 +232,7 @@ CommandOptions::initialize(int argc, char** argv) { case 'l': localname_ = std::string(optarg); + initIsInterface(); break; case 'L': @@ -312,6 +326,8 @@ CommandOptions::initialize(int argc, char** argv) { } } + std::cout << "Running: " << stream.str() << std::endl; + // If the IP version was not specified in the // command line, assume IPv4. if (ipversion_ == 0) { @@ -351,7 +367,27 @@ CommandOptions::initialize(int argc, char** argv) { } } - // TODO handle -l option with IfaceManager when it is created + // Handle the local '-l' address/interface + if (!localname_.empty()) { + if (server_name_.empty()) { + if (is_interface_ && (ipversion_ == 4)) { + broadcast_ = 1; + server_name_ = "255.255.255.255"; + } else if (is_interface_ && (ipversion_ == 6)) { + server_name_ = "FF02::1:2"; + } + } + } + if (server_name_.empty()) { + isc_throw(InvalidParameter, + "without an inteface server is required"); + } + + // If DUID is not specified from command line we need to + // generate one. + if (duid_template_.size() == 0) { + generateDuidTemplate(); + } } void @@ -376,6 +412,17 @@ CommandOptions::initClientsNum() { } } +void +CommandOptions::initIsInterface() { + is_interface_ = false; + if (!localname_.empty()) { + dhcp::IfaceMgr& iface_mgr = dhcp::IfaceMgr::instance(); + if (iface_mgr.getIface(localname_) != NULL) { + is_interface_ = true; + } + } +} + void CommandOptions::decodeBase(const std::string& base) { std::string b(base); @@ -402,7 +449,7 @@ CommandOptions::decodeMac(const std::string& base) { // Decode mac address to vector of uint8_t std::istringstream s1(base.substr(found + 1)); std::string token; - mac_prefix_.clear(); + mac_template_.clear(); // Get pieces of MAC address separated with : (or even ::) while (std::getline(s1, token, ':')) { unsigned int ui = 0; @@ -417,16 +464,17 @@ CommandOptions::decodeMac(const std::string& base) { } // If conversion succeeded store byte value - mac_prefix_.push_back(ui); + mac_template_.push_back(ui); } } // MAC address must consist of 6 octets, otherwise it is invalid - check(mac_prefix_.size() != 6, errmsg); + check(mac_template_.size() != 6, errmsg); } void CommandOptions::decodeDuid(const std::string& base) { // Strip argument from duid= + std::vector duid_template; size_t found = base.find('='); check(found == std::string::npos, "expected -b format for duid is -b duid="); std::string b = base.substr(found + 1); @@ -446,8 +494,44 @@ CommandOptions::decodeDuid(const std::string& base) { isc_throw(isc::InvalidParameter, "invalid characters in DUID provided, exepected hex digits"); } - duid_prefix_.push_back(static_cast(ui)); + duid_template.push_back(static_cast(ui)); } + // @todo Get rid of this limitation when we manage add support + // for DUIDs other than LLT. Shorter DUIDs may be useful for + // server testing purposes. + check(duid_template.size() < 6, "DUID must be at least 6 octets long"); + // Assign the new duid only if successfully generated. + std::swap(duid_template, duid_template_); +} + +void +CommandOptions::generateDuidTemplate() { + using namespace boost::posix_time; + // Duid template will be most likely generated only once but + // it is ok if it is called more then once so we simply + // regenerate it and discard previous value. + duid_template_.clear(); + const uint8_t duid_template_len = 14; + duid_template_.resize(duid_template_len); + // The first four octets consist of DUID LLT and hardware type. + duid_template_[0] = DUID_LLT >> 8; + duid_template_[1] = DUID_LLT & 0xff; + duid_template_[2] = HWTYPE_ETHERNET >> 8; + duid_template_[3] = HWTYPE_ETHERNET & 0xff; + + // As described in RFC3315: 'the time value is the time + // that the DUID is generated represented in seconds + // since midnight (UTC), January 1, 2000, modulo 2^32.' + ptime now = microsec_clock::universal_time(); + ptime duid_epoch(from_iso_string("20000101T000000")); + time_period period(duid_epoch, now); + uint32_t duration_sec = htonl(period.length().total_seconds()); + memcpy(&duid_template_[4], &duration_sec, 4); + + // Set link layer address (6 octets). This value may be + // randomized before sending a packet to simulate different + // clients. + memcpy(&duid_template_[8], &mac_template_[0], 6); } uint8_t @@ -564,6 +648,98 @@ CommandOptions::nonEmptyString(const std::string& errmsg) const { return sarg; } +void +CommandOptions::printCommandLine() const { + std::cout << "IPv" << static_cast(ipversion_) << std::endl; + if (exchange_mode_ == DO_SA) { + if (ipversion_ == 4) { + std::cout << "DISCOVER-OFFER only" << std::endl; + } else { + std::cout << "SOLICIT-ADVERETISE only" << std::endl; + } + } + if (rate_ != 0) { + std::cout << "rate[1/s]=" << rate_ << std::endl; + } + if (report_delay_ != 0) { + std::cout << "report[s]=" << report_delay_ << std::endl; + } + if (clients_num_ != 0) { + std::cout << "clients=" << clients_num_ << std::endl; + } + for (int i = 0; i < base_.size(); ++i) { + std::cout << "base[" << i << "]=" << base_[i] << std::endl; + } + for (int i = 0; i < num_request_.size(); ++i) { + std::cout << "num-request[" << i << "]=" << num_request_[i] << std::endl; + } + if (period_ != 0) { + std::cout << "test-period=" << period_ << std::endl; + } + for (int i = 0; i < drop_time_.size(); ++i) { + std::cout << "drop-time[" << i << "]=" << drop_time_[i] << std::endl; + } + for (int i = 0; i < max_drop_.size(); ++i) { + std::cout << "max-drop{" << i << "]=" << max_drop_[i] << std::endl; + } + for (int i = 0; i < max_pdrop_.size(); ++i) { + std::cout << "max-pdrop{" << i << "]=" << max_pdrop_[i] << std::endl; + } + if (preload_ != 0) { + std::cout << "preload=" << preload_ << std::endl; + } + std::cout << "aggressivity=" << aggressivity_ << std::endl; + if (getLocalPort() != 0) { + std::cout << "local-port=" << local_port_ << std::endl; + } + if (seeded_) { + std::cout << "seed=" << seed_ << std::endl; + } + if (broadcast_) { + std::cout << "broadcast" << std::endl; + } + if (rapid_commit_) { + std::cout << "rapid-commit" << std::endl; + } + if (use_first_) { + std::cout << "use-first" << std::endl; + } + for (int i = 0; i < template_file_.size(); ++i) { + std::cout << "template-file[" << i << "]=" << template_file_[i] << std::endl; + } + for (int i = 0; i < xid_offset_.size(); ++i) { + std::cout << "xid-offset[" << i << "]=" << xid_offset_[i] << std::endl; + } + if (elp_offset_ != 0) { + std::cout << "elp-offset=" << elp_offset_ << std::endl; + } + for (int i = 0; i < rnd_offset_.size(); ++i) { + std::cout << "rnd-offset[" << i << "]=" << rnd_offset_[i] << std::endl; + } + if (sid_offset_ != 0) { + std::cout << "sid-offset=" << sid_offset_ << std::endl; + } + if (rip_offset_ != 0) { + std::cout << "rip-offset=" << rip_offset_ << std::endl; + } + if (!diags_.empty()) { + std::cout << "diagnostic-selectors=" << diags_ << std::endl; + } + if (!wrapped_.empty()) { + std::cout << "wrapped=" << wrapped_ << std::endl; + } + if (!localname_.empty()) { + if (is_interface_) { + std::cout << "interface=" << localname_ << std::endl; + } else { + std::cout << "local-addr=" << localname_ << std::endl; + } + } + if (!server_name_.empty()) { + std::cout << "server=" << server_name_ << std::endl; + } +} + void CommandOptions::usage() const { fprintf(stdout, "%s", @@ -691,7 +867,7 @@ CommandOptions::usage() const { void CommandOptions::version() const { - fprintf(stdout, "version 0.01\n"); + std::cout << "VERSION: " << VERSION << std::endl; } diff --git a/tests/tools/perfdhcp/command_options.h b/tests/tools/perfdhcp/command_options.h index 9196857d7c..b9e2b9e70e 100644 --- a/tests/tools/perfdhcp/command_options.h +++ b/tests/tools/perfdhcp/command_options.h @@ -23,7 +23,7 @@ namespace isc { namespace perfdhcp { -/// \brief Command Options +/// \brief Command Options. /// /// This class is responsible for parsing the command-line and storing the /// specified options. @@ -49,64 +49,64 @@ public: /// command line options. void reset(); - /// \brief Parse command line + /// \brief Parse command line. /// /// Parses the command line and stores the selected options /// in class data members. /// /// \param argc Argument count passed to main(). /// \param argv Argument value array passed to main(). - /// \throws isc::InvalidParameter if parse fails + /// \throws isc::InvalidParameter if parse fails. void parse(int argc, char** const argv); - /// \brief Returns IP version + /// \brief Returns IP version. /// - /// \return IP version to be used + /// \return IP version to be used. uint8_t getIpVersion() const { return ipversion_; } - /// \brief Returns packet exchange mode + /// \brief Returns packet exchange mode. /// - /// \return packet exchange mode + /// \return packet exchange mode. ExchangeMode getExchangeMode() const { return exchange_mode_; } - /// \brief Returns echange rate + /// \brief Returns echange rate. /// - /// \return exchange rate per second + /// \return exchange rate per second. int getRate() const { return rate_; } - /// \brief Returns delay between two performance reports + /// \brief Returns delay between two performance reports. /// - /// \return delay between two consecutive performance reports + /// \return delay between two consecutive performance reports. int getReportDelay() const { return report_delay_; } - /// \brief Returns number of simulated clients + /// \brief Returns number of simulated clients. /// - /// \return number of simulated clients + /// \return number of simulated clients. uint32_t getClientsNum() const { return clients_num_; } - /// \brief Returns MAC address prefix + /// \brief Returns MAC address template. /// - /// \ return MAC address prefix to simulate different clients - std::vector getMacPrefix() const { return mac_prefix_; } + /// \return MAC address template to simulate different clients. + std::vector getMacTemplate() const { return mac_template_; } - /// \brief Returns DUID prefix + /// \brief Returns DUID template. /// - /// \return DUID prefix to simulate different clients - std::vector getDuidPrefix() const { return duid_prefix_; } + /// \return DUID template to simulate different clients. + std::vector getDuidTemplate() const { return duid_template_; } - /// \brief Returns base values + /// \brief Returns base values. /// - /// \return all base values specified + /// \return all base values specified. std::vector getBase() const { return base_; } - /// \brief Returns maximum number of exchanges + /// \brief Returns maximum number of exchanges. /// - /// \return number of exchange requests before test is aborted + /// \return number of exchange requests before test is aborted. std::vector getNumRequests() const { return num_request_; } - /// \brief Returns test period + /// \brief Returns test period. /// - /// \return test period before it is aborted + /// \return test period before it is aborted. int getPeriod() const { return period_; } /// \brief Returns drop time @@ -114,136 +114,139 @@ public: /// The method returns maximum time elapsed from /// sending the packet before it is assumed dropped. /// - /// \return return time before request is assumed dropped + /// \return return time before request is assumed dropped. std::vector getDropTime() const { return drop_time_; } - /// \brief Returns maximum drops number + /// \brief Returns maximum drops number. /// /// Returns maximum number of packet drops before /// aborting a test. /// - /// \return maximum number of dropped requests + /// \return maximum number of dropped requests. std::vector getMaxDrop() const { return max_drop_; } - /// \brief Returns maximal percentage of drops + /// \brief Returns maximal percentage of drops. /// /// Returns maximal percentage of packet drops /// before aborting a test. /// - /// \return maximum percentage of lost requests + /// \return maximum percentage of lost requests. std::vector getMaxDropPercentage() const { return max_pdrop_; } - /// \brief Returns local address or interface name + /// \brief Returns local address or interface name. /// - /// \return local address or interface name + /// \return local address or interface name. std::string getLocalName() const { return localname_; } - /// \brief Checks if interface name was used + /// \brief Checks if interface name was used. /// /// The method checks if interface name was used /// rather than address. /// - /// \return true if interface name was used + /// \return true if interface name was used. bool isInterface() const { return is_interface_; } - /// \brief Returns number of preload exchanges + /// \brief Returns number of preload exchanges. /// - /// \return number of preload exchanges + /// \return number of preload exchanges. int getPreload() const { return preload_; } - /// \brief Returns aggressivity value + /// \brief Returns aggressivity value. /// - /// \return aggressivity value + /// \return aggressivity value. int getAggressivity() const { return aggressivity_; } - /// \brief Returns local port number + /// \brief Returns local port number. /// - /// \return local port number + /// \return local port number. int getLocalPort() const { return local_port_; } - /// \brief Checks if seed provided + /// \brief Checks if seed provided. /// - /// \return true if seed was provided + /// \return true if seed was provided. bool isSeeded() const { return seeded_; } - /// \brief Returns radom seed + /// \brief Returns radom seed. /// - /// \return random seed + /// \return random seed. uint32_t getSeed() const { return seed_; } - /// \brief Checks if broadcast address is to be used + /// \brief Checks if broadcast address is to be used. /// - /// \return true if broadcast address is to be used + /// \return true if broadcast address is to be used. bool isBroadcast() const { return broadcast_; } - /// \brief Check if rapid commit option used + /// \brief Check if rapid commit option used. /// - /// \return true if rapid commit option is used + /// \return true if rapid commit option is used. bool isRapidCommit() const { return rapid_commit_; } - /// \brief Check if server-ID to be taken from first package + /// \brief Check if server-ID to be taken from first package. /// - /// \return true if server-iD to be taken from first package + /// \return true if server-iD to be taken from first package. bool isUseFirst() const { return use_first_; } - /// \brief Returns template file names + /// \brief Returns template file names. /// - /// \return template file names + /// \return template file names. std::vector getTemplateFiles() const { return template_file_; } - /// brief Returns template offsets for xid + /// brief Returns template offsets for xid. /// - /// \return template offsets for xid + /// \return template offsets for xid. std::vector getTransactionIdOffset() const { return xid_offset_; } - /// \brief Returns template offsets for rnd + /// \brief Returns template offsets for rnd. /// - /// \return template offsets for rnd + /// \return template offsets for rnd. std::vector getRandomOffset() const { return rnd_offset_; } - /// \brief Returns template offset for elapsed time + /// \brief Returns template offset for elapsed time. /// - /// \return template offset for elapsed time + /// \return template offset for elapsed time. int getElapsedTimeOffset() const { return elp_offset_; } - /// \brief Returns template offset for server-ID + /// \brief Returns template offset for server-ID. /// - /// \return template offset for server-ID + /// \return template offset for server-ID. int getServerIdOffset() const { return sid_offset_; } - /// \brief Returns template offset for requested IP + /// \brief Returns template offset for requested IP. /// - /// \return template offset for requested IP + /// \return template offset for requested IP. int getRequestedIpOffset() const { return rip_offset_; } - /// \brief Returns diagnostic selectors + /// \brief Returns diagnostic selectors. /// - /// \return diagnostics selector + /// \return diagnostics selector. std::string getDiags() const { return diags_; } - /// \brief Returns wrapped command + /// \brief Returns wrapped command. /// - /// \return wrapped command (start/stop) + /// \return wrapped command (start/stop). std::string getWrapped() const { return wrapped_; } - /// \brief Returns server name + /// \brief Returns server name. /// - /// \return server name + /// \return server name. std::string getServerName() const { return server_name_; } + + /// \brief Print command line arguments. + void printCommandLine() const; - /// \brief Print usage + /// \brief Print usage. /// - /// Prints perfdhcp usage + /// Prints perfdhcp usage. void usage() const; - /// \brief Print program version + /// \brief Print program version. /// - /// Prints perfdhcp version + /// Prints perfdhcp version. void version() const; private: - /// \brief Default Constructor + /// \brief Default Constructor. /// /// Private constructor as this is a singleton class. /// Use CommandOptions::instance() to get instance of it. @@ -251,57 +254,64 @@ private: reset(); } - /// \brief Initializes class members based command line + /// \brief Initializes class members based on the command line. /// - /// Reads each command line parameter and sets class member values + /// Reads each command line parameter and sets class member values. /// /// \param argc Argument count passed to main(). /// \param argv Argument value array passed to main(). - /// \throws isc::InvalidParameter if command line options initialization fails + /// \throws isc::InvalidParameter if command line options initialization fails. void initialize(int argc, char** argv); - /// \brief Validates initialized options + /// \brief Validates initialized options. /// - /// \throws isc::InvalidParameter if command line validation fails + /// \throws isc::InvalidParameter if command line validation fails. void validate() const; - /// \brief Throws !InvalidParameter exception if condition is true + /// \brief Throws !InvalidParameter exception if condition is true. /// /// Convenience function that throws an InvalidParameter exception if - /// the condition argument is true + /// the condition argument is true. /// - /// \param condition Condition to be checked - /// \param errmsg Error message in exception - /// \throws isc::InvalidParameter if condition argument true + /// \param condition Condition to be checked. + /// \param errmsg Error message in exception. + /// \throws isc::InvalidParameter if condition argument true. inline void check(bool condition, const std::string& errmsg) const; - /// \brief Casts command line argument to positive integer + /// \brief Casts command line argument to positive integer. /// - /// \param errmsg Error message if lexical cast fails - /// \throw InvalidParameter if lexical cast fails + /// \param errmsg Error message if lexical cast fails. + /// \throw InvalidParameter if lexical cast fails. int positiveInteger(const std::string& errmsg) const; - /// \brief Casts command line argument to non-negative integer + /// \brief Casts command line argument to non-negative integer. /// - /// \param errmsg Error message if lexical cast fails - /// \throw InvalidParameter if lexical cast fails + /// \param errmsg Error message if lexical cast fails. + /// \throw InvalidParameter if lexical cast fails. int nonNegativeInteger(const std::string& errmsg) const; - /// \brief Returns command line string if it is not empty + /// \brief Returns command line string if it is not empty. /// - /// \param errmsg Error message if string is empty - /// \throw InvalidParameter if string is empty + /// \param errmsg Error message if string is empty. + /// \throw InvalidParameter if string is empty. std::string nonEmptyString(const std::string& errmsg) const; - /// \brief Set number of clients + /// \brief Set number of clients. /// /// Interprets the getopt() "opt" global variable as the number of clients /// (a non-negative number). This value is specified by the "-R" switch. /// - /// \throw InvalidParameter if -R is wrong + /// \throw InvalidParameter if -R is wrong. void initClientsNum(); - /// \brief Decodes base provided with -b + /// \brief Sets value indicating if interface name was given. + /// + /// Method checks if the command line argument given with + /// '-l' option is the interface name. The is_interface_ member + /// is set accordingly. + void initIsInterface(); + + /// \brief Decodes base provided with -b. /// /// Function decodes argument of -b switch, which /// specifies a base value used to generate unique @@ -311,39 +321,47 @@ private: /// - -b mac=00:01:02:03:04:05 /// - -b duid=0F1234 (duid can be up to 128 hex digits) // Function will decode 00:01:02:03:04:05 and/or - /// 0F1234 respectively and initialize mac_prefix_ - /// and/or duid_prefix_ members + /// 0F1234 respectively and initialize mac_template_ + /// and/or duid_template_ members. /// - /// \param base Base in string format - /// \throws isc::InvalidParameter if base is invalid + /// \param base Base in string format. + /// \throws isc::InvalidParameter if base is invalid. void decodeBase(const std::string& base); - /// \brief Decodes base MAC address provided with -b + /// \brief Decodes base MAC address provided with -b. /// /// Function decodes parameter given as -b mac=00:01:02:03:04:05 - /// The function will decode 00:01:02:03:04:05 initialize mac_prefix_ + /// The function will decode 00:01:02:03:04:05 initialize mac_template_ /// class member. - /// Provided MAC address is for example only + /// Provided MAC address is for example only. /// - /// \param base Base string given as -b mac=00:01:02:03:04:05 - /// \throws isc::InvalidParameter if mac address is invalid + /// \param base Base string given as -b mac=00:01:02:03:04:05. + /// \throws isc::InvalidParameter if mac address is invalid. void decodeMac(const std::string& base); - /// \brief Decodes base DUID provided with -b + /// \brief Decodes base DUID provided with -b. /// - /// Function decodes parameter given as -b duid=0F1234 - /// The function will decode 0F1234 and initialize duid_prefix_ + /// Function decodes parameter given as -b duid=0F1234. + /// The function will decode 0F1234 and initialize duid_template_ /// class member. /// Provided DUID is for example only. /// - /// \param base Base string given as -b duid=0F1234 - /// \throws isc::InvalidParameter if DUID is invalid + /// \param base Base string given as -b duid=0F1234. + /// \throws isc::InvalidParameter if DUID is invalid. void decodeDuid(const std::string& base); - - /// \brief Converts two-digit hexadecimal string to a byte + + /// \brief Generates DUID-LLT (based on link layer address). /// - /// \param hex_text Hexadecimal string e.g. AF - /// \throw isc::InvalidParameter if string does not represent hex byte + /// Function generates DUID based on link layer address and + /// initiates duid_template_ value with it. + /// \todo add support to generate DUIDs other than based on + /// 6-octets long MACs (e.g. DUID-UUID. + void generateDuidTemplate(); + + /// \brief Converts two-digit hexadecimal string to a byte. + /// + /// \param hex_text Hexadecimal string e.g. AF. + /// \throw isc::InvalidParameter if string does not represent hex byte. uint8_t convertHexString(const std::string& hex_text) const; uint8_t ipversion_; ///< IP protocol version to be used, expected values are: @@ -353,9 +371,9 @@ private: int report_delay_; ///< Delay between generation of two consecutive ///< performance reports uint32_t clients_num_; ///< Number of simulated clients (aka randomization range). - std::vector mac_prefix_; ///< MAC address prefix used to generate unique DUIDs + std::vector mac_template_; ///< MAC address template used to generate unique DUIDs ///< for simulated clients. - std::vector duid_prefix_; ///< DUID prefix used to generate unique DUIDs for + std::vector duid_template_; ///< DUID template used to generate unique DUIDs for ///< simulated clients std::vector base_; ///< Collection of base values specified with -b ///< options. Supported "bases" are mac= and duid= @@ -404,6 +422,7 @@ private: std::string wrapped_; ///< Wrapped command specified as -w. Expected ///< values are start and stop. std::string server_name_; ///< Server name specified as last argument of command line. + std::string commandline_; ///< Entire command line as typed in by the user. }; } // namespace perfdhcp diff --git a/tests/tools/perfdhcp/localized_option.h b/tests/tools/perfdhcp/localized_option.h index 5374684f89..336e08366e 100644 --- a/tests/tools/perfdhcp/localized_option.h +++ b/tests/tools/perfdhcp/localized_option.h @@ -16,6 +16,8 @@ #define __LOCALIZED_OPTION_H #include +#include +#include namespace isc { namespace perfdhcp { @@ -42,56 +44,30 @@ namespace perfdhcp { /// class LocalizedOption : public dhcp::Option { public: - /// \brief Constructor, sets default (0) option offset - /// - /// \param u specifies universe (V4 or V6) - /// \param type option type (0-255 for V4 and 0-65535 for V6) - /// \param data content of the option - LocalizedOption(dhcp::Option::Universe u, - uint16_t type, - const dhcp::OptionBuffer& data) : - dhcp::Option(u, type, data), - offset_(0) { - } - - /// \brief Constructor, used to create localized option from buffer + /// \brief Constructor, used to create localized option from buffer. /// - /// \param u specifies universe (V4 or V6) - /// \param type option type (0-255 for V4 and 0-65535 for V6) - /// \param data content of the option - /// \param offset location of option in a packet (zero is default) + /// This constructor creates localized option using whole provided + /// option buffer. + /// + /// \param u universe (V4 or V6). + /// \param type option type (0-255 for V4 and 0-65535 for V6). + /// Option values 0 and 255 (v4) and 0 (v6) are not valid option + /// codes but they are accepted here for the server testing purposes. + /// \param data content of the option. + /// \param offset location of option in a packet (zero is default). LocalizedOption(dhcp::Option::Universe u, uint16_t type, const dhcp::OptionBuffer& data, - const size_t offset) : + const size_t offset = 0) : dhcp::Option(u, type, data), - offset_(offset) { + offset_(offset), option_valid_(true) { } - /// \brief Constructor, sets default (0) option offset + /// \brief Constructor, used to create option from buffer iterators. /// - /// This contructor is similar to the previous one, but it does not take - /// the whole vector, but rather subset of it. - /// - /// \param u specifies universe (V4 or V6) - /// \param type option type (0-255 for V4 and 0-65535 for V6) - /// \param first iterator to the first element that should be copied - /// \param last iterator to the next element after the last one - /// to be copied. - LocalizedOption(dhcp::Option::Universe u, - uint16_t type, - dhcp::OptionBufferConstIter first, - dhcp::OptionBufferConstIter last) : - dhcp::Option(u, type, first, last), - offset_(0) { - } - - - /// \brief Constructor, used to create option from buffer iterators - /// - /// This contructor is similar to the previous one, but it does not take - /// the whole vector, but rather subset of it. + /// This constructor creates localized option using part of the + /// option buffer pointed by iterators. /// /// \param u specifies universe (V4 or V6) /// \param type option type (0-255 for V4 and 0-65535 for V6) @@ -102,9 +78,52 @@ public: LocalizedOption(dhcp::Option::Universe u, uint16_t type, dhcp::OptionBufferConstIter first, - dhcp::OptionBufferConstIter last, const size_t offset) : + dhcp::OptionBufferConstIter last, + const size_t offset = 0) : dhcp::Option(u, type, first, last), - offset_(offset) { + offset_(offset), option_valid_(true) { + } + + /// \brief Copy constructor, creates LocalizedOption from Option6IA. + /// + /// This copy constructor creates regular option from Option6IA. + /// The data from Option6IA data members are copied to + /// option buffer in appropriate sequence. + /// + /// \param opt_ia option to be copied. + /// \param offset location of the option in a packet. + LocalizedOption(const boost::shared_ptr& opt_ia, + const size_t offset) : + dhcp::Option(Option::V6, 0, dhcp::OptionBuffer()), + offset_(offset), option_valid_(false) { + // If given option is NULL we will mark this new option + // as invalid. User may query if option is valid when + // object is created. + if (opt_ia) { + // Set universe and type. + universe_ = opt_ia->getUniverse(); + type_ = opt_ia->getType(); + util::OutputBuffer buf(opt_ia->len() - opt_ia->getHeaderLen()); + try { + // Try to pack option data into the temporary buffer. + opt_ia->pack(buf); + if (buf.getLength() > 0) { + const char* buf_data = static_cast(buf.getData()); + // Option has been packed along with option type flag + // and transaction id so we have to skip first 4 bytes + // when copying temporary buffer option buffer. + data_.assign(buf_data + 4, buf_data + buf.getLength()); + } + option_valid_ = true; + } catch (const Exception&) { + // If there was an exception somewhere when packing + // the data into the buffer we assume that option is + // not valid and should not be used. + option_valid_ = false; + } + } else { + option_valid_ = false; + } } /// \brief Returns offset of an option in a DHCP packet. @@ -112,12 +131,20 @@ public: /// \return option offset in a packet size_t getOffset() const { return offset_; }; + /// \brief Checks if option is valid. + /// + /// \return true, if option is valid. + virtual bool valid() { + return (Option::valid() && option_valid_); + } + private: size_t offset_; ///< Offset of DHCP option in a packet + bool option_valid_; ///< Is option valid. }; -} // namespace perfdhcp +} // namespace isc::perfdhcp } // namespace isc #endif // __LOCALIZED_OPTION_H diff --git a/tests/tools/perfdhcp/main.cc b/tests/tools/perfdhcp/main.cc new file mode 100644 index 0000000000..0c706a2b8c --- /dev/null +++ b/tests/tools/perfdhcp/main.cc @@ -0,0 +1,50 @@ +// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC") +// +// Permission to use, copy, modify, and/or distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +// PERFORMANCE OF THIS SOFTWARE. + +#include +#include + +#include +#include + +#include "test_control.h" +#include "command_options.h" + +using namespace isc::perfdhcp; + +int +main(int argc, char* argv[]) { + CommandOptions& command_options = CommandOptions::instance(); + try { + command_options.parse(argc, argv); + } catch(isc::Exception& e) { + std::cout << "Error parsing command line options: " + << e.what() << std::endl; + command_options.usage(); + return(1); + } + try{ + TestControl& test_control = TestControl::instance(); + test_control.run(); + } catch (isc::Exception& e) { + std::cout << "Error running perfdhcp: " << e.what() << std::endl; + std::string diags(command_options.getDiags()); + if (diags.find('e') != std::string::npos) { + std::cout << "Fatal error" << std::endl; + } + return(1); + } + return(0); +} + diff --git a/tests/tools/perfdhcp/perf_pkt4.cc b/tests/tools/perfdhcp/perf_pkt4.cc index 3f733afacc..3ccef94e98 100644 --- a/tests/tools/perfdhcp/perf_pkt4.cc +++ b/tests/tools/perfdhcp/perf_pkt4.cc @@ -16,7 +16,6 @@ #include #include "perf_pkt4.h" -#include "pkt_transform.h" using namespace std; using namespace isc; @@ -58,5 +57,14 @@ PerfPkt4::rawUnpack() { return (res); } +void +PerfPkt4::writeAt(size_t dest_pos, + std::vector::iterator first, + std::vector::iterator last) { + return (PktTransform::writeAt(data_, dest_pos, first, last)); +} + + + } // namespace perfdhcp } // namespace isc diff --git a/tests/tools/perfdhcp/perf_pkt4.h b/tests/tools/perfdhcp/perf_pkt4.h index f4cc440773..87c7bb0974 100644 --- a/tests/tools/perfdhcp/perf_pkt4.h +++ b/tests/tools/perfdhcp/perf_pkt4.h @@ -20,6 +20,7 @@ #include #include "localized_option.h" +#include "pkt_transform.h" namespace isc { namespace perfdhcp { @@ -102,11 +103,36 @@ public: /// \return false If unpack operation failed. bool rawUnpack(); + /// \brief Replace contents of buffer with data. + /// + /// Function replaces part of the buffer with data from vector. + /// + /// \param dest_pos position in buffer where data is replaced. + /// \param first beginning of data range in source vector. + /// \param last end of data range in source vector. + void writeAt(size_t dest_pos, + std::vector::iterator first, + std::vector::iterator last); + + /// \brief Replace contents of buffer with value. + /// + /// Function replaces part of buffer with value. + /// + /// \param dest_pos position in buffer where value is + /// to be written. + /// \param val value to be written. + template + void writeValueAt(size_t dest_pos, T val) { + PktTransform::writeValueAt(data_, dest_pos, val); + } + private: size_t transid_offset_; ///< transaction id offset }; +typedef boost::shared_ptr PerfPkt4Ptr; + } // namespace perfdhcp } // namespace isc diff --git a/tests/tools/perfdhcp/perf_pkt6.cc b/tests/tools/perfdhcp/perf_pkt6.cc index 24cfb931a9..56fe9dfd77 100644 --- a/tests/tools/perfdhcp/perf_pkt6.cc +++ b/tests/tools/perfdhcp/perf_pkt6.cc @@ -60,5 +60,13 @@ PerfPkt6::rawUnpack() { return (res); } +void +PerfPkt6::writeAt(size_t dest_pos, + std::vector::iterator first, + std::vector::iterator last) { + return (PktTransform::writeAt(data_, dest_pos, first, last)); +} + + } // namespace perfdhcp } // namespace isc diff --git a/tests/tools/perfdhcp/perf_pkt6.h b/tests/tools/perfdhcp/perf_pkt6.h index 94fe47bada..25fb4e53a4 100644 --- a/tests/tools/perfdhcp/perf_pkt6.h +++ b/tests/tools/perfdhcp/perf_pkt6.h @@ -20,6 +20,7 @@ #include #include "localized_option.h" +#include "pkt_transform.h" namespace isc { namespace perfdhcp { @@ -102,11 +103,36 @@ public: /// \return false if unpack operation failed. bool rawUnpack(); + /// \brief Replace contents of buffer with data. + /// + /// Function replaces part of the buffer with data from vector. + /// + /// \param dest_pos position in buffer where data is replaced. + /// \param first beginning of data range in source vector. + /// \param last end of data range in source vector. + void writeAt(size_t dest_pos, + std::vector::iterator first, + std::vector::iterator last); + + /// \brief Replace contents of buffer with value. + /// + /// Function replaces part of buffer with value. + /// + /// \param dest_pos position in buffer where value is + /// to be written. + /// \param val value to be written. + template + void writeValueAt(size_t dest_pos, T val) { + PktTransform::writeValueAt(data_, dest_pos, val); + } + private: size_t transid_offset_; ///< transaction id offset }; +typedef boost::shared_ptr PerfPkt6Ptr; + } // namespace perfdhcp } // namespace isc diff --git a/tests/tools/perfdhcp/pkt_transform.cc b/tests/tools/perfdhcp/pkt_transform.cc index 5ed39bfc5f..b1c64e2339 100644 --- a/tests/tools/perfdhcp/pkt_transform.cc +++ b/tests/tools/perfdhcp/pkt_transform.cc @@ -216,7 +216,13 @@ PktTransform::unpackOptions(const OptionBuffer& in_buffer, in_buffer.begin() + offset + opt_len); } } - + +void +PktTransform::writeAt(dhcp::OptionBuffer& in_buffer, size_t dest_pos, + dhcp::OptionBuffer::iterator first, + dhcp::OptionBuffer::iterator last) { + memcpy(&in_buffer[dest_pos], &(*first), std::distance(first, last)); +} } // namespace perfdhcp } // namespace isc diff --git a/tests/tools/perfdhcp/pkt_transform.h b/tests/tools/perfdhcp/pkt_transform.h index 7fb19f48c4..1f57105720 100644 --- a/tests/tools/perfdhcp/pkt_transform.h +++ b/tests/tools/perfdhcp/pkt_transform.h @@ -92,6 +92,35 @@ public: const size_t transid_offset, uint32_t& transid); + /// \brief Replace contents of buffer with vector. + /// + /// Function replaces data of the buffer with data from vector. + /// + /// \param in_buffer destination buffer. + /// \param dest_pos position in destination buffer. + /// \param first beginning of data range in source vector. + /// \param last end of data range in source vector. + static void writeAt(dhcp::OptionBuffer& in_buffer, size_t dest_pos, + std::vector::iterator first, + std::vector::iterator last); + + /// \brief Replace contents of one vector with uint16 value. + /// + /// Function replaces data inside one vector with uint16_t value. + /// + /// \param in_buffer destination buffer. + /// \param dest_pos position in destination buffer. + /// \param val value to be written. + template + static void writeValueAt(dhcp::OptionBuffer& in_buffer, size_t dest_pos, + T val) { + // @todo consider replacing the loop with switch statement + // checking sizeof(T). + for (int i = 0; i < sizeof(T); ++i) { + in_buffer[dest_pos + i] = (val >> 8 * (sizeof(T) - i - 1)) & 0xFF; + } + } + private: /// \brief Replaces contents of options in a buffer. /// @@ -131,6 +160,7 @@ private: /// \throw isc::Unexpected if options unpack failed. static void unpackOptions(const dhcp::OptionBuffer& in_buffer, const dhcp::Option::OptionCollection& options); + }; } // namespace perfdhcp diff --git a/tests/tools/perfdhcp/stats_mgr.h b/tests/tools/perfdhcp/stats_mgr.h index 245c69e3cf..a8dfa8b7bd 100644 --- a/tests/tools/perfdhcp/stats_mgr.h +++ b/tests/tools/perfdhcp/stats_mgr.h @@ -47,8 +47,8 @@ namespace perfdhcp { /// stored on the list of sent packets. When packets are matched the /// round trip time can be calculated. /// -/// \tparam T class representing DHCPv4 or DHCPv6 packet. -template +/// \param T class representing DHCPv4 or DHCPv6 packet. +template class StatsMgr : public boost::noncopyable { public: @@ -138,7 +138,7 @@ public: /// \param packet packet which transaction id is to be hashed. /// \throw isc::BadValue if packet is null. /// \return transaction id hash. - static uint32_t hashTransid(const boost::shared_ptr& packet) { + static uint32_t hashTransid(const boost::shared_ptr& packet) { if (!packet) { isc_throw(BadValue, "Packet is null"); } @@ -214,21 +214,33 @@ public: /// } /// \endcode typedef boost::multi_index_container< - boost::shared_ptr, + // Container holds shared_ptr or shared_ptr objects. + boost::shared_ptr, + // List container indexes. boost::multi_index::indexed_by< + // Sequenced index provides the way to use this container + // in the same way as std::list. boost::multi_index::sequenced<>, + // The other index keeps products of transaction id. boost::multi_index::hashed_non_unique< - boost::multi_index::global_fun< - const boost::shared_ptr&, - uint32_t, - &ExchangeStats::hashTransid - > + // Specify hash function to get the product of + // transaction id. This product is obtained by calling + // hashTransid() function. + boost::multi_index::global_fun< + // Hashing function takes shared_ptr or + // shared_ptr as argument. + const boost::shared_ptr&, + // ... and returns uint32 value. + uint32_t, + // ... and here is a reference to it. + &ExchangeStats::hashTransid + > > > > PktList; /// Packet list iterator for sequencial access to elements. - typedef typename PktList::const_iterator PktListIterator; + typedef typename PktList::iterator PktListIterator; /// Packet list index to search packets using transaction id hash. typedef typename PktList::template nth_index<1>::type PktListTransidHashIndex; @@ -243,20 +255,21 @@ public: /// In this mode all packets are stored throughout the test execution. ExchangeStats(const ExchangeType xchg_type, const bool archive_enabled) : xchg_type_(xchg_type), - min_delay_(std::numeric_limits::max()), - max_delay_(0.), - sum_delay_(0.), - orphans_(0), - sum_delay_squared_(0.), - ordered_lookups_(0), - unordered_lookup_size_sum_(0), - unordered_lookups_(0), - sent_packets_num_(0), - rcvd_packets_num_(0), sent_packets_(), rcvd_packets_(), archived_packets_(), - archive_enabled_(archive_enabled) { + archive_enabled_(archive_enabled), + min_delay_(std::numeric_limits::max()), + max_delay_(0.), + sum_delay_(0.), + sum_delay_squared_(0.), + orphans_(0), + unordered_lookup_size_sum_(0), + unordered_lookups_(0), + ordered_lookups_(0), + sent_packets_num_(0), + rcvd_packets_num_(0) + { next_sent_ = sent_packets_.begin(); } @@ -266,7 +279,7 @@ public: /// /// \param packet packet object to be added. /// \throw isc::BadValue if packet is null. - void appendSent(const boost::shared_ptr& packet) { + void appendSent(const boost::shared_ptr& packet) { if (!packet) { isc_throw(BadValue, "Packet is null"); } @@ -280,7 +293,7 @@ public: /// /// \param packet packet object to be added. /// \throw isc::BadValue if packet is null. - void appendRcvd(const boost::shared_ptr& packet) { + void appendRcvd(const boost::shared_ptr& packet) { if (!packet) { isc_throw(BadValue, "Packet is null"); } @@ -296,8 +309,8 @@ public: /// \param rcvd_packet received packet /// \throw isc::BadValue if sent or received packet is null. /// \throw isc::Unexpected if failed to calculate timestamps - void updateDelays(const boost::shared_ptr& sent_packet, - const boost::shared_ptr& rcvd_packet) { + void updateDelays(const boost::shared_ptr& sent_packet, + const boost::shared_ptr& rcvd_packet) { if (!sent_packet) { isc_throw(BadValue, "Sent packet is null"); } @@ -355,7 +368,8 @@ public: /// \throw isc::BadValue if received packet is null. /// \return packet having specified transaction or NULL if packet /// not found - boost::shared_ptr matchPackets(const boost::shared_ptr& rcvd_packet) { + boost::shared_ptr + matchPackets(const boost::shared_ptr& rcvd_packet) { if (!rcvd_packet) { isc_throw(BadValue, "Received packet is null"); } @@ -366,7 +380,7 @@ public: // that the received packet we got has no corresponding // sent packet so orphans counter has to be updated. ++orphans_; - return(boost::shared_ptr()); + return(boost::shared_ptr()); } else if (next_sent_ == sent_packets_.end()) { // Even if there are still many unmatched packets on the // list we might hit the end of it because of unordered @@ -425,13 +439,13 @@ public: // If we are here, it means that both ordered lookup and // unordered lookup failed. Searched packet is not on the list. ++orphans_; - return(boost::shared_ptr()); + return(boost::shared_ptr()); } // Packet is matched so we count it. We don't count unmatched packets // as they are counted as orphans with a separate counter. ++rcvd_packets_num_; - boost::shared_ptr sent_packet(*next_sent_); + boost::shared_ptr sent_packet(*next_sent_); // If packet was found, we assume it will be never searched // again. We want to delete this packet from the list to // improve performance of future searches. @@ -548,6 +562,19 @@ public: /// \return number of received packets. uint64_t getRcvdPacketsNum() const { return(rcvd_packets_num_); } + /// \brief Return number of dropped packets. + /// + /// Method returns number of dropped packets. + /// + /// \return number of dropped packets. + uint64_t getDroppedPacketsNum() const { + uint64_t drops = 0; + if (getSentPacketsNum() > getRcvdPacketsNum()) { + drops = getSentPacketsNum() - getRcvdPacketsNum(); + } + return(drops); + } + /// \brief Print main statistics for packet exchange. /// /// Method prints main statistics for particular exchange. @@ -555,10 +582,9 @@ public: /// number of dropped packets and number of orphans. void printMainStats() const { using namespace std; - uint64_t drops = getRcvdPacketsNum() - getSentPacketsNum(); cout << "sent packets: " << getSentPacketsNum() << endl << "received packets: " << getRcvdPacketsNum() << endl - << "drops: " << drops << endl + << "drops: " << getDroppedPacketsNum() << endl << "orphans: " << getOrphans() << endl; } @@ -610,7 +636,7 @@ public: for (PktListIterator it = rcvd_packets_.begin(); it != rcvd_packets_.end(); ++it) { - boost::shared_ptr rcvd_packet = *it; + boost::shared_ptr rcvd_packet = *it; PktListTransidHashIndex& idx = archived_packets_.template get<1>(); std::pairgetTransid() == rcvd_packet->getTransid()) { - boost::shared_ptr sent_packet = *it_archived; + boost::shared_ptr sent_packet = *it_archived; // Get sent and received packet times. ptime sent_time = sent_packet->getTimestamp(); ptime rcvd_time = rcvd_packet->getTimestamp(); @@ -761,7 +787,8 @@ public: StatsMgr(const bool archive_enabled = false) : exchanges_(), custom_counters_(), - archive_enabled_(archive_enabled) { + archive_enabled_(archive_enabled), + boot_time_(boost::posix_time::microsec_clock::universal_time()) { } /// \brief Specify new exchange type. @@ -819,7 +846,7 @@ public: /// /// \param counter_key key poitinh to the counter in the counters map. /// \return pointer to specified counter after incrementation. - const CustomCounter& IncrementCounter(const std::string& counter_key) { + const CustomCounter& incrementCounter(const std::string& counter_key) { CustomCounterPtr counter = getCounter(counter_key); return(++(*counter)); } @@ -835,7 +862,7 @@ public: /// \throw isc::BadValue if invalid exchange type specified or /// packet is null. void passSentPacket(const ExchangeType xchg_type, - const boost::shared_ptr& packet) { + const boost::shared_ptr& packet) { ExchangeStatsPtr xchg_stats = getExchangeStats(xchg_type); xchg_stats->appendSent(packet); } @@ -853,10 +880,11 @@ public: /// or packet is null. /// \throw isc::Unexpected if corresponding packet was not /// found on the list of sent packets. - void passRcvdPacket(const ExchangeType xchg_type, - const boost::shared_ptr& packet) { + boost::shared_ptr + passRcvdPacket(const ExchangeType xchg_type, + const boost::shared_ptr& packet) { ExchangeStatsPtr xchg_stats = getExchangeStats(xchg_type); - boost::shared_ptr sent_packet + boost::shared_ptr sent_packet = xchg_stats->matchPackets(packet); if (sent_packet) { @@ -865,6 +893,7 @@ public: xchg_stats->appendRcvd(packet); } } + return(sent_packet); } /// \brief Return minumum delay between sent and received packet. @@ -999,6 +1028,33 @@ public: return(xchg_stats->getRcvdPacketsNum()); } + /// \brief Return total number of dropped packets. + /// + /// Method returns total number of dropped packets for specified + /// exchange type. + /// + /// \param xchg_type exchange type. + /// \throw isc::BadValue if invalid exchange type specified. + /// \return number of dropped packets. + uint64_t getDroppedPacketsNum(const ExchangeType xchg_type) const { + ExchangeStatsPtr xchg_stats = getExchangeStats(xchg_type); + return(xchg_stats->getDroppedPacketsNum()); + } + + /// \brief Get time period since the start of test. + /// + /// Calculate dna return period since the test start. This + /// can be specifically helpful when calculating packet + /// exchange rates. + /// + /// \return test period so far. + boost::posix_time::time_period getTestPeriod() const { + using namespace boost::posix_time; + time_period test_period(boot_time_, + microsec_clock::universal_time()); + return test_period; + } + /// \brief Return name of the exchange. /// /// Method returns name of the specified exchange type. @@ -1052,6 +1108,32 @@ public: } } + /// \brief Print intermediate statistics. + /// + /// Method prints intermediate statistics for all exchanges. + /// Statistics includes sent, received and dropped packets + /// counters. + void printIntermediateStats() const { + std::ostringstream stream_sent; + std::ostringstream stream_rcvd; + std::ostringstream stream_drops; + std::string sep(""); + for (ExchangesMapIterator it = exchanges_.begin(); + it != exchanges_.end(); ++it) { + + if (it != exchanges_.begin()) { + sep = "/"; + } + stream_sent << sep << it->second->getSentPacketsNum(); + stream_rcvd << sep << it->second->getRcvdPacketsNum(); + stream_drops << sep << it->second->getDroppedPacketsNum(); + } + std::cout << "sent: " << stream_sent.str() + << "; received: " << stream_rcvd.str() + << "; drops: " << stream_drops.str() + << std::endl; + } + /// \brief Print timestamps of all packets. /// /// Method prints timestamps of all sent and received @@ -1129,6 +1211,8 @@ private: /// for extended period of time and many packets have to be /// archived. bool archive_enabled_; + + boost::posix_time::ptime boot_time_; ///< Time when test is started. }; } // namespace perfdhcp diff --git a/tests/tools/perfdhcp/templates/Makefile.am b/tests/tools/perfdhcp/templates/Makefile.am new file mode 100644 index 0000000000..1eee19c937 --- /dev/null +++ b/tests/tools/perfdhcp/templates/Makefile.am @@ -0,0 +1,12 @@ +SUBDIRS = . + +# The test1.hex and test2.hex are created by the TestControl.PacketTemplates +# unit tests and have to be removed. +CLEANFILES = test1.hex test2.hex + +perfdhcpdir = $(pkgdatadir) +perfdhcp_DATA = discover-example.hex request4-example.hex +perfdhcp_DATA += solicit-example.hex request6-example.hex + +EXTRA_DIST = discover-example.hex request4-example.hex +EXTRA_DIST += solicit-example.hex request6-example.hex diff --git a/tests/tools/perfdhcp/templates/discover-example.hex b/tests/tools/perfdhcp/templates/discover-example.hex new file mode 100644 index 0000000000..9a6e5ea53d --- /dev/null +++ b/tests/tools/perfdhcp/templates/discover-example.hex @@ -0,0 +1 @@ +01010601008b45d200000000000000000000000000000000ac100102000c0102030400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000638253633501013707011c02030f060cff \ No newline at end of file diff --git a/tests/tools/perfdhcp/templates/request4-example.hex b/tests/tools/perfdhcp/templates/request4-example.hex new file mode 100644 index 0000000000..32447d6ba8 --- /dev/null +++ b/tests/tools/perfdhcp/templates/request4-example.hex @@ -0,0 +1 @@ +01010601007b23f800000000000000000000000000000000ac100102000c0102030400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000638253633204ac1001813501033604ac1001013707011c02030f060cff \ No newline at end of file diff --git a/tests/tools/perfdhcp/templates/request6-example.hex b/tests/tools/perfdhcp/templates/request6-example.hex new file mode 100644 index 0000000000..1e3e76f5e7 --- /dev/null +++ b/tests/tools/perfdhcp/templates/request6-example.hex @@ -0,0 +1 @@ +03da30c60001000e0001000117cf8e76000c010203060002000e0001000117cf8a5c080027a87b3400030028000000010000000a0000000e0005001820010db800010000000000000001b568000000be000000c8000800020000 \ No newline at end of file diff --git a/tests/tools/perfdhcp/templates/solicit-example.hex b/tests/tools/perfdhcp/templates/solicit-example.hex new file mode 100644 index 0000000000..41c5ad33a8 --- /dev/null +++ b/tests/tools/perfdhcp/templates/solicit-example.hex @@ -0,0 +1 @@ +015f4e650001000e0001000117cf8e76000c010203040003000c0000000100000e01000015180006000400170018000800020000 \ No newline at end of file diff --git a/tests/tools/perfdhcp/test_control.cc b/tests/tools/perfdhcp/test_control.cc new file mode 100644 index 0000000000..c154cf9ceb --- /dev/null +++ b/tests/tools/perfdhcp/test_control.cc @@ -0,0 +1,1682 @@ +// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC") +// +// Permission to use, copy, modify, and/or distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +// PERFORMANCE OF THIS SOFTWARE. + + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include "test_control.h" +#include "command_options.h" +#include "perf_pkt4.h" +#include "perf_pkt6.h" + +using namespace std; +using namespace boost::posix_time; +using namespace isc; +using namespace isc::dhcp; +using namespace isc::asiolink; + +namespace isc { +namespace perfdhcp { + +bool TestControl::interrupted_ = false; + +TestControl::TestControlSocket::TestControlSocket(const int socket) : + SocketInfo(socket, asiolink::IOAddress("127.0.0.1"), 0), + ifindex_(0), valid_(true) { + try { + initSocketData(); + } catch (const Exception&) { + valid_ = false; + } +} + +TestControl::TestControlSocket::~TestControlSocket() { + IfaceMgr::Iface* iface = IfaceMgr::instance().getIface(ifindex_); + if (iface) { + iface->delSocket(sockfd_); + } +} + +void +TestControl::TestControlSocket::initSocketData() { + const IfaceMgr::IfaceCollection& ifaces = + IfaceMgr::instance().getIfaces(); + for (IfaceMgr::IfaceCollection::const_iterator it = ifaces.begin(); + it != ifaces.end(); + ++it) { + const IfaceMgr::SocketCollection& socket_collection = + it->getSockets(); + for (IfaceMgr::SocketCollection::const_iterator s = + socket_collection.begin(); + s != socket_collection.end(); + ++s) { + if (s->sockfd_ == sockfd_) { + ifindex_ = it->getIndex(); + addr_ = s->addr_; + return; + } + } + } + isc_throw(BadValue, "interface for for specified socket " + "descriptor not found"); +} + +TestControl& +TestControl::instance() { + static TestControl test_control; + return (test_control); +} + +TestControl::TestControl() { + reset(); +} + +std::string +TestControl::byte2Hex(const uint8_t b) const { + const int b1 = b / 16; + const int b0 = b % 16; + ostringstream stream; + stream << std::hex << b1 << b0 << std::dec; + return (stream.str()); +} + +bool +TestControl::checkExitConditions() const { + if (interrupted_) { + return (true); + } + CommandOptions& options = CommandOptions::instance(); + bool test_period_reached = false; + // Check if test period passed. + if (options.getPeriod() != 0) { + if (options.getIpVersion() == 4) { + time_period period(stats_mgr4_->getTestPeriod()); + if (period.length().total_seconds() >= options.getPeriod()) { + test_period_reached = true; + } + } else if (options.getIpVersion() == 6) { + time_period period = stats_mgr6_->getTestPeriod(); + if (period.length().total_seconds() >= options.getPeriod()) { + test_period_reached = true; + } + } + } + if (test_period_reached) { + if (testDiags('e')) { + std::cout << "reached test-period." << std::endl; + } + return (true); + } + + bool max_requests = false; + // Check if we reached maximum number of DISCOVER/SOLICIT sent. + if (options.getNumRequests().size() > 0) { + if (options.getIpVersion() == 4) { + if (getSentPacketsNum(StatsMgr4::XCHG_DO) >= + options.getNumRequests()[0]) { + max_requests = true; + } + } else if (options.getIpVersion() == 6) { + if (stats_mgr6_->getSentPacketsNum(StatsMgr6::XCHG_SA) >= + options.getNumRequests()[0]) { + max_requests = true; + } + } + } + // Check if we reached maximum number REQUEST packets. + if (options.getNumRequests().size() > 1) { + if (options.getIpVersion() == 4) { + if (stats_mgr4_->getSentPacketsNum(StatsMgr4::XCHG_RA) >= + options.getNumRequests()[1]) { + max_requests = true; + } + } else if (options.getIpVersion() == 6) { + if (stats_mgr6_->getSentPacketsNum(StatsMgr6::XCHG_RR) >= + options.getNumRequests()[1]) { + max_requests = true; + } + } + } + if (max_requests) { + if (testDiags('e')) { + std::cout << "Reached max requests limit." << std::endl; + } + return (true); + } + + // Check if we reached maximum number of drops of OFFER/ADVERTISE packets. + bool max_drops = false; + if (options.getMaxDrop().size() > 0) { + if (options.getIpVersion() == 4) { + if (stats_mgr4_->getDroppedPacketsNum(StatsMgr4::XCHG_DO) >= + options.getMaxDrop()[0]) { + max_drops = true; + } + } else if (options.getIpVersion() == 6) { + if (stats_mgr6_->getDroppedPacketsNum(StatsMgr6::XCHG_SA) >= + options.getMaxDrop()[0]) { + max_drops = true; + } + } + } + // Check if we reached maximum number of drops of ACK/REPLY packets. + if (options.getMaxDrop().size() > 1) { + if (options.getIpVersion() == 4) { + if (stats_mgr4_->getDroppedPacketsNum(StatsMgr4::XCHG_RA) >= + options.getMaxDrop()[1]) { + max_drops = true; + } + } else if (options.getIpVersion() == 6) { + if (stats_mgr6_->getDroppedPacketsNum(StatsMgr6::XCHG_RR) >= + options.getMaxDrop()[1]) { + max_drops = true; + } + } + } + if (max_drops) { + if (testDiags('e')) { + std::cout << "Reached maximum drops number." << std::endl; + } + return (true); + } + + // Check if we reached maximum drops percentage of OFFER/ADVERTISE packets. + bool max_pdrops = false; + if (options.getMaxDropPercentage().size() > 0) { + if (options.getIpVersion() == 4) { + if ((stats_mgr4_->getSentPacketsNum(StatsMgr4::XCHG_DO) > 10) && + ((100. * stats_mgr4_->getDroppedPacketsNum(StatsMgr4::XCHG_DO) / + stats_mgr4_->getSentPacketsNum(StatsMgr4::XCHG_DO)) >= + options.getMaxDropPercentage()[0])) { + max_pdrops = true; + + } + } else if (options.getIpVersion() == 6) { + if ((stats_mgr6_->getSentPacketsNum(StatsMgr6::XCHG_SA) > 10) && + ((100. * stats_mgr6_->getDroppedPacketsNum(StatsMgr6::XCHG_SA) / + stats_mgr6_->getSentPacketsNum(StatsMgr6::XCHG_SA)) >= + options.getMaxDropPercentage()[0])) { + max_pdrops = true; + } + } + } + // Check if we reached maximum drops percentage of ACK/REPLY packets. + if (options.getMaxDropPercentage().size() > 1) { + if (options.getIpVersion() == 4) { + if ((stats_mgr4_->getSentPacketsNum(StatsMgr4::XCHG_RA) > 10) && + ((100. * stats_mgr4_->getDroppedPacketsNum(StatsMgr4::XCHG_RA) / + stats_mgr4_->getSentPacketsNum(StatsMgr4::XCHG_RA)) >= + options.getMaxDropPercentage()[1])) { + max_pdrops = true; + } + } else if (options.getIpVersion() == 6) { + if ((stats_mgr6_->getSentPacketsNum(StatsMgr6::XCHG_RR) > 10) && + ((100. * stats_mgr6_->getDroppedPacketsNum(StatsMgr6::XCHG_RR) / + stats_mgr6_->getSentPacketsNum(StatsMgr6::XCHG_RR)) >= + options.getMaxDropPercentage()[1])) { + max_pdrops = true; + } + } + } + if (max_pdrops) { + if (testDiags('e')) { + std::cout << "Reached maximum percentage of drops." << std::endl; + } + return (true); + } + return (false); +} + +OptionPtr +TestControl::factoryElapsedTime6(Option::Universe, uint16_t, + const OptionBuffer& buf) { + if (buf.size() == 2) { + return (OptionPtr(new Option(Option::V6, D6O_ELAPSED_TIME, buf))); + } else if (buf.size() == 0) { + return (OptionPtr(new Option(Option::V6, D6O_ELAPSED_TIME, + OptionBuffer(2, 0)))); + } + isc_throw(isc::BadValue, + "elapsed time option buffer size has to be 0 or 2"); +} + +OptionPtr +TestControl::factoryGeneric(Option::Universe u, uint16_t type, + const OptionBuffer& buf) { + OptionPtr opt(new Option(u, type, buf)); + return (opt); +} + +OptionPtr +TestControl::factoryIana6(Option::Universe, uint16_t, + const OptionBuffer& buf) { + // @todo allow different values of T1, T2 and IAID. + const uint8_t buf_array[] = { + 0, 0, 0, 1, // IAID = 1 + 0, 0, 3600 >> 8, 3600 & 0xff, // T1 = 3600 + 0, 0, 5400 >> 8, 5400 & 0xff, // T2 = 5400 + }; + OptionBuffer buf_ia_na(buf_array, buf_array + sizeof(buf_array)); + for (int i = 0; i < buf.size(); ++i) { + buf_ia_na.push_back(buf[i]); + } + return (OptionPtr(new Option(Option::V6, D6O_IA_NA, buf_ia_na))); +} + +OptionPtr +TestControl::factoryRapidCommit6(Option::Universe, uint16_t, + const OptionBuffer&) { + return (OptionPtr(new Option(Option::V6, D6O_RAPID_COMMIT, OptionBuffer()))); +} + +OptionPtr +TestControl::factoryOptionRequestOption6(Option::Universe, + uint16_t, + const OptionBuffer&) { + const uint8_t buf_array[] = { + 0, D6O_NAME_SERVERS, + 0, D6O_DOMAIN_SEARCH, + }; + OptionBuffer buf_with_options(buf_array, buf_array + sizeof(buf_array)); + return (OptionPtr(new Option(Option::V6, D6O_ORO, buf_with_options))); +} + + +OptionPtr +TestControl::factoryRequestList4(Option::Universe u, + uint16_t type, + const OptionBuffer& buf) { + const uint8_t buf_array[] = { + DHO_SUBNET_MASK, + DHO_BROADCAST_ADDRESS, + DHO_TIME_OFFSET, + DHO_ROUTERS, + DHO_DOMAIN_NAME, + DHO_DOMAIN_NAME_SERVERS, + DHO_HOST_NAME + }; + + OptionBuffer buf_with_options(buf_array, buf_array + sizeof(buf_array)); + OptionPtr opt(new Option(u, type, buf)); + opt->setData(buf_with_options.begin(), buf_with_options.end()); + return (opt); +} + +std::vector +TestControl::generateMacAddress(uint8_t& randomized) const { + CommandOptions& options = CommandOptions::instance(); + uint32_t clients_num = options.getClientsNum(); + if (clients_num < 2) { + return (options.getMacTemplate()); + } + // Get the base MAC address. We are going to randomize part of it. + std::vector mac_addr(options.getMacTemplate()); + if (mac_addr.size() != HW_ETHER_LEN) { + isc_throw(BadValue, "invalid MAC address template specified"); + } + uint32_t r = macaddr_gen_->generate(); + randomized = 0; + // Randomize MAC address octets. + for (std::vector::iterator it = mac_addr.end() - 1; + it >= mac_addr.begin(); + --it) { + // Add the random value to the current octet. + (*it) += r; + ++randomized; + if (r < 256) { + // If we are here it means that there is no sense + // to randomize the remaining octets of MAC address + // because the following bytes of random value + // are zero and it will have no effect. + break; + } + // Randomize the next octet with the following + // byte of random value. + r >>= 8; + } + return (mac_addr); +} + +std::vector +TestControl::generateDuid(uint8_t& randomized) const { + CommandOptions& options = CommandOptions::instance(); + uint32_t clients_num = options.getClientsNum(); + if ((clients_num == 0) || (clients_num == 1)) { + return (options.getDuidTemplate()); + } + // Get the base DUID. We are going to randomize part of it. + std::vector duid(options.getDuidTemplate()); + // @todo: add support for DUIDs of different sizes. + std::vector mac_addr(generateMacAddress(randomized)); + duid.resize(duid.size()); + std::copy(mac_addr.begin(), mac_addr.end(), + duid.begin() + duid.size() - mac_addr.size()); + return (duid); +} + +template +uint32_t +TestControl::getElapsedTime(const T& pkt1, const T& pkt2) { + using namespace boost::posix_time; + ptime pkt1_time = pkt1->getTimestamp(); + ptime pkt2_time = pkt2->getTimestamp(); + if (pkt1_time.is_not_a_date_time() || + pkt2_time.is_not_a_date_time()) { + isc_throw(InvalidOperation, "packet timestamp not set");; + } + time_period elapsed_period(pkt1_time, pkt2_time); + if (elapsed_period.is_null()) { + isc_throw(InvalidOperation, "unable to calculate time elapsed" + " between packets"); + } + return(elapsed_period.length().total_milliseconds()); +} + + +uint64_t +TestControl::getNextExchangesNum() const { + CommandOptions& options = CommandOptions::instance(); + // Reset number of exchanges. + uint64_t due_exchanges = 0; + // Get current time. + ptime now(microsec_clock::universal_time()); + if (now >= send_due_) { + // If rate is specified from the command line we have to + // synchornize with it. + if (options.getRate() != 0) { + time_period period(send_due_, now); + time_duration duration = period.length(); + // due_factor indicates the number of seconds that + // sending next chunk of packets will take. + double due_factor = duration.fractional_seconds() / + time_duration::ticks_per_second(); + due_factor += duration.total_seconds(); + // Multiplying due_factor by expected rate gives the number + // of exchanges to be initiated. + due_exchanges = static_cast(due_factor * options.getRate()); + // We want to make sure that at least one packet goes out. + if (due_exchanges == 0) { + due_exchanges = 1; + } + // We should not exceed aggressivity as it could have been + // restricted from command line. + if (due_exchanges > options.getAggressivity()) { + due_exchanges = options.getAggressivity(); + } + } else { + // Rate is not specified so we rely on aggressivity + // which is the number of packets to be sent in + // one chunk. + due_exchanges = options.getAggressivity(); + } + return (due_exchanges); + } + return (0); +} + +uint64_t +TestControl::getRcvdPacketsNum(const ExchangeType xchg_type) const { + uint8_t ip_version = CommandOptions::instance().getIpVersion(); + if (ip_version == 4) { + return (stats_mgr4_->getRcvdPacketsNum(xchg_type)); + } + return (stats_mgr6_-> + getRcvdPacketsNum(static_cast(xchg_type))); +} + +uint64_t +TestControl::getSentPacketsNum(const ExchangeType xchg_type) const { + uint8_t ip_version = CommandOptions::instance().getIpVersion(); + if (ip_version == 4) { + return (stats_mgr4_->getSentPacketsNum(xchg_type)); + } + return (stats_mgr6_-> + getSentPacketsNum(static_cast(xchg_type))); +} + +TestControl::TemplateBuffer +TestControl::getTemplateBuffer(const size_t idx) const { + if (template_buffers_.size() > idx) { + return (template_buffers_[idx]); + } + isc_throw(OutOfRange, "invalid buffer index"); +} + +void +TestControl::handleInterrupt(int) { + interrupted_ = true; +} + +void +TestControl::initPacketTemplates() { + template_buffers_.clear(); + CommandOptions& options = CommandOptions::instance(); + std::vector template_files = options.getTemplateFiles(); + for (std::vector::const_iterator it = template_files.begin(); + it != template_files.end(); ++it) { + readPacketTemplate(*it); + } +} + +void +TestControl::initializeStatsMgr() { + CommandOptions& options = CommandOptions::instance(); + if (options.getIpVersion() == 4) { + stats_mgr4_.reset(); + stats_mgr4_ = StatsMgr4Ptr(new StatsMgr4()); + stats_mgr4_->addExchangeStats(StatsMgr4::XCHG_DO); + if (options.getExchangeMode() == CommandOptions::DORA_SARR) { + stats_mgr4_->addExchangeStats(StatsMgr4::XCHG_RA); + } + + } else if (options.getIpVersion() == 6) { + stats_mgr6_.reset(); + stats_mgr6_ = StatsMgr6Ptr(new StatsMgr6()); + stats_mgr6_->addExchangeStats(StatsMgr6::XCHG_SA); + if (options.getExchangeMode() == CommandOptions::DORA_SARR) { + stats_mgr6_->addExchangeStats(StatsMgr6::XCHG_RR); + } + } + if (testDiags('i')) { + if (options.getIpVersion() == 4) { + stats_mgr4_->addCustomCounter("latesend", "Late sent packets"); + stats_mgr4_->addCustomCounter("shortwait", "Short waits for packets"); + stats_mgr4_->addCustomCounter("multircvd", "Multiple packets receives"); + // stats_mgr4_->addCustomCounter("latercvd", "Late received packets"); + } else if (options.getIpVersion() == 6) { + stats_mgr6_->addCustomCounter("latesend", "Late sent packets"); + stats_mgr6_->addCustomCounter("shortwait", "Short waits for packets"); + stats_mgr6_->addCustomCounter("multircvd", "Multiple packets receives"); + // stats_mgr6_->addCustomCounter("latercvd", "Late received packets"); + } + } +} + +int +TestControl::openSocket() const { + CommandOptions& options = CommandOptions::instance(); + std::string localname = options.getLocalName(); + std::string servername = options.getServerName(); + uint16_t port = options.getLocalPort(); + uint8_t family = AF_INET; + int sock = 0; + IOAddress remoteaddr(servername); + if (port == 0) { + if (options.getIpVersion() == 6) { + port = DHCP6_CLIENT_PORT; + } else if (options.getIpVersion() == 4) { + port = 67; // TODO: find out why port 68 is wrong here. + } + } + if (options.getIpVersion() == 6) { + family = AF_INET6; + } + // Local name is specified along with '-l' option. + // It may point to interface name or local address. + if (!localname.empty()) { + // CommandOptions should be already aware wether local name + // is interface name or address because it uses IfaceMgr to + // scan interfaces and get's their names. + if (options.isInterface()) { + sock = IfaceMgr::instance().openSocketFromIface(localname, + port, + family); + } else { + IOAddress localaddr(localname); + sock = IfaceMgr::instance().openSocketFromAddress(localaddr, + port); + } + } else if (!servername.empty()) { + // If only server name is given we will need to try to resolve + // the local address to bind socket to based on remote address. + sock = IfaceMgr::instance().openSocketFromRemoteAddress(remoteaddr, + port); + } + if (sock <= 0) { + isc_throw(BadValue, "unable to open socket to communicate with " + "DHCP server"); + } + + // IfaceMgr does not set broadcast option on the socket. We rely + // on CommandOptions object to find out if socket has to have + // broadcast enabled. + if ((options.getIpVersion() == 4) && options.isBroadcast()) { + int broadcast_enable = 1; + int ret = setsockopt(sock, SOL_SOCKET, SO_BROADCAST, + &broadcast_enable, sizeof(broadcast_enable)); + if (ret < 0) { + isc_throw(InvalidOperation, + "unable to set broadcast option on the socket"); + } + } else if (options.getIpVersion() == 6) { + // If remote address is multicast we need to enable it on + // the socket that has been created. + asio::ip::address_v6 remote_v6 = remoteaddr.getAddress().to_v6(); + if (remote_v6.is_multicast()) { + int hops = 1; + int ret = setsockopt(sock, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, + &hops, sizeof(hops)); + // If user specified interface name with '-l' the + // IPV6_MULTICAST_IF has to be set. + if ((ret >= 0) && options.isInterface()) { + IfaceMgr::Iface* iface = + IfaceMgr::instance().getIface(options.getLocalName()); + if (iface == NULL) { + isc_throw(Unexpected, "unknown interface " + << options.getLocalName()); + } + int idx = iface->getIndex(); + ret = setsockopt(sock, IPPROTO_IPV6, IPV6_MULTICAST_IF, + &idx, sizeof(idx)); + } + if (ret < 0) { + isc_throw(InvalidOperation, + "unable to enable multicast on socket " << sock + << ". errno = " << errno); + } + } + } + + return (sock); +} + +void +TestControl::printDiagnostics() const { + CommandOptions& options = CommandOptions::instance(); + if (testDiags('a')) { + // Print all command line parameters. + options.printCommandLine(); + // Print MAC and DUID. + std::cout << "Set MAC to " << vector2Hex(options.getMacTemplate(), "::") + << std::endl; + if (options.getDuidTemplate().size() > 0) { + std::cout << "Set DUID to " << vector2Hex(options.getDuidTemplate()) << std::endl; + } + } +} + +void +TestControl::printRate() const { + double rate = 0; + CommandOptions& options = CommandOptions::instance(); + if (options.getIpVersion() == 4) { + double duration = + stats_mgr4_->getTestPeriod().length().total_nanoseconds() / 1e9; + rate = stats_mgr4_->getRcvdPacketsNum(StatsMgr4::XCHG_DO) / duration; + } else if (options.getIpVersion() == 6) { + double duration = + stats_mgr6_->getTestPeriod().length().total_nanoseconds() / 1e9; + rate = stats_mgr6_->getRcvdPacketsNum(StatsMgr6::XCHG_SA) / duration; + } + std::cout << "***Rate statistics***" << std::endl; + if (options.getRate() > 0) { + std::cout << "Rate: " << rate << ", expected rate: " + << options.getRate() << std::endl << std::endl; + } else { + std::cout << "Rate: " << rate << std::endl << std::endl; + } +} + +void +TestControl::printIntermediateStats() { + CommandOptions& options = CommandOptions::instance(); + int delay = options.getReportDelay(); + ptime now = microsec_clock::universal_time(); + time_period time_since_report(last_report_, now); + if (time_since_report.length().total_seconds() >= delay) { + if (options.getIpVersion() == 4) { + stats_mgr4_->printIntermediateStats(); + } else if (options.getIpVersion() == 6) { + stats_mgr6_->printIntermediateStats(); + } + last_report_ = now; + } +} + +void +TestControl::printStats() const { + printRate(); + CommandOptions& options = CommandOptions::instance(); + if (options.getIpVersion() == 4) { + if (!stats_mgr4_) { + isc_throw(InvalidOperation, "Statistics Manager for DHCPv4 " + "hasn't been initialized"); + } + stats_mgr4_->printStats(); + if (testDiags('i')) { + stats_mgr4_->printCustomCounters(); + } + } else if (options.getIpVersion() == 6) { + if (!stats_mgr6_) { + isc_throw(InvalidOperation, "Statistics Manager for DHCPv6 " + "hasn't been initialized"); + } + stats_mgr6_->printStats(); + if (testDiags('i')) { + stats_mgr6_->printCustomCounters(); + } + } +} + +std::string +TestControl::vector2Hex(const std::vector& vec, + const std::string& separator /* ="" */) const { + std::ostringstream stream; + for (std::vector::const_iterator it = vec.begin(); + it != vec.end(); + ++it) { + if (it == vec.begin()) { + stream << byte2Hex(*it); + } else { + stream << separator << byte2Hex(*it); + } + } + return (stream.str()); +} + +void +TestControl::readPacketTemplate(const std::string& file_name) { + std::ifstream temp_file; + temp_file.open(file_name.c_str(), ios::in | ios::binary | ios::ate); + if (!temp_file.is_open()) { + isc_throw(BadValue, "unable to open template file " << file_name); + } + std::ifstream::pos_type temp_size = temp_file.tellg(); + if (temp_size % 2 != 0) { + temp_file.close(); + isc_throw(BadValue, "odd number of digits in template file"); + } + temp_file.seekg(0, ios::beg); + std::vector hex_digits(temp_size); + std::vector binary_stream; + temp_file.read(&hex_digits[0], temp_size); + temp_file.close(); + for (int i = 0; i < hex_digits.size(); i += 2) { + if (!isxdigit(hex_digits[i]) || !isxdigit(hex_digits[i+1])) { + isc_throw(BadValue, "the '" << hex_digits[i] << hex_digits[i+1] + << "' is not hexadecimal digit"); + } + stringstream s; + s << "0x" << hex_digits[i] << hex_digits[i+1]; + int b; + s >> std::hex >> b; + binary_stream.push_back(static_cast(b)); + } + template_buffers_.push_back(binary_stream); +} + +void +TestControl::processReceivedPacket4(const TestControlSocket& socket, + const Pkt4Ptr& pkt4) { + if (pkt4->getType() == DHCPOFFER) { + Pkt4Ptr discover_pkt4(stats_mgr4_->passRcvdPacket(StatsMgr4::XCHG_DO, + pkt4)); + CommandOptions::ExchangeMode xchg_mode = + CommandOptions::instance().getExchangeMode(); + if ((xchg_mode == CommandOptions::DORA_SARR) && discover_pkt4) { + if (template_buffers_.size() < 2) { + sendRequest4(socket, discover_pkt4, pkt4); + } else { + // @todo add defines for packet type index that can be + // used to access template_buffers_. + sendRequest4(socket, template_buffers_[1], discover_pkt4, pkt4); + } + } + } else if (pkt4->getType() == DHCPACK) { + stats_mgr4_->passRcvdPacket(StatsMgr4::XCHG_RA, pkt4); + } +} + +void +TestControl::processReceivedPacket6(const TestControlSocket& socket, + const Pkt6Ptr& pkt6) { + uint8_t packet_type = pkt6->getType(); + if (packet_type == DHCPV6_ADVERTISE) { + Pkt6Ptr solicit_pkt6(stats_mgr6_->passRcvdPacket(StatsMgr6::XCHG_SA, + pkt6)); + CommandOptions::ExchangeMode xchg_mode = + CommandOptions::instance().getExchangeMode(); + if ((xchg_mode == CommandOptions::DORA_SARR) && solicit_pkt6) { + // \todo check whether received ADVERTISE packet is sane. + // We might want to check if STATUS_CODE option is non-zero + // and if there is IAADR option in IA_NA. + if (template_buffers_.size() < 2) { + sendRequest6(socket, pkt6); + } else { + // @todo add defines for packet type index that can be + // used to access template_buffers_. + sendRequest6(socket, template_buffers_[1], pkt6); + } + } + } else if (packet_type == DHCPV6_REPLY) { + stats_mgr6_->passRcvdPacket(StatsMgr6::XCHG_RR, pkt6); + } +} + +void +TestControl::receivePackets(const TestControlSocket& socket) { + int timeout = 0; + bool receiving = true; + uint64_t received = 0; + while (receiving) { + if (CommandOptions::instance().getIpVersion() == 4) { + Pkt4Ptr pkt4 = IfaceMgr::instance().receive4(timeout); + if (!pkt4) { + receiving = false; + } else { + ++received; + if ((received > 1) && testDiags('i')) { + stats_mgr4_->incrementCounter("multircvd"); + } + pkt4->unpack(); + processReceivedPacket4(socket, pkt4); + } + } else if (CommandOptions::instance().getIpVersion() == 6) { + Pkt6Ptr pkt6 = IfaceMgr::instance().receive6(timeout); + if (!pkt6) { + receiving = false; + } else { + ++received; + if ((received > 1) && testDiags('i')) { + stats_mgr6_->incrementCounter("multircvd"); + } + if (pkt6->unpack()) { + processReceivedPacket6(socket, pkt6); + } + } + } + } +} + +void +TestControl::registerOptionFactories4() const { + static bool factories_registered = false; + if (!factories_registered) { + // DHCP_MESSAGE_TYPE option factory. + LibDHCP::OptionFactoryRegister(Option::V4, + DHO_DHCP_MESSAGE_TYPE, + &TestControl::factoryGeneric); + // DHCP_SERVER_IDENTIFIER option factory. + LibDHCP::OptionFactoryRegister(Option::V4, + DHO_DHCP_SERVER_IDENTIFIER, + &TestControl::factoryGeneric); + // DHCP_PARAMETER_REQUEST_LIST option factory. + LibDHCP::OptionFactoryRegister(Option::V4, + DHO_DHCP_PARAMETER_REQUEST_LIST, + &TestControl::factoryRequestList4); + } + factories_registered = true; +} + +void +TestControl::registerOptionFactories6() const { + static bool factories_registered = false; + if (!factories_registered) { + // D60_ELAPSED_TIME + LibDHCP::OptionFactoryRegister(Option::V6, + D6O_ELAPSED_TIME, + &TestControl::factoryElapsedTime6); + // D6O_RAPID_COMMIT + LibDHCP::OptionFactoryRegister(Option::V6, + D6O_RAPID_COMMIT, + &TestControl::factoryRapidCommit6); + // D6O_ORO (option request option) factory. + LibDHCP::OptionFactoryRegister(Option::V6, + D6O_ORO, + &TestControl::factoryOptionRequestOption6); + // D6O_CLIENTID option factory. + LibDHCP::OptionFactoryRegister(Option::V6, + D6O_CLIENTID, + &TestControl::factoryGeneric); + // D6O_SERVERID option factory. + LibDHCP::OptionFactoryRegister(Option::V6, + D6O_SERVERID, + &TestControl::factoryGeneric); + // D6O_IA_NA option factory. + LibDHCP::OptionFactoryRegister(Option::V6, + D6O_IA_NA, + &TestControl::factoryIana6); + + + } + factories_registered = true; +} + +void +TestControl::registerOptionFactories() const { + CommandOptions& options = CommandOptions::instance(); + switch(options.getIpVersion()) { + case 4: + registerOptionFactories4(); + break; + case 6: + registerOptionFactories6(); + break; + default: + isc_throw(InvalidOperation, "command line options have to be parsed " + "before DHCP option factories can be registered"); + } +} + +void +TestControl::reset() { + send_due_ = microsec_clock::universal_time(); + last_sent_ = send_due_; + last_report_ = send_due_; + transid_gen_.reset(); + // Actual generators will have to be set later on because we need to + // get command line parameters first. + setTransidGenerator(NumberGeneratorPtr()); + setMacAddrGenerator(NumberGeneratorPtr()); + first_packet_serverid_.clear(); + interrupted_ = false; +} + +void +TestControl::run() { + // Reset singleton state before test starts. + reset(); + + CommandOptions& options = CommandOptions::instance(); + // Ip version is not set ONLY in case the command options + // were not parsed. This surely means that parse() function + // was not called prior to starting the test. This is fatal + // error. + if (options.getIpVersion() == 0) { + isc_throw(InvalidOperation, + "command options must be parsed before running a test"); + } else if (options.getIpVersion() == 4) { + setTransidGenerator(NumberGeneratorPtr(new SequencialGenerator())); + } else { + setTransidGenerator(NumberGeneratorPtr(new SequencialGenerator(0x00FFFFFF))); + } + + uint32_t clients_num = options.getClientsNum() == 0 ? + 1 : options.getClientsNum(); + setMacAddrGenerator(NumberGeneratorPtr(new SequencialGenerator(clients_num))); + + // Diagnostics are command line options mainly. + printDiagnostics(); + // Option factories have to be registered. + registerOptionFactories(); + TestControlSocket socket(openSocket()); + if (!socket.valid_) { + isc_throw(Unexpected, "invalid socket descriptor"); + } + // Initialize packet templates. + initPacketTemplates(); + // Initialize randomization seed. + if (options.isSeeded()) { + srandom(options.getSeed()); + } else { + // Seed with current time. + time_period duration(from_iso_string("20111231T235959"), + microsec_clock::universal_time()); + srandom(duration.length().total_seconds() + + duration.length().fractional_seconds()); + } + // If user interrupts the program we will exit gracefully. + signal(SIGINT, TestControl::handleInterrupt); + // Preload server with number of packets. + const bool do_preload = true; + for (int i = 0; i < options.getPreload(); ++i) { + if (options.getIpVersion() == 4) { + // No template buffer means no -T option specified. + // We will build packet ourselves. + if (template_buffers_.size() == 0) { + sendDiscover4(socket, do_preload); + } else { + // Pick template #0 if Discover is being sent. + // For Request it would be #1. + // @todo add defines for packet type index that can be + // used to access template_buffers_. + sendDiscover4(socket, template_buffers_[0], + do_preload); + } + } else if (options.getIpVersion() == 6) { + // No template buffer means no -T option specified. + // We will build packet ourselfs. + if (template_buffers_.size() == 0) { + sendSolicit6(socket, do_preload); + } else { + // Pick template #0 if Solicit is being sent. + // For Request it would be #1. + // @todo add defines for packet type index that can be + // used to access template_buffers_. + sendSolicit6(socket, template_buffers_[0], + do_preload); + } + } + } + // Initialize Statistics Manager. Release previous if any. + initializeStatsMgr(); + for (;;) { + // Calculate send due based on when last exchange was initiated. + updateSendDue(); + // If test period finished, maximum number of packet drops + // has been reached or test has been interrupted we have to + // finish the test. + if (checkExitConditions()) { + break; + } + // Calculate number of packets to be sent to stay + // catch up with rate. + uint64_t packets_due = getNextExchangesNum(); + if ((packets_due == 0) && testDiags('i')) { + if (options.getIpVersion() == 4) { + stats_mgr4_->incrementCounter("shortwait"); + } else if (options.getIpVersion() == 6) { + stats_mgr6_->incrementCounter("shortwait"); + } + } + + // @todo: set non-zero timeout for packets once we implement + // microseconds timeout in IfaceMgr. + receivePackets(socket); + // Send packets. + for (uint64_t i = packets_due; i > 0; --i) { + if (options.getIpVersion() == 4) { + // No template packets means that no -T option was specified. + // We have to build packets ourselfs. + if (template_buffers_.size() == 0) { + sendDiscover4(socket); + } else { + // @todo add defines for packet type index that can be + // used to access template_buffers_. + sendDiscover4(socket, template_buffers_[0]); + } + } else { + // No template packets means that no -T option was specified. + // We have to build packets ourselfs. + if (template_buffers_.size() == 0) { + sendSolicit6(socket); + } else { + // @todo add defines for packet type index that can be + // used to access template_buffers_. + sendSolicit6(socket, template_buffers_[0]); + } + } + } + // Report delay means that user requested printing number + // of sent/received/dropped packets repeatedly. + if (options.getReportDelay() > 0) { + printIntermediateStats(); + } + } + printStats(); + // Print server id. + if (testDiags('s') && (first_packet_serverid_.size() > 0)) { + std::cout << "Server id: " << vector2Hex(first_packet_serverid_) << std::endl; + } + // Diagnostics flag 'e' means show exit reason. + if (testDiags('e')) { + std::cout << "Interrupted" << std::endl; + } +} + +void +TestControl::sendDiscover4(const TestControlSocket& socket, + const bool preload /*= false*/) { + last_sent_ = microsec_clock::universal_time(); + // Generate the MAC address to be passed in the packet. + uint8_t randomized = 0; + std::vector mac_address = generateMacAddress(randomized); + // Generate trasnaction id to be set for the new exchange. + const uint32_t transid = generateTransid(); + Pkt4Ptr pkt4(new Pkt4(DHCPDISCOVER, transid)); + if (!pkt4) { + isc_throw(Unexpected, "failed to create DISCOVER packet"); + } + // Set options: DHCP_MESSAGE_TYPE and DHCP_PARAMETER_REQUEST_LIST + OptionBuffer buf_msg_type; + buf_msg_type.push_back(DHCPDISCOVER); + pkt4->addOption(Option::factory(Option::V4, DHO_DHCP_MESSAGE_TYPE, + buf_msg_type)); + pkt4->addOption(Option::factory(Option::V4, + DHO_DHCP_PARAMETER_REQUEST_LIST)); + + // Set client's and server's ports as well as server's address, + // and local (relay) address. + setDefaults4(socket, pkt4); + + // Set hardware address + pkt4->setHWAddr(HTYPE_ETHER, mac_address.size(), mac_address); + + pkt4->pack(); + IfaceMgr::instance().send(pkt4); + if (!preload) { + if (!stats_mgr4_) { + isc_throw(InvalidOperation, "Statistics Manager for DHCPv4 " + "hasn't been initialized"); + } + stats_mgr4_->passSentPacket(StatsMgr4::XCHG_DO, pkt4); + } +} + +void +TestControl::sendDiscover4(const TestControlSocket& socket, + const std::vector& template_buf, + const bool preload /* = false */) { + // last_sent_ has to be updated for each function that initiates + // new transaction. The packet exchange synchronization relies on this. + last_sent_ = microsec_clock::universal_time(); + CommandOptions& options = CommandOptions::instance(); + // Get the first argument if mulitple the same arguments specified + // in the command line. First one refers to DISCOVER packets. + const uint8_t arg_idx = 0; + // Generate the MAC address to be passed in the packet. + uint8_t randomized = 0; + std::vector mac_address = generateMacAddress(randomized); + // Generate trasnaction id to be set for the new exchange. + const uint32_t transid = generateTransid(); + // Get transaction id offset. + size_t transid_offset = DHCPV4_TRANSID_OFFSET; + if (options.getTransactionIdOffset().size() > arg_idx) { + transid_offset = options.getTransactionIdOffset()[arg_idx]; + } + // Calculate randomization offset. + size_t rand_offset = DHCPV4_RANDOMIZATION_OFFSET; + if (options.getRandomOffset().size() > arg_idx) { + rand_offset = options.getRandomOffset()[arg_idx]; + } + // We need to go back by HW_ETHER_LEN (MAC address length) + // because this offset points to last octet of MAC address. + rand_offset -= HW_ETHER_LEN + 1; + // Create temporary buffer with template contents. We will + // modify this temporary buffer but we don't want to modify + // the original template. + std::vector in_buf(template_buf.begin(), + template_buf.end()); + // Check if we are not going out of bounds. + if (rand_offset + HW_ETHER_LEN > in_buf.size()) { + isc_throw(OutOfRange, "randomization offset is out of bounds"); + } + PerfPkt4Ptr pkt4(new PerfPkt4(&in_buf[0], in_buf.size(), + transid_offset, + transid)); + + // Replace MAC address in the template with actual MAC address. + pkt4->writeAt(rand_offset, mac_address.begin(), mac_address.end()); + // Create a packet from the temporary buffer. + setDefaults4(socket, boost::static_pointer_cast(pkt4)); + // Pack the input packet buffer to output buffer so as it can + // be sent to server. + pkt4->rawPack(); + IfaceMgr::instance().send(boost::static_pointer_cast(pkt4)); + if (!preload) { + if (!stats_mgr4_) { + isc_throw(InvalidOperation, "Statistics Manager for DHCPv4 " + "hasn't been initialized"); + } + // Update packet stats. + stats_mgr4_->passSentPacket(StatsMgr4::XCHG_DO, + boost::static_pointer_cast(pkt4)); + } +} + +void +TestControl::sendRequest4(const TestControlSocket& socket, + const dhcp::Pkt4Ptr& discover_pkt4, + const dhcp::Pkt4Ptr& offer_pkt4) { + const uint32_t transid = generateTransid(); + Pkt4Ptr pkt4(new Pkt4(DHCPREQUEST, transid)); + OptionBuffer buf_msg_type; + buf_msg_type.push_back(DHCPREQUEST); + OptionPtr opt_msg_type = Option::factory(Option::V4, DHO_DHCP_MESSAGE_TYPE, + buf_msg_type); + pkt4->addOption(opt_msg_type); + if (CommandOptions::instance().isUseFirst() && + (first_packet_serverid_.size() > 0)) { + pkt4->addOption(Option::factory(Option::V4, DHO_DHCP_SERVER_IDENTIFIER, + first_packet_serverid_)); + } else { + OptionPtr opt_serverid = + offer_pkt4->getOption(DHO_DHCP_SERVER_IDENTIFIER); + if (!opt_serverid) { + isc_throw(BadValue, "there is no SERVER_IDENTIFIER option " + << "in OFFER message"); + } + if (stats_mgr4_->getRcvdPacketsNum(StatsMgr4::XCHG_DO) == 1) { + first_packet_serverid_ = opt_serverid->getData(); + } + pkt4->addOption(opt_serverid); + } + + /// Set client address. + asiolink::IOAddress yiaddr = offer_pkt4->getYiaddr(); + if (!yiaddr.getAddress().is_v4()) { + isc_throw(BadValue, "the YIADDR returned in OFFER packet is not " + " IPv4 address"); + } + OptionPtr opt_requested_address = + OptionPtr(new Option(Option::V4, DHO_DHCP_REQUESTED_ADDRESS, + OptionBuffer())); + opt_requested_address->setUint32(static_cast(yiaddr)); + pkt4->addOption(opt_requested_address); + OptionPtr opt_parameter_list = + Option::factory(Option::V4, DHO_DHCP_PARAMETER_REQUEST_LIST); + pkt4->addOption(opt_parameter_list); + // Set client's and server's ports as well as server's address, + // and local (relay) address. + setDefaults4(socket, pkt4); + + // Set hardware address + const uint8_t* chaddr = offer_pkt4->getChaddr(); + std::vector mac_address(chaddr, chaddr + HW_ETHER_LEN); + pkt4->setHWAddr(HTYPE_ETHER, mac_address.size(), mac_address); + // Set elapsed time. + uint32_t elapsed_time = getElapsedTime(discover_pkt4, offer_pkt4); + pkt4->setSecs(static_cast(elapsed_time / 1000)); + // Prepare on wire data to send. + pkt4->pack(); + IfaceMgr::instance().send(pkt4); + if (!stats_mgr4_) { + isc_throw(InvalidOperation, "Statistics Manager for DHCPv4 " + "hasn't been initialized"); + } + stats_mgr4_->passSentPacket(StatsMgr4::XCHG_RA, pkt4); +} + +void +TestControl::sendRequest4(const TestControlSocket& socket, + const std::vector& template_buf, + const dhcp::Pkt4Ptr& discover_pkt4, + const dhcp::Pkt4Ptr& offer_pkt4) { + CommandOptions& options = CommandOptions::instance(); + // Get the second argument if multiple the same arguments specified + // in the command line. Second one refers to REQUEST packets. + const uint8_t arg_idx = 1; + // Generate new transaction id. + const uint32_t transid = generateTransid(); + // Get transaction id offset. + size_t transid_offset = DHCPV4_TRANSID_OFFSET; + if (options.getTransactionIdOffset().size() > arg_idx) { + transid_offset = options.getTransactionIdOffset()[arg_idx]; + } + // Get the offset of MAC's last octet. + size_t rand_offset = DHCPV4_RANDOMIZATION_OFFSET; + if (options.getRandomOffset().size() > arg_idx) { + rand_offset = options.getRandomOffset()[arg_idx]; + } + // We need to go back by HW_ETHER_LEN (MAC address length) + // because this offset points to last octet of MAC address. + rand_offset -= HW_ETHER_LEN + 1; + // Create temporaru buffer from the template. + std::vector in_buf(template_buf.begin(), + template_buf.end()); + // Check if given randomization offset is not out of bounds. + if (rand_offset + HW_ETHER_LEN > in_buf.size()) { + isc_throw(OutOfRange, "randomization offset is out of bounds"); + } + + // Create packet from the temporary buffer. + PerfPkt4Ptr pkt4(new PerfPkt4(&in_buf[0], in_buf.size(), + transid_offset, + transid)); + + // Set hardware address from OFFER packet received. + const uint8_t* chaddr = offer_pkt4->getChaddr(); + std::vector mac_address(chaddr, chaddr + HW_ETHER_LEN); + pkt4->writeAt(rand_offset, mac_address.begin(), mac_address.end()); + + // Set elapsed time. + size_t elp_offset = 0; + if (options.getElapsedTimeOffset() > 0) { + elp_offset = options.getElapsedTimeOffset(); + } + uint32_t elapsed_time = getElapsedTime(discover_pkt4, offer_pkt4); + pkt4->writeValueAt(elp_offset, + static_cast(elapsed_time / 1000)); + + // Get the actual server id offset. + size_t sid_offset = DHCPV4_SERVERID_OFFSET; + if (options.getServerIdOffset() > 0) { + sid_offset = options.getServerIdOffset(); + } + if (CommandOptions::instance().isUseFirst() && + (first_packet_serverid_.size() > 0)) { + boost::shared_ptr + opt_serverid(new LocalizedOption(Option::V4, + DHO_DHCP_SERVER_IDENTIFIER, + first_packet_serverid_, + sid_offset)); + pkt4->addOption(opt_serverid); + } else { + // Copy the contents of server identifier received in + // OFFER packet to put this into REQUEST. + OptionPtr opt_serverid_offer = + offer_pkt4->getOption(DHO_DHCP_SERVER_IDENTIFIER); + if (!opt_serverid_offer) { + isc_throw(BadValue, "there is no SERVER_IDENTIFIER option " + << "in OFFER message"); + } + boost::shared_ptr + opt_serverid(new LocalizedOption(Option::V4, + DHO_DHCP_SERVER_IDENTIFIER, + opt_serverid_offer->getData(), + sid_offset)); + pkt4->addOption(opt_serverid); + if (stats_mgr4_->getRcvdPacketsNum(StatsMgr4::XCHG_DO) == 1) { + first_packet_serverid_ = opt_serverid_offer->getData(); + } + } + + /// Set client address. + asiolink::IOAddress yiaddr = offer_pkt4->getYiaddr(); + if (!yiaddr.getAddress().is_v4()) { + isc_throw(BadValue, "the YIADDR returned in OFFER packet is not " + " IPv4 address"); + } + + // Get the actual offset of requested ip. + size_t rip_offset = DHCPV4_REQUESTED_IP_OFFSET; + if (options.getRequestedIpOffset() > 0) { + rip_offset = options.getRequestedIpOffset(); + } + // Place requested IP option at specified position (rip_offset). + boost::shared_ptr + opt_requested_ip(new LocalizedOption(Option::V4, + DHO_DHCP_REQUESTED_ADDRESS, + OptionBuffer(), + rip_offset)); + // The IOAddress is castable to uint32_t and returns exactly what we need. + opt_requested_ip->setUint32(static_cast(yiaddr)); + pkt4->addOption(opt_requested_ip); + + setDefaults4(socket, boost::static_pointer_cast(pkt4)); + // Prepare on-wire data. + pkt4->rawPack(); + IfaceMgr::instance().send(boost::static_pointer_cast(pkt4)); + if (!stats_mgr4_) { + isc_throw(InvalidOperation, "Statistics Manager for DHCPv4 " + "hasn't been initialized"); + } + // Update packet stats. + stats_mgr4_->passSentPacket(StatsMgr4::XCHG_RA, + boost::static_pointer_cast(pkt4)); +} + +void +TestControl::sendRequest6(const TestControlSocket& socket, + const Pkt6Ptr& advertise_pkt6) { + const uint32_t transid = generateTransid(); + Pkt6Ptr pkt6(new Pkt6(DHCPV6_REQUEST, transid)); + // Set elapsed time. + OptionPtr opt_elapsed_time = + Option::factory(Option::V6, D6O_ELAPSED_TIME); + pkt6->addOption(opt_elapsed_time); + // Set client id. + OptionPtr opt_clientid = advertise_pkt6->getOption(D6O_CLIENTID); + if (!opt_clientid) { + isc_throw(Unexpected, "client id not found in received packet"); + } + pkt6->addOption(opt_clientid); + + // Use first flags indicates that we want to use the server + // id captured in fisrt packet. + if (CommandOptions::instance().isUseFirst() && + (first_packet_serverid_.size() > 0)) { + pkt6->addOption(Option::factory(Option::V6, D6O_SERVERID, + first_packet_serverid_)); + } else { + OptionPtr opt_serverid = advertise_pkt6->getOption(D6O_SERVERID); + if (!opt_serverid) { + isc_throw(Unexpected, "server id not found in received packet"); + } + if (stats_mgr6_->getRcvdPacketsNum(StatsMgr6::XCHG_SA) == 1) { + first_packet_serverid_ = opt_serverid->getData(); + } + pkt6->addOption(opt_serverid); + } + // Set IA_NA option. + OptionPtr opt_ia_na = advertise_pkt6->getOption(D6O_IA_NA); + if (!opt_ia_na) { + isc_throw(Unexpected, "DHCPv6 IA_NA option not found in received " + "packet"); + } + pkt6->addOption(opt_ia_na); + + // Set default packet data. + setDefaults6(socket, pkt6); + // Prepare on-wire data. + pkt6->pack(); + IfaceMgr::instance().send(pkt6); + if (!stats_mgr6_) { + isc_throw(InvalidOperation, "Statistics Manager for DHCPv6 " + "hasn't been initialized"); + } + stats_mgr6_->passSentPacket(StatsMgr6::XCHG_RR, pkt6); +} + +void +TestControl::sendRequest6(const TestControlSocket& socket, + const std::vector& template_buf, + const Pkt6Ptr& advertise_pkt6) { + CommandOptions& options = CommandOptions::instance(); + // Get the second argument if multiple the same arguments specified + // in the command line. Second one refers to REQUEST packets. + const uint8_t arg_idx = 1; + // Generate transaction id. + const uint32_t transid = generateTransid(); + // Get transaction id offset. + size_t transid_offset = DHCPV6_TRANSID_OFFSET; + if (options.getTransactionIdOffset().size() > arg_idx) { + transid_offset = options.getTransactionIdOffset()[arg_idx]; + } + PerfPkt6Ptr pkt6(new PerfPkt6(&template_buf[0], template_buf.size(), + transid_offset, transid)); + // Set elapsed time. + size_t elp_offset = DHCPV6_ELAPSED_TIME_OFFSET; + if (options.getElapsedTimeOffset() > 0) { + elp_offset = options.getElapsedTimeOffset(); + } + boost::shared_ptr + opt_elapsed_time(new LocalizedOption(Option::V6, D6O_ELAPSED_TIME, + OptionBuffer(), elp_offset)); + pkt6->addOption(opt_elapsed_time); + + // Get the actual server id offset. + size_t sid_offset = DHCPV6_SERVERID_OFFSET; + if (options.getServerIdOffset() > 0) { + sid_offset = options.getServerIdOffset(); + } + if (CommandOptions::instance().isUseFirst() && + (first_packet_serverid_.size() > 0)) { + boost::shared_ptr + opt_serverid(new LocalizedOption(Option::V6, + D6O_SERVERID, + first_packet_serverid_, + sid_offset)); + pkt6->addOption(opt_serverid); + + } else { + // Copy the contents of server identifier received in + // ADVERTISE packet to put this into REQUEST. + OptionPtr opt_serverid_advertise = + advertise_pkt6->getOption(D6O_SERVERID); + if (!opt_serverid_advertise) { + isc_throw(BadValue, "there is no SERVERID option " + << "in ADVERTISE message"); + } + boost::shared_ptr + opt_serverid(new LocalizedOption(Option::V6, + D6O_SERVERID, + opt_serverid_advertise->getData(), + sid_offset)); + pkt6->addOption(opt_serverid); + if (stats_mgr6_->getRcvdPacketsNum(StatsMgr6::XCHG_SA) == 1) { + first_packet_serverid_ = opt_serverid_advertise->getData(); + } + } + // Set IA_NA + boost::shared_ptr opt_ia_na_advertise = + boost::static_pointer_cast(advertise_pkt6->getOption(D6O_IA_NA)); + if (!opt_ia_na_advertise) { + isc_throw(Unexpected, "DHCPv6 IA_NA option not found in received " + "packet"); + } + size_t addr_offset = DHCPV6_IA_NA_OFFSET; + if (options.getRequestedIpOffset() > 0) { + addr_offset = options.getRequestedIpOffset(); + } + boost::shared_ptr + opt_ia_na(new LocalizedOption(opt_ia_na_advertise, addr_offset)); + if (!opt_ia_na->valid()) { + isc_throw(BadValue, "Option IA_NA in advertise packet is invalid"); + } + pkt6->addOption(opt_ia_na); + // Set server id. + OptionPtr opt_serverid_advertise = advertise_pkt6->getOption(D6O_SERVERID); + if (!opt_serverid_advertise) { + isc_throw(Unexpected, "DHCPV6 SERVERID option not found in received " + "packet"); + } + size_t srvid_offset = DHCPV6_SERVERID_OFFSET; + if (options.getServerIdOffset() > 0) { + srvid_offset = options.getServerIdOffset(); + } + boost::shared_ptr + opt_serverid(new LocalizedOption(Option::V6, D6O_SERVERID, + opt_serverid_advertise->getData(), + srvid_offset)); + pkt6->addOption(opt_serverid); + // Get randomization offset. + size_t rand_offset = DHCPV6_RANDOMIZATION_OFFSET; + if (options.getRandomOffset().size() > arg_idx) { + rand_offset = options.getRandomOffset()[arg_idx]; + } + OptionPtr opt_clientid_advertise = advertise_pkt6->getOption(D6O_CLIENTID); + if (!opt_clientid_advertise) { + isc_throw(Unexpected, "DHCPV6 CLIENTID option not found in received packet"); + } + rand_offset -= (opt_clientid_advertise->len() - 1); + // Set client id. + boost::shared_ptr + opt_clientid(new LocalizedOption(Option::V6, D6O_CLIENTID, + opt_clientid_advertise->getData(), + rand_offset)); + pkt6->addOption(opt_clientid); + // Set default packet data. + setDefaults6(socket, pkt6); + // Prepare on wire data. + pkt6->rawPack(); + // Send packet. + IfaceMgr::instance().send(pkt6); + if (!stats_mgr6_) { + isc_throw(InvalidOperation, "Statistics Manager for DHCPv6 " + "hasn't been initialized"); + } + // Update packet stats. + stats_mgr6_->passSentPacket(StatsMgr6::XCHG_RR, pkt6); + +} + +void +TestControl::sendSolicit6(const TestControlSocket& socket, + const bool preload /*= false*/) { + last_sent_ = microsec_clock::universal_time(); + // Generate DUID to be passed to the packet + uint8_t randomized = 0; + std::vector duid = generateDuid(randomized); + // Generate trasnaction id to be set for the new exchange. + const uint32_t transid = generateTransid(); + Pkt6Ptr pkt6(new Pkt6(DHCPV6_SOLICIT, transid)); + if (!pkt6) { + isc_throw(Unexpected, "failed to create SOLICIT packet"); + } + pkt6->addOption(Option::factory(Option::V6, D6O_ELAPSED_TIME)); + if (CommandOptions::instance().isRapidCommit()) { + pkt6->addOption(Option::factory(Option::V6, D6O_RAPID_COMMIT)); + } + pkt6->addOption(Option::factory(Option::V6, D6O_CLIENTID, duid)); + pkt6->addOption(Option::factory(Option::V6, D6O_ORO)); + pkt6->addOption(Option::factory(Option::V6, D6O_IA_NA)); + + setDefaults6(socket, pkt6); + pkt6->pack(); + IfaceMgr::instance().send(pkt6); + if (!preload) { + if (!stats_mgr6_) { + isc_throw(InvalidOperation, "Statistics Manager for DHCPv6 " + "hasn't been initialized"); + } + stats_mgr6_->passSentPacket(StatsMgr6::XCHG_SA, pkt6); + } +} + +void +TestControl::sendSolicit6(const TestControlSocket& socket, + const std::vector& template_buf, + const bool preload /*= false*/) { + last_sent_ = microsec_clock::universal_time(); + CommandOptions& options = CommandOptions::instance(); + const int arg_idx = 0; + // Get transaction id offset. + size_t transid_offset = DHCPV6_TRANSID_OFFSET; + if (options.getTransactionIdOffset().size() > arg_idx) { + transid_offset = options.getTransactionIdOffset()[arg_idx]; + } + // Generate trasnaction id to be set for the new exchange. + const uint32_t transid = generateTransid(); + // Create packet. + PerfPkt6Ptr pkt6(new PerfPkt6(&template_buf[0], template_buf.size(), + transid_offset, transid)); + if (!pkt6) { + isc_throw(Unexpected, "failed to create SOLICIT packet"); + } + size_t rand_offset = DHCPV6_RANDOMIZATION_OFFSET; + if (options.getRandomOffset().size() > arg_idx) { + rand_offset = options.getRandomOffset()[arg_idx]; + } + // randomized will pick number of bytes randomized so we can + // just use part of the generated duid and substitude a few bytes + /// in template. + uint8_t randomized = 0; + std::vector duid = generateDuid(randomized); + if (rand_offset > template_buf.size()) { + isc_throw(OutOfRange, "randomization offset is out of bounds"); + } + // Store random part of the DUID into the packet. + pkt6->writeAt(rand_offset - randomized + 1, + duid.end() - randomized, duid.end()); + + // Prepare on-wire data. + pkt6->rawPack(); + setDefaults6(socket, pkt6); + // Send solicit packet. + IfaceMgr::instance().send(pkt6); + if (!preload) { + if (!stats_mgr6_) { + isc_throw(InvalidOperation, "Statistics Manager for DHCPv6 " + "hasn't been initialized"); + } + // Update packet stats. + stats_mgr6_->passSentPacket(StatsMgr6::XCHG_SA, pkt6); + } +} + + +void +TestControl::setDefaults4(const TestControlSocket& socket, + const Pkt4Ptr& pkt) { + CommandOptions& options = CommandOptions::instance(); + // Interface name. + IfaceMgr::Iface* iface = IfaceMgr::instance().getIface(socket.ifindex_); + if (iface == NULL) { + isc_throw(BadValue, "unable to find interface with given index"); + } + pkt->setIface(iface->getName()); + // Interface index. + pkt->setIndex(socket.ifindex_); + // Local client's port (68) + pkt->setLocalPort(DHCP4_CLIENT_PORT); + // Server's port (67) + pkt->setRemotePort(DHCP4_SERVER_PORT); + // The remote server's name or IP. + pkt->setRemoteAddr(IOAddress(options.getServerName())); + // Set local addresss. + pkt->setLocalAddr(IOAddress(socket.addr_)); + // Set relay (GIADDR) address to local address. + pkt->setGiaddr(IOAddress(socket.addr_)); + // Pretend that we have one relay (which is us). + pkt->setHops(1); +} + +void +TestControl::setDefaults6(const TestControlSocket& socket, + const Pkt6Ptr& pkt) { + CommandOptions& options = CommandOptions::instance(); + // Interface name. + IfaceMgr::Iface* iface = IfaceMgr::instance().getIface(socket.ifindex_); + if (iface == NULL) { + isc_throw(BadValue, "unable to find interface with given index"); + } + pkt->setIface(iface->getName()); + // Interface index. + pkt->setIndex(socket.ifindex_); + // Local client's port (547) + pkt->setLocalPort(DHCP6_CLIENT_PORT); + // Server's port (548) + pkt->setRemotePort(DHCP6_SERVER_PORT); + // Set local address. + pkt->setLocalAddr(socket.addr_); + // The remote server's name or IP. + pkt->setRemoteAddr(IOAddress(options.getServerName())); +} + +bool +TestControl::testDiags(const char diag) const { + std::string diags(CommandOptions::instance().getDiags()); + if (diags.find(diag) != std::string::npos) { + return (true); + } + return (false); +} + +void +TestControl::updateSendDue() { + // If default constructor was called, this should not happen but + // if somebody has changed default constructor it is better to + // keep this check. + if (last_sent_.is_not_a_date_time()) { + isc_throw(Unexpected, "time of last sent packet not initialized"); + } + // Get the expected exchange rate. + CommandOptions& options = CommandOptions::instance(); + int rate = options.getRate(); + // If rate was not specified we will wait just one clock tick to + // send next packet. This simulates best effort conditions. + long duration = 1; + if (rate != 0) { + // We use number of ticks instead of nanoseconds because + // nanosecond resolution may not be available on some + // machines. Number of ticks guarantees the highest possible + // timer resolution. + duration = time_duration::ticks_per_second() / rate; + } + // Calculate due time to initate next chunk of exchanges. + send_due_ = last_sent_ + time_duration(0, 0, 0, duration); + // Check if it is already due. + ptime now(microsec_clock::universal_time()); + // \todo verify if this condition is not too tight. In other words + // verify if this will not produce too many late sends. + // We might want to look at this once we are done implementing + // microsecond timeouts in IfaceMgr. + if (now > send_due_) { + if (testDiags('i')) { + if (options.getIpVersion() == 4) { + stats_mgr4_->incrementCounter("latesend"); + } else if (options.getIpVersion() == 6) { + stats_mgr6_->incrementCounter("latesend"); + } + } + } +} + + +} // namespace perfdhcp +} // namespace isc diff --git a/tests/tools/perfdhcp/test_control.h b/tests/tools/perfdhcp/test_control.h new file mode 100644 index 0000000000..1b0b83c385 --- /dev/null +++ b/tests/tools/perfdhcp/test_control.h @@ -0,0 +1,803 @@ +// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC") +// +// Permission to use, copy, modify, and/or distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +// PERFORMANCE OF THIS SOFTWARE. + +#ifndef __TEST_CONTROL_H +#define __TEST_CONTROL_H + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "stats_mgr.h" + +namespace isc { +namespace perfdhcp { + +/// \brief Test Control class. +/// +/// This class is responsible for executing DHCP performance +/// test end to end. +/// +/// Option factory functions are registered using +/// \ref dhcp::LibDHCP::OptionFactoryRegister. Registered factory functions +/// provide a way to create options of the same type in the same way. +/// When new option instance is needed the corresponding factory +/// function is called to create it. This is done by calling +/// \ref dhcp::Option::factory with DHCP message type specified as one of +/// parameters. Some of the parameters passed to factory function +/// may be ignored (e.g. option buffer). +/// Please note that naming convention for factory functions within this +/// class is as follows: +/// - factoryABC4 - factory function for DHCPv4 option, +/// - factoryDEF6 - factory function for DHCPv6 option, +/// - factoryGHI - factory function that can be used to create either +/// DHCPv4 or DHCPv6 option. +class TestControl : public boost::noncopyable { +public: + + /// Default transaction id offset. + static const size_t DHCPV4_TRANSID_OFFSET = 4; + /// Default offset of MAC's last octet. + static const size_t DHCPV4_RANDOMIZATION_OFFSET = 35; + /// Default elapsed time offset. + static const size_t DHCPV4_ELAPSED_TIME_OFFSET = 8; + /// Default server id offset. + static const size_t DHCPV4_SERVERID_OFFSET = 54; + /// Default requested ip offset. + static const size_t DHCPV4_REQUESTED_IP_OFFSET = 240; + /// Default DHCPV6 transaction id offset. + static const size_t DHCPV6_TRANSID_OFFSET = 1; + /// Default DHCPV6 randomization offset (last octet of DUID) + static const size_t DHCPV6_RANDOMIZATION_OFFSET = 21; + /// Default DHCPV6 elapsed time offset. + static const size_t DHCPV6_ELAPSED_TIME_OFFSET = 84; + /// Default DHCPV6 server id offset. + static const size_t DHCPV6_SERVERID_OFFSET = 22; + /// Default DHCPV6 IA_NA offset. + static const size_t DHCPV6_IA_NA_OFFSET = 40; + + /// Statistics Manager for DHCPv4. + typedef StatsMgr StatsMgr4; + /// Pointer to Statistics Manager for DHCPv4; + typedef boost::shared_ptr StatsMgr4Ptr; + /// Statictics Manager for DHCPv6. + typedef StatsMgr StatsMgr6; + /// Pointer to Statistics Manager for DHCPv6. + typedef boost::shared_ptr StatsMgr6Ptr; + /// Packet exchange type. + typedef StatsMgr<>::ExchangeType ExchangeType; + /// Packet template buffer. + typedef std::vector TemplateBuffer; + /// Packet template buffers list. + typedef std::vector TemplateBufferCollection; + + /// \brief Socket wrapper structure. + /// + /// This is the wrapper that holds descriptor of the socket + /// used to run DHCP test. The wrapped socket is closed in + /// the destructor. This prevents resource leaks when when + /// function that created the socket ends (normally or + /// when exception occurs). This structure extends parent + /// structure with new field ifindex_ that holds interface + /// index where socket is bound to. + struct TestControlSocket : public dhcp::IfaceMgr::SocketInfo { + /// Interface index. + uint16_t ifindex_; + /// Is socket valid. It will not be valid if the provided socket + /// descriptor does not point to valid socket. + bool valid_; + + /// \brief Constructor of socket wrapper class. + /// + /// This constructor uses provided socket descriptor to + /// find the name of the interface where socket has been + /// bound to. If provided socket descriptor is invalid then + /// valid_ field is set to false; + /// + /// \param socket socket descriptor. + TestControlSocket(const int socket); + + /// \brief Destriuctor of the socket wrapper class. + /// + /// Destructor closes wrapped socket. + ~TestControlSocket(); + + private: + /// \brief Initialize socket data. + /// + /// This method initializes members of the class that Interface + /// Manager holds: interface name, local address. + /// + /// \throw isc::BadValue if interface for specified socket + /// descriptor does not exist. + void initSocketData(); + }; + + /// \brief Number generator class. + /// + /// This is default numbers generator class. The member function is + /// used to generate uint32_t values. Other generator classes should + /// derive from this one to implement generation algorithms + /// (e.g. sequencial or based on random function). + class NumberGenerator { + public: + /// \brief Generate number. + /// + /// \return Generate number. + virtual uint32_t generate() = 0; + }; + + /// The default generator pointer. + typedef boost::shared_ptr NumberGeneratorPtr; + + /// \brief Sequencial numbers generatorc class. + class SequencialGenerator : public NumberGenerator { + public: + /// \brief Constructor. + /// + /// \param range maximum number generated. If 0 is given then + /// range defaults to maximym uint32_t value. + SequencialGenerator(uint32_t range = 0xFFFFFFFF) : + NumberGenerator(), + num_(0), + range_(range) { + if (range_ == 0) { + range_ = 0xFFFFFFFF; + } + } + + /// \brief Generate number sequencialy. + /// + /// \return generated number. + virtual uint32_t generate() { + uint32_t num = num_; + num_ = (num_ + 1) % range_; + return (num); + } + private: + uint32_t num_; ///< Current number. + uint32_t range_; ///< Maximum number generated. + }; + + /// \brief Length of the Ethernet HW address (MAC) in bytes. + /// + /// \todo Make this variable length as there are cases when HW + /// address is longer than this (e.g. 20 bytes). + static const uint8_t HW_ETHER_LEN = 6; + + /// TestControl is a singleton class. This method returns reference + /// to its sole instance. + /// + /// \return the only existing instance of test control + static TestControl& instance(); + + /// brief\ Run performance test. + /// + /// Method runs whole performance test. Command line options must + /// be parsed prior to running this function. Othewise function will + /// throw exception. + /// + /// \throw isc::InvalidOperation if command line options are not parsed. + /// \throw isc::Unexpected if internal Test Controler error occured. + void run(); + + /// \brief Set new transaction id generator. + /// + /// \param generator generator object to be used. + void setTransidGenerator(const NumberGeneratorPtr& generator) { + transid_gen_.reset(); + transid_gen_ = generator; + } + + /// \brief Set new MAC address generator. + /// + /// Set numbers generator that will be used to generate various + /// MAC addresses to simulate number of clients. + /// + /// \param generator object to be used. + void setMacAddrGenerator(const NumberGeneratorPtr& generator) { + macaddr_gen_.reset(); + macaddr_gen_ = generator; + } + + // We would really like following methods and members to be private but + // they have to be accessible for unit-testing. Another, possibly better, + // solution is to make this class friend of test class but this is not + // what's followed in other classes. +protected: + /// \brief Default constructor. + /// + /// Default constructor is protected as the object can be created + /// only via \ref instance method. + TestControl(); + + /// \brief Check if test exit condtitions fulfilled. + /// + /// Method checks if the test exit conditions are fulfiled. + /// Exit conditions are checked periodically from the + /// main loop. Program should break the main loop when + /// this method returns true. It is calling function + /// responsibility to break main loop gracefully and + /// cleanup after test execution. + /// + /// \return true if any of the exit conditions is fulfiled. + bool checkExitConditions() const; + + /// \brief Factory function to create DHCPv6 ELAPSED_TIME option. + /// + /// This factory function creates DHCPv6 ELAPSED_TIME option instance. + /// If empty buffer is passed the option buffer will be initialized + /// to length 2 and values will be initialized to zeros. Otherwise + /// function will initialize option buffer with values in passed buffer. + /// + /// \param u universe (ignored) + /// \param type option-type (ignored). + /// \param buf option-buffer containing option content (2 bytes) or + /// empty buffer if option content has to be set to default (0) value. + /// \throw if elapsed time buffer size is neither 2 nor 0. + /// \return instance o the option. + static dhcp::OptionPtr + factoryElapsedTime6(dhcp::Option::Universe u, + uint16_t type, + const dhcp::OptionBuffer& buf); + + /// \brief Factory function to create generic option. + /// + /// This factory function creates option with specified universe, + /// type and buf. It does not have any additional logic validating + /// the buffer contents, size etc. + /// + /// \param u universe (V6 or V4). + /// \param type option-type (ignored). + /// \param buf option-buffer. + /// \return instance o the option. + static dhcp::OptionPtr factoryGeneric(dhcp::Option::Universe u, + uint16_t type, + const dhcp::OptionBuffer& buf); + + /// \brief Factory function to create IA_NA option. + /// + /// This factory function creates DHCPv6 IA_NA option instance. + /// + /// \todo add support for IA Address options. + /// + /// \param u universe (ignored). + /// \param type option-type (ignored). + /// \param buf option-buffer carrying IANA suboptions. + /// \return instance of IA_NA option. + static dhcp::OptionPtr factoryIana6(dhcp::Option::Universe u, + uint16_t type, + const dhcp::OptionBuffer& buf); + + /// \brief Factory function to create DHCPv6 ORO option. + /// + /// This factory function creates DHCPv6 Option Request Option instance. + /// The created option will contain the following set of requested options: + /// - D6O_NAME_SERVERS + /// - D6O_DOMAIN_SEARCH + /// + /// \param u universe (ignored). + /// \param type option-type (ignored). + /// \param buf option-buffer (ignored). + /// \return instance of ORO option. + static dhcp::OptionPtr + factoryOptionRequestOption6(dhcp::Option::Universe u, + uint16_t type, + const dhcp::OptionBuffer& buf); + + /// \brief Factory function to create DHCPv6 RAPID_COMMIT option instance. + /// + /// This factory function creates DHCPv6 RAPID_COMMIT option instance. + /// The buffer passed to this option must be empty because option does + /// not have any payload. + /// + /// \param u universe (ignored). + /// \param type option-type (ignored). + /// \param buf option-buffer (ignored). + /// \return instance of RAPID_COMMIT option.. + static dhcp::OptionPtr factoryRapidCommit6(dhcp::Option::Universe u, + uint16_t type, + const dhcp::OptionBuffer& buf); + + + /// \brief Factory function to create DHCPv4 Request List option. + /// + /// This factory function creayes DHCPv4 PARAMETER_REQUEST_LIST option + /// instance with the following set of requested options: + /// - DHO_SUBNET_MASK, + /// - DHO_BROADCAST_ADDRESS, + /// - DHO_TIME_OFFSET, + /// - DHO_ROUTERS, + /// - DHO_DOMAIN_NAME, + /// - DHO_DOMAIN_NAME_SERVERS, + /// - DHO_HOST_NAME. + /// + /// \param u universe (ignored). + /// \param type option-type (ignored). + /// \param buf option-buffer (ignored). + /// \return instance o the generic option. + static dhcp::OptionPtr factoryRequestList4(dhcp::Option::Universe u, + uint16_t type, + const dhcp::OptionBuffer& buf); + + /// \brief Generate DUID. + /// + /// Method generates unique DUID. The number of DUIDs it can generate + /// depends on the number of simulated clients, which is specified + /// from the command line. It uses \ref CommandOptions object to retrieve + /// number of clients. Since the last six octets of DUID are constructed + /// from the MAC address, this function uses \ref generateMacAddress + /// internally to randomize the DUID. + /// + /// \todo add support for other types of DUID. + /// + /// \param [out] randomized number of bytes randomized (initial value + /// is ignored). + /// \throw isc::BadValue if \ref generateMacAddress throws. + /// \return vector representing DUID. + std::vector generateDuid(uint8_t& randomized) const; + + /// \brief Generate MAC address. + /// + /// This method generates MAC address. The number of unique + /// MAC addresses it can generate is determined by the number + /// simulated DHCP clients specified from command line. It uses + /// \ref CommandOptions object to retrieve number of clients. + /// Based on this the random value is generated and added to + /// the MAC address template (default MAC address). + /// + /// \param [out] randomized number of bytes randomized (initial + /// value is ignored). + /// \throw isc::BadValue if MAC address template (default or specified + /// from the command line) has invalid size (expected 6 octets). + /// \return generated MAC address. + std::vector generateMacAddress(uint8_t& randomized) const; + + /// \brief generate transaction id. + /// + /// Generate transaction id value (32-bit for DHCPv4, + /// 24-bit for DHCPv6). + /// + /// \return generated transaction id. + uint32_t generateTransid() { + return (transid_gen_->generate()); + } + + /// \brief Returns number of exchanges to be started. + /// + /// Method returns number of new exchanges to be started as soon + /// as possible to satisfy expected rate. Calculation used here + /// is based on current time, due time calculated with + /// \ref updateSendDue function and expected rate. + /// + /// \return number of exchanges to be started immediately. + uint64_t getNextExchangesNum() const; + + /// \brief Return template buffer. + /// + /// Method returns template buffer at specified index. + /// + /// \param idx index of template buffer. + /// \throw isc::OutOfRange if buffer index out of bounds. + /// \return reference to template buffer. + TemplateBuffer getTemplateBuffer(const size_t idx) const; + + /// \brief Reads packet templates from files. + /// + /// Method iterates through all specified template files, reads + /// their content and stores it in class internal buffers. Template + /// file names are specified from the command line with -T option. + /// + /// \throw isc::BadValue if any of the template files does not exist + void initPacketTemplates(); + + /// \brief Initializes Statistics Manager. + /// + /// This function initializes Statistics Manager. If there is + /// the one initialized already it is released. + void initializeStatsMgr(); + + /// \brief Open socket to communicate with DHCP server. + /// + /// Method opens socket and binds it to local address. Function will + /// use either interface name, local address or server address + /// to create a socket, depending on what is available (specified + /// from the command line). If socket can't be created for any + /// reason, exception is thrown. + /// If destination address is broadcast (for DHCPv4) or multicast + /// (for DHCPv6) than broadcast or multicast option is set on + /// the socket. Opened socket is registered and managed by IfaceMgr. + /// + /// \throw isc::BadValue if socket can't be created for given + /// interface, local address or remote address. + /// \throw isc::InvalidOperation if broadcast option can't be + /// set for the v4 socket or if multicast option cat't be set + /// for the v6 socket. + /// \throw isc::Unexpected if interal unexpected error occured. + /// \return socket descriptor. + int openSocket() const; + + /// \brief Print intermediate statistics. + /// + /// Print brief statistics regarding number of sent packets, + /// received packets and dropped packets so far. + void printIntermediateStats(); + + /// \brief Print rate statistics. + /// + /// Method print packet exchange rate statistics. + void printRate() const; + + /// \brief Print performance statistics. + /// + /// Method prints performance statistics. + /// \throws isc::InvalidOperation if Statistics Manager was + /// not initialized. + void printStats() const; + + /// \brief Process received DHCPv4 packet. + /// + /// Method performs processing of the received DHCPv4 packet, + /// updates statistics and responds to the server if required, + /// e.g. when OFFER packet arrives, this function will initiate + /// REQUEST message to the server. + /// + /// \warning this method does not check if provided socket is + /// valid (specifically if v4 socket for received v4 packet). + /// + /// \param [in] socket socket to be used. + /// \param [in] pkt4 object representing DHCPv4 packet received. + /// \throw isc::BadValue if unknown message type received. + /// \throw isc::Unexpected if unexpected error occured. + void processReceivedPacket4(const TestControlSocket& socket, + const dhcp::Pkt4Ptr& pkt4); + + /// \brief Process received DHCPv6 packet. + /// + /// Method performs processing of the received DHCPv6 packet, + /// updates statistics and responsds to the server if required, + /// e.g. when ADVERTISE packet arrives, this function will initiate + /// REQUEST message to the server. + /// + /// \warning this method does not check if provided socket is + /// valid (specifically if v4 socket for received v4 packet). + /// + /// \param [in] socket socket to be used. + /// \param [in] pkt6 object representing DHCPv6 packet received. + /// \throw isc::BadValue if unknown message type received. + /// \throw isc::Unexpected if unexpected error occured. + void processReceivedPacket6(const TestControlSocket& socket, + const dhcp::Pkt6Ptr& pkt6); + + /// \brief Receive DHCPv4 or DHCPv6 packets from the server. + /// + /// Method receives DHCPv4 or DHCPv6 packets from the server. + /// This function will call \ref receivePacket4 or + /// \ref receivePacket6 depending if DHCPv4 or DHCPv6 packet + /// has arrived. + /// + /// \warning this method does not check if provided socket is + /// valid. Ensure that it is valid prior to calling it. + /// + /// \param socket socket to be used. + /// \throw isc::BadValue if unknown message type received. + /// \throw isc::Unexpected if unexpected error occured. + void receivePackets(const TestControlSocket& socket); + + /// \brief Register option factory functions for DHCPv4 + /// + /// Method registers option factory functions for DHCPv4. + /// These functions are called to create instances of DHCPv4 + /// options. Call \ref dhcp::Option::factory to invoke factory + /// function for particular option. Don't use this function directly. + /// Use \ref registerOptionFactories instead. + void registerOptionFactories4() const; + + /// \brief Register option factory functions for DHCPv6 + /// + /// Method registers option factory functions for DHCPv6. + /// These functions are called to create instances of DHCPv6 + /// options. Call \ref dhcp::Option::factory to invoke factory + /// function for particular option. Don't use this function directly. + /// Use \ref registerOptionFactories instead. + void registerOptionFactories6() const; + + /// \brief Register option factory functions for DHCPv4 or DHCPv6. + /// + /// Method registers option factory functions for DHCPv4 or DHCPv6, + /// depending in whch mode test is currently running. + void registerOptionFactories() const; + + + /// \brief Resets internal state of the object. + /// + /// Method resets internal state of the object. It has to be + /// called before new test is started. + void reset(); + + /// \brief Send DHCPv4 DISCOVER message. + /// + /// Method creates and sends DHCPv4 DISCOVER message to the server + /// with the following options: + /// - MESSAGE_TYPE set to DHCPDISCOVER + /// - PARAMETER_REQUEST_LIST with the same list of requested options + /// as described in \ref factoryRequestList4. + /// The transaction id and MAC address are randomly generated for + /// the message. Range of unique MAC addresses generated depends + /// on the number of clients specified from the command line. + /// Copy of sent packet is stored in the stats_mgr4_ object to + /// update statistics. + /// + /// \param socket socket to be used to send the message. + /// \param preload preload mode, packets not included in statistics. + /// \throw isc::Unexpected if failed to create new packet instance. + /// \throw isc::BadValue if MAC address has invalid length. + void sendDiscover4(const TestControlSocket& socket, + const bool preload = false); + + /// \brief Send DHCPv4 DISCOVER message from template. + /// + /// Method sends DHCPv4 DISCOVER message from template. The + /// template data is exepcted to be in binary format. Provided + /// buffer is copied and parts of it are replaced with actual + /// data (e.g. MAC address, transaction id etc.). + /// Copy of sent packet is stored in the stats_mgr4_ object to + /// update statistics. + /// + /// \param socket socket to be used to send the message. + /// \param template_buf buffer holding template packet. + /// \param preload preload mode, packets not included in statistics. + /// \throw isc::OutOfRange if randomization offset is out of bounds. + void sendDiscover4(const TestControlSocket& socket, + const std::vector& template_buf, + const bool preload = false); + + /// \brief Send DHCPv4 REQUEST message. + /// + /// Method creates and sends DHCPv4 REQUEST message to the server. + /// Copy of sent packet is stored in the stats_mgr4_ object to + /// update statistics. + /// + /// \param socket socket to be used to send message. + /// \param discover_pkt4 DISCOVER packet sent. + /// \param offer_pkt4 OFFER packet object. + /// \throw isc::Unexpected if unexpected error occured. + /// \throw isc::InvalidOperation if Statistics Manager has not been + /// initialized. + void sendRequest4(const TestControlSocket& socket, + const dhcp::Pkt4Ptr& discover_pkt4, + const dhcp::Pkt4Ptr& offer_pkt4); + + /// \brief Send DHCPv4 REQUEST message from template. + /// + /// Method sends DHCPv4 REQUEST message from template. + /// Copy of sent packet is stored in the stats_mgr4_ object to + /// update statistics. + /// + /// \param socket socket to be used to send message. + /// \param template_buf buffer holding template packet. + /// \param discover_pkt4 DISCOVER packet sent. + /// \param offer_pkt4 OFFER packet received. + void sendRequest4(const TestControlSocket& socket, + const std::vector& template_buf, + const dhcp::Pkt4Ptr& discover_pkt4, + const dhcp::Pkt4Ptr& offer_pkt4); + + /// \brief Send DHCPv6 REQUEST message. + /// + /// Method creates and sends DHCPv6 REQUEST message to the server + /// with the following options: + /// - D6O_ELAPSED_TIME + /// - D6O_CLIENTID + /// - D6O_SERVERID + /// Copy of sent packet is stored in the stats_mgr6_ object to + /// update statistics. + /// + /// \param socket socket to be used to send message. + /// \param advertise_pkt6 ADVERTISE packet object. + /// \throw isc::Unexpected if unexpected error occured. + /// \throw isc::InvalidOperation if Statistics Manager has not been + /// initialized. + void sendRequest6(const TestControlSocket& socket, + const dhcp::Pkt6Ptr& advertise_pkt6); + + /// \brief Send DHCPv6 REQUEST message from template. + /// + /// Method sends DHCPv6 REQUEST message from template. + /// Copy of sent packet is stored in the stats_mgr6_ object to + /// update statistics. + /// + /// \param socket socket to be used to send message. + /// \param template_buf packet template buffer. + /// \param advertise_pkt6 ADVERTISE packet object. + void sendRequest6(const TestControlSocket& socket, + const std::vector& template_buf, + const dhcp::Pkt6Ptr& advertise_pkt6); + + /// \brief Send DHCPv6 SOLICIT message. + /// + /// Method creates and sends DHCPv6 SOLICIT message to the server + /// with the following options: + /// - D6O_ELAPSED_TIME, + /// - D6O_RAPID_COMMIT if rapid commit is requested in command line, + /// - D6O_CLIENTID, + /// - D6O_ORO (Option Request Option), + /// - D6O_IA_NA. + /// Copy of sent packet is stored in the stats_mgr6_ object to + /// update statistics. + /// + /// \param socket socket to be used to send the message. + /// \param preload mode, packets not included in statistics. + /// \throw isc::Unexpected if failed to create new packet instance. + void sendSolicit6(const TestControlSocket& socket, + const bool preload = false); + + /// \brief Send DHCPv6 SOLICIT message from template. + /// + /// Method sends DHCPv6 SOLICIT message from template. + /// Copy of sent packet is stored in the stats_mgr6_ object to + /// update statistics. + /// + /// \param socket socket to be used to send the message. + /// \param template_buf packet template buffer. + /// \param preload mode, packets not included in statistics. + void sendSolicit6(const TestControlSocket& socket, + const std::vector& template_buf, + const bool preload = false); + + /// \brief Set default DHCPv4 packet parameters. + /// + /// This method sets default parameters on the DHCPv4 packet: + /// - interface name, + /// - local port = 68 (DHCP client port), + /// - remote port = 67 (DHCP server port), + /// - server's address, + /// - GIADDR = local address where socket is bound to, + /// - hops = 1 (pretending that we are a relay) + /// + /// \param socket socket used to send the packet. + /// \param pkt reference to packet to be configured. + void setDefaults4(const TestControlSocket& socket, + const dhcp::Pkt4Ptr& pkt); + + /// \brief Set default DHCPv6 packet parameters. + /// + /// This method sets default parameters on the DHCPv6 packet: + /// - interface name, + /// - interface index, + /// - local port, + /// - remote port, + /// - local address, + /// - remote address (server). + /// + /// \param socket socket used to send the packet. + /// \param pkt reference to packet to be configured. + void setDefaults6(const TestControlSocket& socket, + const dhcp::Pkt6Ptr& pkt); + + /// \brief Find if diagnostic flag has been set. + /// + /// \param diag diagnostic flag (a,e,i,s,r,t,T). + /// \return true if diagnostics flag has been set. + bool testDiags(const char diag) const; + + /// \brief Update due time to initiate next chunk of exchanges. + /// + /// Method updates due time to initiate next chunk of exchanges. + /// Function takes current time, last sent packet's time and + /// expected rate in its calculations. + void updateSendDue(); + +private: + + /// \brief Convert binary value to hex string. + /// + /// \todo Consider moving this function to src/lib/util. + /// + /// \param b byte to convert. + /// \return hex string. + std::string byte2Hex(const uint8_t b) const; + + /// \brief Calculate elapsed time between two packets. + /// + /// \param T Pkt4Ptr or Pkt6Ptr class. + /// \param pkt1 first packet. + /// \param pkt2 second packet. + /// \throw InvalidOperation if packet timestamps are invalid. + /// \return elapsed time in milliseconds between pkt1 and pkt2. + template + uint32_t getElapsedTime(const T& pkt1, const T& pkt2); + + /// \brief Get number of received packets. + /// + /// Get the number of received packets from the Statistics Manager. + /// Function may throw if Statistics Manager object is not + /// initialized. + /// \param xchg_type packet exchange type. + /// \return number of received packets. + uint64_t getRcvdPacketsNum(const ExchangeType xchg_type) const; + + /// \brief Get number of sent packets. + /// + /// Get the number of sent packets from the Statistics Manager. + /// Function may throw if Statistics Manager object is not + /// initialized. + /// \param xchg_type packet exchange type. + /// \return number of sent packets. + uint64_t getSentPacketsNum(const ExchangeType xchg_type) const; + + /// \brief Handle interrupt signal. + /// + /// Function sets flag indicating that program has been + /// interupted. + /// + /// \param sig signal (ignored) + static void handleInterrupt(int sig); + + /// \brief Print main diagnostics data. + /// + /// Method prints main diagnostics data. + void printDiagnostics() const; + + /// \brief Read DHCP message template from file. + /// + /// Method reads DHCP message template from file and + /// converts it to binary format. Read data is appended + /// to template_buffers_ vector. + void readPacketTemplate(const std::string& file_name); + + /// \brief Convert vector in hexadecimal string. + /// + /// \todo Consider moving this function to src/lib/util. + /// + /// \param vec vector to be converted. + /// \param separator separator. + std::string vector2Hex(const std::vector& vec, + const std::string& separator = "") const; + + boost::posix_time::ptime send_due_; ///< Due time to initiate next chunk + ///< of exchanges. + boost::posix_time::ptime last_sent_; ///< Indicates when the last exchange + /// was initiated. + + boost::posix_time::ptime last_report_; ///< Last intermediate report time. + + StatsMgr4Ptr stats_mgr4_; ///< Statistics Manager 4. + StatsMgr6Ptr stats_mgr6_; ///< Statistics Manager 6. + + NumberGeneratorPtr transid_gen_; ///< Transaction id generator. + NumberGeneratorPtr macaddr_gen_; ///< Numbers generator for MAC address. + + /// Buffer holiding server id received in first packet + dhcp::OptionBuffer first_packet_serverid_; + + /// Packet template buffers. + TemplateBufferCollection template_buffers_; + + static bool interrupted_; ///< Is program interrupted. +}; + +} // namespace perfdhcp +} // namespace isc + +#endif // __COMMAND_OPTIONS_H diff --git a/tests/tools/perfdhcp/tests/Makefile.am b/tests/tools/perfdhcp/tests/Makefile.am index 16e18425ac..73ec6babc5 100644 --- a/tests/tools/perfdhcp/tests/Makefile.am +++ b/tests/tools/perfdhcp/tests/Makefile.am @@ -22,10 +22,13 @@ run_unittests_SOURCES += perf_pkt6_unittest.cc run_unittests_SOURCES += perf_pkt4_unittest.cc run_unittests_SOURCES += localized_option_unittest.cc run_unittests_SOURCES += stats_mgr_unittest.cc +run_unittests_SOURCES += test_control_unittest.cc +run_unittests_SOURCES += command_options_helper.h run_unittests_SOURCES += $(top_builddir)/tests/tools/perfdhcp/command_options.cc run_unittests_SOURCES += $(top_builddir)/tests/tools/perfdhcp/pkt_transform.cc run_unittests_SOURCES += $(top_builddir)/tests/tools/perfdhcp/perf_pkt6.cc run_unittests_SOURCES += $(top_builddir)/tests/tools/perfdhcp/perf_pkt4.cc +run_unittests_SOURCES += $(top_builddir)/tests/tools/perfdhcp/test_control.cc run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS) diff --git a/tests/tools/perfdhcp/tests/command_options_helper.h b/tests/tools/perfdhcp/tests/command_options_helper.h new file mode 100644 index 0000000000..860a040fd3 --- /dev/null +++ b/tests/tools/perfdhcp/tests/command_options_helper.h @@ -0,0 +1,138 @@ +// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC") +// +// Permission to use, copy, modify, and/or distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +// PERFORMANCE OF THIS SOFTWARE. + +#ifndef __COMMAND_OPTIONS_HELPER_H +#define __COMMAND_OPTIONS_HELPER_H + +#include +#include + +#include +#include "../command_options.h" + +namespace isc { +namespace perfdhcp { + +/// \brief Command Options Helper class. +/// +/// This helper class can be shared between unit tests that +/// need to initialize CommandOptions objects and feed it with +/// specific command line. The command line can be given as a +/// string representing program name, options and arguments. +/// The static method exposed by this class can be used to +/// tokenize this string into array of C-strings that are later +/// consumed by \ref CommandOptions::parse. The state of the +/// CommandOptions object is reset every time the process +/// function is invoked. Also, when command line parsing is +/// ended the array of C-string is freed from the memory. +class CommandOptionsHelper { +public: + + /// \brief Wrapper class for allocated argv[] array. + /// + /// This class wraps allocated char** array and ensures that memory + /// allocated for this array is freed at the end o the scope. + class ArgvPtr { + public: + /// \brief Constructor. + /// + /// \param argv array of C-strings. + /// \param number of C-strings in the array. + ArgvPtr(char** argv, int argc) : argv_(argv), argc_(argc) { } + + /// \brief Destructor. + /// + /// Dealocates wrapped array of C-strings. + ~ArgvPtr() { + if (argv_ != NULL) { + for(int i = 0; i < argc_; ++i) { + free(argv_[i]); + argv_[i] = NULL; + } + free(argv_); + } + } + + /// \brief Return the array of C-strings. + /// + /// \return array of C-strings. + char** getArgv() const { return (argv_); } + + /// \brief Return C-strings counter. + /// + /// \return C-strings counter. + int getArgc() const { return(argc_); } + + public: + char** argv_; ///< array of C-strings being wrapped. + int argc_; ///< number of C-strings. + }; + + /// \brief Parse command line provided as string. + /// + /// Method transforms the string representing command line + /// to the array of C-strings consumed by the + /// \ref CommandOptions::parse function and performs + /// parsing. + /// + /// \param cmdline command line provided as single string. + static void process(const std::string& cmdline) { + CommandOptions& opt = CommandOptions::instance(); + int argc = 0; + char** argv = tokenizeString(cmdline, argc); + ArgvPtr args(argv, argc); + opt.reset(); + opt.parse(args.getArgc(), args.getArgv()); + } + +private: + + /// \brief Split string to the array of C-strings. + /// + /// \param text_to_split string to be splited. + /// \param [out] num number of substrings returned. + /// \return array of C-strings created from split. + static char** tokenizeString(const std::string& text_to_split, int& num) { + char** results = NULL; + // Tokenization with std streams + std::stringstream text_stream(text_to_split); + // Iterators to be used for tokenization + std::istream_iterator text_iterator(text_stream); + std::istream_iterator text_end; + // Tokenize string (space is a separator) using begin and end iteratos + std::vector tokens(text_iterator, text_end); + + if (tokens.size() > 0) { + // Allocate array of C-strings where we will store tokens + results = static_cast(malloc(tokens.size() * sizeof(char*))); + if (results == NULL) { + isc_throw(Unexpected, "unable to allocate array of c-strings"); + } + // Store tokens in C-strings array + for (int i = 0; i < tokens.size(); ++i) { + char* cs = static_cast(malloc(tokens[i].length() + 1)); + strcpy(cs, tokens[i].c_str()); + results[i] = cs; + } + // Return number of tokens to calling function + num = tokens.size(); + } + return results; + } +}; + +} // namespace isc::perfdhcp +} // namespace isc + +#endif // __COMMAND_OPTIONS_HELPER_H diff --git a/tests/tools/perfdhcp/tests/command_options_unittest.cc b/tests/tools/perfdhcp/tests/command_options_unittest.cc index 8e1053dc30..801b02dd29 100644 --- a/tests/tools/perfdhcp/tests/command_options_unittest.cc +++ b/tests/tools/perfdhcp/tests/command_options_unittest.cc @@ -16,14 +16,17 @@ #include #include #include +#include -#include "../command_options.h" +#include +#include -#include "exceptions/exceptions.h" +#include "command_options_helper.h" using namespace std; using namespace isc; using namespace isc::perfdhcp; +using namespace boost::posix_time; /// \brief Test Fixture Class /// @@ -45,16 +48,7 @@ protected: /// \param cmdline Command line to parse /// \throws std::bad allocation if tokenization failed void process(const std::string& cmdline) { - CommandOptions& opt = CommandOptions::instance(); - int argc = 0; - char** argv = tokenizeString(cmdline, &argc); - opt.reset(); - opt.parse(argc, argv); - for(int i = 0; i < argc; ++i) { - free(argv[i]); - argv[i] = NULL; - } - free(argv); + CommandOptionsHelper::process(cmdline); } /// \brief Check default initialized values @@ -62,7 +56,7 @@ protected: /// Check if initialized values are correct void checkDefaults() { CommandOptions& opt = CommandOptions::instance(); - process("perfdhcp"); + process("perfdhcp 192.168.0.1"); EXPECT_EQ(4, opt.getIpVersion()); EXPECT_EQ(CommandOptions::DORA_SARR, opt.getExchangeMode()); EXPECT_EQ(0, opt.getRate()); @@ -70,11 +64,45 @@ protected: EXPECT_EQ(0, opt.getClientsNum()); // default mac - uint8_t mac[6] = { 0x00, 0x0C, 0x01, 0x02, 0x03, 0x04 }; - std::vector v1 = opt.getMacPrefix(); + const uint8_t mac[6] = { 0x00, 0x0C, 0x01, 0x02, 0x03, 0x04 }; + std::vector v1 = opt.getMacTemplate(); ASSERT_EQ(6, v1.size()); EXPECT_TRUE(std::equal(v1.begin(), v1.end(), mac)); + // Check if DUID is initialized. The DUID-LLT is expected + // to start with DUID_LLT value of 1 and hardware ethernet + // type equal to 1 (HWETHER_TYPE). + const uint8_t duid_llt_and_hw[4] = { 0x0, 0x1, 0x0, 0x1 }; + // We assume DUID-LLT length 14. This includes 4 octets of + // DUID_LLT value, two octets of hardware type, 4 octets + // of time value and 6 octets of variable link layer (MAC) + // address. + const int duid_llt_size = 14; + // DUID is not given from the command line but it is supposed + // to be initialized by the CommandOptions private method + // generateDuidTemplate(). + std::vector v2 = opt.getDuidTemplate(); + ASSERT_EQ(duid_llt_size, opt.getDuidTemplate().size()); + EXPECT_TRUE(std::equal(v2.begin(), v2.begin() + 4, + duid_llt_and_hw)); + // Check time field contents. + ptime now = microsec_clock::universal_time(); + ptime duid_epoch(from_iso_string("20000101T000000")); + time_period period(duid_epoch, now); + uint32_t duration_sec = period.length().total_seconds(); + // Read time from the template generated. + uint32_t duration_from_template = 0; + memcpy(&duration_from_template, &v2[4], 4); + duration_from_template = htonl(duration_from_template); + // In special cases, we may have overflow in time field + // so we give ourselves the margin of 10 seconds here. + // If time value has been set more then 10 seconds back + // it is safe to compare it with the time value generated + // from now. + if (duration_from_template > 10) { + EXPECT_GE(duration_sec, duration_from_template); + } + EXPECT_EQ(0, opt.getBase().size()); EXPECT_EQ(0, opt.getNumRequests().size()); EXPECT_EQ(0, opt.getPeriod()); @@ -104,194 +132,215 @@ protected: EXPECT_GT(0, opt.getRequestedIpOffset()); EXPECT_EQ("", opt.getDiags()); EXPECT_EQ("", opt.getWrapped()); - EXPECT_EQ("", opt.getServerName()); + EXPECT_EQ("192.168.0.1", opt.getServerName()); } - - /// \brief Split string to array of C-strings - /// - /// \param s String to split (tokenize) - /// \param num Number of tokens returned - /// \return array of C-strings (tokens) - char** tokenizeString(const std::string& text_to_split, int* num) const { - char** results = NULL; - // Tokenization with std streams - std::stringstream text_stream(text_to_split); - // Iterators to be used for tokenization - std::istream_iterator text_iterator(text_stream); - std::istream_iterator text_end; - // Tokenize string (space is a separator) using begin and end iteratos - std::vector tokens(text_iterator, text_end); - - if (tokens.size() > 0) { - // Allocate array of C-strings where we will store tokens - results = static_cast(malloc(tokens.size() * sizeof(char*))); - if (results == NULL) { - throw std::bad_alloc(); - } - // Store tokens in C-strings array - for (int i = 0; i < tokens.size(); ++i) { - char* cs = static_cast(malloc(tokens[i].length() + 1)); - strcpy(cs, tokens[i].c_str()); - results[i] = cs; - } - // Return number of tokens to calling function - if (num != NULL) { - *num = tokens.size(); - } - } - return results; - } - }; TEST_F(CommandOptionsTest, Defaults) { - process("perfdhcp"); + process("perfdhcp all"); checkDefaults(); } TEST_F(CommandOptionsTest, UseFirst) { CommandOptions& opt = CommandOptions::instance(); - process("perfdhcp -1 -B -l ethx"); + process("perfdhcp -1 -B -l ethx all"); EXPECT_TRUE(opt.isUseFirst()); } TEST_F(CommandOptionsTest, IpVersion) { CommandOptions& opt = CommandOptions::instance(); - process("perfdhcp -6 -l ethx -c -i"); + process("perfdhcp -6 -l ethx -c -i all"); EXPECT_EQ(6, opt.getIpVersion()); EXPECT_EQ("ethx", opt.getLocalName()); EXPECT_TRUE(opt.isRapidCommit()); EXPECT_FALSE(opt.isBroadcast()); - process("perfdhcp -4 -B -l ethx"); + process("perfdhcp -4 -B -l ethx all"); EXPECT_EQ(4, opt.getIpVersion()); EXPECT_TRUE(opt.isBroadcast()); EXPECT_FALSE(opt.isRapidCommit()); // Negative test cases // -4 and -6 must not coexist - EXPECT_THROW(process("perfdhcp -4 -6 -l ethx"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -4 -6 -l ethx all"), isc::InvalidParameter); // -6 and -B must not coexist - EXPECT_THROW(process("perfdhcp -6 -B -l ethx"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -6 -B -l ethx all"), isc::InvalidParameter); // -c and -4 (default) must not coexist - EXPECT_THROW(process("perfdhcp -c -l ethx"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -c -l ethx all"), isc::InvalidParameter); } TEST_F(CommandOptionsTest, Rate) { CommandOptions& opt = CommandOptions::instance(); - process("perfdhcp -4 -r 10 -l ethx"); + process("perfdhcp -4 -r 10 -l ethx all"); EXPECT_EQ(10, opt.getRate()); // Negative test cases // Rate must not be 0 - EXPECT_THROW(process("perfdhcp -4 -r 0 -l ethx"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -4 -r 0 -l ethx all"), + isc::InvalidParameter); // -r must be specified to use -n, -p and -D - EXPECT_THROW(process("perfdhcp -6 -t 5 -l ethx"), isc::InvalidParameter); - EXPECT_THROW(process("perfdhcp -4 -n 150 -l ethx"), isc::InvalidParameter); - EXPECT_THROW(process("perfdhcp -6 -p 120 -l ethx"), isc::InvalidParameter); - EXPECT_THROW(process("perfdhcp -4 -D 1400 -l ethx"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -6 -t 5 -l ethx all"), + isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -4 -n 150 -l ethx all"), + isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -6 -p 120 -l ethx all"), + isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -4 -D 1400 -l ethx all"), + isc::InvalidParameter); } TEST_F(CommandOptionsTest, ReportDelay) { CommandOptions& opt = CommandOptions::instance(); - process("perfdhcp -r 100 -t 17 -l ethx"); + process("perfdhcp -r 100 -t 17 -l ethx all"); EXPECT_EQ(17, opt.getReportDelay()); // Negative test cases // -t must be positive integer - EXPECT_THROW(process("perfdhcp -r 10 -t -8 -l ethx"), isc::InvalidParameter); - EXPECT_THROW(process("perfdhcp -r 10 -t 0 -l ethx"), isc::InvalidParameter); - EXPECT_THROW(process("perfdhcp -r 10 -t s -l ethx"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -r 10 -t -8 -l ethx all"), + isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -r 10 -t 0 -l ethx all"), + isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -r 10 -t s -l ethx all"), + isc::InvalidParameter); } TEST_F(CommandOptionsTest, ClientsNum) { CommandOptions& opt = CommandOptions::instance(); - process("perfdhcp -R 200 -l ethx"); + process("perfdhcp -R 200 -l ethx all"); EXPECT_EQ(200, opt.getClientsNum()); - process("perfdhcp -R 0 -l ethx"); + process("perfdhcp -R 0 -l ethx all"); EXPECT_EQ(0, opt.getClientsNum()); // Negative test cases // Number of clients must be non-negative integer - EXPECT_THROW(process("perfdhcp -R -5 -l ethx"), isc::InvalidParameter); - EXPECT_THROW(process("perfdhcp -R gs -l ethx"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -R -5 -l ethx all"), + isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -R gs -l ethx all"), + isc::InvalidParameter); } TEST_F(CommandOptionsTest, Base) { CommandOptions& opt = CommandOptions::instance(); - process("perfdhcp -6 -b MAC=10::20::30::40::50::60 -l ethx -b duiD=1AB7F5670901FF"); uint8_t mac[6] = {0x10, 0x20, 0x30, 0x40, 0x50, 0x60 }; - uint8_t duid[7] = { 0x1A, 0xB7, 0xF5, 0x67, 0x09, 0x01, 0xFF }; - - // Test Mac - std::vector v1 = opt.getMacPrefix(); - ASSERT_EQ(6, v1.size()); + uint8_t duid[14] = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x10, 0x11, 0x1F, 0x14 }; + // Test DUID and MAC together. + EXPECT_NO_THROW(process("perfdhcp -b DUID=0101010101010101010110111F14" + " -b MAC=10::20::30::40::50::60" + " -l 127.0.0.1 all")); + std::vector v1 = opt.getMacTemplate(); + std::vector v2 = opt.getDuidTemplate(); + v2 = opt.getDuidTemplate(); EXPECT_TRUE(std::equal(v1.begin(), v1.end(), mac)); - // "3x" is invalid value in MAC address - EXPECT_THROW(process("perfdhcp -b mac=10::2::3x::4::5::6 -l ethx"), isc::InvalidParameter); + EXPECT_TRUE(std::equal(v2.begin(), v2.end(), duid)); + // Test valid DUID. + EXPECT_NO_THROW( + process("perfdhcp -b duid=0101010101010101010110111F14 -l 127.0.0.1 all") + ); - // Test DUID - std::vector v2 = opt.getDuidPrefix(); ASSERT_EQ(sizeof(duid) / sizeof(uint8_t), v2.size()); EXPECT_TRUE(std::equal(v2.begin(), v2.end(), duid)); - // "t" is invalid digit in DUID - EXPECT_THROW(process("perfdhcp -6 -l ethx -b duiD=1AB7Ft670901FF"), isc::InvalidParameter); - - // Some more negative test cases + // Test mix of upper/lower case letters. + EXPECT_NO_THROW(process("perfdhcp -b DuiD=0101010101010101010110111F14" + " -b Mac=10::20::30::40::50::60" + " -l 127.0.0.1 all")); + v1 = opt.getMacTemplate(); + v2 = opt.getDuidTemplate(); + EXPECT_TRUE(std::equal(v1.begin(), v1.end(), mac)); + EXPECT_TRUE(std::equal(v2.begin(), v2.end(), duid)); + // Use "ether" instead of "mac". + EXPECT_NO_THROW(process("perfdhcp -b ether=10::20::30::40::50::60" + " -l 127.0.0.1 all")); + v1 = opt.getMacTemplate(); + EXPECT_TRUE(std::equal(v1.begin(), v1.end(), mac)); + // Use "ETHER" in upper case. + EXPECT_NO_THROW(process("perfdhcp -b ETHER=10::20::30::40::50::60" + " -l 127.0.0.1 all")); + v1 = opt.getMacTemplate(); + EXPECT_TRUE(std::equal(v1.begin(), v1.end(), mac)); + // "t" is invalid character in DUID + EXPECT_THROW(process("perfdhcp -6 -l ethx -b " + "duid=010101010101010101t110111F14 all"), + isc::InvalidParameter); + // "3x" is invalid value in MAC address + EXPECT_THROW(process("perfdhcp -b mac=10::2::3x::4::5::6 -l ethx all"), + isc::InvalidParameter); // Base is not specified - EXPECT_THROW(process("perfdhcp -b -l ethx"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -b -l ethx all"), + isc::InvalidParameter); // Typo: should be mac= instead of mc= - EXPECT_THROW(process("perfdhcp -l ethx -b mc=00:01:02:03::04:05"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -l ethx -b mc=00:01:02:03::04:05 all"), + isc::InvalidParameter); + // Too short DUID (< 6). + EXPECT_THROW(process("perfdhcp -l ethx -b duid=00010203 all"), + isc::InvalidParameter); + // Odd number of digits. + EXPECT_THROW(process("perfdhcp -l ethx -b duid=000102030405060 all"), + isc::InvalidParameter); + // Too short MAC (!= 6). + EXPECT_THROW(process("perfdhcp -l ethx -b mac=00:01:02:04 all"), + isc::InvalidParameter); } TEST_F(CommandOptionsTest, DropTime) { CommandOptions& opt = CommandOptions::instance(); - process("perfdhcp -l ethx -d 12"); + process("perfdhcp -l ethx -d 12 all"); ASSERT_EQ(2, opt.getDropTime().size()); EXPECT_DOUBLE_EQ(12, opt.getDropTime()[0]); EXPECT_DOUBLE_EQ(1, opt.getDropTime()[1]); - process("perfdhcp -l ethx -d 2 -d 4.7"); + process("perfdhcp -l ethx -d 2 -d 4.7 all"); ASSERT_EQ(2, opt.getDropTime().size()); EXPECT_DOUBLE_EQ(2, opt.getDropTime()[0]); EXPECT_DOUBLE_EQ(4.7, opt.getDropTime()[1]); // Negative test cases // Drop time must not be negative - EXPECT_THROW(process("perfdhcp -l ethx -d -2 -d 4.7"), isc::InvalidParameter); - EXPECT_THROW(process("perfdhcp -l ethx -d -9.1 -d 0"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -l ethx -d -2 -d 4.7 all"), + isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -l ethx -d -9.1 -d 0 all"), + isc::InvalidParameter); } TEST_F(CommandOptionsTest, TimeOffset) { CommandOptions& opt = CommandOptions::instance(); - process("perfdhcp -l ethx -T file1.x -T file2.x -E 4"); + process("perfdhcp -l ethx -T file1.x -T file2.x -E 4 all"); EXPECT_EQ(4, opt.getElapsedTimeOffset()); // Negative test cases // Argument -E must be used with -T - EXPECT_THROW(process("perfdhcp -l ethx -E 3 -i"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -l ethx -E 3 -i all"), + isc::InvalidParameter); // Value in -E not specified - EXPECT_THROW(process("perfdhcp -l ethx -T file.x -E -i"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -l ethx -T file.x -E -i all"), + isc::InvalidParameter); // Value for -E must not be negative - EXPECT_THROW(process("perfdhcp -l ethx -E -3 -T file.x"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -l ethx -E -3 -T file.x all"), + isc::InvalidParameter); } TEST_F(CommandOptionsTest, ExchangeMode) { CommandOptions& opt = CommandOptions::instance(); - process("perfdhcp -l ethx -i"); + process("perfdhcp -l ethx -i all"); EXPECT_EQ(CommandOptions::DO_SA, opt.getExchangeMode()); // Negative test cases // No template file specified - EXPECT_THROW(process("perfdhcp -i -l ethx -X 3"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -i -l ethx -X 3 all"), + isc::InvalidParameter); // Offsets can't be used in simple exchanges (-i) - EXPECT_THROW(process("perfdhcp -i -l ethx -O 2 -T file.x"), isc::InvalidParameter); - EXPECT_THROW(process("perfdhcp -i -l ethx -E 3 -T file.x"), isc::InvalidParameter); - EXPECT_THROW(process("perfdhcp -i -l ethx -S 1 -T file.x"), isc::InvalidParameter); - EXPECT_THROW(process("perfdhcp -i -l ethx -I 2 -T file.x"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -i -l ethx -O 2 -T file.x all"), + isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -i -l ethx -E 3 -T file.x all"), + isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -i -l ethx -S 1 -T file.x all"), + isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -i -l ethx -I 2 -T file.x all"), + isc::InvalidParameter); } TEST_F(CommandOptionsTest, Offsets) { CommandOptions& opt = CommandOptions::instance(); - process("perfdhcp -E5 -4 -I 2 -S3 -O 30 -X7 -l ethx -X3 -T file1.x -T file2.x"); + process("perfdhcp -E5 -4 -I 2 -S3 -O 30 -X7 -l ethx " + "-X3 -T file1.x -T file2.x all"); EXPECT_EQ(2, opt.getRequestedIpOffset()); EXPECT_EQ(5, opt.getElapsedTimeOffset()); EXPECT_EQ(3, opt.getServerIdOffset()); @@ -304,151 +353,237 @@ TEST_F(CommandOptionsTest, Offsets) { // Negative test cases // IP offset/IA_NA offset must be positive - EXPECT_THROW(process("perfdhcp -6 -I 0 -l ethx"), isc::InvalidParameter); - EXPECT_THROW(process("perfdhcp -6 -I -4 -l ethx"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -6 -I 0 -l ethx all"), + isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -6 -I -4 -l ethx all"), + isc::InvalidParameter); // TODO - other negative cases } TEST_F(CommandOptionsTest, LocalPort) { CommandOptions& opt = CommandOptions::instance(); - process("perfdhcp -l ethx -L 2000"); + process("perfdhcp -l ethx -L 2000 all"); EXPECT_EQ(2000, opt.getLocalPort()); // Negative test cases // Local port must be between 0..65535 - EXPECT_THROW(process("perfdhcp -l ethx -L -2"), isc::InvalidParameter); - EXPECT_THROW(process("perfdhcp -l ethx -L"), isc::InvalidParameter); - EXPECT_THROW(process("perfdhcp -l ethx -L 65540"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -l ethx -L -2 all"), + isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -l ethx -L all"), + isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -l ethx -L 65540 all"), + isc::InvalidParameter); } TEST_F(CommandOptionsTest, Preload) { CommandOptions& opt = CommandOptions::instance(); - process("perfdhcp -1 -P 3 -l ethx"); + process("perfdhcp -1 -P 3 -l ethx all"); EXPECT_EQ(3, opt.getPreload()); // Negative test cases // Number of preload packages must not be negative integer - EXPECT_THROW(process("perfdhcp -P -1 -l ethx"), isc::InvalidParameter); - EXPECT_THROW(process("perfdhcp -P -3 -l ethx"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -P -1 -l ethx all"), + isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -P -3 -l ethx all"), + isc::InvalidParameter); } TEST_F(CommandOptionsTest, Seed) { CommandOptions& opt = CommandOptions::instance(); - process("perfdhcp -6 -P 2 -s 23 -l ethx"); + process("perfdhcp -6 -P 2 -s 23 -l ethx all"); EXPECT_EQ(23, opt.getSeed()); EXPECT_TRUE(opt.isSeeded()); - process("perfdhcp -6 -P 2 -s 0 -l ethx"); + process("perfdhcp -6 -P 2 -s 0 -l ethx all"); EXPECT_EQ(0, opt.getSeed()); EXPECT_FALSE(opt.isSeeded()); // Negtaive test cases // Seed must be non-negative integer - EXPECT_THROW(process("perfdhcp -6 -P 2 -s -5 -l ethx"), isc::InvalidParameter); - EXPECT_THROW(process("perfdhcp -6 -P 2 -s -l ethx"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -6 -P 2 -s -5 -l ethx all"), + isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -6 -P 2 -s -l ethx all"), + isc::InvalidParameter); } TEST_F(CommandOptionsTest, TemplateFiles) { CommandOptions& opt = CommandOptions::instance(); - process("perfdhcp -T file1.x -l ethx"); + process("perfdhcp -T file1.x -l ethx all"); ASSERT_EQ(1, opt.getTemplateFiles().size()); EXPECT_EQ("file1.x", opt.getTemplateFiles()[0]); - process("perfdhcp -T file1.x -s 12 -w start -T file2.x -4 -l ethx"); + process("perfdhcp -T file1.x -s 12 -w start -T file2.x -4 -l ethx all"); ASSERT_EQ(2, opt.getTemplateFiles().size()); EXPECT_EQ("file1.x", opt.getTemplateFiles()[0]); EXPECT_EQ("file2.x", opt.getTemplateFiles()[1]); // Negative test cases // No template file specified - EXPECT_THROW(process("perfdhcp -s 12 -l ethx -T"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -s 12 -T -l ethx all"), + isc::InvalidParameter); // Too many template files specified - EXPECT_THROW(process("perfdhcp -s 12 -l ethx -T file.x -T file.x -T file.x"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -s 12 -l ethx -T file.x " + "-T file.x -T file.x all"), + isc::InvalidParameter); } TEST_F(CommandOptionsTest, Wrapped) { CommandOptions& opt = CommandOptions::instance(); - process("perfdhcp -B -w start -i -l ethx"); + process("perfdhcp -B -w start -i -l ethx all"); EXPECT_EQ("start", opt.getWrapped()); // Negative test cases // Missing command after -w, expected start/stop - EXPECT_THROW(process("perfdhcp -B -i -l ethx -w"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -B -i -l ethx -w all"), + isc::InvalidParameter); } TEST_F(CommandOptionsTest, Diagnostics) { CommandOptions& opt = CommandOptions::instance(); - process("perfdhcp -l ethx -i -x asTe"); + process("perfdhcp -l ethx -i -x asTe all"); EXPECT_EQ("asTe", opt.getDiags()); // Negative test cases // No diagnostics string specified - EXPECT_THROW(process("perfdhcp -l ethx -i -x"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -l ethx -i -x all"), + isc::InvalidParameter); } TEST_F(CommandOptionsTest, Aggressivity) { CommandOptions& opt = CommandOptions::instance(); - process("perfdhcp -a 10 -l 192.168.0.1"); + process("perfdhcp -a 10 -l 192.168.0.1 all"); EXPECT_EQ(10, opt.getAggressivity()); // Negative test cases // Aggressivity must be non negative integer - EXPECT_THROW(process("perfdhcp -l ethx -a 0"), isc::InvalidParameter); - EXPECT_THROW(process("perfdhcp -l ethx -a"), isc::InvalidParameter); - EXPECT_THROW(process("perfdhcp -a -2 -l ethx -a 3"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -l ethx -a 0 all"), + isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -l ethx -a all"), + isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -a -2 -l ethx -a 3 all"), + isc::InvalidParameter); } TEST_F(CommandOptionsTest, MaxDrop) { CommandOptions& opt = CommandOptions::instance(); - process("perfdhcp -D 25 -l ethx -r 10"); + process("perfdhcp -D 25 -l ethx -r 10 all"); EXPECT_EQ(25, opt.getMaxDrop()[0]); - process("perfdhcp -D 25 -l ethx -D 15 -r 10"); + process("perfdhcp -D 25 -l ethx -D 15 -r 10 all"); EXPECT_EQ(25, opt.getMaxDrop()[0]); EXPECT_EQ(15, opt.getMaxDrop()[1]); - process("perfdhcp -D 15% -l ethx -r 10"); + process("perfdhcp -D 15% -l ethx -r 10 all"); EXPECT_EQ(15, opt.getMaxDropPercentage()[0]); - process("perfdhcp -D 15% -D25% -l ethx -r 10"); + process("perfdhcp -D 15% -D25% -l ethx -r 10 all"); EXPECT_EQ(15, opt.getMaxDropPercentage()[0]); EXPECT_EQ(25, opt.getMaxDropPercentage()[1]); - process("perfdhcp -D 1% -D 99% -l ethx -r 10"); + process("perfdhcp -D 1% -D 99% -l ethx -r 10 all"); EXPECT_EQ(1, opt.getMaxDropPercentage()[0]); EXPECT_EQ(99, opt.getMaxDropPercentage()[1]); // Negative test cases // Too many -D options - EXPECT_THROW(process("perfdhcp -D 0% -D 1 -l ethx -r20 -D 3"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -D 0% -D 1 -l ethx -r20 -D 3 all"), + isc::InvalidParameter); // Too many -D options - EXPECT_THROW(process("perfdhcp -D 99% -D 13% -l ethx -r20 -D 10%"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -D 99% -D 13% -l ethx -r20 -D 10% all"), + isc::InvalidParameter); // Percentage is out of bounds - EXPECT_THROW(process("perfdhcp -D101% -D 13% -l ethx -r20"), isc::InvalidParameter); - EXPECT_THROW(process("perfdhcp -D0% -D 13% -l ethx -r20"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -D101% -D 13% -l ethx -r20 all"), + isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -D0% -D 13% -l ethx -r20 all"), + isc::InvalidParameter); } TEST_F(CommandOptionsTest, NumRequest) { CommandOptions& opt = CommandOptions::instance(); - process("perfdhcp -n 1000 -r 10 -l ethx"); + process("perfdhcp -n 1000 -r 10 -l ethx all"); EXPECT_EQ(1000, opt.getNumRequests()[0]); - process("perfdhcp -n 5 -r 10 -n 500 -l ethx"); + process("perfdhcp -n 5 -r 10 -n 500 -l ethx all"); EXPECT_EQ(5, opt.getNumRequests()[0]); EXPECT_EQ(500, opt.getNumRequests()[1]); // Negative test cases // Too many -n parameters, expected maximum 2 - EXPECT_THROW(process("perfdhcp -n 1 -n 2 -l ethx -n3 -r 20"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -n 1 -n 2 -l ethx -n3 -r 20 all"), + isc::InvalidParameter); // Num request must be positive integer - EXPECT_THROW(process("perfdhcp -n 1 -n -22 -l ethx -r 10"), isc::InvalidParameter); - EXPECT_THROW(process("perfdhcp -n 0 -l ethx -r 10"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -n 1 -n -22 -l ethx -r 10 all"), + isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -n 0 -l ethx -r 10 all"), + isc::InvalidParameter); } TEST_F(CommandOptionsTest, Period) { CommandOptions& opt = CommandOptions::instance(); - process("perfdhcp -p 120 -l ethx -r 100"); + process("perfdhcp -p 120 -l ethx -r 100 all"); EXPECT_EQ(120, opt.getPeriod()); // Negative test cases // Test period must be positive integer - EXPECT_THROW(process("perfdhcp -p 0 -l ethx -r 50"), isc::InvalidParameter); - EXPECT_THROW(process("perfdhcp -p -3 -l ethx -r 50"), isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -p 0 -l ethx -r 50 all"), + isc::InvalidParameter); + EXPECT_THROW(process("perfdhcp -p -3 -l ethx -r 50 all"), + isc::InvalidParameter); +} + +TEST_F(CommandOptionsTest, Interface) { + // In order to make this test portable we need to know + // at least one interface name on OS where test is run. + // Interface Manager has ability to detect interfaces. + // Altough we don't call initIsInterface explicitely + // here it is called by CommandOptions object interally + // so this function is covered by the test. + dhcp::IfaceMgr& iface_mgr = dhcp::IfaceMgr::instance(); + const dhcp::IfaceMgr::IfaceCollection& ifaces = iface_mgr.getIfaces(); + std::string iface_name; + CommandOptions& opt = CommandOptions::instance(); + // The local loopback interface should be available. + // If no interface have been found for any reason we should + // not fail this test. + if (ifaces.size() > 0) { + // Get the name of the interface we detected. + iface_name = ifaces.begin()->getName(); + // Use the name in the command parser. + ASSERT_NO_THROW(process("perfdhcp -4 -l " + iface_name + " abc")); + // We expect that command parser will detect that argument + // specified along with '-l' is the interface name. + EXPECT_TRUE(opt.isInterface()); + + // If neither interface nor server is specified then + // exception is expected to be thrown. + EXPECT_THROW(process("perfdhcp -4"), isc::InvalidParameter); + } +} + +TEST_F(CommandOptionsTest, Server) { + CommandOptions& opt = CommandOptions::instance(); + // There is at least server parameter needed. If server is not + // specified the local interface must be specified. + // The server value equal to 'all' means use broadcast. + ASSERT_NO_THROW(process("perfdhcp all")); + // Once command line is parsed we expect that server name is + // set to broadcast address because 'all' was specified. + EXPECT_TRUE(opt.isBroadcast()); + // The broadcast address is 255.255.255.255. + EXPECT_EQ("255.255.255.255", opt.getServerName()); + + // When all is specified for DHCPv6 mode we expect + // FF02::1:2 as a server name which means All DHCP + // servers and relay agents in local network segment + ASSERT_NO_THROW(process("perfdhcp -6 all")); + EXPECT_EQ("FF02::1:2", opt.getServerName()); + + // When server='servers' in DHCPv6 mode we expect + // FF05::1:3 as server name which means All DHCP + // servers in local network. + ASSERT_NO_THROW(process("perfdhcp -6 servers")); + EXPECT_EQ("FF05::1:3", opt.getServerName()); + + // If server name is neither 'all' nor 'servers' + // the given argument value is expected to be + // returned. + ASSERT_NO_THROW(process("perfdhcp -6 abc")); + EXPECT_EQ("abc", opt.getServerName()); } diff --git a/tests/tools/perfdhcp/tests/perf_pkt4_unittest.cc b/tests/tools/perfdhcp/tests/perf_pkt4_unittest.cc index 3863faa111..5523c640ec 100644 --- a/tests/tools/perfdhcp/tests/perf_pkt4_unittest.cc +++ b/tests/tools/perfdhcp/tests/perf_pkt4_unittest.cc @@ -381,4 +381,50 @@ TEST_F(PerfPkt4Test, UnpackTransactionId) { EXPECT_FALSE(pkt2->rawUnpack()); } +TEST_F(PerfPkt4Test, Writes) { + // Initialize intput buffer with 260 elements set to value 1. + dhcp::OptionBuffer in_data(260, 1); + // Initialize buffer to be used for write: 1,2,3,4,...,9 + dhcp::OptionBuffer write_buf(10); + for (int i = 0; i < write_buf.size(); ++i) { + write_buf[i] = i; + } + // Create packet from the input buffer. + const size_t transid_offset = 4; + boost::scoped_ptr pkt1(new PerfPkt4(&in_data[0], + in_data.size(), + transid_offset)); + // Write numbers 4,5,6,7 to the packet's input buffer at position 10. + pkt1->writeAt(10, write_buf.begin() + 3, write_buf.begin() + 7); + // We have to pack data to output buffer here because Pkt4 provides no + // way to retrieve input buffer. If we pack data it will go to + // output buffer that has getter available. + ASSERT_TRUE(pkt1->rawPack()); + const util::OutputBuffer& out_buf = pkt1->getBuffer(); + ASSERT_EQ(in_data.size(), out_buf.getLength()); + // Verify that 4,5,6,7 has been written to the packet's buffer. + const char* out_data = static_cast(out_buf.getData()); + EXPECT_TRUE(std::equal(write_buf.begin() + 3, write_buf.begin() + 7, + out_data + 10)); + // Write 1 octet (0x51) at position 10. + pkt1->writeValueAt(10, 0x51); + ASSERT_TRUE(pkt1->rawPack()); + ASSERT_EQ(in_data.size(), pkt1->getBuffer().getLength()); + EXPECT_EQ(0x51, pkt1->getBuffer()[10]); + // Write 2 octets (0x5251) at position 20. + pkt1->writeValueAt(20, 0x5251); + ASSERT_TRUE(pkt1->rawPack()); + ASSERT_EQ(in_data.size(), pkt1->getBuffer().getLength()); + EXPECT_EQ(0x52, pkt1->getBuffer()[20]); + EXPECT_EQ(0x51, pkt1->getBuffer()[21]); + // Write 4 octets (0x54535251) at position 30. + pkt1->writeValueAt(30, 0x54535251); + ASSERT_TRUE(pkt1->rawPack()); + ASSERT_EQ(in_data.size(), pkt1->getBuffer().getLength()); + EXPECT_EQ(0x54, pkt1->getBuffer()[30]); + EXPECT_EQ(0x53, pkt1->getBuffer()[31]); + EXPECT_EQ(0x52, pkt1->getBuffer()[32]); + EXPECT_EQ(0x51, pkt1->getBuffer()[33]); +} + } diff --git a/tests/tools/perfdhcp/tests/stats_mgr_unittest.cc b/tests/tools/perfdhcp/tests/stats_mgr_unittest.cc index 2233847bb1..d6b3aeff24 100644 --- a/tests/tools/perfdhcp/tests/stats_mgr_unittest.cc +++ b/tests/tools/perfdhcp/tests/stats_mgr_unittest.cc @@ -387,13 +387,13 @@ TEST_F(StatsMgrTest, CustomCounters) { // Increment one of the counters 10 times. const uint64_t tooshort_num = 10; for (uint64_t i = 0; i < tooshort_num; ++i) { - stats_mgr->IncrementCounter(too_short_key); + stats_mgr->incrementCounter(too_short_key); } // Increment another counter by 5 times. const uint64_t toolate_num = 5; for (uint64_t i = 0; i < toolate_num; ++i) { - stats_mgr->IncrementCounter(too_late_key); + stats_mgr->incrementCounter(too_late_key); } // Check counter's current value and name. diff --git a/tests/tools/perfdhcp/tests/test_control_unittest.cc b/tests/tools/perfdhcp/tests/test_control_unittest.cc new file mode 100644 index 0000000000..a4cde00f19 --- /dev/null +++ b/tests/tools/perfdhcp/tests/test_control_unittest.cc @@ -0,0 +1,1011 @@ +// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC") +// +// Permission to use, copy, modify, and/or distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +// PERFORMANCE OF THIS SOFTWARE. + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include "command_options_helper.h" +#include "../test_control.h" + +using namespace std; +using namespace boost::posix_time; +using namespace isc; +using namespace isc::dhcp; +using namespace isc::perfdhcp; + +/// \brief Test Control class with protected members made public. +/// +/// This class makes protected TestControl class'es member public +/// to allow unit testing. +class NakedTestControl: public TestControl { +public: + + /// \brief Incremental transaction id generaator. + /// + /// This is incremental transaction id generator. It overrides + /// the default transaction id generator that generates transaction + /// ids using random function. This generator will generate values + /// like: 1,2,3 etc. + class IncrementalGenerator : public TestControl::NumberGenerator { + public: + /// \brief Default constructor. + IncrementalGenerator() : + NumberGenerator(), + transid_(0) { + } + + /// \brief Generate unique transaction id. + /// + /// Generate unique transaction ids incrementally: + /// 1,2,3,4 etc. + /// + /// \return generated transaction id. + virtual uint32_t generate() { + return (++transid_); + } + private: + uint32_t transid_; ///< Last generated transaction id. + }; + + using TestControl::checkExitConditions; + using TestControl::factoryElapsedTime6; + using TestControl::factoryGeneric; + using TestControl::factoryIana6; + using TestControl::factoryOptionRequestOption6; + using TestControl::factoryRapidCommit6; + using TestControl::factoryRequestList4; + using TestControl::generateDuid; + using TestControl::generateMacAddress; + using TestControl::getNextExchangesNum; + using TestControl::getTemplateBuffer; + using TestControl::initPacketTemplates; + using TestControl::initializeStatsMgr; + using TestControl::openSocket; + using TestControl::processReceivedPacket4; + using TestControl::processReceivedPacket6; + using TestControl::registerOptionFactories; + using TestControl::sendDiscover4; + using TestControl::sendSolicit6; + using TestControl::setDefaults4; + using TestControl::setDefaults6; + + NakedTestControl() : TestControl() { + uint32_t clients_num = CommandOptions::instance().getClientsNum() == 0 ? + 1 : CommandOptions::instance().getClientsNum(); + setMacAddrGenerator(NumberGeneratorPtr(new TestControl::SequencialGenerator(clients_num))); + }; + +}; + +/// \brief Test Fixture Class +/// +/// This test fixture class is used to perform +/// unit tests on perfdhcp TestControl class. +class TestControlTest : public virtual ::testing::Test +{ +public: + + typedef std::vector MacAddress; + typedef MacAddress::iterator MacAddressIterator; + + typedef std::vector Duid; + typedef Duid::iterator DuidIterator; + + /// \brief Default Constructor + TestControlTest() { } + + /// \brief Create packet template file from binary data. + /// + /// Function creates file containing data from the provided buffer + /// in hexadecimal format. + /// \param filename template file to be created. + /// \param buffer with binary datato be stored in file. + /// \return true if file creation successful. + bool createTemplateFile(const std::string& filename, + const std::vector& buf) const { + std::ofstream temp_file; + temp_file.open(filename.c_str(), ios::out | ios::trunc); + if (!temp_file.is_open()) { + return (false); + } + for (int i = 0; i < buf.size(); ++i) { + int first_digit = buf[i] / 16; + int second_digit = buf[i] % 16; + temp_file << std::hex << first_digit << second_digit << std::dec; + } + temp_file.close(); + return (true); + } + + /// \brief Get local loopback interface name. + /// + /// Scan available network interfaces for local loopback + /// interface and get its name. On Linux this interface is + /// usually called 'lo' but on other systems, e.g. BSD + /// it will have slightly different name. Local loopback + /// interface is required for unit tests that require + /// socket creation. + /// + /// \return local loopback interface name. + std::string getLocalLoopback() const { + const IfaceMgr::IfaceCollection& ifaces = + IfaceMgr::instance().getIfaces(); + for (IfaceMgr::IfaceCollection::const_iterator iface = ifaces.begin(); + iface != ifaces.end(); + ++iface) { + if (iface->flag_loopback_) { + return (iface->getName()); + } + } + return (""); + } + + /// \brief Match requested options in the buffer with given list. + /// + /// This method iterates through options provided in the buffer + /// and matches them with the options specified with first parameter. + /// Options in both vectors may be laid in different order. + /// + /// \param requested_options reference buffer with options. + /// \param buf test buffer with options that will be matched. + /// \return number of options from the buffer matched with options + /// in the reference buffer. + int matchRequestedOptions(const dhcp::OptionBuffer& requested_options, + const dhcp::OptionBuffer& buf) const { + size_t matched_num = 0; + for (size_t i = 0; i < buf.size(); ++i) { + for (int j = 0; j < requested_options.size(); ++j) { + if (requested_options[j] == buf[i]) { + // Requested option has been found. + ++matched_num; + } + } + } + return (matched_num); + } + + /// \brief Match requested DHCPv6 options in the buffer with given list. + /// + /// This method iterates through options provided in the buffer and + /// matches them with the options specified with first parameter. + /// Options in both vectors ma be laid in different order. + /// + /// \param requested_options reference buffer with options. + /// \param buf test buffer with options that will be matched. + /// \return number of options from the buffer matched with options in + /// the reference buffer or -1 if error occured. + int matchRequestedOptions6(const dhcp::OptionBuffer& requested_options, + const dhcp::OptionBuffer& buf) const { + // Sanity check. + if ((requested_options.size() % 2 != 0) || + (buf.size() % 2 != 0)) { + return -1; + } + size_t matched_num = 0; + for (size_t i = 0; i < buf.size(); i += 2) { + for (int j = 0; j < requested_options.size(); j += 2) { + uint16_t opt_i = buf[i + 1] << 8 + buf[i] & 0xFF; + uint16_t opt_j = requested_options[j + 1] << 8 + requested_options[j] & 0xFF; + if (opt_i == opt_j) { + // Requested option has been found. + ++matched_num; + } + } + } + return (matched_num); + } + + /// \brief Calculate the maximum vectors' mismatch position. + /// + /// This helper function calculates the maximum mismatch position + /// between two vectors (two different DUIDs or MAC addresses). + /// Calculated position is counted from the end of vectors. + /// Calculation is based on number of simulated clients. When number + /// of clients is less than 256 different DUIDs or MAC addresses can + /// can be coded in such a way that they differ on last vector element. + /// If number of clients is between 257 and 65536 they can differ + /// on two last positions so the returned value will be 2 and so on. + /// + /// \param clients_num number of simulated clinets + /// \return maximum mismatch position + int unequalOctetPosition(int clients_num) const { + if (!clients_num) { + return (0); + } + clients_num--; + + int cnt = 0; + while (clients_num) { + clients_num >>= 8; + ++cnt; + } + + return (cnt); + } + + /// brief Test generation of mulitple DUIDs + /// + /// Thie method checks the generation of multiple DUIDs. Number + /// of iterations depends on the number of simulated clients. + /// It is expected that DUID's size is 14 (consists of DUID-LLT + /// HW type field, 4 octets of time value and MAC address). The + /// MAC address can be randomized depending on the number of + /// simulated clients. The DUID-LLT and HW type are expected to + /// be constant. The time value has to be properly calculated + /// as the number of seconds since DUID time epoch. The parts + /// of MAC address has to change if multiple clients are simulated + /// and do not change if single client is simulated. + void testDuid() const { + int clients_num = CommandOptions::instance().getClientsNum(); + // Initialize Test Control class. + NakedTestControl tc; + // The old duid will be holding the previously generated DUID. + // It will be used to compare against the new one. If we have + // multiple clients we want to make sure that duids differ. + uint8_t randomized = 0; + Duid old_duid(tc.generateDuid(randomized)); + Duid new_duid(0); + // total_dist shows the total difference between generated duid. + // It has to be greater than zero if multiple clients are simulated. + size_t total_dist = 0; + // Number of unique DUIDs. + size_t unique_duids = 0; + // Holds the position if the octet on which two DUIDS can be different. + // If number of clients is 256 or less it is last DUID octet (except for + // single client when subsequent DUIDs have to be equal). If number of + // clients is between 257 and 65536 the last two octets can differ etc. + int unequal_pos = unequalOctetPosition(clients_num); + // Keep generated DUIDs in this container. + std::list > duids; + // Perform number of iterations to generate number of DUIDs. + for (int i = 0; i < 10 * clients_num; ++i) { + if (new_duid.empty()) { + new_duid = old_duid; + } else { + std::swap(old_duid, new_duid); + new_duid = tc.generateDuid(randomized); + } + // The DUID-LLT is expected to start with DUID_LLT value + // of 1 and hardware ethernet type equal to 1 (HWETHER_TYPE). + const uint8_t duid_llt_and_hw[4] = { 0x0, 0x1, 0x0, 0x1 }; + // We assume DUID-LLT length 14. This includes 4 octets of + // DUID_LLT value, two octets of hardware type, 4 octets + // of time value and 6 octets of variable link layer (MAC) + // address. + const int duid_llt_size = 14; + ASSERT_EQ(duid_llt_size, new_duid.size()); + // The first four octets do not change. + EXPECT_TRUE(std::equal(new_duid.begin(), new_duid.begin() + 4, + duid_llt_and_hw)); + + // As described in RFC3315: 'the time value is the time + // that the DUID is generated represented in seconds + // since midnight (UTC), January 1, 2000, modulo 2^32.' + uint32_t duid_time = 0; + // Pick 4 bytes of the time from generated DUID and put them + // in reverse order (in DUID they are stored in network order). + for (int j = 4; j < 8; ++j) { + duid_time |= new_duid[j] << (j - 4); + } + // Calculate the duration since epoch time. + ptime now = microsec_clock::universal_time(); + ptime duid_epoch(from_iso_string("20000101T000000")); + time_period period(duid_epoch, now); + + // Current time is the same or later than time from the DUID because + // DUID had been generated before reference duration was calculated. + EXPECT_GE(period.length().total_seconds(), duid_time); + + // Get the mismatch position (counting from the end) of + // mismatched octet between previously generated DUID + // and current. + std::pair mismatch_pos = + std::mismatch(old_duid.begin(), old_duid.end(), + new_duid.begin()); + size_t mismatch_dist = + std::distance(mismatch_pos.first, old_duid.end()); + // For single client total_dist is expected to be 0 because + // old_duid and new_duid should always match. If we have + // more clients then duids have to differ except the case + // if randomization algorithm generates the same values but + // this would be an error in randomization algorithm. + total_dist += mismatch_dist; + // Mismatch may have occured on the DUID octet position + // up to calculated earlier unequal_pos. + ASSERT_LE(mismatch_dist, unequal_pos); + // unique will inform if tested DUID is unique. + bool unique = true; + for (std::list >::const_iterator it = + duids.begin(); + it != duids.end(); ++it) { + // DUIDs should be of the same size if we want to compare them. + ASSERT_EQ(new_duid.size(), it->size()); + // Check if DUID is unique. + if (std::equal(new_duid.begin(), new_duid.end(), it->begin())) { + unique = false; + } + } + // Expecting that DUIDs will be unique only when + // first clients-num iterations is performed. + // After that, DUIDs become non unique. + if (unique) { + ++unique_duids; + } + // For number of iterations equal to clients_num,2*clients_num + // 3*clients_num ... we have to have number of unique duids + // equal to clients_num. + if ((i != 0) && (i % clients_num == 0)) { + ASSERT_EQ(clients_num, unique_duids); + } + // Remember generated DUID. + duids.push_back(new_duid); + } + // If we have more than one client at least one mismatch occured. + if (clients_num < 2) { + EXPECT_EQ(0, total_dist); + } + } + + /// \brief Test DHCPv4 exchanges. + /// + /// Function simulates DHCPv4 exchanges. Function caller specifies + /// number of exchanges to be simulated and number of simulated + /// responses. When number of responses is lower than number of + /// iterations than the difference between them is the number + /// of simulated packet drops. This is useful to test if program + /// exit conditions are handled properly (maximum number of packet + /// drops specified as -D is taken into account). + /// + /// \param iterations_num number of exchanges to simulate. + /// \param receive_num number of received OFFER packets. + /// \param iterations_performed actual number of iterations. + void testPkt4Exchange(int iterations_num, + int receive_num, + bool use_templates, + int& iterations_performed) const { + int sock_handle = 0; + NakedTestControl tc; + tc.initializeStatsMgr(); + + // Use templates files to crate packets. + if (use_templates) { + tc.initPacketTemplates(); + ASSERT_NO_THROW(tc.getTemplateBuffer(0)); + ASSERT_NO_THROW(tc.getTemplateBuffer(1)); + } + + // Incremental transaction id generator will generate + // predictable values of transaction id for each iteration. + // This is important because we need to simulate responses + // from the server and use the same transaction ids as in + // packets sent by client. + TestControl::NumberGeneratorPtr + generator(new NakedTestControl::IncrementalGenerator()); + tc.setTransidGenerator(generator); + // Socket is needed to send packets through the interface. + ASSERT_NO_THROW(sock_handle = tc.openSocket()); + TestControl::TestControlSocket sock(sock_handle); + uint32_t transid = 0; + for (int i = 0; i < iterations_num; ++i) { + if (use_templates) { + ASSERT_NO_THROW(tc.sendDiscover4(sock, tc.getTemplateBuffer(0))); + } else { + ASSERT_NO_THROW(tc.sendDiscover4(sock)); + } + ++transid; + // Do not simulate responses for packets later + // that specified as receive_num. This simulates + // packet drops. + if (i < receive_num) { + boost::shared_ptr offer_pkt4(createOfferPkt4(transid)); + ASSERT_NO_THROW(tc.processReceivedPacket4(sock, offer_pkt4)); + ++transid; + } + if (tc.checkExitConditions()) { + iterations_performed = i + 1; + break; + } + iterations_performed = i + 1; + } + } + + /// \brief Test DHCPv6 exchanges. + /// + /// Function simulates DHCPv6 exchanges. Function caller specifies + /// number of exchanges to be simulated and number of simulated + /// responses. When number of responses is lower than number of + /// iterations than the difference between them is the number + /// of simulated packet drops. This is useful to test if program + /// exit conditions are handled properly (maximum number of packet + /// drops specified as -D is taken into account). + /// + /// \param iterations_num number of exchanges to simulate. + /// \param receive_num number of received OFFER packets. + /// \param iterations_performed actual number of iterations. + void testPkt6Exchange(int iterations_num, + int receive_num, + bool use_templates, + int& iterations_performed) const { + int sock_handle = 0; + NakedTestControl tc; + tc.initializeStatsMgr(); + + // Use templates files to crate packets. + if (use_templates) { + tc.initPacketTemplates(); + ASSERT_NO_THROW(tc.getTemplateBuffer(0)); + ASSERT_NO_THROW(tc.getTemplateBuffer(1)); + } + + // Incremental transaction id generator will generate + // predictable values of transaction id for each iteration. + // This is important because we need to simulate reponses + // from the server and use the same transaction ids as in + // packets sent by client. + TestControl::NumberGeneratorPtr + generator(new NakedTestControl::IncrementalGenerator()); + tc.setTransidGenerator(generator); + // Socket is needed to send packets through the interface. + ASSERT_NO_THROW(sock_handle = tc.openSocket()); + TestControl::TestControlSocket sock(sock_handle); + uint32_t transid = 0; + for (int i = 0; i < iterations_num; ++i) { + // Do not simulate responses for packets later + // that specified as receive_num. This simulates + // packet drops. + if (use_templates) { + ASSERT_NO_THROW(tc.sendSolicit6(sock, tc.getTemplateBuffer(0))); + } else { + ASSERT_NO_THROW(tc.sendSolicit6(sock)); + } + ++transid; + if (i < receive_num) { + boost::shared_ptr + advertise_pkt6(createAdvertisePkt6(transid)); + // Receive ADVERTISE and send REQUEST. + ASSERT_NO_THROW(tc.processReceivedPacket6(sock, advertise_pkt6)); + ++transid; + } + if (tc.checkExitConditions()) { + iterations_performed = i + 1; + break; + } + iterations_performed = i + 1; + } + } + + /// \brief Test generation of multiple MAC addresses. + /// + /// This method validates generation of multiple MAC addresses. + /// The MAC address can be randomized depending on the number + /// of simulated clients. This test checks if different MAC + /// addresses are generated if number of simulated clients is + /// greater than 1. It also checks if the same MAC addresses is + /// generated if only 1 client is simulated. + void testMacAddress() const { + int clients_num = CommandOptions::instance().getClientsNum(); + // The old_mac will be holding the value of previously generated + // MAC address. We will be comparing the newly generated one with it + // to see if it changes when mulitple clients are simulated or if it + // does not change when single client is simulated. + MacAddress old_mac(CommandOptions::instance().getMacTemplate()); + // Holds the position if the octet on which two MAC addresses can + // be different. If number of clients is 256 or less it is last MAC + // octet (except for single client when subsequent MAC addresses + // have to be equal). If number of clients is between 257 and 65536 + // the last two octets can differ etc. + int unequal_pos = unequalOctetPosition(clients_num); + // Number of unique MACs. + size_t unique_macs = 0; + // Initialize Test Controller. + NakedTestControl tc; + size_t total_dist = 0; + // Keep generated MACs in this container. + std::list > macs; + // Do many iterations to generate and test MAC address values. + for (int i = 0; i < clients_num * 10; ++i) { + // Generate new MAC address. + uint8_t randomized = 0; + MacAddress new_mac(tc.generateMacAddress(randomized)); + // Get the mismatch position (counting from the end) of + // mismatched octet between previously generated MAC address + // and current. + std::pair mismatch_pos = + std::mismatch(old_mac.begin(), old_mac.end(), new_mac.begin()); + size_t mismatch_dist = + std::distance(mismatch_pos.first, old_mac.end()); + // For single client total_dist is expected to be 0 because + // old_mac and new_mac should always match. If we have + // more clients then MAC addresses have to differ except + // the case if randomization algorithm generates the same + // values but this would be an error in randomization algorithm. + total_dist += mismatch_dist; + // Mismatch may have occured on the MAC address'es octet position + // up to calculated earlier unequal_pos. + ASSERT_LE(mismatch_dist, unequal_pos); + // unique will inform if tested DUID is unique. + bool unique = true; + for (std::list >::const_iterator it = + macs.begin(); + it != macs.end(); ++it) { + // MACs should be of the same size if we want to compare them. + ASSERT_EQ(new_mac.size(), it->size()); + // Check if MAC is unique. + if (std::equal(new_mac.begin(), new_mac.end(), it->begin())) { + unique = false; + } + } + // Expecting that MACs will be unique only when + // first clients-num iterations is performed. + // After that, MACs become non unique. + if (unique) { + ++unique_macs; + } + // For number of iterations equal to clients_num,2*clients_num + // 3*clients_num ... we have to have number of unique MACs + // equal to clients_num. + if ((i != 0) && (i % clients_num == 0)) { + ASSERT_EQ(clients_num, unique_macs); + } + // Remember generated MAC. + macs.push_back(new_mac); + + } + if (clients_num < 2) { + EXPECT_EQ(total_dist, 0); + } + } + + /// \brief Parse command line string with CommandOptions. + /// + /// \param cmdline command line string to be parsed. + /// \throw isc::Unexpected if unexpected error occured. + /// \throw isc::InvalidParameter if command line is invalid. + void processCmdLine(const std::string& cmdline) const { + CommandOptionsHelper::process(cmdline); + } + +private: + /// \brief Create DHCPv4 OFFER packet. + /// + /// \param transid transaction id. + /// \return instance of the packet. + boost::shared_ptr + createOfferPkt4(uint32_t transid) const { + boost::shared_ptr offer(new Pkt4(DHCPOFFER, transid)); + OptionPtr opt_msg_type = Option::factory(Option::V4, DHO_DHCP_MESSAGE_TYPE, + OptionBuffer(DHCPOFFER)); + OptionPtr opt_serverid = Option::factory(Option::V4, + DHO_DHCP_SERVER_IDENTIFIER, + OptionBuffer(4, 1)); + offer->setYiaddr(asiolink::IOAddress("127.0.0.1")); + offer->addOption(opt_msg_type); + offer->addOption(opt_serverid); + offer->updateTimestamp(); + return (offer); + } + + /// \brief Create DHCPv6 ADVERTISE packet. + /// + /// \param transid transaction id. + /// \return instance of the packet. + boost::shared_ptr + createAdvertisePkt6(uint32_t transid) const { + OptionPtr opt_ia_na = Option::factory(Option::V6, D6O_IA_NA); + OptionPtr opt_serverid(new Option(Option::V6, D6O_SERVERID)); + NakedTestControl tc; + uint8_t randomized = 0; + std::vector duid(tc.generateDuid(randomized)); + OptionPtr opt_clientid(Option::factory(Option::V6, D6O_CLIENTID, duid)); + boost::shared_ptr advertise(new Pkt6(DHCPV6_ADVERTISE, transid)); + advertise->addOption(opt_ia_na); + advertise->addOption(opt_serverid); + advertise->addOption(opt_clientid); + advertise->updateTimestamp(); + return (advertise); + } + +}; + +TEST_F(TestControlTest, GenerateDuid) { + // Simple command line that simulates one client only. Always the + // same DUID will be generated. + ASSERT_NO_THROW(processCmdLine("perfdhcp -l 127.0.0.1 all")); + testDuid(); + + // Simulate 50 clients. Different DUID will be generated. + ASSERT_NO_THROW(processCmdLine("perfdhcp -l 127.0.0.1 -R 50 all")); + testDuid(); +} + +TEST_F(TestControlTest, GenerateMacAddress) { + // Simulate one client only. Always the same MAC address will be + // generated. + ASSERT_NO_THROW(processCmdLine("perfdhcp -l 127.0.0.1 all")); + testMacAddress(); + + // Simulate 50 clients. Different MAC addresses will be generated. + ASSERT_NO_THROW(processCmdLine("perfdhcp -l 127.0.0.1 -R 50 all")); + testMacAddress(); +} + +TEST_F(TestControlTest, Options4) { + using namespace isc::dhcp; + NakedTestControl tc; + // By default the IP version mode is V4 so there is no need to + // parse command line to override the IP version. Note that + // registerOptionFactories is used for both V4 and V6. + tc.registerOptionFactories(); + // Create option with buffer size equal to 1 and holding DHCPDISCOVER + // message type. + OptionPtr opt_msg_type(Option::factory(Option::V4, DHO_DHCP_MESSAGE_TYPE, + OptionBuffer(1, DHCPDISCOVER))); + // Validate the option type and universe. + EXPECT_EQ(Option::V4, opt_msg_type->getUniverse()); + EXPECT_EQ(DHO_DHCP_MESSAGE_TYPE, opt_msg_type->getType()); + // Validate the message type from the option we have now created. + uint8_t msg_type = 0; + ASSERT_NO_THROW(msg_type = opt_msg_type->getUint8()); + EXPECT_EQ(DHCPDISCOVER, msg_type); + + // Create another option: DHCP_PARAMETER_REQUEST_LIST + OptionPtr + opt_requested_options(Option::factory(Option::V4, + DHO_DHCP_PARAMETER_REQUEST_LIST)); + // Here is a list of options that we are requesting in the + // server's response. + const uint8_t requested_options[] = { + DHO_SUBNET_MASK, + DHO_BROADCAST_ADDRESS, + DHO_TIME_OFFSET, + DHO_ROUTERS, + DHO_DOMAIN_NAME, + DHO_DOMAIN_NAME_SERVERS, + DHO_HOST_NAME + }; + + OptionBuffer + requested_options_ref(requested_options, + requested_options + sizeof(requested_options)); + + // Get the option buffer. It should hold the combination of values + // listed in requested_options array. However their order can be + // different in general so we need to search each value separatelly. + const OptionBuffer& requested_options_buf = + opt_requested_options->getData(); + EXPECT_EQ(requested_options_ref.size(), requested_options_buf.size()); + size_t matched_num = matchRequestedOptions(requested_options_ref, + requested_options_buf); + // We want exactly the same requested options as listed in + // requested_options array - nothing more or less. + EXPECT_EQ(requested_options_ref.size(), matched_num); +} + +TEST_F(TestControlTest, Options6) { + using namespace isc::dhcp; + + // Lets override the IP version to test V6 options (-6 parameter) + ASSERT_NO_THROW(processCmdLine("perfdhcp -l 127.0.0.1 -6 all")); + + NakedTestControl tc; + tc.registerOptionFactories(); + + // Validate the D6O_ELAPSED_TIME option. + OptionPtr opt_elapsed_time(Option::factory(Option::V6, D6O_ELAPSED_TIME)); + // Validate the option type and universe. + EXPECT_EQ(Option::V6, opt_elapsed_time->getUniverse()); + EXPECT_EQ(D6O_ELAPSED_TIME, opt_elapsed_time->getType()); + // The default value of elapsed time is zero. + uint16_t elapsed_time; + ASSERT_NO_THROW(elapsed_time = opt_elapsed_time->getUint16()); + EXPECT_EQ(0, elapsed_time); + + // With the factory function we may also specify the actual + // value of elapsed time. Let's make use of std::vector + // constructor to create the option buffer, 2 octets long + // with each octet initialized to 0x1. + size_t elapsed_time_buf_size = 2; + uint8_t elapsed_time_pattern = 0x1; + OptionPtr + opt_elapsed_time2(Option::factory(Option::V6, D6O_ELAPSED_TIME, + OptionBuffer(elapsed_time_buf_size, + elapsed_time_pattern))); + + // Any buffer that has size neither equal to 0 nor 2 is considered invalid. + elapsed_time_buf_size = 1; + EXPECT_THROW( + Option::factory(Option::V6, D6O_ELAPSED_TIME, + OptionBuffer(elapsed_time_buf_size, elapsed_time_pattern)), + isc::BadValue + ); + + // Validate the option type and universe. + EXPECT_EQ(Option::V6, opt_elapsed_time2->getUniverse()); + EXPECT_EQ(D6O_ELAPSED_TIME, opt_elapsed_time2->getType()); + // Make sure the getUint16 does not throw exception. It wile throw + // buffer is shorter than 2 octets. + ASSERT_NO_THROW(elapsed_time = opt_elapsed_time2->getUint16()); + // Check the expected value of elapsed time. + EXPECT_EQ(0x0101, elapsed_time); + + // Validate the D6O_RAPID_COMMIT option. + OptionPtr opt_rapid_commit(Option::factory(Option::V6, D6O_RAPID_COMMIT)); + // Validate the option type and universe. + EXPECT_EQ(Option::V6, opt_rapid_commit->getUniverse()); + EXPECT_EQ(D6O_RAPID_COMMIT, opt_rapid_commit->getType()); + // Rapid commit has no data payload. + EXPECT_THROW(opt_rapid_commit->getUint8(), isc::OutOfRange); + + // Validate the D6O_CLIENTID option. + OptionBuffer duid(CommandOptions::instance().getDuidTemplate()); + OptionPtr opt_clientid(Option::factory(Option::V6, D6O_CLIENTID, duid)); + EXPECT_EQ(Option::V6, opt_clientid->getUniverse()); + EXPECT_EQ(D6O_CLIENTID, opt_clientid->getType()); + const OptionBuffer& duid2 = opt_clientid->getData(); + ASSERT_EQ(duid.size(), duid2.size()); + // The Duid we set for option is the same we get. + EXPECT_TRUE(std::equal(duid.begin(), duid.end(), duid2.begin())); + + // Validate the D6O_ORO (Option Request Option). + OptionPtr opt_oro(Option::factory(Option::V6, D6O_ORO)); + // Prepare the reference buffer with requested options. + const uint8_t requested_options[] = { + 0, D6O_NAME_SERVERS, + 0, D6O_DOMAIN_SEARCH, + }; + int requested_options_num = + sizeof(requested_options) / sizeof(requested_options[0]); + OptionBuffer + requested_options_ref(requested_options, + requested_options + sizeof(requested_options)); + // Get the buffer from option. + const OptionBuffer& requested_options_buf = opt_oro->getData(); + // Size of reference buffer and option buffer have to be + // the same for comparison. + EXPECT_EQ(requested_options_ref.size(), requested_options_buf.size()); + // Check if all options in the buffer are matched with reference buffer. + size_t matched_num = matchRequestedOptions6(requested_options_ref, + requested_options_buf); + EXPECT_EQ(requested_options_num, matched_num); + + // Validate the D6O_IA_NA option. + OptionPtr opt_ia_na(Option::factory(Option::V6, D6O_IA_NA)); + EXPECT_EQ(Option::V6, opt_ia_na->getUniverse()); + EXPECT_EQ(D6O_IA_NA, opt_ia_na->getType()); + // Every IA_NA option is expected to start with this sequence. + const uint8_t opt_ia_na_array[] = { + 0, 0, 0, 1, // IAID = 1 + 0, 0, 3600 >> 8, 3600 & 0xff, // T1 = 3600 + 0, 0, 5400 >> 8, 5400 & 0xff, // T2 = 5400 + }; + OptionBuffer opt_ia_na_ref(opt_ia_na_array, + opt_ia_na_array + sizeof(opt_ia_na_array)); + const OptionBuffer& opt_ia_na_buf = opt_ia_na->getData(); + ASSERT_EQ(opt_ia_na_buf.size(), opt_ia_na_ref.size()); + EXPECT_TRUE(std::equal(opt_ia_na_ref.begin(), opt_ia_na_ref.end(), + opt_ia_na_buf.begin())); + + // @todo Add more tests for IA address options. +} + +TEST_F(TestControlTest, Packet4) { + // Use Interface Manager to get the local loopback interface. + // If interface can't be found we don't want to fail test. + std::string loopback_iface(getLocalLoopback()); + if (!loopback_iface.empty()) { + ASSERT_NO_THROW(processCmdLine("perfdhcp -l " + loopback_iface + + " -L 10547 all")); + NakedTestControl tc; + int sock_handle = 0; + // We have to create the socket to setup some parameters of + // outgoing packet. + ASSERT_NO_THROW(sock_handle = tc.openSocket()); + TestControl::TestControlSocket sock(sock_handle); + uint32_t transid = 123; + boost::shared_ptr pkt4(new Pkt4(DHCPDISCOVER, transid)); + // Set parameters on outgoing packet. + ASSERT_NO_THROW(tc.setDefaults4(sock, pkt4)); + // Validate that packet has been setup correctly. + EXPECT_EQ(loopback_iface, pkt4->getIface()); + EXPECT_EQ(sock.ifindex_, pkt4->getIndex()); + EXPECT_EQ(DHCP4_CLIENT_PORT, pkt4->getLocalPort()); + EXPECT_EQ(DHCP4_SERVER_PORT, pkt4->getRemotePort()); + EXPECT_EQ(1, pkt4->getHops()); + EXPECT_EQ(asiolink::IOAddress("255.255.255.255"), + pkt4->getRemoteAddr()); + EXPECT_EQ(asiolink::IOAddress(sock.addr_), pkt4->getLocalAddr()); + EXPECT_EQ(asiolink::IOAddress(sock.addr_), pkt4->getGiaddr()); + } else { + std::cout << "Unable to find the loopback interface. Skip test. " + << std::endl; + } +} + +TEST_F(TestControlTest, Packet6) { + // Use Interface Manager to get the local loopback interface. + // If the interface can't be found we don't want to fail test. + std::string loopback_iface(getLocalLoopback()); + if (!loopback_iface.empty()) { + ASSERT_NO_THROW(processCmdLine("perfdhcp -6 -l " + loopback_iface + + " -L 10547 servers")); + NakedTestControl tc; + int sock_handle = 0; + // Create the socket. It will be needed to set packet's + // parameters. + ASSERT_NO_THROW(sock_handle = tc.openSocket()); + TestControl::TestControlSocket sock(sock_handle); + uint32_t transid = 123; + boost::shared_ptr pkt6(new Pkt6(DHCPV6_SOLICIT, transid)); + // Set packet's parameters. + ASSERT_NO_THROW(tc.setDefaults6(sock, pkt6)); + // Validate if parameters have been set correctly. + EXPECT_EQ(loopback_iface, pkt6->getIface()); + EXPECT_EQ(sock.ifindex_, pkt6->getIndex()); + EXPECT_EQ(DHCP6_CLIENT_PORT, pkt6->getLocalPort()); + EXPECT_EQ(DHCP6_SERVER_PORT, pkt6->getRemotePort()); + EXPECT_EQ(sock.addr_, pkt6->getLocalAddr()); + EXPECT_EQ(asiolink::IOAddress("FF05::1:3"), pkt6->getRemoteAddr()); + } else { + std::cout << "Unable to find the loopback interface. Skip test. " + << std::endl; + } +} + +TEST_F(TestControlTest, Packet4Exchange) { + // Get the local loopback interface to open socket on + // it and test packets exchanges. We don't want to fail + // the test if interface is not available. + std::string loopback_iface(getLocalLoopback()); + if (loopback_iface.empty()) { + std::cout << "Unable to find the loopback interface. Skip test." + << std::endl; + return; + } + + // Set number of iterations to some high value. + const int iterations_num = 100; + processCmdLine("perfdhcp -l " + loopback_iface + + " -r 100 -n 10 -R 20 -L 10547 127.0.0.1"); + // The actual number of iterations will be stored in the + // following variable. + int iterations_performed = 0; + bool use_templates = false; + testPkt4Exchange(iterations_num, iterations_num, use_templates, iterations_performed); + // The command line restricts the number of iterations to 10 + // with -n 10 parameter. + EXPECT_EQ(10, iterations_performed); + + // With the following command line we restrict the maximum + // number of dropped packets to 20% of all. + // Use templates for this test. + processCmdLine("perfdhcp -l " + loopback_iface + + " -r 100 -R 20 -n 20 -D 10% -L 10547" + + " -T ../templates/discover-example.hex" + + " -T ../templates/request4-example.hex" + + " 127.0.0.1"); + // The number iterations is restricted by the percentage of + // dropped packets (-D 10%). We also have to bump up the number + // of iterations because the percentage limitation checks starts + // at packet #10. We expect that at packet #12 the 10% threshold + // will be reached. + const int received_num = 10; + use_templates = true; + testPkt4Exchange(iterations_num, received_num, use_templates, iterations_performed); + EXPECT_EQ(12, iterations_performed); +} + +TEST_F(TestControlTest, Packet6Exchange) { + // Get the local loopback interface to open socket on + // it and test packets exchanges. We don't want to fail + // the test if interface is not available. + std::string loopback_iface(getLocalLoopback()); + if (loopback_iface.empty()) { + std::cout << "Unable to find the loopback interface. Skip test." + << std::endl; + return; + } + + const int iterations_num = 100; + // Set number of iterations to 10. + processCmdLine("perfdhcp -l " + loopback_iface + + " -6 -r 100 -n 10 -R 20 -L 10547 ::1"); + int iterations_performed = 0; + // Set number of received packets equal to number of iterations. + // This simulates no packet drops. + bool use_templates = false; + testPkt6Exchange(iterations_num, iterations_num, use_templates, + iterations_performed); + // Actual number of iterations should be 10. + EXPECT_EQ(10, iterations_performed); + + // The maximum number of dropped packets is 3 (because of -D 3). + use_templates = true; + processCmdLine("perfdhcp -l " + loopback_iface + + " -6 -r 100 -n 10 -R 20 -D 3 -L 10547" + + " -T ../templates/solicit-example.hex" + + " -T ../templates/request6-example.hex ::1"); + // For the first 3 packets we are simulating responses from server. + // For other packets we don't so packet as 4,5,6 will be dropped and + // then test should be interrupted and actual number of iterations will + // be 6. + const int received_num = 3; + testPkt6Exchange(iterations_num, received_num, use_templates, + iterations_performed); + EXPECT_EQ(6, iterations_performed); +} + +TEST_F(TestControlTest, PacketTemplates) { + std::vector template1(256); + std::string file1("../templates/test1.hex"); + std::vector template2(233); + std::string file2("../templates/test2.hex"); + for (int i = 0; i < template1.size(); ++i) { + template1[i] = static_cast(random() % 256); + } + for (int i = 0; i < template2.size(); ++i) { + template2[i] = static_cast(random() % 256); + } + ASSERT_TRUE(createTemplateFile(file1, template1)); + ASSERT_TRUE(createTemplateFile(file2, template2)); + CommandOptions& options = CommandOptions::instance(); + NakedTestControl tc; + + ASSERT_NO_THROW( + processCmdLine("perfdhcp -l 127.0.0.1" + " -T " + file1 + " -T " + file2 + " all") + ); + ASSERT_NO_THROW(tc.initPacketTemplates()); + TestControl::TemplateBuffer buf1; + TestControl::TemplateBuffer buf2; + ASSERT_NO_THROW(buf1 = tc.getTemplateBuffer(0)); + ASSERT_NO_THROW(buf2 = tc.getTemplateBuffer(1)); + ASSERT_EQ(template1.size(), buf1.size()); + ASSERT_EQ(template2.size(), buf2.size()); + EXPECT_TRUE(std::equal(template1.begin(), template1.end(), buf1.begin())); + EXPECT_TRUE(std::equal(template2.begin(), template2.end(), buf2.begin())); +} + +TEST_F(TestControlTest, RateControl) { + // We don't specify the exchange rate here so the aggressivity + // value will determine how many packets are to be send each + // time we query the getNextExchangesNum. + ASSERT_NO_THROW(processCmdLine("perfdhcp -l 127.0.0.1 all")); + CommandOptions& options = CommandOptions::instance(); + + NakedTestControl tc1; + uint64_t xchgs_num = tc1.getNextExchangesNum(); + EXPECT_EQ(options.getAggressivity(), xchgs_num); + + // The exchange rate is now 1 per second. We don't know how many + // exchanges have to initiated exactly but for sure it has to be + // non-zero value. Also, since aggressivity is very high we expect + // that it will not be restricted by aggressivity. + ASSERT_NO_THROW( + processCmdLine("perfdhcp -l 127.0.0.1 -a 1000000 -r 1 all") + ); + NakedTestControl tc2; + xchgs_num = tc2.getNextExchangesNum(); + EXPECT_GT(xchgs_num, 0); + EXPECT_LT(xchgs_num, options.getAggressivity()); + // @todo add more thorough checks for rate values. +}
- Graphical representation of the performance results - presented in table . + Graphical representation of the optimized performance + results presented in table .