feature: plugin/rewrite: rewrite ANSWER SECTION (#1318)

Resolves: #1313
This commit is contained in:
Paul Greenberg
2018-01-18 10:41:14 -05:00
committed by John Belamaric
parent cb3190bab1
commit 258c163bb0
8 changed files with 161 additions and 11 deletions

View File

@@ -78,6 +78,11 @@ func (rule *edns0NsidRule) Mode() string {
return rule.mode
}
// GetResponseRule return a rule to rewrite the response with. Currently not implemented.
func (rule *edns0NsidRule) GetResponseRule() ResponseRule {
return ResponseRule{}
}
// Rewrite will alter the request EDNS0 local options
func (rule *edns0LocalRule) Rewrite(w dns.ResponseWriter, r *dns.Msg) Result {
result := RewriteIgnored
@@ -115,6 +120,11 @@ func (rule *edns0LocalRule) Mode() string {
return rule.mode
}
// GetResponseRule return a rule to rewrite the response with. Currently not implemented.
func (rule *edns0LocalRule) GetResponseRule() ResponseRule {
return ResponseRule{}
}
// newEdns0Rule creates an EDNS0 rule of the appropriate type based on the args
func newEdns0Rule(mode string, args ...string) (Rule, error) {
if len(args) < 2 {
@@ -312,6 +322,11 @@ func (rule *edns0VariableRule) Mode() string {
return rule.mode
}
// GetResponseRule return a rule to rewrite the response with. Currently not implemented.
func (rule *edns0VariableRule) GetResponseRule() ResponseRule {
return ResponseRule{}
}
func isValidVariable(variable string) bool {
switch variable {
case
@@ -423,6 +438,11 @@ func (rule *edns0SubnetRule) Mode() string {
return rule.mode
}
// GetResponseRule return a rule to rewrite the response with. Currently not implemented.
func (rule *edns0SubnetRule) GetResponseRule() ResponseRule {
return ResponseRule{}
}
// These are all defined actions.
const (
Replace = "replace"