From: Alan T. DeKok Date: Sun, 15 Aug 2021 20:40:39 +0000 (-0400) Subject: add tests for arrays of DNS labels in a struct X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ae5bd8ae8aa2433bf8def41efa5c784da69fabe;p=thirdparty%2Ffreeradius-server.git add tests for arrays of DNS labels in a struct --- diff --git a/src/tests/unit/protocols/dhcpv6/rfc6731.txt b/src/tests/unit/protocols/dhcpv6/rfc6731.txt new file mode 100644 index 00000000000..2d7da73b8dc --- /dev/null +++ b/src/tests/unit/protocols/dhcpv6/rfc6731.txt @@ -0,0 +1,46 @@ +# -*- text -*- +# Copyright (C) 2021 Network RADIUS SARL (legal@networkradius.com) +# This work is licensed under CC-BY version 4.0 https://creativecommons.org/licenses/by/4.0 +# +# Version $Id$ +# + +# +# Test vectors for DHCPv6 protocol +# +proto dhcpv6 +proto-dictionary dhcpv6 + +# 0 1 2 3 +# 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +# | OPTION_RDNSS_SELECTION | option-len | +# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +# | | +# | DNS-recursive-name-server (IPv6 address) | +# | | +# | | +# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +# | Reserved |prf| | +# +-+-+-+-+-+-+-+-+ Domains and networks | +# | (variable length) | +# | | +# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +encode-pair RDNSS-Selection = { DNS-Recursive-Name-Server = ::1, Preference = High, FQDN = ns1.example.com } +match 00 4a 00 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 01 03 6e 73 31 07 65 78 61 6d 70 6c 65 03 63 6f 6d 00 + +decode-pair - +match RDNSS-Selection.DNS-Recursive-Name-Server = ::1, RDNSS-Selection.Preference = High, RDNSS-Selection.FQDN = "ns1.example.com" + +# +# RFC 8415 Section 10 says that DNS labels MUST NOT be stored in compressed form. +# +encode-pair RDNSS-Selection = { DNS-Recursive-Name-Server = ::1, Preference = High, FQDN = ns1.example.com, FQDN = ns2.example.com } +match 00 4a 00 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 01 03 6e 73 31 07 65 78 61 6d 70 6c 65 03 63 6f 6d 00 03 6e 73 32 07 65 78 61 6d 70 6c 65 03 63 6f 6d 00 + +decode-pair - +match RDNSS-Selection.DNS-Recursive-Name-Server = ::1, RDNSS-Selection.Preference = High, RDNSS-Selection.FQDN = "ns1.example.com", RDNSS-Selection.FQDN = "ns2.example.com" + +count +match 10