From e56d206542c901a48b28c4501fe5805e9e9e1a10 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Mon, 28 Mar 2016 12:08:05 +0100 Subject: Support outgoing zone transfers These can be enabled by adding "transfer out" to the Corefile. Without it no AXFR is allowed. For now only AXFR and no IXFR. No TSIG and no ACLs. --- middleware/file/tree/all.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 middleware/file/tree/all.go (limited to 'middleware/file/tree/all.go') diff --git a/middleware/file/tree/all.go b/middleware/file/tree/all.go new file mode 100644 index 000000000..f621e3465 --- /dev/null +++ b/middleware/file/tree/all.go @@ -0,0 +1,21 @@ +package tree + +// All traverses tree and returns all elements +func (t *Tree) All() []*Elem { + if t.Root == nil { + return nil + } + found := t.Root.all(nil) + return found +} + +func (n *Node) all(found []*Elem) []*Elem { + if n.Left != nil { + found = n.Left.all(found) + } + found = append(found, n.Elem) + if n.Right != nil { + found = n.Right.all(found) + } + return found +} -- cgit v1.2.3