#  -*- 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: 73810cd0db69289754b64ed0397d0bedb3bb25d4 $
#
#  Test vectors for DHCPv6 protocol
#
#  Based on https://github.com/the-tcpdump-group/tcpdump/blob/master/tests/dhcpv6-ntp-server.pcap
#

proto dhcpv6
proto-dictionary dhcpv6
fuzzer-out dhcpv6

#
#  1.
#
# [ DHCPv6 Reply Message ]
#   msgtype   = REPLY
#   trid      = 0xf69b57
# [ DHCP6 Client Identifier Option ]
#    optcode   = CLIENTID
#    optlen    = 14
#    \duid      \
#     |[ DUID - Link-layer address plus time ]
#     |  type      = Link-layer address plus time
#     |  hwtype    = Ethernet (10Mb)
#     |  timeval   = Thu, 04 Apr 2013 09:58:23 -0300 (1365069503)
#     |  lladdr    = 00:0c:29:38:f3:68
# [ DHCP6 Server Identifier Option ]
#     optcode   = SERVERID
#     optlen    = 14
#     \duid      \
#      |[ DUID - Link-layer address plus time ]
#      |  type      = Link-layer address plus time
#      |  hwtype    = Ethernet (10Mb)
#      |  timeval   = Thu, 04 Apr 2013 01:34:19 -0300 (1365039259)
#      |  lladdr    = 00:0c:29:9b:a1:53
# [ Unknown DHCPv6 Option ]
#      optcode   = 56
#      optlen    = 61
#      data      = '\x00\x01\x00\x10*\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x02\x00\x10\xff\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x01\x00\x03\x00\x11\x03ntp\x07example\x03com\x00'
#
decode-proto 07 f6 9b 57 00 01 00 0e 00 01 00 01 18 f0 0b 3f 00 0c 29 38 f3 68 00 02 00 0e 00 01 00 01 18 ef 95 1b 00 0c 29 9b a1 53 00 38 00 3d 00 01 00 10 2a 01 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 10 ff 05 00 00 00 00 00 00 00 00 00 00 00 00 01 01 00 03 00 11 03 6e 74 70 07 65 78 61 6d 70 6c 65 03 63 6f 6d 00
match Packet-Type = ::Reply, Transaction-ID = 0xf69b57, Client-ID = { DUID = ::LLT, DUID.LLT = { Hardware-Type = ::Ethernet, Time = "2013-04-04T09:58:23Z", Hardware-Type.Ethernet = { Address = 00:0c:29:38:f3:68 } } }, Server-ID = { DUID = ::LLT, DUID.LLT = { Hardware-Type = ::Ethernet, Time = "2013-04-04T01:34:19Z", Hardware-Type.Ethernet = { Address = 00:0c:29:9b:a1:53 } } }, NTP-Server = { Address = 2a01::1, Multicast-Address = ff05::101, FQDN = "ntp.example.com" }

encode-proto -
match 07 f6 9b 57 00 01 00 0e 00 01 00 01 18 f0 0b 3f 00 0c 29 38 f3 68 00 02 00 0e 00 01 00 01 18 ef 95 1b 00 0c 29 9b a1 53 00 38 00 3d 00 01 00 10 2a 01 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 10 ff 05 00 00 00 00 00 00 00 00 00 00 00 00 01 01 00 03 00 11 03 6e 74 70 07 65 78 61 6d 70 6c 65 03 63 6f 6d 00

count
match 7
