Packet Filter V2#9
Conversation
Moves location for Filter Test Suite.
Formatting. Different output from over Serial vs LoRa, no need for compact view over Serial.
|
It does what the documentation says it will do. I'm offering prebuilt firmware to test in our meshcore community. I have created a simple page with documentation (filter.md in different form) and configurator for this functionality: |
All rules are disabled by default, they have to be enabled after being entered. |
|
Ah yes, I have added a section that is highlighting this behavior. Thanks for pointing it out. |
file format on /filter_rules.bin
|
It would be great to have it merged soon. Do these filters support 2-byte and 3-byte hashes? (to avoid blocking too much) |
Yes, but they can't be mixed in the same line. |
|
Testing for a couple weeks now and also requested a update to add multiple channels in one filter rule. That is working great with 4 channels now in one rule. just like 4 repeaters in one rule. |
Packet Filter Engine
Adds a flexible rule-based packet filter engine to the repeater firmware.
Rules can match on route type, payload type, hop count, path hash size, last-hop repeater, channel hash, SNR and RSSI. Each rule supports an optional AND condition for combined matching. A configurable default policy (allow/drop) applies when no rule matches.
Rules are added disabled by default and must be explicitly enabled. All rules survive reboot via SPIFFS/LittleFS persistence.
New files
FilterRule.h— rule struct, enums and constantsFilterParser.h/.cpp— command parserChannelFilter.h/.cpp— rule storage, evaluation, persistence and CLI dispatchChanges to existing files
MyMesh.h— addedChannelFilter _filtermember and includeMyMesh.cpp— added_filter.load()inbegin(), filter evaluation infilterRecvFloodPacket(), andfiltercommand routing inhandleCommand()CLI
Commands are available over the remote CLI via the
filterprefix. See FILTER.md for full command reference and examples.Testing
A standalone test suite is included in
filter_test_suite/. See filter_test_suite/README.md for build instructions.