137 Commits

Author SHA1 Message Date
Miek Gieben
0c0b97f72b Parsing fix for lines starting with class or TTL
name.   IN SOA  a6.nstld.com. hostmaster.nic.name ....
              IN 7200   NS      j6.nstld.com.
              7200 IN     NS      k6.nstld.com.

Wasn't handled properly
2012-02-27 18:48:53 +01:00
Miek Gieben
3b089b94fc slightly faster parsing 2012-02-23 20:13:37 +01:00
Miek Gieben
f9d3068eb9 Parsing speed increase of facter 2/3
Implemented my own little tokenizer in scanner.go. I only use the
stuff I need.
2012-02-21 22:41:00 +01:00
Miek Gieben
fee04d5ef9 Small tweaks to make it faster 2012-02-19 20:51:04 +01:00
Miek Gieben
c15712dbf6 remove unneed byte() 2012-02-19 19:57:01 +01:00
Miek Gieben
88a0052d1d Fix newline/space handling and braces
( dsjkdjk
djsdjk
)

( dkjsdjsd
  djskdjsd
)

Are two different strings, the above contains NO spaces, the bottom
one does. This doesn't matter anywhere, except in HIP record, which
say some data may not contain spaces.
2012-02-19 12:04:27 +01:00
Miek Gieben
c2e99e8b41 Get started for the LOC record 2012-02-18 19:24:53 +01:00
Miek Gieben
ef709d6e77 remove empty line 2012-02-15 23:08:21 +01:00
Miek Gieben
4f118afe8c Error start wth a lowercase 2012-02-15 23:04:46 +01:00
Miek Gieben
73c743feb2 Compile error 2012-02-15 21:55:34 +01:00
Miek Gieben
596e0618a7 Update the documentation 2012-02-15 12:50:23 +01:00
Miek Gieben
ef524d882a Add features to soa parsing 2012-02-15 09:04:09 +01:00
Miek Gieben
697d67ea96 Fix origin handling and fix lines which start with ownernames
Zonefile handling is more robust and more up to the specs.
Also added a new zone file which has some nice properties
which trigger corner cases.
2012-02-15 08:47:31 +01:00
Miek Gieben
0a79fd28e0 nicer 2012-02-14 16:15:44 +01:00
Miek Gieben
63d8b1feb1 Implement TTLs in words
1H, 1M, 1W2D, etc. should now be parsed in TTLs
2012-02-14 15:14:54 +01:00
Miek Gieben
b3a58abd24 discard \r when reading zonefile 2012-02-14 14:05:33 +01:00
Miek Gieben
35bd7ac4f4 Slightly shorter 2012-02-14 13:57:12 +01:00
Miek Gieben
7ef88cf5b3 Add support for @
For this to work ParseZone was extended to accept a starting
origin. This way even zonefiles without $ORIGIN would work
as expected. This is an api change.
2012-02-14 13:46:40 +01:00
Miek Gieben
b49e4f2411 Allow @ to be recognized as zone origin 2012-02-14 13:23:09 +01:00
Miek Gieben
d10b0f731e We indeed need a larger buffer 2012-02-13 21:57:22 +01:00
Miek Gieben
5dbfc48a5e start fixing for unknown rrs parsing/printing 2012-02-13 21:12:14 +01:00
Miek Gieben
b888c94542 Update defttl as we go 2012-02-13 19:26:44 +01:00
Miek Gieben
fece54374d Support comments after $DIRECTIVEs
Just read until the end of the line after the first string.
2012-02-13 19:14:11 +01:00
Miek Gieben
c9da0472de Update the documentation 2012-02-13 17:52:53 +01:00
Miek Gieben
2f64868d3c Add quotes to the parsing engine.
Support:
TXT
NAPTR

And other record that we may use.
2012-02-13 13:19:37 +01:00
Miek Gieben
42efa912b5 Almost there with parsing 2012-02-12 23:00:26 +01:00
Miek Gieben
a7b2a88e7a Parsing TXT records now works OK 2012-02-12 22:24:18 +01:00
Miek Gieben
5a48b54327 added quotes as important chars in the parser 2012-02-12 19:06:32 +01:00
Miek Gieben
9c478ab6e4 Add the dot in the correct place 2012-02-12 12:36:26 +01:00
Miek Gieben
34a711372a Fix the ORIGIN appending 2012-02-12 12:28:08 +01:00
Miek Gieben
a21f7c6b30 Documentation updates and parsing fixes 2012-02-12 11:45:44 +01:00
Miek Gieben
da440eb9f0 remove debugging 2012-02-05 11:35:58 +01:00
Miek Gieben
77b60231e7 If we add a dot to a name, be sure to remove one from the length 2012-02-05 11:33:55 +01:00
Miek Gieben
ed61734c89 Optimize the RR reading further
remove len(strings) from the code. 16% increase
in speed. Getting about 35K RR/s
2012-01-30 21:26:29 +01:00
Miek Gieben
09ac6c8dc5 gofmt 2012-01-28 00:35:37 +01:00
Miek Gieben
8b03f43ee7 try it with 512 bytes 2012-01-28 00:04:31 +01:00
Miek Gieben
06ab0a998a Make parsing 50% faster by elminating allocation
* We now use a [1024]byte buffer to store the token
* Return an error when this is to small
2012-01-27 23:59:21 +01:00
Miek Gieben
74181dee8e More tests 2012-01-22 20:44:52 +01:00
Miek Gieben
0211c1663d Add ReadRR function 2012-01-22 20:20:30 +01:00
Miek Gieben
698660270a better handle recursive includes 2012-01-21 23:46:53 +01:00
Miek Gieben
01cb137157 better handle recursive includes 2012-01-21 23:42:33 +01:00
Miek Gieben
add6f10462 support $INCLUDE
ParseZone now needs a filename to report the
correct file
2012-01-21 23:36:54 +01:00
Miek Gieben
9b48d4b899 gofmt 2012-01-12 22:49:26 +01:00
Miek Gieben
a3949750be Somewhat nicer 2012-01-12 11:17:01 +01:00
Miek Gieben
ecfd5451a9 Remove the Labels() function.
This is now handled inside IsDomainName, which really parses
the name and then (also) returns the number of labels found.
2012-01-08 15:54:33 +01:00
Miek Gieben
0322d3a9da Fix $ORIGIN in zonefiles
also check if a dname isn't fq, and add $ORIGIN is not.
2012-01-08 14:06:58 +01:00
Miek Gieben
822c8c66e2 Revert "partially working code"
This reverts commit fa0d78db9e5f54028972d635b5e7f0865b5219f0.
2012-01-05 13:24:35 +01:00
Miek Gieben
e2ecf8b80a Revert "I can parse again"
This reverts commit 0d08da5d844b02a48297eec88ed0f4b0b966985e.
2012-01-05 13:24:27 +01:00
Miek Gieben
662ab3dac9 Revert "Use 64K buffer"
This reverts commit 041b8e196e375381070a7fe835e2ba2539588113.
2012-01-05 13:24:20 +01:00
Miek Gieben
0877df185c Revert "Use larger buffer to speed things up"
This reverts commit f999d52e7eb32b09d87776a919db644db5f3f2b1.
2012-01-05 13:24:11 +01:00