]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Move pipebackend-abi-version to the pipebackend
authorPieter Lexis <pieter.lexis@powerdns.com>
Tue, 7 Jul 2015 12:48:49 +0000 (14:48 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Fri, 10 Jul 2015 09:05:15 +0000 (11:05 +0200)
This makes the ABI version specific to the launched backend. Also, fix a
typo in the help. Closes #2620

docs/markdown/authoritative/backend-pipe.md
docs/markdown/authoritative/settings.md
modules/pipebackend/pipebackend.cc
pdns/common_startup.cc
pdns/pdns.conf-dist

index 682df3e5639987b5c9b907af5dc730dc4eeaac36..4f4f3077c6a1b4268eb2136ecc09afdcd5ae35b8 100644 (file)
@@ -30,6 +30,17 @@ will not correspond to the queries that arrived over DNS. So, a query for an AAA
 can or should be done about this.
 
 ## Configuration Parameters
+### `pipe-abi-version`
+|&nbsp;|&nbsp;|
+|:-|:-|
+|Type|Integer|
+|Default|1|
+|Mandatory|No|
+
+This is the version of the question format that is sent to the co-process ([`pipe-command`](#pipe-command)) for the pipe backend.
+
+If not set the default `pipe-abi-version` is 1. When set to 2, the local-ip-address field is added after the remote-ip-address. (the local-ip-address refers to the IP address the question was received on). When set to 3, the real remote IP/subnet is added based on edns-subnet support (this also requires enabling 'edns-subnet-processing'). When set to 4 it sends zone name in AXFR request.
+
 ### `pipe-command`
 |&nbsp;|&nbsp;|
 |:-|:-|
@@ -55,11 +66,6 @@ If set, only questions matching this regular expression are even sent to the bac
 
 To match only ANY and A queries for www.powerdns.com, use `^www.powerdns.com;(A|ANY)$`.
 
-### `pipebackend-abi-version`
-This is the version of the question format that is sent to the co-process ([`pipe-command`](#pipe-command)) for the pipe backend.
-
-If not set the default pipebackend-abi-version is 1. When set to 2, the local-ip-address field is added after the remote-ip-address. (the local-ip-address refers to the IP address the question was received on). When set to 3, the real remote IP/subnet is added based on edns-subnet support (this also requires enabling 'edns-subnet-processing'). When set to 4 it sends zone name in AXFR request.
-
 ## Deploying the PipeBackend with the BindBackend
 Included with the PDNS distribution is the example.pl backend which has knowledge of the example.com zone, just like the BindBackend. To install both, add the following to your `pdns.conf`:
 
@@ -85,17 +91,17 @@ PowerDNS sends out `HELO\t1`, indicating that it wants to speak the protocol as
 
 The question format, for type Q questions:
 
-#### pipebackend-abi-version = 1 [default]
+#### pipe-abi-version = 1 [default]
 ```
 Q   qname       qclass  qtype   id  remote-ip-address
 ```
 
-#### pipebackend-abi-version = 2
+#### pipe-abi-version = 2
 ```
 Q   qname       qclass  qtype   id  remote-ip-address   local-ip-address
 ```
 
-#### pipebackend-abi-version = 3
+#### pipe-abi-version = 3
 ```
 Q   qname       qclass  qtype   id  remote-ip-address   local-ip-address    edns-subnet-address
 ```
index 767985036b4c3e212273cd505d56a29899460534..932d3b7863915fa0a949b7da57ce5392684d0a62 100644 (file)
@@ -520,6 +520,7 @@ been "yes" since 2005.
 ## `pipebackend-abi-version`
 * Integer
 * Default: 1
+* Removed in: 4.0.0 (is now specific to the backend)
 
 ABI version to use for the pipe backend. See
 ["PipeBackend protocol"](backend-pipe.md#pipebackend-protocol).
index 2b6e31c79840e7df5e3db5a8f4197e19aee5b841..4723e4f965956d51c82f4f7953fcc66710471063 100644 (file)
@@ -98,7 +98,7 @@ PipeBackend::PipeBackend(const string &suffix)
      d_coproc=shared_ptr<CoWrapper>(new CoWrapper(getArg("command"), getArgAsNum("timeout")));
      d_regex=getArg("regex").empty() ? 0 : new Regex(getArg("regex"));
      d_regexstr=getArg("regex");
-     d_abiVersion = ::arg().asNum("pipebackend-abi-version");
+     d_abiVersion = getArgAsNum("abi-version");
    }
    catch(const ArgException &A) {
       L<<Logger::Error<<kBackendId<<" Fatal argument error: "<<A.reason<<endl;
@@ -304,7 +304,8 @@ class PipeFactory : public BackendFactory
       {
          declare(suffix,"command","Command to execute for piping questions to","");
          declare(suffix,"timeout","Number of milliseconds to wait for an answer","2000");
-         declare(suffix,"regex","Regular exception of queries to pass to coprocess","");
+         declare(suffix,"regex","Regular expression of queries to pass to coprocess","");
+         declare(suffix,"abi-version","Version of the pipe backend ABI","1");
       }
 
       DNSBackend *make(const string &suffix="")
index ccf43f65cff070c1959d7af7544ce39aa9e404dd..1894bcf36ec67ac4db843e7164532c3d1b4b980e 100644 (file)
@@ -92,7 +92,6 @@ void declareArguments()
   ::arg().set("queue-limit","Maximum number of milliseconds to queue a query")="1500"; 
   ::arg().set("recursor","If recursion is desired, IP address of a recursing nameserver")="no"; 
   ::arg().set("allow-recursion","List of subnets that are allowed to recurse")="0.0.0.0/0";
-  ::arg().set("pipebackend-abi-version","Version of the pipe backend ABI")="1";
   ::arg().set("udp-truncation-threshold", "Maximum UDP response size before we truncate")="1680";
   ::arg().set("disable-tcp","Do not listen to TCP queries")="no";
   
index 9b8b80e05b9ea428e735ddf6afb89559ebd86771..670cab31706c346ece81b8d7ac420e9f439d5580 100644 (file)
 #
 # overload-queue-length=0
 
-#################################
-# pipebackend-abi-version      Version of the pipe backend ABI
-#
-# pipebackend-abi-version=1
-
 #################################
 # prevent-self-notification    Don't send notifications to what we think is ourself
 #