summaryrefslogtreecommitdiffstats
path: root/src/test/create_dnstap.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-02-10 09:43:12 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-02-10 09:43:12 +0000
commit25bb6715fdff85ace8f3e821517d4279d1a68f65 (patch)
tree2aef869d16323831e5d9d48195dc6bd1651eac8d /src/test/create_dnstap.c
parentAdding upstream version 0.2.0. (diff)
downloaddnswire-25bb6715fdff85ace8f3e821517d4279d1a68f65.tar.xz
dnswire-25bb6715fdff85ace8f3e821517d4279d1a68f65.zip
Adding upstream version 0.3.3.upstream/0.3.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/create_dnstap.c')
-rw-r--r--src/test/create_dnstap.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/create_dnstap.c b/src/test/create_dnstap.c
index 9fbd4a8..b1f00ff 100644
--- a/src/test/create_dnstap.c
+++ b/src/test/create_dnstap.c
@@ -12,6 +12,7 @@
static char dns_wire_format_placeholder[] = "dns_wire_format_placeholder";
static unsigned char query_address[sizeof(struct in_addr)];
static unsigned char response_address[sizeof(struct in_addr)];
+static char policy_value[] = "bad.ns.name";
static inline void create_dnstap(struct dnstap* d, const char* identity)
{
@@ -48,4 +49,10 @@ static inline void create_dnstap(struct dnstap* d, const char* identity)
dnstap_message_set_query_message(*d, dns_wire_format_placeholder, sizeof(dns_wire_format_placeholder) - 1);
dnstap_message_set_response_message(*d, dns_wire_format_placeholder, sizeof(dns_wire_format_placeholder) - 1);
+
+ dnstap_message_use_policy(*d);
+ dnstap_message_policy_set_type(*d, "RPZ");
+ dnstap_message_policy_set_action(*d, DNSTAP_POLICY_ACTION_DROP);
+ dnstap_message_policy_set_match(*d, DNSTAP_POLICY_MATCH_NS_NAME);
+ dnstap_message_policy_set_value(*d, policy_value, sizeof(policy_value) - 1);
}