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

proto dhcpv6
proto-dictionary dhcpv6
fuzzer-out dhcpv6

#
#  1.
#
# [ DHCPv6 Solicit Message ]
#   msgtype   = SOLICIT
#   trid      = 0xe1e093
# [ DHCP6 Client Identifier Option ]
#    optcode   = CLIENTID
#    optlen    = 10
#    \duid      \
#     |[ DUID - Based on Link-layer Address ]
#     |  type      = Link-layer Address
#     |  hwtype    = Ethernet (10Mb)
#     |  lladdr    = 00:01:02:03:04:05
# [ DHCP6 Option Request Option ]
#     optcode   = ORO
#     optlen    = 4
#     reqopts   = [DNS Recursive Name Server Option, Domain Search List option]
# [ DHCP6 Elapsed Time Option ]
#      optcode   = ELAPSED_TIME
#      optlen    = 2
#      elapsedtime= 0.00 sec
# [ DHCP6 Option - Identity Association for Prefix Delegation ]
#       optcode   = OPTION_IA_PD
#       optlen    = 12
#       iaid      = 0x2030405
#       T1        = 3600
#       T2        = 5400
#       \iapdopt   \
#
decode-proto 01 e1 e0 93 00 01 00 0a 00 03 00 01 00 01 02 03 04 05 00 06 00 04 00 17 00 18 00 08 00 02 00 00 00 19 00 0c 02 03 04 05 00 00 0e 10 00 00 15 18
match Packet-Type = ::Solicit, Transaction-ID = 0xe1e093, Client-ID = { DUID = ::LL, DUID.LL = { Hardware-Type = ::Ethernet, Hardware-Type.Ethernet = { Address = 00:01:02:03:04:05 } } }, Option-Request = ::DNS-Servers, Option-Request = ::Domain-List, Elapsed-Time = 0, IA-PD = { IAID = 33752069, T1 = 3600, T2 = 5400 }

encode-proto -
match 01 e1 e0 93 00 01 00 0a 00 03 00 01 00 01 02 03 04 05 00 06 00 04 00 17 00 18 00 08 00 02 00 00 00 19 00 0c 02 03 04 05 00 00 0e 10 00 00 15 18

#
#  2.
#
# [ DHCPv6 Advertise Message ]
#   msgtype   = ADVERTISE
#   trid      = 0xe1e093
# [ DHCP6 Option - Identity Association for Prefix Delegation ]
#    optcode   = OPTION_IA_PD
#    optlen    = 41
#    iaid      = 0x2030405
#    T1        = 3600
#    T2        = 5400
#    \iapdopt   \
#     |[ DHCP6 Option - IA_PD Prefix option ]
#     |  optcode   = OPTION_IAPREFIX
#     |  optlen    = 25
#     |  preflft   = 4500
#     |  validlft  = 7200
#     |  plen      = 56
#     |  prefix    = 2a00:1:1:100::
#     |  iaprefopts= ''
# [ DHCP6 Client Identifier Option ]
#     optcode   = CLIENTID
#     optlen    = 10
#     \duid      \
#      |[ DUID - Based on Link-layer Address ]
#      |  type      = Link-layer Address
#      |  hwtype    = Ethernet (10Mb)
#      |  lladdr    = 00:01:02:03:04:05
# [ 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   = Mon, 26 Nov 2012 15:39:05 -0300 (1353944345)
#       |  lladdr    = 00:11:22:33:44:55
#
decode-proto 02 e1 e0 93 00 19 00 29 02 03 04 05 00 00 0e 10 00 00 15 18 00 1a 00 19 00 00 11 94 00 00 1c 20 38 2a 00 00 01 00 01 01 00 00 00 00 00 00 00 00 00 00 01 00 0a 00 03 00 01 00 01 02 03 04 05 00 02 00 0e 00 01 00 01 18 46 49 99 00 11 22 33 44 55
match Packet-Type = ::Advertise, Transaction-ID = 0xe1e093, IA-PD = { IAID = 33752069, T1 = 3600, T2 = 5400, Options = { IA-PD-Prefix = { Preferred-Lifetime = 4500, Valid-Lifetime = 7200, IPv6-Prefix = 2a00:1:1:100::/56 } } }, Client-ID = { DUID = ::LL, DUID.LL = { Hardware-Type = ::Ethernet, Hardware-Type.Ethernet = { Address = 00:01:02:03:04:05 } } }, Server-ID = { DUID = ::LLT, DUID.LLT = { Hardware-Type = ::Ethernet, Time = "2012-11-26T15:39:05Z", Hardware-Type.Ethernet = { Address = 00:11:22:33:44:55 } } }

encode-proto -
match 02 e1 e0 93 00 19 00 29 02 03 04 05 00 00 0e 10 00 00 15 18 00 1a 00 19 00 00 11 94 00 00 1c 20 38 2a 00 00 01 00 01 01 00 00 00 00 00 00 00 00 00 00 01 00 0a 00 03 00 01 00 01 02 03 04 05 00 02 00 0e 00 01 00 01 18 46 49 99 00 11 22 33 44 55


