{ "show", true, "string", "outputs `string`" },
{ "showACL", true, "", "show our ACL set" },
{ "showBinds", true, "", "show listening addresses (frontends)" },
- { "showCacheHitResponseRules", true, "[{showUUIDs=false, truncateRuleWidth=-1}]", "show all defined cache hit response rules, optionally with their UUID sand optionally truncated to a given width" },
+ { "showCacheHitResponseRules", true, "[{showUUIDs=false, truncateRuleWidth=-1}]", "show all defined cache hit response rules, optionally with their UUIDs and optionally truncated to a given width" },
{ "showDNSCryptBinds", true, "", "display the currently configured DNSCrypt binds" },
{ "showDynBlocks", true, "", "show dynamic blocks in force" },
{ "showPools", true, "", "show the available pools" },
uuid = makeRuleID(uuidStr);
}
-typedef std::unordered_map<std::string, boost::variant<bool, int, std::string, std::vector<std::pair<int,int> > > > localbind_t;
+typedef std::unordered_map<std::string, boost::variant<bool, int, std::string, std::vector<std::pair<int,int> > > > ruleparams_t;
template<typename T>
-static void showRules(GlobalStateHolder<vector<T> > *someRulActions, boost::optional<localbind_t> vars) {
+static void showRules(GlobalStateHolder<vector<T> > *someRulActions, boost::optional<ruleparams_t> vars) {
setLuaNoSideEffect();
int num=0;
bool showUUIDs = false;
g_lua.registerFunction<string(std::shared_ptr<DNSRule>::*)()>("toString", [](const std::shared_ptr<DNSRule>& rule) { return rule->toString(); });
- g_lua.writeFunction("showResponseRules", [](boost::optional<localbind_t> vars) {
+ g_lua.writeFunction("showResponseRules", [](boost::optional<ruleparams_t> vars) {
showRules(&g_resprulactions, vars);
});
mvRule(&g_resprulactions, from, to);
});
- g_lua.writeFunction("showCacheHitResponseRules", [](boost::optional<localbind_t> vars) {
+ g_lua.writeFunction("showCacheHitResponseRules", [](boost::optional<ruleparams_t> vars) {
showRules(&g_cachehitresprulactions, vars);
});
mvRule(&g_cachehitresprulactions, from, to);
});
- g_lua.writeFunction("showSelfAnsweredResponseRules", [](boost::optional<localbind_t> vars) {
+ g_lua.writeFunction("showSelfAnsweredResponseRules", [](boost::optional<ruleparams_t> vars) {
showRules(&g_selfansweredresprulactions, vars);
});
return std::shared_ptr<DNSRule>(new ERCodeRule(rcode));
});
- g_lua.writeFunction("showRules", [](boost::optional<localbind_t> vars) {
+ g_lua.writeFunction("showRules", [](boost::optional<ruleparams_t> vars) {
showRules(&g_rulactions, vars);
});