dns/dnsmessage: add support for parsing and packing of DNS messages
The Go standard library contains support for packing and unpacking of
DNS messages, but it is not exported, doesn't follow Go style, and is
not very well optimized. Low level DNS functionality is clearly useful
to the Go community as evidenced by the success of
github.com/miekg/dns. This implementation endeavors to avoid the
limitations of both the standard library and github.com/miekg/dns
implementations and is an almost complete rewrite of the code
currently found in on net/dnsmsg.go and net/dnsmsg_test.go.
* Minimize heap allocations.
* Allow parsing only what is needed. Avoid unnecessary parsing and
heap allocations for parts of the message that you don't care about.
Parsing should be allowed on as small of a granularity as is useful,
but no smaller as to avoid complicating the interface.
* Parse and pack each byte of the message at most one time.
Run-TryBot: Mikio Hara <firstname.lastname@example.org>
TryBot-Result: Gobot Gobot <email@example.com>
Reviewed-by: Mikio Hara <firstname.lastname@example.org>
2 files changed