mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 10:38:20 +00:00
DHCP: Adding unit tests.
This commit is contained in:
parent
0f1b0e75b7
commit
1786a3b92d
10 changed files with 68 additions and 2 deletions
|
@ -20,3 +20,15 @@ event dhcp_request(c: connection, msg: dhcp_msg, req_addr: addr, serv_addr: addr
|
|||
Log::write(Known::DEVICES_LOG, [$ts=network_time(), $mac=msg$h_addr, $dhcp_host_name=host_name]);
|
||||
}
|
||||
}
|
||||
|
||||
event dhcp_inform(c: connection, msg: dhcp_msg, host_name: string)
|
||||
{
|
||||
if ( msg$h_addr == "" )
|
||||
return;
|
||||
|
||||
if ( msg$h_addr !in known_devices )
|
||||
{
|
||||
add known_devices[msg$h_addr];
|
||||
Log::write(Known::DEVICES_LOG, [$ts=network_time(), $mac=msg$h_addr, $dhcp_host_name=host_name]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue