Commit Graph

3131 Commits

Author SHA1 Message Date
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
Miek Gieben 3f504e8dab Merge pull request #160 from FiloSottile/fix_tcp_test_race
Tests: fix TestShutdownTCP race using NotifyStartedFunc
2014-12-17 14:02:00 +00:00
Filippo Valsorda 17a90cfd68 Tests: fix TestShutdownTCP race using NotifyStartedFunc 2014-12-17 13:46:50 +00:00
Miek Gieben 2c1a31d550 Small cleanup of the docs 2014-12-12 12:57:47 +00:00
Miek Gieben ab5f43b1a4 Merge pull request #159 from hlandauf/racefix
Add NotifyStartedFunc field to Server
2014-12-12 12:54:26 +00:00
Hugo Landau f039fd8203 Add NotifyStartedFunc field to Server
Adds a field, NotifyStartedFunc func() to Server.

If non-nil, it is called after a server starts listening. This is useful
for synchronization purposes, for example when a daemon needs to drop
privileges after binding. Otherwise, there is no way to determine when
the server has begun listening and hardcoded delays (!) must be used or
race conditions may occur.
2014-12-12 12:51:17 +00:00
Miek Gieben bb020c579e Merge pull request #158 from FiloSottile/loc_fixes
Add tests for LOC record String() generation and fix small problems
2014-12-10 14:06:03 +00: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 877e47b4c3 Merge pull request #157 from FiloSottile/intermittent_errors
Fix some intermittent errors
2014-12-09 15:37:00 +00:00
Filippo Valsorda e613ea6d07 Tests: silence a data race detected during server tests 2014-12-06 10:27:29 +00:00
Filippo Valsorda ddb0b0f565 Tests: wait for the server to be started before proceeding 2014-12-06 10:27:29 +00:00
Filippo Valsorda 0afbf1143c Extend the fixed-length int representation fixes to sig0.go 2014-12-06 10:27:27 +00:00
Filippo Valsorda c47471f80e [DNSSEC] Make int to bytes conversions fixed length in DSA (RFC 2536)
This fixes DSA key generation.
2014-12-06 10:26:56 +00:00
Filippo Valsorda ed475ae9fa [DNSSEC] Make int to bytes conversions fixed length in ECDSA
ECDSA public keys consist of a single value, called "Q" in FIPS
  186-3.  In DNSSEC keys, Q is a simple bit string that represents the
  uncompressed form of a curve point, "x | y".

  The ECDSA signature is the combination of two non-negative integers,
  called "r" and "s" in FIPS 186-3.  The two integers, each of which is
  formatted as a simple octet string, are combined into a single longer
  octet string for DNSSEC as the concatenation "r | s".  (Conversion of
  the integers to bit strings is described in Section C.2 of FIPS
  186-3.)  For P-256, each integer MUST be encoded as 32 octets; for
  P-384, each integer MUST be encoded as 48 octets.
2014-12-05 20:17:11 +00:00
Filippo Valsorda 0f1b1184ae Rename and simplify packing helper functions 2014-12-05 19:27:44 +00:00
Filippo Valsorda bcc05715b3 Make some ECDSA failures more informative/accurate 2014-12-05 18:39:06 +00:00
Miek Gieben f01e44c2fd Merge pull request #156 from hlandauf/master
Remove extraneous spaces in String() methods
2014-11-28 20:47:24 +00:00