]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
4243. [func] Improved stats reporting from Timothe Litt. [RT #38941]
authorMark Andrews <marka@isc.org>
Tue, 27 Oct 2015 22:45:46 +0000 (09:45 +1100)
committerMark Andrews <marka@isc.org>
Tue, 27 Oct 2015 22:45:46 +0000 (09:45 +1100)
CHANGES
bin/named/bind9.xsl
bin/named/bind9.xsl.h
bin/named/server.c
bin/named/statschannel.c
bin/tests/system/statistics/tests.sh
lib/dns/include/dns/zone.h

diff --git a/CHANGES b/CHANGES
index 7a288004294fbaf69fa8ccb806b3d2c3457616ba..d85e87425794e71d4475299db206b2c601da617b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+4243.  [func]          Improved stats reporting from Timothe Litt. [RT #38941]
+
 4242.  [bug]           Replace the client if not already replaced when
                        prefetching. [RT #41001]
 
index 5b1ffe86555d6aa68fe03557b4da1a37c3ac6b8c..b516a2930c05ad3f3b68afcc7d0026fc8c469015 100644 (file)
@@ -14,7 +14,6 @@
  - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  - PERFORMANCE OF THIS SOFTWARE.
 -->
-
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
   <xsl:output method="html" indent="yes" version="4.0"/>
   <xsl:template match="statistics[@version=&quot;3.6&quot;]">
           <script type="text/javascript" src="https://www.google.com/jsapi"/>
           <script type="text/javascript">
 
-            google.load("visualization", "1", {packages:["corechart"]});
-            google.setOnLoadCallback(loadGraphs);
-
-            var graphs=[];
-
-            function drawChart(chart_title,target,style,data) {
-              var data = google.visualization.arrayToDataTable(data);
-
-              var options = {
-                title: chart_title
-              };
-
-              var chart;
-              if (style == "barchart") {
-                chart = new google.visualization.BarChart(document.getElementById(target));
-                chart.draw(data, options);
-              } else if (style == "piechart") {
-                chart = new google.visualization.PieChart(document.getElementById(target));
-                chart.draw(data, options);
-              }
-            }
-
-            function loadGraphs(){
-              var g;
-
-              while(g = graphs.shift()){
-                // alert("going for: " + g.target);
-                if(g.data.length > 1){
-                  drawChart(g.title,g.target,g.style,g.data);
-                }
-              }
-            }
-
-            <xsl:if test="server/counters[@type=&quot;qtype&quot;]/counter">
-              // Server Incoming Query Types
-              graphs.push({
-                           'title' : "Server Incoming Query Types",
-                           'target': 'chart_incoming_qtypes',
-                           'style': 'barchart',
-                           'data': [['Type','Counter'],<xsl:for-each select="server/counters[@type=&quot;qtype&quot;]/counter">['<xsl:value-of select="@name"/>',<xsl:value-of select="."/>],</xsl:for-each>]
-                           });
-            </xsl:if>
-
-            <xsl:if test="server/counters[@type=&quot;opcode&quot;]/counter">
-              // Server Incoming Requests by opcode
-              graphs.push({
-                           'title' : "Server Incoming Requests by DNS Opcode",
-                           'target': 'chart_incoming_opcodes',
-                           'style': 'barchart',
-                           'data': [['Opcode','Counter'],<xsl:for-each select="server/counters[@type=&quot;opcode&quot;]/counter[. &gt; 0 or substring(@name,1,3) != 'RES']">['<xsl:value-of select="@name"/>',<xsl:value-of select="."/>],</xsl:for-each>]});
-            </xsl:if>
-          </script>
+           google.load("visualization", "1", {packages:["corechart"]});
+           google.setOnLoadCallback(loadGraphs);
+
+           var graphs=[];
+
+           function drawChart(chart_title,target,style,data) {
+             var data = google.visualization.arrayToDataTable(data);
+
+             var options = {
+               title: chart_title
+             };
+
+             var chart;
+             if (style == "barchart") {
+               chart = new google.visualization.BarChart(document.getElementById(target));
+               chart.draw(data, options);
+             } else if (style == "piechart") {
+               chart = new google.visualization.PieChart(document.getElementById(target));
+               chart.draw(data, options);
+             }
+           }
+
+           function loadGraphs(){
+             var g;
+
+             while(g = graphs.shift()){
+               // alert("going for: " + g.target);
+               if(g.data.length > 1){
+                 drawChart(g.title,g.target,g.style,g.data);
+               }
+             }
+           }
+
+           <xsl:if test="server/counters[@type=&quot;qtype&quot;]/counter">
+             // Server Incoming Query Types
+             graphs.push({
+                          'title' : "Server Incoming Query Types",
+                          'target': 'chart_incoming_qtypes',
+                          'style': 'barchart',
+                          'data': [['Type','Counter'],<xsl:for-each select="server/counters[@type=&quot;qtype&quot;]/counter">['<xsl:value-of select="@name"/>',<xsl:value-of select="."/>],</xsl:for-each>]
+                          });
+           </xsl:if>
+
+           <xsl:if test="server/counters[@type=&quot;opcode&quot;]/counter">
+             // Server Incoming Requests by opcode
+             graphs.push({
+                          'title' : "Server Incoming Requests by DNS Opcode",
+                          'target': 'chart_incoming_opcodes',
+                          'style': 'barchart',
+                          'data': [['Opcode','Counter'],<xsl:for-each select="server/counters[@type=&quot;opcode&quot;]/counter[. &gt; 0 or substring(@name,1,3) != 'RES']">['<xsl:value-of select="@name"/>',<xsl:value-of select="."/>],</xsl:for-each>]});
+           </xsl:if>
+         </script>
         </xsl:if>
         <style type="text/css">
      body {
        text-align:center;
      }
      h4 {
-        color:  rgb(1,169,206);
-        font-size: 10pt;
+       color:  rgb(1,169,206);
+       font-size: 10pt;
        width:500px;
        text-align:center;
      }
         <div class="header">
           <h1>ISC Bind 9 Configuration and Statistics</h1>
         </div>
-       <p>Alternate statistics views: <a href="/">All</a>,
+        <p>Alternate statistics views: <a href="/">All</a>,
        <a href="/xml/v3/status">Status</a>,
        <a href="/xml/v3/server">Server</a>,
        <a href="/xml/v3/zones">Zones</a>,
               <xsl:value-of select="server/current-time"/>
             </td>
           </tr>
+          <tr>
+            <th>Server version:</th>
+            <td>
+              <xsl:value-of select="server/version"/>
+            </td>
+          </tr>
         </table>
         <br/>
         <xsl:if test="server/counters[@type=&quot;opcode&quot;]/counter[. &gt; 0]">
             <h2>Incoming Requests by DNS Opcode</h2>
             <!-- Non Mozilla specific markup -->
             <div class="pie" id="chart_incoming_opcodes">
-              [cannot display chart]
-            </div>
+             [cannot display chart]
+           </div>
           </xsl:if>
           <table class="counters">
             <xsl:for-each select="server/counters[@type=&quot;opcode&quot;]/counter[. &gt; 0 or substring(@name,1,3) != 'RES']">
             <!-- Non Mozilla specific markup -->
             <h3>Incoming Queries by Query Type</h3>
             <div class="pie" id="chart_incoming_qtypes">
-              [cannot display chart]
-            </div>
+             [cannot display chart]
+           </div>
           </xsl:if>
           <table class="counters">
             <xsl:for-each select="server/counters[@type=&quot;qtype&quot;]/counter">
             <h3>View <xsl:value-of select="@name"/></h3>
             <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
               <!-- Non Mozilla specific markup -->
-            <script type="text/javascript">
-                  graphs.push({
-                                'title': "Outgoing Queries for view: <xsl:value-of select="@name"/>",
-                                'target': 'chart_outgoing_queries_view_<xsl:value-of select="@name"/>',
-                                'style': 'barchart',
-                                'data': [['Type','Counter'],<xsl:for-each select="counters[@type=&quot;resqtype&quot;]/counter">['<xsl:value-of select="@name"/>',<xsl:value-of select="."/>],</xsl:for-each>]
-                                });
-              </script>
-            <xsl:variable name="target">
-              <xsl:value-of select="@name"/>
-            </xsl:variable>
+              <script type="text/javascript">
+                 graphs.push({
+                               'title': "Outgoing Queries for view: <xsl:value-of select="@name"/>",
+                               'target': 'chart_outgoing_queries_view_<xsl:value-of select="@name"/>',
+                               'style': 'barchart',
+                               'data': [['Type','Counter'],<xsl:for-each select="counters[@type=&quot;resqtype&quot;]/counter">['<xsl:value-of select="@name"/>',<xsl:value-of select="."/>],</xsl:for-each>]
+                               });
+             </script>
+              <xsl:variable name="target">
+                <xsl:value-of select="@name"/>
+              </xsl:variable>
               <div class="pie" id="chart_outgoing_queries_view_{$target}">[no data to display]</div>
             </xsl:if>
             <table class="counters">
           <h2>Server Statistics</h2>
           <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
             <!-- Non Mozilla specific markup -->
-          <script type="text/javascript">
-                  graphs.push({
-                                'title' : "Server Counters",
-                                'target': 'chart_server_nsstat_restype',
-                                'style': 'barchart',
-                                'data': [['Type','Counter'],<xsl:for-each select="server/counters[@type=&quot;nsstat&quot;]/counter[.&gt;0]">['<xsl:value-of select="@name"/>',<xsl:value-of select="."/>],</xsl:for-each>]
-                                });
-              </script>
+            <script type="text/javascript">
+                 graphs.push({
+                               'title' : "Server Counters",
+                               'target': 'chart_server_nsstat_restype',
+                               'style': 'barchart',
+                               'data': [['Type','Counter'],<xsl:for-each select="server/counters[@type=&quot;nsstat&quot;]/counter[.&gt;0]">['<xsl:value-of select="@name"/>',<xsl:value-of select="."/>],</xsl:for-each>]
+                               });
+             </script>
             <div class="pie" id="chart_server_nsstat_restype">[no data to display]</div>
           </xsl:if>
           <table class="counters">
           <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
             <h2>Zone Maintenance Statistics</h2>
             <script type="text/javascript">
-                  graphs.push({
-                                'title' : "Zone Maintenance Stats",
-                                'target': 'chart_server_zone_maint',
-                                'style': 'barchart',
-                                'data': [['Type','Counter'],<xsl:for-each select="server/counters[@type=&quot;zonestat&quot;]/counter[.&gt;0]">['<xsl:value-of select="@name"/>',<xsl:value-of select="."/>],</xsl:for-each>]
-                                });
-            </script>
+                 graphs.push({
+                               'title' : "Zone Maintenance Stats",
+                               'target': 'chart_server_zone_maint',
+                               'style': 'barchart',
+                               'data': [['Type','Counter'],<xsl:for-each select="server/counters[@type=&quot;zonestat&quot;]/counter[.&gt;0]">['<xsl:value-of select="@name"/>',<xsl:value-of select="."/>],</xsl:for-each>]
+                               });
+           </script>
             <!-- Non Mozilla specific markup -->
             <div class="pie" id="chart_server_zone_maint">[no data to display]</div>
           </xsl:if>
             </table>
           </xsl:if>
         </xsl:for-each>
-
         <xsl:for-each select="views/view">
           <xsl:if test="counters[@type=&quot;cachestats&quot;]/counter[.&gt;0]">
             <h3>Cache Statistics for View <xsl:value-of select="@name"/></h3>
             </table>
           </xsl:if>
         </xsl:for-each>
-
         <xsl:for-each select="views/view">
           <xsl:if test="cache/rrset">
             <h3>Cache DB RRsets for View <xsl:value-of select="@name"/></h3>
             <br/>
           </xsl:if>
         </xsl:for-each>
-
         <xsl:if test="traffic/udp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0] or traffic/udp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0] or traffic/tcp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0] or traffic/tcp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]">
           <h2>Traffic Size Statistics</h2>
         </xsl:if>
-       <xsl:if test="traffic/udp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0]">
-         <h4>UDP Requests Received</h4>
-         <table class="counters">
-           <xsl:for-each select="traffic/udp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0]">
-             <xsl:variable name="css-class7">
-               <xsl:choose>
-                 <xsl:when test="position() mod 2 = 0">even</xsl:when>
-                 <xsl:otherwise>odd</xsl:otherwise>
-               </xsl:choose>
-             </xsl:variable>
-             <tr class="{$css-class7}">
-               <th>
-                 <xsl:value-of select="@name"/>
-               </th>
-               <td>
-                 <xsl:value-of select="."/>
-               </td>
-             </tr>
-           </xsl:for-each>
-         </table>
-         <br/>
-       </xsl:if>
-
-       <xsl:if test="traffic/udp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]">
-         <h4>UDP Responses Sent</h4>
-         <table class="counters">
-                 <xsl:for-each select="traffic/udp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]">
-             <xsl:variable name="css-class7">
-               <xsl:choose>
-                 <xsl:when test="position() mod 2 = 0">even</xsl:when>
-                 <xsl:otherwise>odd</xsl:otherwise>
-               </xsl:choose>
-             </xsl:variable>
-             <tr class="{$css-class7}">
-               <th>
-                 <xsl:value-of select="@name"/>
-               </th>
-               <td>
-                 <xsl:value-of select="."/>
-               </td>
-             </tr>
-           </xsl:for-each>
-         </table>
-         <br/>
-       </xsl:if>
-
-       <xsl:if test="traffic/tcp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0]">
-         <h4>TCP Requests Received</h4>
-         <table class="counters">
-           <xsl:for-each select="traffic/tcp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0]">
-             <xsl:variable name="css-class7">
-               <xsl:choose>
-                 <xsl:when test="position() mod 2 = 0">even</xsl:when>
-                 <xsl:otherwise>odd</xsl:otherwise>
-               </xsl:choose>
-             </xsl:variable>
-             <tr class="{$css-class7}">
-               <th>
-                 <xsl:value-of select="@name"/>
-               </th>
-               <td>
-                 <xsl:value-of select="."/>
-               </td>
-             </tr>
-           </xsl:for-each>
-         </table>
-         <br/>
-       </xsl:if>
-
-       <xsl:if test="traffic/tcp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]">
-         <h4>TCP Responses Sent</h4>
-         <table class="counters">
-                 <xsl:for-each select="traffic/tcp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]">
-             <xsl:variable name="css-class7">
-               <xsl:choose>
-                 <xsl:when test="position() mod 2 = 0">even</xsl:when>
-                 <xsl:otherwise>odd</xsl:otherwise>
-               </xsl:choose>
-             </xsl:variable>
-             <tr class="{$css-class7}">
-               <th>
-                 <xsl:value-of select="@name"/>
-               </th>
-               <td>
-                 <xsl:value-of select="."/>
-               </td>
-             </tr>
-           </xsl:for-each>
-         </table>
-         <br/>
-       </xsl:if>
-
-       <xsl:if test="server/counters[@type=&quot;sockstat&quot;]/counter[.&gt;0]">
-         <h2>Socket I/O Statistics</h2>
-         <table class="counters">
-           <xsl:for-each select="server/counters[@type=&quot;sockstat&quot;]/counter[.&gt;0]">
-             <xsl:variable name="css-class7">
-               <xsl:choose>
-                 <xsl:when test="position() mod 2 = 0">even</xsl:when>
-                 <xsl:otherwise>odd</xsl:otherwise>
-               </xsl:choose>
-             </xsl:variable>
-             <tr class="{$css-class7}">
-               <th>
-                 <xsl:value-of select="@name"/>
-               </th>
-               <td>
-                 <xsl:value-of select="."/>
-               </td>
-             </tr>
-           </xsl:for-each>
-         </table>
-         <br/>
-       </xsl:if>
-       <xsl:if test="views/view[zones/zone/counters[@type=&quot;qtype&quot;]/counter &gt;0]">
-         <h2>Received QTYPES per view/zone</h2>
-         <xsl:for-each select="views/view[zones/zone/counters[@type=&quot;qtype&quot;]/counter &gt;0]">
-           <h3>View <xsl:value-of select="@name"/></h3>
-           <xsl:variable name="thisview">
-             <xsl:value-of select="@name"/>
-           </xsl:variable>
-           <xsl:for-each select="zones/zone">
-             <xsl:if test="counters[@type=&quot;qtype&quot;]/counter[count(.) &gt; 0]">
-               <h4>Zone <xsl:value-of select="@name"/></h4>
-               <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
-                 <!-- Non Mozilla specific markup -->
-               <script type="text/javascript">
+        <xsl:if test="traffic/udp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0]">
+          <h4>UDP Requests Received</h4>
+          <table class="counters">
+            <xsl:for-each select="traffic/udp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0]">
+              <xsl:variable name="css-class7">
+                <xsl:choose>
+                  <xsl:when test="position() mod 2 = 0">even</xsl:when>
+                  <xsl:otherwise>odd</xsl:otherwise>
+                </xsl:choose>
+              </xsl:variable>
+              <tr class="{$css-class7}">
+                <th>
+                  <xsl:value-of select="@name"/>
+                </th>
+                <td>
+                  <xsl:value-of select="."/>
+                </td>
+              </tr>
+            </xsl:for-each>
+          </table>
+          <br/>
+        </xsl:if>
+        <xsl:if test="traffic/udp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]">
+          <h4>UDP Responses Sent</h4>
+          <table class="counters">
+            <xsl:for-each select="traffic/udp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]">
+              <xsl:variable name="css-class7">
+                <xsl:choose>
+                  <xsl:when test="position() mod 2 = 0">even</xsl:when>
+                  <xsl:otherwise>odd</xsl:otherwise>
+                </xsl:choose>
+              </xsl:variable>
+              <tr class="{$css-class7}">
+                <th>
+                  <xsl:value-of select="@name"/>
+                </th>
+                <td>
+                  <xsl:value-of select="."/>
+                </td>
+              </tr>
+            </xsl:for-each>
+          </table>
+          <br/>
+        </xsl:if>
+        <xsl:if test="traffic/tcp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0]">
+          <h4>TCP Requests Received</h4>
+          <table class="counters">
+            <xsl:for-each select="traffic/tcp/counters[@type=&quot;request-size&quot;]/counter[.&gt;0]">
+              <xsl:variable name="css-class7">
+                <xsl:choose>
+                  <xsl:when test="position() mod 2 = 0">even</xsl:when>
+                  <xsl:otherwise>odd</xsl:otherwise>
+                </xsl:choose>
+              </xsl:variable>
+              <tr class="{$css-class7}">
+                <th>
+                  <xsl:value-of select="@name"/>
+                </th>
+                <td>
+                  <xsl:value-of select="."/>
+                </td>
+              </tr>
+            </xsl:for-each>
+          </table>
+          <br/>
+        </xsl:if>
+        <xsl:if test="traffic/tcp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]">
+          <h4>TCP Responses Sent</h4>
+          <table class="counters">
+            <xsl:for-each select="traffic/tcp/counters[@type=&quot;response-size&quot;]/counter[.&gt;0]">
+              <xsl:variable name="css-class7">
+                <xsl:choose>
+                  <xsl:when test="position() mod 2 = 0">even</xsl:when>
+                  <xsl:otherwise>odd</xsl:otherwise>
+                </xsl:choose>
+              </xsl:variable>
+              <tr class="{$css-class7}">
+                <th>
+                  <xsl:value-of select="@name"/>
+                </th>
+                <td>
+                  <xsl:value-of select="."/>
+                </td>
+              </tr>
+            </xsl:for-each>
+          </table>
+          <br/>
+        </xsl:if>
+        <xsl:if test="server/counters[@type=&quot;sockstat&quot;]/counter[.&gt;0]">
+          <h2>Socket I/O Statistics</h2>
+          <table class="counters">
+            <xsl:for-each select="server/counters[@type=&quot;sockstat&quot;]/counter[.&gt;0]">
+              <xsl:variable name="css-class7">
+                <xsl:choose>
+                  <xsl:when test="position() mod 2 = 0">even</xsl:when>
+                  <xsl:otherwise>odd</xsl:otherwise>
+                </xsl:choose>
+              </xsl:variable>
+              <tr class="{$css-class7}">
+                <th>
+                  <xsl:value-of select="@name"/>
+                </th>
+                <td>
+                  <xsl:value-of select="."/>
+                </td>
+              </tr>
+            </xsl:for-each>
+          </table>
+          <br/>
+        </xsl:if>
+        <xsl:if test="views/view[zones/zone/counters[@type=&quot;qtype&quot;]/counter &gt;0]">
+          <h2>Received QTYPES per view/zone</h2>
+          <xsl:for-each select="views/view[zones/zone/counters[@type=&quot;qtype&quot;]/counter &gt;0]">
+            <h3>View <xsl:value-of select="@name"/></h3>
+            <xsl:variable name="thisview">
+              <xsl:value-of select="@name"/>
+            </xsl:variable>
+            <xsl:for-each select="zones/zone">
+              <xsl:if test="counters[@type=&quot;qtype&quot;]/counter[count(.) &gt; 0]">
+                <h4>Zone <xsl:value-of select="@name"/></h4>
+                <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
+                  <!-- Non Mozilla specific markup -->
+                  <script type="text/javascript">
                        graphs.push({
                                      'title': "Query types for zone <xsl:value-of select="@name"/>",
                                      'target': 'chart_qtype_<xsl:value-of select="../../@name"/>_<xsl:value-of select="@name"/>',
                                      });
 
                    </script>
-               <xsl:variable name="target">
-                 <xsl:value-of select="@name"/>
-               </xsl:variable>
-                 <div class="pie" id="chart_qtype_{$thisview}_{$target}">[no data to display]</div>
-               </xsl:if>
-               <table class="counters">
-                 <xsl:for-each select="counters[@type=&quot;qtype&quot;]/counter">
-                   <xsl:sort select="."/>
-                   <xsl:variable name="css-class10">
-                     <xsl:choose>
-                       <xsl:when test="position() mod 2 = 0">even</xsl:when>
-                       <xsl:otherwise>odd</xsl:otherwise>
-                     </xsl:choose>
-                   </xsl:variable>
-                   <tr class="{$css-class10}">
-                     <th>
-                       <xsl:value-of select="@name"/>
-                     </th>
-                     <td>
-                       <xsl:value-of select="."/>
-                     </td>
-                   </tr>
-                 </xsl:for-each>
-               </table>
-             </xsl:if>
-           </xsl:for-each>
-         </xsl:for-each>
-       </xsl:if>
-       <xsl:if test="views/view[zones/zone/counters[@type=&quot;rcode&quot;]/counter &gt;0]">
-         <h2>Response Codes per view/zone</h2>
-         <xsl:for-each select="views/view[zones/zone/counters[@type=&quot;rcode&quot;]/counter &gt;0]">
-           <h3>View <xsl:value-of select="@name"/></h3>
-           <xsl:variable name="thisview2">
-             <xsl:value-of select="@name"/>
-           </xsl:variable>
-           <xsl:for-each select="zones/zone">
-             <xsl:if test="counters[@type=&quot;rcode&quot;]/counter[. &gt; 0]">
-               <h4>Zone <xsl:value-of select="@name"/></h4>
-               <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
-                 <!-- Non Mozilla specific markup -->
-               <script type="text/javascript">
+                  <xsl:variable name="target">
+                    <xsl:value-of select="@name"/>
+                  </xsl:variable>
+                  <div class="pie" id="chart_qtype_{$thisview}_{$target}">[no data to display]</div>
+                </xsl:if>
+                <table class="counters">
+                  <xsl:for-each select="counters[@type=&quot;qtype&quot;]/counter">
+                    <xsl:sort select="."/>
+                    <xsl:variable name="css-class10">
+                      <xsl:choose>
+                        <xsl:when test="position() mod 2 = 0">even</xsl:when>
+                        <xsl:otherwise>odd</xsl:otherwise>
+                      </xsl:choose>
+                    </xsl:variable>
+                    <tr class="{$css-class10}">
+                      <th>
+                        <xsl:value-of select="@name"/>
+                      </th>
+                      <td>
+                        <xsl:value-of select="."/>
+                      </td>
+                    </tr>
+                  </xsl:for-each>
+                </table>
+              </xsl:if>
+            </xsl:for-each>
+          </xsl:for-each>
+        </xsl:if>
+        <xsl:if test="views/view[zones/zone/counters[@type=&quot;rcode&quot;]/counter &gt;0]">
+          <h2>Response Codes per view/zone</h2>
+          <xsl:for-each select="views/view[zones/zone/counters[@type=&quot;rcode&quot;]/counter &gt;0]">
+            <h3>View <xsl:value-of select="@name"/></h3>
+            <xsl:variable name="thisview2">
+              <xsl:value-of select="@name"/>
+            </xsl:variable>
+            <xsl:for-each select="zones/zone">
+              <xsl:if test="counters[@type=&quot;rcode&quot;]/counter[. &gt; 0]">
+                <h4>Zone <xsl:value-of select="@name"/></h4>
+                <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
+                  <!-- Non Mozilla specific markup -->
+                  <script type="text/javascript">
                        graphs.push({
                                      'title': "Response codes for zone <xsl:value-of select="@name"/>",
                                      'target': 'chart_rescode_<xsl:value-of select="../../@name"/>_<xsl:value-of select="@name"/>',
                                      });
 
                </script>
-               <xsl:variable name="target">
-                 <xsl:value-of select="@name"/>
-               </xsl:variable>
-                 <div class="pie" id="chart_rescode_{$thisview2}_{$target}">[no data to display]</div>
-               </xsl:if>
-               <table class="counters">
-                 <xsl:for-each select="counters[@type=&quot;rcode&quot;]/counter[.&gt;0 and @name != &quot;QryAuthAns&quot;]">
-                   <xsl:sort select="."/>
-                   <xsl:variable name="css-class11">
-                     <xsl:choose>
-                       <xsl:when test="position() mod 2 = 0">even</xsl:when>
-                       <xsl:otherwise>odd</xsl:otherwise>
-                     </xsl:choose>
-                   </xsl:variable>
-                   <tr class="{$css-class11}">
-                     <th>
-                       <xsl:value-of select="@name"/>
-                     </th>
-                     <td>
-                       <xsl:value-of select="."/>
-                     </td>
-                   </tr>
-                 </xsl:for-each>
-               </table>
-             </xsl:if>
-           </xsl:for-each>
-         </xsl:for-each>
-       </xsl:if>
-       <xsl:if test="socketmgr/sockets/socket">
-         <h2>Network Status</h2>
-         <table class="netstat">
-           <tr>
-             <th>ID</th>
-             <th>Name</th>
-             <th>Type</th>
-             <th>References</th>
-             <th>LocalAddress</th>
-             <th>PeerAddress</th>
-             <th>State</th>
-           </tr>
-           <xsl:for-each select="socketmgr/sockets/socket">
-             <xsl:sort select="id"/>
-             <xsl:variable name="css-class12">
-               <xsl:choose>
-                 <xsl:when test="position() mod 2 = 0">even</xsl:when>
-                 <xsl:otherwise>odd</xsl:otherwise>
-               </xsl:choose>
-             </xsl:variable>
-             <tr class="{$css-class12}">
-               <td>
-                 <xsl:value-of select="id"/>
-               </td>
-               <td>
-                 <xsl:value-of select="name"/>
-               </td>
-               <td>
-                 <xsl:value-of select="type"/>
-               </td>
-               <td>
-                 <xsl:value-of select="references"/>
-               </td>
-               <td>
-                 <xsl:value-of select="local-address"/>
-               </td>
-               <td>
-                 <xsl:value-of select="peer-address"/>
-               </td>
-               <td>
-                 <xsl:for-each select="states">
-                   <xsl:value-of select="."/>
-                 </xsl:for-each>
-               </td>
-             </tr>
-           </xsl:for-each>
-         </table>
-         <br/>
-       </xsl:if>
-       <xsl:if test="taskmgr/thread-model/type">
-         <h2>Task Manager Configuration</h2>
-         <table class="counters">
-           <tr>
-             <th class="even">Thread-Model</th>
-             <td>
-               <xsl:value-of select="taskmgr/thread-model/type"/>
-             </td>
-           </tr>
-           <tr class="odd">
-             <th>Worker Threads</th>
-             <td>
-               <xsl:value-of select="taskmgr/thread-model/worker-threads"/>
-             </td>
-           </tr>
-           <tr class="even">
-             <th>Default Quantum</th>
-             <td>
-               <xsl:value-of select="taskmgr/thread-model/default-quantum"/>
-             </td>
-           </tr>
-           <tr class="odd">
-             <th>Tasks Running</th>
-             <td>
-               <xsl:value-of select="taskmgr/thread-model/tasks-running"/>
-             </td>
-           </tr>
-           <tr class="even">
-             <th>Tasks Ready</th>
-             <td>
-               <xsl:value-of select="taskmgr/thread-model/tasks-ready"/>
-             </td>
-           </tr>
-         </table>
-         <br/>
-       </xsl:if>
-       <xsl:if test="taskmgr/tasks/task">
-         <h2>Tasks</h2>
-         <table class="tasks">
-           <tr>
-             <th>ID</th>
-             <th>Name</th>
-             <th>References</th>
-             <th>State</th>
-             <th>Quantum</th>
-             <th>Events</th>
-           </tr>
-           <xsl:for-each select="taskmgr/tasks/task">
-             <xsl:sort select="name"/>
-             <xsl:variable name="css-class14">
-               <xsl:choose>
-                 <xsl:when test="position() mod 2 = 0">even</xsl:when>
-                 <xsl:otherwise>odd</xsl:otherwise>
-               </xsl:choose>
-             </xsl:variable>
-             <tr class="{$css-class14}">
-               <td>
-                 <xsl:value-of select="id"/>
-               </td>
-               <td>
-                 <xsl:value-of select="name"/>
-               </td>
-               <td>
-                 <xsl:value-of select="references"/>
-               </td>
-               <td>
-                 <xsl:value-of select="state"/>
-               </td>
-               <td>
-                 <xsl:value-of select="quantum"/>
-               </td>
-               <td>
-                 <xsl:value-of select="events"/>
-               </td>
-             </tr>
-           </xsl:for-each>
-         </table>
-         <br/>
-       </xsl:if>
-       <xsl:if test="memory/summary">
-         <h2>Memory Usage Summary</h2>
-         <table class="counters">
-           <xsl:for-each select="memory/summary/*">
-             <xsl:variable name="css-class13">
-               <xsl:choose>
-                 <xsl:when test="position() mod 2 = 0">even</xsl:when>
-                 <xsl:otherwise>odd</xsl:otherwise>
-               </xsl:choose>
-             </xsl:variable>
-             <tr class="{$css-class13}">
-               <th>
-                 <xsl:value-of select="name()"/>
-               </th>
-               <td>
-                 <xsl:value-of select="."/>
-               </td>
-             </tr>
-           </xsl:for-each>
-         </table>
-         <br/>
-       </xsl:if>
-       <xsl:if test="memory/contexts/context">
-         <h2>Memory Contexts</h2>
-         <table class="mctx">
-           <tr>
-             <th>ID</th>
-             <th>Name</th>
-             <th>References</th>
-             <th>TotalUse</th>
-             <th>InUse</th>
-             <th>MaxUse</th>
-             <th>BlockSize</th>
-             <th>Pools</th>
-             <th>HiWater</th>
-             <th>LoWater</th>
-           </tr>
-           <xsl:for-each select="memory/contexts/context">
-             <xsl:sort select="total" data-type="number" order="descending"/>
-             <xsl:variable name="css-class14">
-               <xsl:choose>
-                 <xsl:when test="position() mod 2 = 0">even</xsl:when>
-                 <xsl:otherwise>odd</xsl:otherwise>
-               </xsl:choose>
-             </xsl:variable>
-             <tr class="{$css-class14}">
-               <td>
-                 <xsl:value-of select="id"/>
-               </td>
-               <td>
-                 <xsl:value-of select="name"/>
-               </td>
-               <td>
-                 <xsl:value-of select="references"/>
-               </td>
-               <td>
-                 <xsl:value-of select="total"/>
-               </td>
-               <td>
-                 <xsl:value-of select="inuse"/>
-               </td>
-               <td>
-                 <xsl:value-of select="maxinuse"/>
-               </td>
-               <td>
-                 <xsl:value-of select="blocksize"/>
-               </td>
-               <td>
-                 <xsl:value-of select="pools"/>
-               </td>
-               <td>
-                 <xsl:value-of select="hiwater"/>
-               </td>
-               <td>
-                 <xsl:value-of select="lowater"/>
-               </td>
-             </tr>
-           </xsl:for-each>
-         </table>
-       </xsl:if>
-       <hr/>
-       <p class="footer">Internet Systems Consortium Inc.<br/><a href="http://www.isc.org">http://www.isc.org</a></p>
+                  <xsl:variable name="target">
+                    <xsl:value-of select="@name"/>
+                  </xsl:variable>
+                  <div class="pie" id="chart_rescode_{$thisview2}_{$target}">[no data to display]</div>
+                </xsl:if>
+                <table class="counters">
+                  <xsl:for-each select="counters[@type=&quot;rcode&quot;]/counter[.&gt;0 and @name != &quot;QryAuthAns&quot;]">
+                    <xsl:sort select="."/>
+                    <xsl:variable name="css-class11">
+                      <xsl:choose>
+                        <xsl:when test="position() mod 2 = 0">even</xsl:when>
+                        <xsl:otherwise>odd</xsl:otherwise>
+                      </xsl:choose>
+                    </xsl:variable>
+                    <tr class="{$css-class11}">
+                      <th>
+                        <xsl:value-of select="@name"/>
+                      </th>
+                      <td>
+                        <xsl:value-of select="."/>
+                      </td>
+                    </tr>
+                  </xsl:for-each>
+                </table>
+              </xsl:if>
+            </xsl:for-each>
+          </xsl:for-each>
+        </xsl:if>
+        <xsl:if test="socketmgr/sockets/socket">
+          <h2>Network Status</h2>
+          <table class="netstat">
+            <tr>
+              <th>ID</th>
+              <th>Name</th>
+              <th>Type</th>
+              <th>References</th>
+              <th>LocalAddress</th>
+              <th>PeerAddress</th>
+              <th>State</th>
+            </tr>
+            <xsl:for-each select="socketmgr/sockets/socket">
+              <xsl:sort select="id"/>
+              <xsl:variable name="css-class12">
+                <xsl:choose>
+                  <xsl:when test="position() mod 2 = 0">even</xsl:when>
+                  <xsl:otherwise>odd</xsl:otherwise>
+                </xsl:choose>
+              </xsl:variable>
+              <tr class="{$css-class12}">
+                <td>
+                  <xsl:value-of select="id"/>
+                </td>
+                <td>
+                  <xsl:value-of select="name"/>
+                </td>
+                <td>
+                  <xsl:value-of select="type"/>
+                </td>
+                <td>
+                  <xsl:value-of select="references"/>
+                </td>
+                <td>
+                  <xsl:value-of select="local-address"/>
+                </td>
+                <td>
+                  <xsl:value-of select="peer-address"/>
+                </td>
+                <td>
+                  <xsl:for-each select="states">
+                    <xsl:value-of select="."/>
+                  </xsl:for-each>
+                </td>
+              </tr>
+            </xsl:for-each>
+          </table>
+          <br/>
+        </xsl:if>
+        <xsl:if test="taskmgr/thread-model/type">
+          <h2>Task Manager Configuration</h2>
+          <table class="counters">
+            <tr>
+              <th class="even">Thread-Model</th>
+              <td>
+                <xsl:value-of select="taskmgr/thread-model/type"/>
+              </td>
+            </tr>
+            <tr class="odd">
+              <th>Worker Threads</th>
+              <td>
+                <xsl:value-of select="taskmgr/thread-model/worker-threads"/>
+              </td>
+            </tr>
+            <tr class="even">
+              <th>Default Quantum</th>
+              <td>
+                <xsl:value-of select="taskmgr/thread-model/default-quantum"/>
+              </td>
+            </tr>
+            <tr class="odd">
+              <th>Tasks Running</th>
+              <td>
+                <xsl:value-of select="taskmgr/thread-model/tasks-running"/>
+              </td>
+            </tr>
+            <tr class="even">
+              <th>Tasks Ready</th>
+              <td>
+                <xsl:value-of select="taskmgr/thread-model/tasks-ready"/>
+              </td>
+            </tr>
+          </table>
+          <br/>
+        </xsl:if>
+        <xsl:if test="taskmgr/tasks/task">
+          <h2>Tasks</h2>
+          <table class="tasks">
+            <tr>
+              <th>ID</th>
+              <th>Name</th>
+              <th>References</th>
+              <th>State</th>
+              <th>Quantum</th>
+              <th>Events</th>
+            </tr>
+            <xsl:for-each select="taskmgr/tasks/task">
+              <xsl:sort select="name"/>
+              <xsl:variable name="css-class14">
+                <xsl:choose>
+                  <xsl:when test="position() mod 2 = 0">even</xsl:when>
+                  <xsl:otherwise>odd</xsl:otherwise>
+                </xsl:choose>
+              </xsl:variable>
+              <tr class="{$css-class14}">
+                <td>
+                  <xsl:value-of select="id"/>
+                </td>
+                <td>
+                  <xsl:value-of select="name"/>
+                </td>
+                <td>
+                  <xsl:value-of select="references"/>
+                </td>
+                <td>
+                  <xsl:value-of select="state"/>
+                </td>
+                <td>
+                  <xsl:value-of select="quantum"/>
+                </td>
+                <td>
+                  <xsl:value-of select="events"/>
+                </td>
+              </tr>
+            </xsl:for-each>
+          </table>
+          <br/>
+        </xsl:if>
+        <xsl:if test="memory/summary">
+          <h2>Memory Usage Summary</h2>
+          <table class="counters">
+            <xsl:for-each select="memory/summary/*">
+              <xsl:variable name="css-class13">
+                <xsl:choose>
+                  <xsl:when test="position() mod 2 = 0">even</xsl:when>
+                  <xsl:otherwise>odd</xsl:otherwise>
+                </xsl:choose>
+              </xsl:variable>
+              <tr class="{$css-class13}">
+                <th>
+                  <xsl:value-of select="name()"/>
+                </th>
+                <td>
+                  <xsl:value-of select="."/>
+                </td>
+              </tr>
+            </xsl:for-each>
+          </table>
+          <br/>
+        </xsl:if>
+        <xsl:if test="memory/contexts/context">
+          <h2>Memory Contexts</h2>
+          <table class="mctx">
+            <tr>
+              <th>ID</th>
+              <th>Name</th>
+              <th>References</th>
+              <th>TotalUse</th>
+              <th>InUse</th>
+              <th>MaxUse</th>
+              <th>BlockSize</th>
+              <th>Pools</th>
+              <th>HiWater</th>
+              <th>LoWater</th>
+            </tr>
+            <xsl:for-each select="memory/contexts/context">
+              <xsl:sort select="total" data-type="number" order="descending"/>
+              <xsl:variable name="css-class14">
+                <xsl:choose>
+                  <xsl:when test="position() mod 2 = 0">even</xsl:when>
+                  <xsl:otherwise>odd</xsl:otherwise>
+                </xsl:choose>
+              </xsl:variable>
+              <tr class="{$css-class14}">
+                <td>
+                  <xsl:value-of select="id"/>
+                </td>
+                <td>
+                  <xsl:value-of select="name"/>
+                </td>
+                <td>
+                  <xsl:value-of select="references"/>
+                </td>
+                <td>
+                  <xsl:value-of select="total"/>
+                </td>
+                <td>
+                  <xsl:value-of select="inuse"/>
+                </td>
+                <td>
+                  <xsl:value-of select="maxinuse"/>
+                </td>
+                <td>
+                  <xsl:value-of select="blocksize"/>
+                </td>
+                <td>
+                  <xsl:value-of select="pools"/>
+                </td>
+                <td>
+                  <xsl:value-of select="hiwater"/>
+                </td>
+                <td>
+                  <xsl:value-of select="lowater"/>
+                </td>
+              </tr>
+            </xsl:for-each>
+          </table>
+        </xsl:if>
+        <hr/>
+        <p class="footer">Internet Systems Consortium Inc.<br/><a href="http://www.isc.org">http://www.isc.org</a></p>
       </body>
     </html>
   </xsl:template>
index 9b7ab4b2bdab77db47bc5fa0934db38ab08d0d88..f1e1edd28e031580775ee53776ee5f9008be1486 100644 (file)
@@ -302,6 +302,12 @@ static char xslmsg[] =
        " <xsl:value-of select=\"server/current-time\"/>\n"
        " </td>\n"
        " </tr>\n"
+       " <tr>\n"
+       " <th>Server version:</th>\n"
+       " <td>\n"
+       " <xsl:value-of select=\"server/version\"/>\n"
+       " </td>\n"
+       " </tr>\n"
        " </table>\n"
        " <br/>\n"
        " <xsl:if test=\"server/counters[@type=&quot;opcode&quot;]/counter[. &gt; 0]\">\n"
index f607cbd8d0b6885aa646ff2992b5fe83a26c3782..ff5ac5e9831773338e0dadb372583c68f5636211 100644 (file)
@@ -2373,6 +2373,7 @@ create_empty_zone(dns_zone_t *zone, dns_name_t *name, dns_view_t *view,
                dns_db_closeversion(db, &version, ISC_TRUE);
                CHECK(dns_zone_replacedb(zone, db, ISC_FALSE));
        }
+       dns_zone_setoption2(zone, DNS_ZONEOPT2_AUTOEMPTY, ISC_TRUE);
        dns_zone_setview(zone, view);
        CHECK(dns_view_addzone(view, zone));
 
index 3c55304e09c6517a381180c49cdc0f68906ecf04..adb9125d1d752072b9a5181d026bc28451144404 100644 (file)
@@ -80,6 +80,41 @@ static isc_once_t once = ISC_ONCE_INIT;
 #undef EXTENDED_STATS
 #endif
 
+#ifdef EXTENDED_STATS
+static const char *
+user_zonetype( dns_zone_t *zone ) {
+       dns_zonetype_t ztype;
+       dns_view_t *view;
+       static const struct zt {
+               const dns_zonetype_t type;
+               const char *const string;
+       } typemap[] = {
+               { dns_zone_none, "none" },
+               { dns_zone_master, "master" },
+               { dns_zone_slave, "slave" },
+               { dns_zone_stub, "stub" },
+               { dns_zone_staticstub, "static-stub" },
+               { dns_zone_key, "key" },
+               { dns_zone_dlz, "dlz" },
+               { dns_zone_redirect, "redirect" },
+               { 0, NULL }
+       };
+       const struct zt *tp;
+
+       if ((dns_zone_getoptions2(zone) & DNS_ZONEOPT2_AUTOEMPTY) != 0)
+               return ("builtin");
+
+       view = dns_zone_getview(zone);
+       if (view != NULL && strcmp(view->name, "_bind") == 0)
+               return ("builtin");
+
+       ztype = dns_zone_gettype(zone);
+       for  (tp = typemap; tp->string != NULL && tp->type != ztype; tp++)
+               /* empty */;
+       return (tp->string);
+}
+#endif
+
 /*%
  * Statistics descriptions.  These could be statistically initialized at
  * compile time, but we configure them run time in the init_desc() function
@@ -1296,6 +1331,7 @@ zone_xmlrender(dns_zone_t *zone, void *arg) {
        isc_uint64_t nsstat_values[dns_nsstatscounter_max];
        int xmlrc;
        stats_dumparg_t dumparg;
+       const char *ztype;
 
        statlevel = dns_zone_getstatlevel(zone);
        if (statlevel == dns_zonestat_none)
@@ -1315,6 +1351,14 @@ zone_xmlrender(dns_zone_t *zone, void *arg) {
        TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "rdataclass",
                                         ISC_XMLCHAR buf));
 
+       TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "type"));
+       ztype = user_zonetype(zone);
+       if (ztype != NULL)
+               TRY0(xmlTextWriterWriteString(writer, ISC_XMLCHAR ztype));
+       else
+               TRY0(xmlTextWriterWriteString(writer, ISC_XMLCHAR "unknown"));
+       TRY0(xmlTextWriterEndElement(writer)); /* type */
+
        TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "serial"));
        if (dns_zone_getserial2(zone, &serial) == ISC_R_SUCCESS)
                TRY0(xmlTextWriterWriteFormatString(writer, "%u", serial));
@@ -1418,6 +1462,9 @@ generatexml(ns_server_t *server, isc_uint32_t flags,
        TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "current-time"));
        TRY0(xmlTextWriterWriteString(writer, ISC_XMLCHAR nowstr));
        TRY0(xmlTextWriterEndElement(writer));  /* current-time */
