#  -*- 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: 1b80eab98e6c28d84427876152f78b2046d5319a $
#

#
#  Test vectors for DHCPv6 protocol
#
proto dhcpv6
proto-dictionary dhcpv6
fuzzer-out dhcpv6

#
#  4.  The DHCPv6 Client FQDN Option
#
#  The format of the DHCPv6 Client FQDN option is shown below:
#
#  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_FQDN          |         option-len            |
#  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#  |   flags       |                                               |
#  +-+-+-+-+-+-+-+-+                                               |
#  .                                                               .
#  .                          domain-name                          .
#  .                                                               .
#  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#
#   option-code      OPTION_CLIENT_FQDN (39)
#
#   option-len       1 + length of domain name
#
#   flags            flag bits used between client and server to
#                    negotiate who performs which updates
#
#   domain-name      the partial or fully qualified domain name
#                    (with length option-len - 1)
#

encode-pair Client-FQDN.No-Server-Update = no, Client-FQDN.Server-Override = yes, Client-FQDN.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 = { Reserved = 0, No-Server-Update = no, Server-Override = yes, Server-Update = yes, Domain-Name = "tapioca01" }

# let's try another combination
encode-pair Client-FQDN.No-Server-Update = yes, Client-FQDN.Server-Override = no, Client-FQDN.Server-Update = no, Client-FQDN.Domain-Name = "tapioca01"
match 00 27 00 0b 04 09 74 61 70 69 6f 63 61 30 31

decode-pair -
match Client-FQDN = { Reserved = 0, No-Server-Update = yes, Server-Override = no, Server-Update = no, Domain-Name = "tapioca01" }

count
match 11
