Commit Graph

152 Commits

Author SHA1 Message Date
Miek Gieben 67945c119e A bunch of golint fixes
The proposed vars names are a nono, because they break the API.
Things left: document each RR and zscan_rr.go has some funcky if-then-elses.
2015-02-19 09:58:33 +00:00
anb 8ac429e4e8 add checks to prevent panic when parsing zone text. 2015-01-11 16:36:46 +08:00
John Graham-Cumming 3e97ddb0e0 Add tests for LOC record String() generation and fix small problems
Added tests for the cmToM function to make sure that it's output is
correct. Modified the way the Altitude is written to a string. Previously,
if the altitude was an exact number of meters it would always be reported
with two decimal places. This is not needed. Conversely if it was not
an exact number of meters the cm were removed.
2014-12-10 13:39:58 +00:00
Miek Gieben 3d8aa78c0a Merge pull request #127 from asergeyev/txtescapezscan
Fixed TXT parsing with escaped chars
2014-09-12 07:18:46 +01:00
Alex Sergeyev ae7d973e40 Updated code to handle escapes in TXT RDATA
Added test demonstrating error in TXT parsing.
Fixed lexing process and slightly updated conversion
back to strings.

See #126 for details.
2014-09-11 21:23:38 -04:00
Miek Gieben 0aa3021a83 Remove all copyright notices
Use the central COPYRIGHT file.
2014-09-11 20:57:37 +01:00
Alex Sergeyev 05bec3968a Addressed cases when tokenUpper makes sense to be used. 2014-08-28 13:34:00 -04:00
Alex Sergeyev 476d122030 Changed test for lowercase tokens; improved code:
* for cases if $ORIGIN or $TTL are used in mixed case
* changed test name too
2014-08-28 12:59:54 -04:00
Alex Sergeyev 755a8483b6 Committing @miekg patch from gist.
https://gist.github.com/miekg/f1b1fe6dba7d6b088eec
2014-08-28 12:59:54 -04:00
Miek Gieben 53a11d9163 better err message 2014-08-27 22:09:21 +01:00
Miek Gieben 17c7921aa2 Documentation updates 2014-07-31 08:48:26 +00:00
Miek Gieben 40333dd179 Fix trailing whitespace 2014-04-24 09:55:55 +00:00
Miek Gieben b0474155fb NewRR: add documentation about Rdlength
Rdlength is not set when the RR is returned from NewRR and friends.
2014-04-21 09:10:39 +01:00
Miek Gieben bae157c7ef remove bogus comments 2013-12-05 09:56:15 +00:00
Miek Gieben 186871d2a9 Add check for > maxUint16 sizes TYPEXXXX or CLASSXXX
These were silently wrapped in a uint16, nicer to actually give
an error.
2013-12-05 09:54:46 +00:00
Miek Gieben 792fd9743e Allow for escape spaces in NewRR
Fix omission in NewRR where the parsing does not allow for
escaped spaces (unless \032 was used).
2013-12-03 09:12:21 +00:00
Miek Gieben 8fec6dd3a3 Use *Token instead of Token when parsing
This result in a 10% speedup when parsing a zone from disk.
2013-11-09 19:34:46 +00:00
Miek Gieben 47cc5b052d Work on making IsDomainName better 2013-09-10 13:13:10 +00:00
Miek Gieben 3bba2c99c6 Kill the use of strings.ToUpper
This creates garbage and does not really help the parsing.
2013-05-15 19:43:10 +02:00
Miek Gieben 81941d4422 Update all copyright notices 2013-05-12 16:15:52 +02:00
Miek Gieben 709d11aa2c update documentation 2013-05-06 22:23:13 +02:00
Miek Gieben d53d9eab81 gofmt 2013-05-05 20:30:44 +02:00
Miek Gieben b323d0276a Docs 2013-03-05 13:56:59 +01:00
Miek Gieben 3ba1bf974e better doc 2013-03-04 17:21:34 +01:00
Miek Gieben ef9b83d3bd Docs 2013-03-04 15:01:49 +01:00
Miek Gieben 7b7eaaa4b0 Make (some) commments normative in zonefiles 2013-03-04 12:16:20 +01:00
Miek Gieben 525465db6d Add parse test and further tweaks 2013-03-04 11:24:08 +01:00
Miek Gieben 88c149cdb4 remove line 2013-03-04 10:05:47 +01:00
Miek Gieben ff062b8157 Parse comments in the lexer 2013-03-04 09:58:09 +01:00
Miek Gieben a5e9f8010d Use the new debbugging 2013-03-04 09:42:24 +01:00
Miek Gieben c413442565 add sane debugging 2013-03-04 09:40:45 +01:00
Miek Gieben 464a7bacf4 For ommited ttls fall back to $TTL or 3600
As per RFC 2308
2012-12-13 15:11:22 +01:00
Miek Gieben 623de14ebb Add missing checks if $ORIGIN's name is valid
Call IsDomainName() as $ORIGIN is rel. infrequent this does
not impact the parsing speed.
2012-12-13 10:14:22 +01:00
Miek Gieben d594c79d19 A optional new origin can be used after $INCLUDE
Add code to check for a new origin.
2012-12-13 10:08:35 +01:00
Miek Gieben 2a3b818b95 Use much more descriptive names for the maps
Alg_str -> AlgorithmToString
 Rr_str  -> TypeToString

And for the reverse maps also.
2012-12-02 09:29:54 +01:00
Miek Gieben a014286039 Some updates in the comments/documentation 2012-12-02 08:31:56 +01:00
Miek Gieben 6e605f578e Make the line count error reporting more sane 2012-11-22 13:41:40 +01:00
Miek Gieben fa55001b4c Add tests and fix bug in the parser
torc wasn't set in some part resulting in parsing a 'A' while
in fact the parsed record type should have been returned.
2012-11-22 11:54:46 +01:00
Miek Gieben 5a3db7b240 delayed newline counting
Fix a lot of corning cases for correct newline counting, but not
the ones where the closing brace is solely on a newline.
2012-11-21 22:21:40 +01:00
Miek Gieben c15d4fe3a3 Ugly hack to get line count correct
When the parser has read a \n to error messsage is off-by-one.
This fixes that.
2012-11-21 17:19:16 +01:00
Miek Gieben 314a0eebcc Add support for L32, NID, L64 and LP records 2012-11-18 10:29:05 +01:00
Miek Gieben 20a1a740c5 Check for @ begin used as origin in rdata 2012-11-09 10:34:51 +01:00
Miek Gieben 2999e6a509 Add check origin function 2012-11-08 23:10:31 +01:00
Miek Gieben 6f7aad15d8 documenation 2012-08-21 17:36:58 +02:00
Miek Gieben b720003623 make api smaller 2012-08-17 08:31:38 +02:00
Miek Gieben 7adc5ab95b make origin an fqdn 2012-07-16 19:46:16 +02:00
Miek Gieben 24bc5b8041 Actually use strings.HasPrefix correctly 2012-07-11 11:09:52 +02:00
Miek Gieben 722460f52d documentation 2012-07-06 20:44:41 +02:00
Miek Gieben a3fb69689b use buffered channels, as per Robs suggestion 2012-07-03 20:06:02 +02:00
Miek Gieben 26a6d3f833 small tweaks 2012-05-20 20:46:25 +02:00