Commit Graph

3147 Commits

Author SHA1 Message Date
Miek Gieben dfa09b604c Very small cleanups 2015-02-04 06:55:03 +00:00
Yann Kerhervé 80d2db2e86 Fix ignored last line of resolv.conf
When ClientConfigFromFile is given a file that is missing a newline
before EOF, then the last directive is completely ignored.

This also adds a very basic test for a normal resolv.conf parsing.
2015-02-03 16:27:39 -08:00
Miek Gieben a76c0a363d Merge branch 'master' of github.com:miekg/dns 2015-01-27 08:20:08 +00:00
Miek Gieben 50890090cb Merge branch 'ipseckey'
Tentatively merging.
2015-01-27 08:17:50 +00:00
Miek Gieben ca7706307e Merge pull request #177 from StalkR/dns-reverse-proxy
README: update Users: StalkR/misc/dns/proxy moved to its own repo
2015-01-26 10:29:39 +00:00
StalkR 48aa88a987 README: update Users: StalkR/misc/dns/proxy moved to its own repo at StalkR/dns-reverse-proxy 2015-01-25 18:39:30 +01:00
Miek Gieben b6ff23905a Finish implementing IPSECKEY
Remaining tests and unpack for IPSECKEY.
2015-01-25 12:24:39 +00:00
Miek Gieben 3244eb7baa Merge pull request #173 from FiloSottile/privkey_refactor
PrivateKey refactor
2015-01-25 12:08:34 +00:00
Miek Gieben 477cb4d3fa Implement IPSECKEY
IPSECKEY is kinda strange because it has a type selector which tells
what type a later rdata field has. The type can be a domainname, address
or v6 address. You sort of wish Go would have a union type for this, but
alas.
Currently this is implemented as:

	GatewayA    net.IP `dns:"a"`
	GatewayAAAA net.IP `dns:"aaaa"`
	GatewayName string `dns:"domain-name"`

In the IPSECKEY. Only one of these is active at any one time. When
parsing/packing and unpacking the value of GatewayType is checked
to see what to do.

Parsing from strings is also implemented properly and tested. The Unpack
function still needs work.
2015-01-25 10:58:30 +00:00
Filippo Valsorda 3035815b29 Reorder DNSSEC code 2015-01-23 13:06:08 -08:00
Filippo Valsorda e9faa971b3 Refactor the DNSSEC private key code
Now PrivateKey is an interface exposing Sign() and String(). Common
implementations are wrappers for {rsa|dsa|ecdsa}.PrivateKey but
this allows for custom signers, and abstracts away the private-ops
code to a single place.
2015-01-23 13:04:29 -08:00
Miek Gieben 7f65f12951 Merge pull request #175 from flebarbe/master
Add support for HmacSHA512 algorithm in TSIG
2015-01-23 10:05:14 +00:00
Flavien Lebarbe 067cfe8d4e Add support for HmacSHA512 algorithm in TSIG 2015-01-23 10:51:56 +01:00
Miek Gieben 3fcd28bab1 Merge branch 'master' of github.com:miekg/dns 2015-01-23 07:16:05 +00:00
Miek Gieben ebbe30ad4e axfr test is flaky
Off for now: can be turned on, but we need to up a local server
and xfr from there.
2015-01-23 07:15:26 +00:00
Filippo Valsorda 3fd8a8eef6 Fix: RSA key export and its test 2015-01-22 22:02:20 -08:00
Miek Gieben f2aff624fc Fix SetIxfr
Making a ixfr message requires a complete SOA. Add to paramaters
to SetIxfr: Ns and Mbox that will be used in the SOA in the msg.
2015-01-22 09:01:49 +00:00
Miek Gieben 2efce5c9e0 Short tests 2015-01-21 18:26:30 +00:00
Miek Gieben d344ff065b Move all AXFR tests to their own file 2015-01-21 17:37:20 +00:00
Miek Gieben 7232d0cce1 Merge branch 'master' of github.com:miekg/dns 2015-01-16 07:48:51 +00:00
Miek Gieben 33e6f6fe1b Add dnsproxy as a project 2015-01-16 07:48:43 +00:00
Miek Gieben 68de7327c0 Merge pull request #172 from StalkR/second
minor clean ups: use time.Second instead of 1e9
2015-01-15 22:17:04 +00:00
StalkR fe160dfba4 minor clean ups: use time.Second instead of 1e9, do not reference ns as time.Duration is enough 2015-01-15 23:11:11 +01:00
Miek Gieben 22cf53fe1e Merge pull request #171 from StalkR/xfr
xfr: Transfer.Out use a new Msg every time
2015-01-15 13:00:16 +00:00
StalkR 1d1dad9498 xfr: Transfer.Out use a new Msg every time 2015-01-15 13:07:26 +01:00
Miek Gieben 06484909b2 Merge pull request #170 from StalkR/sync
xfr: make Transfer.Out synchronous
2015-01-15 10:43:15 +00:00
StalkR cf4c9a358e xfr: make Transfer.Out synchronous 2015-01-15 11:39:47 +01:00
Miek Gieben 2c80cd7c5c Merge branch 'format' 2015-01-13 16:40:23 +00:00
Miek Gieben 3431a56aac Typo in comment 2015-01-13 16:21:24 +00:00
Miek Gieben cd839f929c Merge branch 'master' of github.com:miekg/dns 2015-01-13 14:59:50 +00:00
Miek Gieben f5bc1323a1 update.go: make RemoveRRset as dumb as the rest.
The RemoveRRset method was the only one that had a check for RRsets.
While adding multiple identical RRs is an error, there should be now
check for that at this level.
2015-01-13 14:40:53 +00:00
Miek Gieben 733a2d3822 Remove code, fix doc and fix test 2015-01-13 11:43:57 +00:00
Miek Gieben 7777789184 Some remarks on wks 2015-01-13 10:39:13 +00:00
Miek Gieben aa1047c551 Remove format test 2015-01-13 10:21:50 +00:00
Miek Gieben 5d8dbab4c8 Remove the fmt Formatters
Formatters are not needs you can access the members just fine.
However the rdata Field access function are handy and non-trivial,
extend them and add a basic test.
2015-01-13 10:20:34 +00:00
Miek Gieben 2b6f0d61e5 When locking *do* unlock
Add unlocking to some more places as pointed out by bronze1man.

