legal logging hook should save state of lease added via lease4/6-add commands
Found out while I was working on #1022 (closed) Lease4/6-add commands are related to legal logging hook. If administrator is able to add lease with different states - it should be logged when legal logging hook is enabled. e.g.:
commands and result:
'{"command": "lease6-add","arguments": {"state": 2, "subnet-id": 1,"ip-address": "2001:db8:1::1","duid": "1a:1b:1c:1d:1e:1f:20:21:22:23:24","iaid": 1234}}'
{
"result": 0,
"text": "Lease for address 2001:db8:1::1, subnet-id 1 added."
}
'{"command": "lease6-add","arguments": {"state": 1, "subnet-id": 1,"ip-address": "2001:db8:1::2","duid": "1a:1b:1c:1d:1e:1f:20:21:22:23:24","iaid": 1234}}'
{
"result": 0,
"text": "Lease for address 2001:db8:1::2, subnet-id 1 added."
}
'{"command": "lease6-add","arguments": {"state": 0, "subnet-id": 1,"ip-address": "2001:db8:1::3","duid": "1a:1b:1c:1d:1e:1f:20:21:22:23:24","iaid": 1234}}'
{
"result": 0,
"text": "Lease for address 2001:db8:1::3, subnet-id 1 added."
}
and even if we added 3 different leases, legal logging saved this:
2020-01-24 05:49:42 PST Administrator added a lease of address: 2001:db8:1::1 to a device with DUID: 1a:1b:1c:1d:1e:1f:20:21:22:23:24
2020-01-24 05:49:42 PST Administrator added a lease of address: 2001:db8:1::2 to a device with DUID: 1a:1b:1c:1d:1e:1f:20:21:22:23:24
2020-01-24 05:49:42 PST Administrator added a lease of address: 2001:db8:1::3 to a device with DUID: 1a:1b:1c:1d:1e:1f:20:21:22:23:24