summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/policy/policy.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/policy/policy.lua b/modules/policy/policy.lua
index 443fc0b0..60b03478 100644
--- a/modules/policy/policy.lua
+++ b/modules/policy/policy.lua
@@ -856,6 +856,16 @@ function policy.TAGS_ASSIGN(names)
return 'policy.tags_assign_bitmap(' .. tostring(bitmap) .. ')'
end
+-- Perform a list of actions sequentially; meant for kr_view_insert_action().
+function policy.COMBINE(list)
+ if #list == 1 then return list[1] end
+ local r = 'function(state,req) '
+ for _, item in ipairs(list) do
+ r = r .. item .. '(state,req); '
+ end
+ return r .. 'end'
+end
+
--[[ Insert a forwarding rule, i.e. override upstream for one DNS subtree.
Throws lua exceptions when detecting something fishy.