From: Evan Hunt Date: Thu, 23 Jul 2026 05:04:50 +0000 (-0700) Subject: move wire-test to bin/tools/named-wireformat X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4bd24df57ef803a0305fb0bbee81c609f747f421;p=thirdparty%2Fbind9.git move wire-test to bin/tools/named-wireformat The wire-test has been renamed to named-wireformat and moved from bin/tests/system to bin/tools. --- diff --git a/bin/tests/system/dnstap/tests.sh b/bin/tests/system/dnstap/tests.sh index 3d34c6b87f..8ad7dbaa2a 100644 --- a/bin/tests/system/dnstap/tests.sh +++ b/bin/tests/system/dnstap/tests.sh @@ -489,7 +489,7 @@ fi echo_i "checking dnstap-read hex output" ret=0 hex=$($DNSTAPREAD -x ns3/dnstap.out | tail -1) -echo $hex | $WIRETEST >dnstap.hex +echo $hex | $WIREFORMAT >dnstap.hex grep 'status: NOERROR' dnstap.hex >/dev/null 2>&1 || ret=1 grep 'ANSWER: 3, AUTHORITY: 0' dnstap.hex >/dev/null 2>&1 || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi diff --git a/bin/tests/system/isctest/vars/basic.py b/bin/tests/system/isctest/vars/basic.py index 9d8783c37b..a5b625fe1a 100644 --- a/bin/tests/system/isctest/vars/basic.py +++ b/bin/tests/system/isctest/vars/basic.py @@ -44,7 +44,7 @@ BASIC_VARS = { "SIGNER": f"{BUILD_VARS['TOP_BUILDDIR']}/dnssec-signzone", "TSIGKEYGEN": f"{BUILD_VARS['TOP_BUILDDIR']}/tsig-keygen", "VERIFY": f"{BUILD_VARS['TOP_BUILDDIR']}/dnssec-verify", - "WIRETEST": f"{BUILD_VARS['TOP_BUILDDIR']}/wire-test", + "WIREFORMAT": f"{BUILD_VARS['TOP_BUILDDIR']}/named-wireformat", "BIGKEY": f"{BUILD_VARS['TOP_BUILDDIR']}/bigkey", "PIPEQUERIES": f"{BUILD_VARS['TOP_BUILDDIR']}/pipequeries", "TMPDIR": os.getenv("TMPDIR", "/tmp"), diff --git a/bin/tools/meson.build b/bin/tools/meson.build index 9557de1d98..7dfe9d5f55 100644 --- a/bin/tools/meson.build +++ b/bin/tools/meson.build @@ -17,7 +17,7 @@ named_journalprint_src += files('named-journalprint.c') named_nzd2nzf_src += files('named-nzd2nzf.c') named_rrchecker_src += files('named-rrchecker.c') nsec3hash_src += files('nsec3hash.c') -wiretest_src += files('wire-test.c') +wireformat_src += files('named-wireformat.c') manrst_srcset.add(when: 'HAVE_DNSTAP', if_true: files('dnstap-read.rst')) manrst_srcset.add( diff --git a/bin/tools/wire-test.c b/bin/tools/named-wireformat.c similarity index 100% rename from bin/tools/wire-test.c rename to bin/tools/named-wireformat.c diff --git a/bin/tools/named-wireformat.rst b/bin/tools/named-wireformat.rst new file mode 100644 index 0000000000..736c5b61d2 --- /dev/null +++ b/bin/tools/named-wireformat.rst @@ -0,0 +1,86 @@ +.. Copyright (C) Internet Systems Consortium, Inc. ("ISC") +.. +.. SPDX-License-Identifier: MPL-2.0 +.. +.. This Source Code Form is subject to the terms of the Mozilla Public +.. License, v. 2.0. If a copy of the MPL was not distributed with this +.. file, you can obtain one at https://mozilla.org/MPL/2.0/. +.. +.. See the COPYRIGHT file distributed with this work for additional +.. information regarding copyright ownership. + +.. highlight: console + +.. iscman:: named-wireformat +.. program:: named-wireformat +.. _man_named-wireformat: + +named-wireformat - parse DNS wire format messages +------------------------------------------------- + +Synopsis +~~~~~~~~ + +:program:`named-wireformat` [**-b**] [**-d**] [**-h**] [**-m** flag] [**-p**] [**-r**] [**-s**] [**-t**] [{filename}] + +Description +~~~~~~~~~~~ + +:program:`named-wireformat` reads a DNS message in wire format, either +in hexidecimal form or as raw data, from a file or from standard input, +and translates it to text format to check whether it is formatted correctly. + +Options +~~~~~~~ + +.. option:: -b + + Use best-effort parsing. Errors in message content will be + ignored, so long as the message itself can still be parsed as valid + DNS wire data. + +.. option:: -d + + Read input as raw binary data instead of hexidecimal text. + +.. option:: -h + + Print out the help menu. + +.. option:: -m flag + + Turn on memory debugging flags. Possible flags are ``usage``, + ``trace`` and ``record``. + +.. option:: -p + + Preserve the order of records in the message, instead of sorting + by name and type. + +.. option:: -r + + After parsing and displaying the input message, render it back to wire + format, parse that, and display it again. This is used to confirm + that parsing and rendering are idempotent. + +.. option:: -s + + Print memory statistics on shutdown. + +.. option:: -t + + Parse the input as a TCP DNS message, with a two-byte length header. + +Arguments +~~~~~~~~~ + +.. option:: filename + + If specified, the message to be parsed is read from this file. + Otherwise, it is read from the standard input. + +See Also +~~~~~~~~ + +:iscman:`named-rrchecker(8) `, +BIND 9 Administrator Reference Manual. diff --git a/meson.build b/meson.build index 4bf9e386c8..88e554e559 100644 --- a/meson.build +++ b/meson.build @@ -1253,7 +1253,7 @@ nsupdate_src = [] rndc_confgen_src = [] rndc_src = [] tsig_keygen_src = [] -wiretest_src = [] +wireformat_src = [] filter_a_src = [] filter_aaaa_src = [] @@ -1884,8 +1884,8 @@ executable( ) executable( - 'wire-test', - wiretest_src, + 'named-wireformat', + wireformat_src, export_dynamic: true, implicit_include_directories: false, install: true,