]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Update 'Client-FQDN-Flag' to use bit fields
authorJorge Pereira <jpereiran@gmail.com>
Tue, 19 Nov 2019 01:05:13 +0000 (22:05 -0300)
committerAlan DeKok <aland@freeradius.org>
Tue, 19 Nov 2019 01:20:44 +0000 (20:20 -0500)
share/dictionary/dhcpv6/dictionary.rfc4704
src/tests/unit/protocols/dhcpv6/rfc4704.txt

index 7d100808f9b44adf23881f314f4314b935dcf097..8091c43cd2a67c82720782c764142ebb55ca1783 100644 (file)
@@ -12,9 +12,8 @@
 ##############################################################################
 
 ATTRIBUTE      Client-FQDN                             39      struct
-MEMBER         Client-FQDN-Flags                       uint8
+MEMBER         Client-FQDN-Flag-Reserved               bit[5]
+MEMBER         Client-FQDN-Flag-No-Server-Update                       bit[1]
+MEMBER         Client-FQDN-Flag-Server-Override                bit[1]
+MEMBER         Client-FQDN-Flag-Server-Update          bit[1]
 MEMBER         Client-FQDN-Domain-Name                 string          partial_dns_label
-
-VALUE  Client-FQDN-Flags                       Server-Update  1        # really bit field
-VALUE  Client-FQDN-Flags                       Server-Override  2      # really bit field
-VALUE  Client-FQDN-Flags                       No-Server-Update  4     # really bit field
index 72ab6496a4a65fe5d1c6e91f73dfe451fa7a3039..47aff3bf7b250ef0359855433f67b8f1d8293d48 100644 (file)
@@ -37,15 +37,18 @@ proto-dictionary dhcpv6
 #                    (with length option-len - 1)
 #
 
-encode-pair Client-FQDN-Flags = Server-Update, Client-FQDN-Domain-Name = "tapioca01"
-match 00 27 00 0b 01 09 74 61 70 69 6f 63 61 30 31
+encode-pair Client-FQDN-Flag-No-Server-Update = no, Client-FQDN-Flag-Server-Override = yes, Client-FQDN-Flag-Server-Update = yes, Client-FQDN-Domain-Name = "tapioca01"
+match 00 27 00 0b 03 09 74 61 70 69 6f 63 61 30 31
+
+decode-pair -
+match Client-FQDN-Flag-Reserved = 0, Client-FQDN-Flag-No-Server-Update = no, Client-FQDN-Flag-Server-Override = yes, Client-FQDN-Flag-Server-Update = yes, Client-FQDN-Domain-Name = "tapioca01"
+
+# let's try another combination
+encode-pair Client-FQDN-Flag-No-Server-Update = yes, Client-FQDN-Flag-Server-Override = no, Client-FQDN-Flag-Server-Update = no, Client-FQDN-Domain-Name = "tapioca01"
+match 00 27 00 0b 04 09 74 61 70 69 6f 63 61 30 31
 
-#
-# TODO: The current API do not support 'struct' attributes with
-# fields like 'string encode=dns_label'. e.g: Client-FQDN-Domain-Name
-#
 decode-pair -
-match Client-FQDN-Flags = Server-Update, Client-FQDN-Domain-Name = "tapioca01"
+match Client-FQDN-Flag-Reserved = 0, Client-FQDN-Flag-No-Server-Update = yes, Client-FQDN-Flag-Server-Override = no, Client-FQDN-Flag-Server-Update = no, Client-FQDN-Domain-Name = "tapioca01"
 
 count
-match 6
+match 10