Emits the inline pf anchor block used inside the main pf.conf. Mirrors the engine-side helper that previously built these rules.
| 20 | // Emits the inline pf anchor block used inside the main pf.conf. Mirrors the engine-side helper that |
| 21 | // previously built these rules. |
| 22 | std::string anchorBlock(const std::string &name, const std::vector<std::string> &rules) |
| 23 | { |
| 24 | if (rules.empty()) { |
| 25 | return "anchor " + name + " all"; |
| 26 | } |
| 27 | std::string str = "anchor " + name + " all {\n"; |
| 28 | for (const auto &r : rules) { |
| 29 | str += r + "\n"; |
| 30 | } |
| 31 | str += "}"; |
| 32 | return str; |
| 33 | } |
| 34 | |
| 35 | } // namespace |
| 36 |