Really closes #161.
2015-01-13 08:12:02 +00:00
Miek Gieben 9c3a117004 Add some more string conversion 2015-01-12 22:33:49 +00:00
Miek Gieben 59ad100e22 Need to implement some more verbs as well 2015-01-12 09:54:56 +00:00
Miek Gieben a8e252952e Doc tweaks 2015-01-11 22:15:41 +00:00
Miek Gieben 735efcbd10 Allow access (as strings) to the rdata of each RR 2015-01-11 21:01:54 +00:00
Miek Gieben 74b8577dc6 Better docs 2015-01-11 18:03:32 +00:00
Miek Gieben 1e8afcf787 Fix the tests, add the %s verb as well 2015-01-11 17:55:39 +00:00
Miek Gieben 78d0037371 And add the new file... 2015-01-11 17:28:21 +00:00
Miek Gieben aaa3aba4ed Implement custom verbs for fmt.Printf use
The dns package implements String() for all RR types, but sometimes you will
need more flexibility. The functions Printf, Sprintf, etc. implemented formatted I/O
for the RR type.

Printing

The verbs:

Generic part of RRs:

     %N	the owner name of the RR
     %C	the class: IN, CH, CLASS15, etc.
     %D	the TTL in seconds
     %Y	the type: MX, A, etc.

The rdata of each RR differs, we allow each field to be printed as a string.

Rdata:

     %0	the first rdata field
     %1	the second rdata field
     %2	the third rdata field
     ..	...
     %9      the nineth rdata field
     %R	all rdata fields

The rdata fields remain a TODO, but will be implemented using
reflection.
2015-01-11 17:23:02 +00:00
Miek Gieben a07be6b2c1 Server: unlock when already started.
Closes #161
2015-01-11 09:26:00 +00:00
Miek Gieben 79f88fc5d7 fmt 2015-01-11 09:23:26 +00:00
Miek Gieben 5bde7ab7ea Put the zscan_test.go in parse_test.go 2015-01-11 09:20:04 +00:00
Miek Gieben 9af97127a9 Merge pull request #165 from xofyarg/master
add checks to prevent panic when parsing zone text.
2015-01-11 09:18:10 +00:00
anb 8ac429e4e8 add checks to prevent panic when parsing zone text. 2015-01-11 16:36:46 +08:00
Miek Gieben 8da60e45f5 Remove refs to IsMsg - we are not going to do this 2015-01-08 09:42:46 +00:00