88 Commits

Author SHA1 Message Date
Miek Gieben
a945149fab Print unknown record type with CLASSX and TYPEX
When printing unknown records it is best to print the entire thing
as unknown, instead of relying on the internal defined type. An
example A record, printed as an unknown one:
    miek.nl.      3600    CLASS1  TYPE1   \# 4 0a000101
2014-11-02 11:06:05 +00:00
Miek Gieben
02dd474056 Dont export typeToRR (old rr_mk) 2014-09-16 07:31:20 +01:00
Miek Gieben
bcb640ccaf Make rr_mk public and call it TypeToRR 2014-09-16 07:15:06 +01:00
Miek Gieben
0aa3021a83 Remove all copyright notices
Use the central COPYRIGHT file.
2014-09-11 20:57:37 +01:00
Miek Gieben
06fc321c2c fmt 2014-08-30 08:45:10 +01:00
Miek Gieben
34f5a12bfc Don't crash on emtpy string in compressionLenSearch
Fixes #105
2014-08-22 08:46:24 +00:00
Miek Gieben
9f5fcf8459 Add extra length test for issue #105 2014-08-22 08:15:35 +01:00
Miek Gieben
f5fe400c53 Lowercase all test output.
Add Shutdown tests as well
2014-08-19 08:39:04 +00:00
Miek Gieben
5a8fe5d5f7 Add Copy test 2014-06-06 21:10:38 +01:00
Andrew Tunnell-Jones
8772f9064c Make PackRR enforce RR data length limit
• Make rawSetRdlength return false if length would overflow
• Make PackRR assume rawSetRdlength returning false indicates an overflow
2014-04-29 05:03:01 +00:00
Miek Gieben
87b380cad5 Revert "Use dLen for domain name length"
This reverts commit b59518383446378cde7758d16f925b5ee324c5a4.

Fix up the tests too.
2014-02-14 20:20:22 +00:00
Miek Gieben
c46b0e07c3 Normalize names a bit 2014-02-12 13:36:04 +00:00
Miek Gieben
89cc033428 Be much more precice in msg.Len()
There is still a one-off in EDNS0 records, but I'm not too bothered with
that one.
2014-02-12 12:59:42 +00:00
Miek Gieben
b595183834 Use dLen for domain name length 2014-02-12 12:50:16 +00:00
Miek Gieben
31102c38b7 Make Len() much more accurate for compressed messages.
Lots of changes made and bugs fixed.
2014-02-11 23:01:47 +00:00
Miek Gieben
d0fa099d08 Document and disable the test 2014-02-10 20:28:17 +00:00
Miek Gieben
d24565edc8 Merge branch 'len'
Cleanup the rest and add the test.
2014-02-10 20:20:08 +00:00
Miek Gieben
21283d2192 Improve msg.Len() accuracy
Currently msg.Len() overshoots a _lot_ when compression is
enabled. The main problem is that once a part of a domain is found to
be compressed, the whole domain is _not_ added back to compression
dictionary.

That means if we once cache ".microsoft.com" we won't cache
"blah.microsoft.com".