#
#  3.
#
# [ DHCPv6 Request Message ]
#   msgtype   = REQUEST
#   trid      = 0x12b08a
# [ DHCP6 Client Identifier Option ]
#    optcode   = CLIENTID
#    optlen    = 10
#    \duid      \
#     |[ DUID - Based on Link-layer Address ]
#     |  type      = Link-layer Address
#     |  hwtype    = Ethernet (10Mb)
#     |  lladdr    = 00:01:02:03:04:05
# [ 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   = Mon, 26 Nov 2012 15:39:05 -0300 (1353944345)
#      |  lladdr    = 00:11:22:33:44:55
# [ DHCP6 Option Request Option ]
#      optcode   = ORO
#      optlen    = 4
#      reqopts   = [DNS Recursive Name Server Option, Domain Search List option]
# [ DHCP6 Elapsed Time Option ]
#       optcode   = ELAPSED_TIME
#       optlen    = 2
#       elapsedtime= 0.00 sec
# [ DHCP6 Option - Identity Association for Prefix Delegation ]
#        optcode   = OPTION_IA_PD
#        optlen    = 41
#        iaid      = 0x2030405
#        T1        = 3600
#        T2        = 5400
#        \iapdopt   \
#         |[ DHCP6 Option - IA_PD Prefix option ]
#         |  optcode   = OPTION_IAPREFIX
#         |  optlen    = 25
#         |  preflft   = 7200
#         |  validlft  = 7500
#         |  plen      = 56
#         |  prefix    = 2a00:1:1:100::
#         |  iaprefopts= ''
#
decode-proto 03 12 b0 8a 00 01 00 0a 00 03 00 01 00 01 02 03 04 05 00 02 00 0e 00 01 00 01 18 46 49 99 00 11 22 33 44 55 00 06 00 04 00 17 00 18 00 08 00 02 00 00 00 19 00 29 02 03 04 05 00 00 0e 10 00 00 15 18 00 1a 00 19 00 00 1c 20 00 00 1d 4c 38 2a 00 00 01 00 01 01 00 00 00 00 00 00 00 00 00
match Packet-Type = ::Request, Transaction-ID = 0x12b08a, Client-ID = { DUID = ::LL, DUID.LL = { Hardware-Type = ::Ethernet, Hardware-Type.Ethernet = { Address = 00:01:02:03:04:05 } } }, Server-ID = { DUID = ::LLT, DUID.LLT = { Hardware-Type = ::Ethernet, Time = "2012-11-26T15:39:05Z", Hardware-Type.Ethernet = { Address = 00:11:22:33:44:55 } } }, Option-Request = ::DNS-Servers, Option-Request = ::Domain-List, Elapsed-Time = 0, IA-PD = { IAID = 33752069, T1 = 3600, T2 = 5400, Options = { IA-PD-Prefix = { Preferred-Lifetime = 7200, Valid-Lifetime = 7500, IPv6-Prefix = 2a00:1:1:100::/56 } } }

encode-proto -
match 03 12 b0 8a 00 01 00 0a 00 03 00 01 00 01 02 03 04 05 00 02 00 0e 00 01 00 01 18 46 49 99 00 11 22 33 44 55 00 06 00 04 00 17 00 18 00 08 00 02 00 00 00 19 00 29 02 03 04 05 00 00 0e 10 00 00 15 18 00 1a 00 19 00 00 1c 20 00 00 1d 4c 38 2a 00 00 01 00 01 01 00 00 00 00 00 00 00 00 00

#
#  4.
#
# [ DHCPv6 Reply Message ]
#   msgtype   = REPLY
#   trid      = 0x12b08a
# [ DHCP6 Option - Identity Association for Prefix Delegation ]
#    optcode   = OPTION_IA_PD
#    optlen    = 41
#    iaid      = 0x2030405
#    T1        = 3600
#    T2        = 5400
#    \iapdopt   \
#     |[ DHCP6 Option - IA_PD Prefix option ]
#     |  optcode   = OPTION_IAPREFIX
#     |  optlen    = 25
#     |  preflft   = 4500
#     |  validlft  = 7200
#     |  plen      = 56
#     |  prefix    = 2a00:1:1:100::
#     |  iaprefopts= ''
# [ DHCP6 Client Identifier Option ]
#     optcode   = CLIENTID
#     optlen    = 10
#     \duid      \
#      |[ DUID - Based on Link-layer Address ]
#      |  type      = Link-layer Address
#      |  hwtype    = Ethernet (10Mb)
#      |  lladdr    = 00:01:02:03:04:05
# [ 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   = Mon, 26 Nov 2012 15:39:05 -0300 (1353944345)
#       |  lladdr    = 00:11:22:33:44:55
#
decode-proto 07 12 b0 8a 00 19 00 29 02 03 04 05 00 00 0e 10 00 00 15 18 00 1a 00 19 00 00 11 94 00 00 1c 20 38 2a 00 00 01 00 01 01 00 00 00 00 00 00 00 00 00 00 01 00 0a 00 03 00 01 00 01 02 03 04 05 00 02 00 0e 00 01 00 01 18 46 49 99 00 11 22 33 44 55
match Packet-Type = ::Reply, Transaction-ID = 0x12b08a, IA-PD = { IAID = 33752069, T1 = 3600, T2 = 5400, Options = { IA-PD-Prefix = { Preferred-Lifetime = 4500, Valid-Lifetime = 7200, IPv6-Prefix = 2a00:1:1:100::/56 } } }, Client-ID = { DUID = ::LL, DUID.LL = { Hardware-Type = ::Ethernet, Hardware-Type.Ethernet = { Address = 00:01:02:03:04:05 } } }, Server-ID = { DUID = ::LLT, DUID.LLT = { Hardware-Type = ::Ethernet, Time = "2012-11-26T15:39:05Z", Hardware-Type.Ethernet = { Address = 00:11:22:33:44:55 } } }

encode-proto -
match 07 12 b0 8a 00 19 00 29 02 03 04 05 00 00 0e 10 00 00 15 18 00 1a 00 19 00 00 11 94 00 00 1c 20 38 2a 00 00 01 00 01 01 00 00 00 00 00 00 00 00 00 00 01 00 0a 00 03 00 01 00 01 02 03 04 05 00 02 00 0e 00 01 00 01 18 46 49 99 00 11 22 33 44 55

count
match 19