+       TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "version"));
+       TRY0(xmlTextWriterWriteString(writer, ISC_XMLCHAR ns_g_version));
+       TRY0(xmlTextWriterEndElement(writer));  /* version */
 
        if ((flags & STATS_XML_SERVER) != 0) {
                dumparg.result = ISC_R_SUCCESS;
@@ -1896,8 +1943,8 @@ wrap_jsonfree(isc_buffer_t *buffer, void *arg) {
 }
 
 static json_object *
-addzone(char *name, char *class, isc_uint32_t serial,
-       isc_boolean_t add_serial)
+addzone(char *name, char *class, const char *ztype,
+       isc_uint32_t serial, isc_boolean_t add_serial)
 {
        json_object *node = json_object_new_object();
 
@@ -1909,6 +1956,9 @@ addzone(char *name, char *class, isc_uint32_t serial,
        if (add_serial)
                json_object_object_add(node, "serial",
                                       json_object_new_int64(serial));
+       if (ztype != NULL)
+               json_object_object_add(node, "type",
+                                      json_object_new_string(ztype));
        return (node);
 }
 
@@ -1940,9 +1990,11 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
        class_only = class;
 
        if (dns_zone_getserial2(zone, &serial) != ISC_R_SUCCESS)
-               zoneobj = addzone(zone_name_only, class_only, 0, ISC_FALSE);
+               zoneobj = addzone(zone_name_only, class_only,
+                                 user_zonetype(zone), 0, ISC_FALSE);
        else
-               zoneobj = addzone(zone_name_only, class_only, serial, ISC_TRUE);
+               zoneobj = addzone(zone_name_only, class_only,
+                                 user_zonetype(zone), serial, ISC_TRUE);
 
        if (zoneobj == NULL)
                return (ISC_R_NOMEMORY);
@@ -2057,6 +2109,9 @@ generatejson(ns_server_t *server, size_t *msglen,
        obj = json_object_new_string(nowstr);
        CHECKMEM(obj);
        json_object_object_add(bindstats, "current-time", obj);
+       obj = json_object_new_string(ns_g_version);
+       CHECKMEM(obj);
+       json_object_object_add(bindstats, "version", obj);
 
        if ((flags & STATS_JSON_SERVER) != 0) {
                /* OPCODE counters */
@@ -2466,7 +2521,7 @@ render_json(isc_uint32_t flags,
        json_object *bindstats = NULL;
        ns_server_t *server = arg;
        const char *msg = NULL;
-       size_t msglen;
+       size_t msglen = 0;
        char *p;
 
        UNUSED(url);
index 39f42806af9d331eace7a407f054f7cdf9388c79..49524fa9f61340e84c2685bf912a3e8e5ddd5fba 100644 (file)
@@ -130,5 +130,17 @@ fi
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
+ret=0
+n=`expr $n + 1`
+echo "I:checking that zones return their type ($n)"
+if ./xmlstats && [ -x ${CURL} ] ; then
+    ${CURL} http://10.53.0.1:8053/xml/v3/zones > curl.out.${t} 2>/dev/null || ret=1
+    grep '<zone name="32/1.0.0.127-in-addr.example" rdataclass="IN"><type>master</type>' curl.out.${t} > /dev/null || ret=1
+else
+    echo "I:skipping test as libxml2 and/or curl was not found"
+fi
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
+
 echo "I:exit status: $status"
 exit $status
index a5f3cde2756587f4935dbd8a405fffd69952144c..8837ea655e3ee01dc6280c7204cdab57c2c8da40 100644 (file)
@@ -93,7 +93,8 @@ typedef enum {
  * The following zone options are shifted left into the
  * higher-order 32 bits of the options.
  */
-#define DNS_ZONEOPT2_CHECKTTL    0x00000001    /*%< check max-zone-ttl */
+#define DNS_ZONEOPT2_CHECKTTL    0x00000001U   /*%< check max-zone-ttl */
+#define DNS_ZONEOPT2_AUTOEMPTY   0x00000002U   /*%< automatic empty zone */
 
 #ifndef NOMINUM_PUBLIC
 /*