From df73fb3155a0b5d30dccb0737d09f19fbc6aff41 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Tue, 7 Jul 2015 14:48:49 +0200 Subject: [PATCH] Move pipebackend-abi-version to the pipebackend 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 | 22 +++++++++++++-------- docs/markdown/authoritative/settings.md | 1 + modules/pipebackend/pipebackend.cc | 5 +++-- pdns/common_startup.cc | 1 - pdns/pdns.conf-dist | 5 ----- 5 files changed, 18 insertions(+), 16 deletions(-) diff --git a/docs/markdown/authoritative/backend-pipe.md b/docs/markdown/authoritative/backend-pipe.md index 682df3e563..4f4f3077c6 100644 --- a/docs/markdown/authoritative/backend-pipe.md +++ b/docs/markdown/authoritative/backend-pipe.md @@ -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` +| | | +|:-|:-| +|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` | | | |:-|:-| @@ -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 ``` diff --git a/docs/markdown/authoritative/settings.md b/docs/markdown/authoritative/settings.md index 767985036b..932d3b7863 100644 --- a/docs/markdown/authoritative/settings.md +++ b/docs/markdown/authoritative/settings.md @@ -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). diff --git a/modules/pipebackend/pipebackend.cc b/modules/pipebackend/pipebackend.cc index 2b6e31c798..4723e4f965 100644 --- a/modules/pipebackend/pipebackend.cc +++ b/modules/pipebackend/pipebackend.cc @@ -98,7 +98,7 @@ PipeBackend::PipeBackend(const string &suffix) d_coproc=shared_ptr(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<