luaCtx.registerFunction<void(std::shared_ptr<BPFFilter>::*)()>("attachToAllBinds", [](std::shared_ptr<BPFFilter> bpf) {
std::string res;
+ if (!g_configurationDone) {
+ throw std::runtime_error("attachToAllBinds() cannot be used at configuration time!");
+ return;
+ }
if (bpf) {
for (const auto& frontend : g_frontends) {
frontend->attachFilter(bpf);
addAction(AndRule({TCPRule(true), makeRule("evildomain.com")}), DropAction())
-The :meth:`BPFFilter:attachToAllBinds` method attaches the filter to every existing bind at runtime, but it's also possible to define a default BPF filter at configuration time, so it's automatically attached to every bind::
+The :meth:`BPFFilter:attachToAllBinds` method attaches the filter to every existing bind at runtime. It cannot use at configuration time. The :func:`setDefaultBPFFilter()` should be used at configuration time.
+
+The :meth:`BPFFilter:attachToAllBinds` automatically attached to every bind::
bpf = newBPFFilter(1024, 1024, 1024)
setDefaultBPFFilter(bpf)
.. method:: BPFFilter:attachToAllBinds()
Attach this filter to every bind already defined.
- This is the run-time equivalent of :func:`setDefaultBPFFilter`
+ This is the run-time equivalent of :func:`setDefaultBPFFilter`.
+ This only can be use at run-time.
+
.. method:: BPFFilter:block(address)