diff --git a/DnsServerCore/Dns/Applications/DnsApplicationManager.cs b/DnsServerCore/Dns/Applications/DnsApplicationManager.cs index f247fe6f..6b61a19c 100644 --- a/DnsServerCore/Dns/Applications/DnsApplicationManager.cs +++ b/DnsServerCore/Dns/Applications/DnsApplicationManager.cs @@ -1,6 +1,6 @@ /* Technitium DNS Server -Copyright (C) 2022 Shreyas Zare (shreyas@technitium.com) +Copyright (C) 2023 Shreyas Zare (shreyas@technitium.com) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -40,6 +40,7 @@ namespace DnsServerCore.Dns.Applications IReadOnlyList _dnsRequestControllers = Array.Empty(); IReadOnlyList _dnsAuthoritativeRequestHandlers = Array.Empty(); + IReadOnlyList _dnsRequestBlockingHandlers = Array.Empty(); IReadOnlyList _dnsQueryLoggers = Array.Empty(); IReadOnlyList _dnsPostProcessors = Array.Empty(); @@ -120,6 +121,7 @@ namespace DnsServerCore.Dns.Applications { List dnsRequestControllers = new List(1); List dnsAuthoritativeRequestHandlers = new List(1); + List dnsRequestBlockingHandlers = new List(1); List dnsQueryLoggers = new List(1); List dnsPostProcessors = new List(1); @@ -131,6 +133,9 @@ namespace DnsServerCore.Dns.Applications foreach (KeyValuePair handler in application.Value.DnsAuthoritativeRequestHandlers) dnsAuthoritativeRequestHandlers.Add(handler.Value); + foreach (KeyValuePair blocker in application.Value.DnsRequestBlockingHandler) + dnsRequestBlockingHandlers.Add(blocker.Value); + foreach (KeyValuePair logger in application.Value.DnsQueryLoggers) dnsQueryLoggers.Add(logger.Value); @@ -140,6 +145,7 @@ namespace DnsServerCore.Dns.Applications _dnsRequestControllers = dnsRequestControllers; _dnsAuthoritativeRequestHandlers = dnsAuthoritativeRequestHandlers; + _dnsRequestBlockingHandlers = dnsRequestBlockingHandlers; _dnsQueryLoggers = dnsQueryLoggers; _dnsPostProcessors = dnsPostProcessors; } @@ -167,6 +173,7 @@ namespace DnsServerCore.Dns.Applications _applications.Clear(); _dnsRequestControllers = Array.Empty(); _dnsAuthoritativeRequestHandlers = Array.Empty(); + _dnsRequestBlockingHandlers = Array.Empty(); _dnsQueryLoggers = Array.Empty(); _dnsPostProcessors = Array.Empty(); } @@ -290,6 +297,9 @@ namespace DnsServerCore.Dns.Applications public IReadOnlyList DnsAuthoritativeRequestHandlers { get { return _dnsAuthoritativeRequestHandlers; } } + public IReadOnlyList DnsRequestBlockingHandlers + { get { return _dnsRequestBlockingHandlers; } } + public IReadOnlyList DnsQueryLoggers { get { return _dnsQueryLoggers; } }