Ammended a bit: put the test in dns_test.go
2014-02-10 20:16:05 +00:00
Miek Gieben
372e3d55c3 More tests lenght 2014-02-10 12:29:33 +00:00
Miek Gieben
56e0bb46d8 Remove packLen() and fix bug in Len()
packLen() was a featureless mirror of Len(). Remove it, and just use
Len() internally too.
Fix bug in Len() too, where the length of the additional section was
not counted.
2014-02-10 12:23:53 +00:00
Alex Ciuba
008c1d5916 Add domain unpacking benchmark 2014-02-01 01:29:10 -05:00
Miek Gieben
dd35496669 dont care about padding for benchmark function 2014-01-29 07:56:21 +00:00
Miek Gieben
876680216e Revert "Revert "Add benchmark for message unpacking""
This reverts commit ca87093b6d0b1cb41d55df82e8143c4dab0c7dee.
2014-01-29 07:52:43 +00:00
Miek Gieben
509a6ff9e2 Revert "Revert "Fix benchmark alignment""
This reverts commit b8e6bd45bea3a58e61b6018f13fdd899a84e8639.
2014-01-29 07:52:23 +00:00
Miek Gieben
f2f9d43da5 Revert "Revert "Add more benchmarks""
This reverts commit 58a3a82b8e13c6147abfbb8eb1c6dd6fb0a7439e.
2014-01-29 07:51:36 +00:00
Miek Gieben
58a3a82b8e Revert "Add more benchmarks"
This reverts commit 5a3bf3d74996d4be97ff6ab5e27699f90ef42d39.
2014-01-28 22:44:07 +00:00
Miek Gieben
b8e6bd45be Revert "Fix benchmark alignment"
This reverts commit 008dfb4ee81e8a0bf7cee3ee59dc87d5bc02aac7.
2014-01-28 22:43:57 +00:00
Miek Gieben
ca87093b6d Revert "Add benchmark for message unpacking"
This reverts commit dc4eddaf9acd873ba8efd68e467cc9286f4591af.
2014-01-28 22:43:37 +00:00
Alex Ciuba
dc4eddaf9a Add benchmark for message unpacking 2014-01-27 20:55:15 -05:00
Alex Ciuba
008dfb4ee8 Fix benchmark alignment 2014-01-27 17:40:57 -05:00
Alex Ciuba
5a3bf3d749 Add more benchmarks 2014-01-27 17:33:14 -05:00
Miek Gieben
c17b6e8905 Merge pull request #68 from soh335/fix/empty-txt
if txt rdlength is 0, not read anymore
2014-01-04 06:41:58 -08:00
Miek Gieben
5b8a651bf0 Fix typo in comment 2014-01-04 11:53:50 +00:00
Miek Gieben
9e73cb688f Fix NAPTR's length function
Add the 3 bytes for the length byte of the strings.

Close issue #67.
2014-01-04 11:30:20 +00:00
soh335
e8a5f90957 if txt rdlength is 0, not read anymore 2014-01-04 17:30:08 +09:00
Miek Gieben
675f170a3d Fix axfr tsig 2013-10-12 14:00:10 +01:00
Miek Gieben
bf37f92d4a Some test tweaking 2013-09-29 11:30:03 +01:00
Miek Gieben
29232adf26 better comment 2013-08-31 20:26:24 +01:00
Miek Gieben
b6a2d1fb5e Allow empty rdata in records
Empty or no rdata is allowed for dynamic updates, so test if this
works for packing/unpacking. It only fails for TSIG (which is
never seen in zone files), SOA (which is not seen like this in dyn.
updates) and WKS (just an old record).
2013-08-31 20:24:52 +01:00
Miek Gieben
401a5e6429 Add unpack test too 2013-08-26 21:24:06 -07:00
Miek Gieben
fdcdc6dbf6 Add test to zero rdata (for dyn updates)
This triggerd a bunch of failures, the most important one
is the packing and zero length domain name now works.
2013-08-26 21:11:24 -07:00
Miek Gieben
cb9ec711f5 Add (failing) test for zero rdata 2013-08-25 21:38:10 -07:00
Miek Gieben
3f40afaafd Print the actual error 2013-06-27 20:01:32 +01:00
Miek Gieben
53789814d0 Add benchmarking tests - Len() is ~4 times after then packing and getting a length from that 2013-06-27 09:47:53 +00:00
Miek Gieben
1ad76fe65b Added packLen
packLen() returns the length of an uncompressed packet buffer, this
is used when packing a packet. This is needed for compression. When
compression is used, we first create the full packet and *then*
compress it. If we use Len() which accounts for compression, we can
get buffer overruns, when packing the (then still uncompressed) packet.
2013-06-26 22:18:09 +01:00
Ray Bejjani
d83e816f30 Changed TestLenCompress to use error inducing name
Long labels cause a packing out of bounds error. It is thrown at msg.go:268 in
the PackDomain function. It happens with messages of any construction (no RR
data, some RR data etc.).
2013-06-26 20:38:55 +01:00
Miek Gieben
b9f82b0a36 Cherry-pick specific hunks 2013-06-26 20:33:01 +01:00
Miek Gieben
38ea608d79 Rename the Label* functions
SplitLabels -> SplitDomainName
CompareLabels -> CompareDomainName
LenLabels -> CountLabel
          -> NextLabel was added as a simple iterator-like function
2013-06-22 07:21:15 +00:00
Miek Gieben
f595bf7a06 Set license on test files 2013-05-12 16:09:52 +02:00
Miek Gieben
6bd90e04c3 Fix the test 2013-02-08 16:47:21 +01:00