]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add tests for DHCPv6 / rfc6355
authorJorge Pereira <jpereiran@gmail.com>
Thu, 24 Oct 2019 17:22:23 +0000 (14:22 -0300)
committerAlan DeKok <aland@freeradius.org>
Tue, 29 Oct 2019 01:38:31 +0000 (21:38 -0400)
src/tests/unit/all.mk
src/tests/unit/dhcpv6_rfc6355.txt [new file with mode: 0644]

index 5a58b930e4ad7bf7a87c554a66d03e3dcf07199c..6735a0eddb8974b86a3a7ae901d35deb0f33be2f 100644 (file)
@@ -33,6 +33,7 @@ FILES  := \
        dhcpv6_rfc3315.txt \
        dhcpv6_rfc3319.txt \
        dhcpv6_rfc3646.txt \
+       dhcpv6_rfc6355.txt \
        regex.txt \
        escape.txt \
        condition.txt \
diff --git a/src/tests/unit/dhcpv6_rfc6355.txt b/src/tests/unit/dhcpv6_rfc6355.txt
new file mode 100644 (file)
index 0000000..0570549
--- /dev/null
@@ -0,0 +1,49 @@
+#
+#  Test vectors for DHCPv6 attributes for DUID-UUID
+#
+load dhcpv6
+dictionary-load dhcpv6
+
+#
+#  Encoding an option header:
+#
+#   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_CLIENTID        |          option-len           |
+#  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+#
+
+#
+#  4.  DUID-UUID Format
+#
+#  The DUID-UUID is carried within Client Identifier or Server
+#  Identifier options.  It has the following format:
+#
+#  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
+#  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+#  |          DUID-Type (4)        |    UUID (128 bits)            |
+#  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               |
+#  |                                                               |
+#  |                                                               |
+#  |                                -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+#  |                                |
+#  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+#
+#  Figure 1: DUID-UUID Format
+#
+#  DUID-Type -  DUID-UUID (4) - (16 bits)
+#  UUID -  An [RFC4122] UUID (128 bits)
+#
+
+#
+#  Client Identifier
+#
+
+#  Define the DUID-LLT + DUID
+encode-pair Client-ID-DUID = Client-ID-DUID-UUID
+match 00 01 00 02 00 04
+
+decode-pair -
+match Client-ID-DUID = Client-ID-DUID-UUID