#  -*- 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: 52b2d2ec7a02386a288d97bb90a1d20ae60232c7 $
#
proto dhcpv6
proto-dictionary dhcpv6
fuzzer-out dhcpv6

encode-pair IA-Addr.IPv6-Address = 2001:db8::c:78eb, IA-Addr.Valid-Lifetime = 3600
match 00 05 00 18 20 01 0d b8 00 00 00 00 00 00 00 00 00 0c 78 eb 00 00 00 00 00 00 0e 10

#
#  Decode ALL fields.
#
decode-pair -
match IA-Addr = { IPv6-Address = 2001:db8::c:78eb, Preferred-Lifetime = 0, Valid-Lifetime = 3600 }

#
#  Allow structs as groups, in which case they are encoded properly.
#
encode-pair IA-Addr = { IPv6-Address = 2001:db8::c:78eb, Valid-Lifetime = 3600 }
match 00 05 00 18 20 01 0d b8 00 00 00 00 00 00 00 00 00 0c 78 eb 00 00 00 00 00 00 0e 10

#
#  BUT if we are given the children out of order, we sort them, and put them in place properly.
#
encode-pair IA-Addr = { Valid-Lifetime = 3600, IPv6-Address = 2001:db8::c:78eb }
match 00 05 00 18 20 01 0d b8 00 00 00 00 00 00 00 00 00 0c 78 eb 00 00 00 00 00 00 0e 10

encode-proto Packet-Type = Reply, Transaction-ID = 0x000005, Client-ID.DUID = LLT, Client-ID.DUID.LLT.Hardware-Type = Ethernet, Client-ID.DUID.LLT.Time = "Nov 27 2020 16:46:12 UTC", Client-ID.DUID.LLT.Hardware-Type.Ethernet.Address = 00:0c:01:02:03:06, IA-NA.IAID = 1, IA-NA.Options = { IA-Addr.IPv6-Address = 2001:db8::c:78eb, IA-Addr.Valid-Lifetime = 3600}, Server-ID.DUID = LL, Server-ID.DUID.LL.Hardware-Type = Ethernet, Server-ID.DUID.LL.Hardware-Type.Ethernet.Address = 00:aa:bb:cc:dd:ff

match 07 00 00 05 00 01 00 0e 00 01 00 01 27 53 e9 d4 00 0c 01 02 03 06 00 03 00 28 00 00 00 01 00 00 00 00 00 00 00 00 00 05 00 18 20 01 0d b8 00 00 00 00 00 00 00 00 00 0c 78 eb 00 00 00 00 00 00 0e 10 00 02 00 0a 00 03 00 01 00 aa bb cc dd ff


encode-proto Packet-Type = Request, Transaction-ID = 0xabcdef, Client-ID.DUID = UUID, Client-ID.DUID.UUID.Value = 0x000102030405060708090a0b0c0d0e0f
match 03 ab cd ef 00 01 00 12 00 04 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f

decode-proto -
match Packet-Type = ::Request, Transaction-ID = 0xabcdef, Client-ID = { DUID = ::UUID, DUID.UUID = { Value = 0x000102030405060708090a0b0c0d0e0f } }

count
match 17
