]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
update for structs, and add tests
authorAlan T. DeKok <aland@freeradius.org>
Sat, 5 Dec 2020 14:25:31 +0000 (09:25 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 6 Dec 2020 02:48:09 +0000 (21:48 -0500)
share/dictionary/dhcpv6/dictionary.rfc4776
src/tests/unit/protocols/dhcpv6/rfc4776.txt [new file with mode: 0644]

index 2ed9503a8ed85cfacaced556318afbeccf2b5e27..762b4b857885ead491f0e62dcf8453be26935f92 100644 (file)
 #
 ##############################################################################
 
-ATTRIBUTE      Geoconf-Civic                           36      octets          # Complex struct see RFC 4776
+ATTRIBUTE      Geoconf-Civic                           36      struct
+MEMBER         What                                    uint8
+VALUE  What                            DHCP-Server-Location    0
+VALUE  What                            Closest-Network-Element 1
+VALUE  What                            Client-Location         2
+
+#
+#  2 letter ISO 3166 country code
+#
+MEMBER         Country-Code                            string[2]
+
+#
+#  @todo - define this option for DHCPv4, and then have the option here
+#  be a "group" which references the DHCPv4 options.  That _should_ get
+#  everything encoded correctly.
+#
+MEMBER         Civic-Address-Elements                  octets # really 8-bit DHCPv4 option
diff --git a/src/tests/unit/protocols/dhcpv6/rfc4776.txt b/src/tests/unit/protocols/dhcpv6/rfc4776.txt
new file mode 100644 (file)
index 0000000..0065e73
--- /dev/null
@@ -0,0 +1,22 @@
+#  -*- text -*-
+#  Copyright (C) 2019 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$
+#
+
+proto dhcpv6
+proto-dictionary dhcpv6
+
+#
+#  A1 = "ON"
+#
+encode-pair Geoconf-Civic = { What = Client-Location, Country-Code = "CA", Civic-Address-Elements = 0x01024f4e }
+match 00 24 00 07 02 43 41 01 02 4f 4e
+
+decode-pair -
+match Geoconf-Civic.What = Client-Location, Geoconf-Civic.Country-Code = "CA", Geoconf-Civic.Civic-Address-Elements = 0x01024f4e
+#match Geoconf-Civic = { What = Client-Location, Country-Code = "CA", Civic-Address-Elements = 0x01024f4e }
+
+count
+match 6