zeek/testing/btest/scripts/base/protocols/dns/event-handler-warning.zeek
Johanna Amann 9f72353a41 Raise warnings when for DNS events that are not raised due to dns_skip_all_addl
By default, dns_skip_all_addl is set to false. This causes several
events to not be raised. This change emits warnings when a user defines
event handlers for events that will not be raised.

Furthermore, it adds notes about this behavior to the documentation. We
also introduce a new BIF, `is_event_handled`, which checks if an event
is handled.

Fixes GH-4061
2025-01-07 17:46:27 +00:00

31 lines
651 B
Text

# Check that warnings are for events that will not be raised
# @TEST-EXEC: zeek -b %INPUT
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff .stderr
@load base/protocols/dns
event dns_EDNS_addl(c: connection, msg: dns_msg, ans: dns_edns_additional)
{
print "";
}
event dns_EDNS_ecs(c: connection, msg: dns_msg, opt: dns_edns_ecs)
{
print "";
}
event dns_EDNS_tcp_keepalive(c: connection, msg: dns_msg, opt: dns_edns_tcp_keepalive)
{
print "";
}
event dns_EDNS_cookie(c: connection, msg: dns_msg, opt: dns_edns_cookie)
{
print "";
}
event dns_TKEY(c: connection, msg: dns_msg, ans: dns_tkey)
{
print "";
}