diff --git a/Makefile b/Makefile index 93475f83..596ae07b 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,7 @@ GOFILES=\ dnssec.go\ edns.go\ keygen.go\ + kscan.go\ msg.go\ nsec3.go \ qnamestring.go\ diff --git a/zscan.go b/zscan.go index d278b1d5..5a8d5421 100644 --- a/zscan.go +++ b/zscan.go @@ -15,6 +15,7 @@ import ( // * Handle comments: ; // * Handle braces. const ( + // Zonefile _EOF = iota // Don't let it start with zero _STRING _BLANK @@ -23,6 +24,10 @@ const ( _OWNER _CLASS + // Privatekey file + _VALUE + _KEY + _EXPECT_OWNER // Ownername _EXPECT_OWNER_BL // Whitespace after the ownername _EXPECT_ANY // Expect rrtype, ttl or class @@ -82,7 +87,7 @@ func ParseZone(r io.Reader, cr chan RR) { s.Mode = 0 s.Whitespace = 0 // Start the lexer - go lexer(s, c) + go zlexer(s, c) // 5 possible beginnings of a line, _ is a space // 1. _OWNER _ _RRTYPE -> class/ttl omitted // 2. _OWNER _ _STRING _ _RRTYPE -> class omitted @@ -216,8 +221,8 @@ func (l Lex) String() string { return "" } -// lexer scans the sourcefile and returns tokens on the channel c. -func lexer(s scanner.Scanner, c chan Lex) { +// zlexer scans the sourcefile and returns tokens on the channel c. +func zlexer(s scanner.Scanner, c chan Lex) { var l Lex str := "" // Hold the current read text quote := false