From: Jorge Pereira Date: Tue, 19 Nov 2019 01:05:13 +0000 (-0300) Subject: Update 'Client-FQDN-Flag' to use bit fields X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26a730caeef2279a9a09fc869a5db7bacedc02f2;p=thirdparty%2Ffreeradius-server.git Update 'Client-FQDN-Flag' to use bit fields --- diff --git a/share/dictionary/dhcpv6/dictionary.rfc4704 b/share/dictionary/dhcpv6/dictionary.rfc4704 index 7d100808f9b..8091c43cd2a 100644 --- a/share/dictionary/dhcpv6/dictionary.rfc4704 +++ b/share/dictionary/dhcpv6/dictionary.rfc4704 @@ -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 diff --git a/src/tests/unit/protocols/dhcpv6/rfc4704.txt b/src/tests/unit/protocols/dhcpv6/rfc4704.txt index 72ab6496a4a..47aff3bf7b2 100644 --- a/src/tests/unit/protocols/dhcpv6/rfc4704.txt +++ b/src/tests/unit/protocols/dhcpv6/rfc4704.txt @@ -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