}
}
-void BPFFilter::unblock(const Netmask& addr)
+void BPFFilter::allow(const Netmask& addr)
{
int res = 0;
CounterAndActionValue value;
{
throw std::runtime_error("eBPF support not enabled");
}
-void BPFFilter::unblock(const Netmask&)
+void BPFFilter::allow(const Netmask&)
{
throw std::runtime_error("eBPF support not enabled");
}
void block(const Netmask& address, BPFFilter::MatchAction action);
void block(const DNSName& qname, MatchAction action, uint16_t qtype=255);
void unblock(const ComboAddress& addr);
- void unblock(const Netmask& address);
+ void allow(const Netmask& address);
void unblock(const DNSName& qname, uint16_t qtype=255);
std::vector<std::pair<ComboAddress, uint64_t> > getAddrStats();
return bpf->unblock(ca);
}
});
- luaCtx.registerFunction<void (std::shared_ptr<BPFFilter>::*)(const string& range)>("unblockRange", [](std::shared_ptr<BPFFilter> bpf, const string& range) {
+ luaCtx.registerFunction<void (std::shared_ptr<BPFFilter>::*)(const string& range)>("allowRange", [](std::shared_ptr<BPFFilter> bpf, const string& range) {
if (!bpf) {
return;
}
- bpf->unblock(Netmask(range));
+ bpf->allow(Netmask(range));
});
luaCtx.registerFunction<void(std::shared_ptr<BPFFilter>::*)(const DNSName& qname, boost::optional<uint16_t> qtype)>("unblockQName", [](std::shared_ptr<BPFFilter> bpf, const DNSName& qname, boost::optional<uint16_t> qtype) {
if (bpf) {
:param ComboAddress address: The address to unblock
- .. method:: BPFFilter:unblockRange(Netmask)
+ .. method:: BPFFilter:allowRange(Netmask)
.. versionchanged:: 1.8.0
- Unblock this range.
-
+ Allow all IP address in this range.
+ DNSDist will attempt to delete the item specified by Netmask first, and if no such item can be found, a new item will be inserted to indicate the exception for this subnet.
DNSDist eBPF code first checks if an exact IP match is found, then if a range matches, and finally if a DNSName does.
If a query coming from an IP or range marked as allowed, but is for a qname for which a DNSName block exists, the packet will be accepted as the first match wins.