]> granicus.if.org Git - pdns/commitdiff
update sample pipebackend script in docs, now a full include, thanks @davidstrauss
authorPeter van Dijk <peter.van.dijk@netherlabs.nl>
Wed, 21 Aug 2013 06:53:10 +0000 (08:53 +0200)
committerPeter van Dijk <peter.van.dijk@netherlabs.nl>
Wed, 21 Aug 2013 06:53:10 +0000 (08:53 +0200)
pdns/docs/pdns.xml

index 10b02b8a9db4b5d8c79d1bbf28e0d76b1f26bdae..d61d4a6485a71225989e47103fd985f8be8742fb 100755 (executable)
@@ -17222,62 +17222,7 @@ field indicates whether this response is authoritative; this is for DNSSEC.
        </sect3>
        <sect3>
        <title>Sample perl backend</title>
-       <para>
-       <screen>
-#!/usr/bin/perl -w
-# sample PowerDNS Coprocess backend
-#
-
-use strict;
-
-
-$|=1;                                  # no buffering
-
-my $line=&lt;&gt;;
-chomp($line);
-
-unless($line eq "HELO\t1") {
-       print "FAIL\n";
-       print STDERR "Received '$line'\n";
-       &lt;&gt;;
-       exit;
-}
-print "OK      Sample backend firing up\n";    # print our banner
-
-while(&lt;&gt;)
-{
-       print STDERR "$$ Received: $_";
-       chomp();
-       my @arr=split(/\t/);
-       if(@arr&lt;6) {
-               print "LOG      PowerDNS sent unparseable line\n";
-               print "FAIL\n";
-               next;
-       }
-
-       my ($type,$qname,$qclass,$qtype,$id,$ip)=split(/\t/);
-
-       if(($qtype eq "A" || $qtype eq "ANY") &amp;&amp; $qname eq "webserver.example.com") {
-               print STDERR "$$ Sent A records\n";
-               print "DATA     $qname  $qclass A       3600    -1      192.0.2.4\n";
-               print "DATA     $qname  $qclass A       3600    -1      192.0.2.5\n";
-               print "DATA     $qname  $qclass A       3600    -1      192.0.2.6\n";
-       }
-       elsif(($qtype eq "CNAME" || $qtype eq "ANY") &amp;&amp; $qname eq "www.example.com") {
-               print STDERR "$$ Sent CNAME records\n";
-               print "DATA     $qname  $qclass CNAME   3600    -1      webserver.example.com\n";
-       }
-       elsif($qtype eq "MBOXFW") {
-               print STDERR "$$ Sent MBOXFW records\n";
-               print "DATA     $qname  $qclass MBOXFW  3600    -1      powerdns\@example.com\n";
-       }
-
-
-       print STDERR "$$ End of data\n";
-       print "END\n";
-}
-         </screen>
-       </para>
+<programlisting><xi:include  href="../../modules/pipebackend/backend.pl"  parse="text"  xmlns:xi="http://www.w3.org/2001/XInclude"/></programlisting>
        </sect3>
       </sect2>
       <sect2><title id="implement-the-any-query">Notes</title>