]> granicus.if.org Git - pdns/commitdiff
report acl and local addresses over web-api
authorbert hubert <bert.hubert@netherlabs.nl>
Sat, 5 Dec 2015 19:50:03 +0000 (20:50 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Sat, 5 Dec 2015 19:50:03 +0000 (20:50 +0100)
pdns/dnsdist-web.cc

index 2e09fa37ef5d128398e0e59b173c8585b29a35ee..0a38d2a271f2d9199530dcad701f3322e0db06a4 100644 (file)
@@ -158,13 +158,31 @@ static void connectionThread(int sock, ComboAddress remote, string password)
                {"action", a.second->toString()} };
        rules.push_back(rule);
       }
+      
+
+      string acl;
+
+      vector<string> vec;
 
+      g_ACL.getCopy().toStringVector(&vec);
+
+      for(const auto& s : vec) {
+        if(!acl.empty()) acl += ", ";
+        acl+=s;      
+      }
+      string localaddresses;
+      for(const auto& loc : g_locals) {
+        if(!localaddresses.empty()) localaddresses += ", ";
+        localaddresses += loc.first.toStringWithPort();
+      }
  
       Json my_json = Json::object {
        { "daemon_type", "dnsdist" },
        { "version", VERSION},
        { "servers", servers},
        { "rules", rules},
+       { "acl", acl},
+       { "local", localaddresses}
       };
       resp.headers["Content-Type"] = "application/json";
       resp.body=my_json.dump();