Commit Graph

337 Commits

Author SHA1 Message Date
Miek Gieben bca469e6b1 Fix other string len occurences
Add the +1 in the correct places for the RR length calculations.
2014-01-04 12:50:18 +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
Miek Gieben 6b32a711e9 Allocate just enough space
Remove the len()*2, and replace it with len()+1. The current
len() impl. of the types is good enough to be more precise.
2013-12-06 11:30:33 +00:00
Miek Gieben 70ee966106 Fix the unknown record sign test
Don't make up new error in msg.Pack when there are perfectly fine
errors to return.
2013-12-06 09:43:26 +00:00
Miek Gieben 6c9cc37ac3 Small tweaks to the pull request from Alex 2013-12-06 07:46:08 +00:00
Miek Gieben 110f6c9ea7 Test for TYPE65534 records, copy now copies slices correctly 2013-12-06 07:37:48 +00:00
Miek Gieben ca52132cef reverse this until I have evidence it would be needed 2013-12-05 19:48:08 +00:00
Skinner, Alex edd235088a Added TYPE65534 record type so that zone scanning doesn't die upon encountering one. Fixed DNSSEC signature verification. 2013-12-04 12:58:20 -05:00
Miek Gieben ff7806469c Implement EID and NIMLOC records 2013-10-19 21:31:12 +01:00
Miek Gieben 221e0c0e4e some doc updates 2013-10-13 13:27:50 +01:00
Miek Gieben 35bcc78d76 Implement PX record 2013-10-13 13:23:02 +01:00
Miek Gieben cc2c42cc91 Implement GPOS record 2013-10-13 13:01:33 +01:00
Miek Gieben 961e137891 Add NSAP and NSAP-PTR record 2013-10-13 12:25:08 +01:00
Miek Gieben 67065da09c Fix the CAA type 2013-09-27 08:51:20 +00: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 f99d511479 if A or AAAA is nil return empty string
Now it returns <nil> for nil value, which can not be parsed
back to the record.
2013-08-31 20:07:13 +01:00
Miek Gieben 80f55713f1 comment update 2013-08-30 20:15:05 +01: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 9fa50d8ac2 Fix the nsec/3 length calculation
This overshoots, 'cause it only counts the windows, not the
actual bitmap sizes in the window. But it keeps the code
simple and fast.
2013-06-27 20:19:02 +01:00
Miek Gieben b651c7ea1f Fix TXT lenght again, but now it looks more right 2013-06-27 14:43:57 +00:00
Miek Gieben 245be76edf Revert "Fix length computation for TXT"
This reverts commit 795a69a6ec.
2013-06-26 22:22:31 +01:00
Miek Gieben b35306b755 Created two new types: Type and Class
Actually just go with Robert's suggestion as this seems the
cleanest way to do it. Also saves me from thinking about could
names for the new functions.
2013-06-08 14:09:37 +01:00
Miek Gieben c72535f2d6 Add TypeToTypeString and ClassToClassString
After some discussion with Robert Edmonds, these helper functions
seems in order. It is not what he requested (that was an RRType
and RRClass as new types), but is does make sense to add some
convience functions to save some typing. The dns package itself
also used these function (4 times). So clearly there is a need.

I'm not completely sold about the names.
2013-06-08 13:59:49 +01:00
Marc Capdevielle 795a69a6ec Fix length computation for TXT 2013-06-06 14:02:43 +02:00
Miek Gieben c66494c6c5 Resolv merge conflicts 2013-05-12 19:08:37 +02:00
Miek Gieben 98b677a97c Update the copy right for the original GO files 2013-05-12 16:07:06 +02:00
Miek Gieben e1151d6edc Update the Zone structure for NSEC and NSEC3 2013-05-07 09:44:21 +02:00
Miek Gieben 6c9efcdf1f Small tweaks 2013-04-30 16:56:30 +02:00
Miek Gieben 495b7d6552 Add UID/GID/UINFO record 2013-04-30 16:42:04 +02:00
Miek Gieben 8285ae4e56 add uinfo uid gid and unspec rr type number 2013-04-30 15:20:01 +02:00
Miek Gieben 9d9f5e0b95 Implement CAA 2013-04-30 15:04:07 +02:00
Miek Gieben 8d0b1a32cf Add the code, but does fit in the map anymore 2013-04-27 17:02:28 +01:00
Miek Gieben 0ddecce7e6 remove useless comment 2013-04-17 08:38:10 +01:00
Miek Gieben d098e9fdce Lengh is 6 bytes for eui48 2013-04-16 15:38:15 +01:00
Miek Gieben f43b7368bd Add tests for EUIxx 2013-04-16 08:41:35 +01:00
Miek Gieben 740ad9674c Allow EUI48 and EUI46 to be parsed 2013-04-16 08:41:35 +01:00
Miek Gieben 4c7a8b4985 Add EUI48 (108) and EUI64 (109)
This is an implementation of
http://tools.ietf.org/html/draft-jabley-dnsext-eui48-eui64-rrtypes-02
2013-04-16 08:40:24 +01:00
Miek Gieben a00f1d82de remove these printlns 2013-03-20 22:35:13 +00:00
Miek Gieben ed28992106 Merge branch 'master' of github.com:miekg/dns 2013-02-09 08:36:28 +01:00
Miek Gieben cd10853288 Make Len() and Copy() private
I don't think anybody will needs these, msg.Len() is still
available. Severly cuts back on the amount of exported functions.
2013-02-09 08:35:17 +01:00
Miek Gieben 8adb7c519c Flag bad rdlength as an error 2013-02-08 16:39:21 +01:00
Miek Gieben ed0aa9b5fb remove newline 2013-01-27 17:18:54 +01:00
Miek Gieben be7b4d5873 Start to add support for json marshalling 2013-01-24 21:13:37 +01:00
Miek Gieben a86aa5cdb6 Fix the rest of the URI stuff 2013-01-20 15:45:19 +01:00
Miek Gieben 27c20aff55 Fix URI 2013-01-20 15:43:40 +01:00
Miek Gieben 2e02b42558 Fix documentation too 2012-12-09 20:20:16 +01:00
Miek Gieben 235e892dfc Rename the RR types drop the RR_ prefix
This is also done in the official Go library. It also make the
code shorter.
2012-12-09 19:23:25 +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 48434502f4 layout tweaks in the source file 2012-11-30 14:05:08 +01:00
Miek Gieben 7298fe690c tweak layout 2012-11-30 13:25:55 +01:00
Miek Gieben 7bd7a65e4d Add CAA 2012-11-20 16:53:58 +01:00
Miek Gieben 67343920d5 Add CDS type 2012-11-20 16:52:18 +01:00
Miek Gieben 4737bfa319 Add the all important RKEY 2012-11-20 16:48:28 +01:00
Miek Gieben 3686d24ca7 Add NINFO record 2012-11-20 16:42:16 +01:00
Miek Gieben f7956a96e6 ATMA 2012-11-20 14:32:06 +01:00
Miek Gieben d34c05f4fc Add def. of SIDN RR 2012-11-20 14:14:00 +01:00
Miek Gieben f6896bea4f Add X25 Resource Record 2012-11-20 14:07: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 a95de22bc3 Pref -> Preference for all types that have one 2012-11-18 09:13:43 +01:00
Miek Gieben 5afca3330b Add tests and uppercase output of L64 2012-11-18 09:10:28 +01:00
Miek Gieben 85366b595b Fix presentation format 2012-11-17 23:01:35 +01:00
Miek Gieben e2bc22cb43 Add LP record 2012-11-17 21:43:09 +01:00
Miek Gieben a509e3af80 Add L64 2012-11-17 21:37:15 +01:00
Miek Gieben 4aea3d193b Add L32 record 2012-11-17 21:32:02 +01:00
Miek Gieben 0c3a90193a Add the NID record 2012-11-17 21:26:48 +01:00
Miek Gieben 1751b8d753 more stuff 2012-09-11 22:00:19 +02:00
Miek Gieben f7f4aa7886 add more time functions 2012-09-11 21:54:07 +02:00
Miek Gieben 915781ea86 Better naming 2012-09-11 21:45:21 +02:00
Miek Gieben 3a6edfa2c9 fmt 2012-09-10 20:51:19 +02:00
Miek Gieben 6e9317868b doc tweaks 2012-09-01 17:06:24 +02:00
Miek Gieben e4fb00c34d Fix handling of non fully qualified domain names
When PackDomain sees such a name it calls panic.
All panic now use the prefix 'dns:'
2012-08-28 18:21:23 +02:00
Miek Gieben 80038f2230 docs 2012-08-26 22:40:00 +02:00
Miek Gieben 73b6d37885 cleanup api, dont export Year68 2012-08-17 08:29:45 +02:00
Miek Gieben a9126f1b54 Add RT type 2012-08-10 09:22:50 +02:00
Miek Gieben ff707cf2c0 revert this too 2012-06-30 14:49:37 +02:00
Miek Gieben f570d79c08 Export rr_mk (Rr_mk) 2012-06-30 13:16:38 +02:00
Miek Gieben e6fca0be3f Actually copy the RR for DNSSEC validation.
This is needed because we need to fiddle with the TTL and sometimes
even need to lowercase the rdata. We dont want this to propagate
to the original RRs
2012-06-20 19:16:54 +02:00
Miek Gieben 01442e58af more Copy() functions 2012-06-20 17:44:18 +02:00
Miek Gieben 4177512abe More Copy() methods 2012-06-20 17:12:10 +02:00
Miek Gieben a6f42f338a more copys 2012-06-20 14:32:23 +02:00
Miek Gieben 331276b2b1 add more Copy functions 2012-06-20 13:00:12 +02:00
Miek Gieben f48dba4ad1 Add Copy to all RRs 2012-06-20 11:56:25 +02:00
Miek Gieben 89ec077d8f Support the WKS record 2012-06-02 17:33:49 +02:00
Miek Gieben fb0623fbb2 change comments 2012-06-01 22:23:21 +02:00
Miek Gieben b2f459b7fa fixes 2012-06-01 18:29:07 +02:00
Miek Gieben de95ac0bb3 gofmt 2012-06-01 13:35:52 +02:00
Miek Gieben e747b8f46e Add AFSDB 2012-06-01 13:34:14 +02:00
Miek Gieben 969ce4371d Add support for MD and MF 2012-06-01 13:25:54 +02:00
Miek Gieben f3bb703019 gofmt 2012-05-22 08:48:26 +02:00
Miek Gieben 6b28ef1353 remove the TODO 2012-05-15 12:27:40 +02:00
Miek Gieben f0154aa0c2 Fix and test rfc 1982 arithmetic 2012-05-15 12:24:57 +02:00
Miek Gieben 8c74494576 Call all preferences Pref, like MX 2012-05-06 20:59:44 +02:00
Miek Gieben d3171d4f71 Also parse the RP record (wire + zone) 2012-05-01 22:57:22 +02:00
Miek Gieben d30dcf93e0 Doesnt parse from string - otherwise it works 2012-04-30 23:59:15 +02:00
Miek Gieben d85d8f9fe9 Start adding LOC tests 2012-04-30 21:42:58 +02:00
Miek Gieben b50e3f690e First chunk in parsing LOC RRs 2012-04-30 16:54:02 +02:00
Miek Gieben 2d231ae3b3 Fix LOC string output 2012-04-30 15:36:04 +02:00
Miek Gieben 60f368ba5b Almost there in printing the LOC record 2012-04-30 14:50:52 +02:00
Miek Gieben 1948cd2a90 Use go vetted struct tags
They had the form: "domain-name", now they are key value pairs (key is
always dns: `dns:"domain-name"`
2012-04-29 21:55:29 +02:00
Miek Gieben a3befb0651 typecode assigned 2012-04-14 10:44:32 +02:00
Miek Gieben edf4b3d11b Test signing with ecdsa 2012-04-11 15:13:17 +02:00
Miek Gieben 9cbe439ce3 Fix tsig 48 bits timer 2012-03-02 23:12:23 +01:00
Miek Gieben e1873c28bc move tsig to tsig.go just as RR_OPT 2012-03-02 23:07:25 +01:00
Miek Gieben c5465127f3 Fix non tsig queries 2012-03-02 21:19:37 +01:00
Miek Gieben 3232814d1b Fix client side TSIG
Redesign of TSIG. Validation is on the TOOD - this can be
done in the same way as in the server.
2012-03-01 22:40:34 +01:00
Miek Gieben 8220a1b148 use maximum bitmap length 2012-02-28 21:06:11 +01:00
Miek Gieben a38a7311a0 NSEC3 bitmap length is still todo 2012-02-28 21:00:22 +01:00
Miek Gieben ef2e12b0dd Validation fixes, still not perfect, but much nicer 2012-02-25 22:04:29 +01:00
Miek Gieben 76d4547fbf Rename Cname to Target in RR_CNAME 2012-02-25 22:01:49 +01:00
Miek Gieben 4ee6d26106 correctly quote txt 2012-02-23 13:34:46 +01:00
Miek Gieben 9c5c2ee96f Fix very large SOA/TTL values 2012-02-19 18:36:59 +01:00
Miek Gieben c82a1af1e3 HIP unpack support -- not tested 2012-02-19 15:33:12 +01:00
Miek Gieben f45d4d933d Add length for base64 encodings 2012-02-19 15:24:26 +01:00
Miek Gieben 73f11ddf6b add URI record 2012-02-18 21:49:12 +01:00
Miek Gieben 9180a06d7c base16 is hex 2012-02-18 20:22:06 +01:00
Miek Gieben 8a619fd289 Some HIP stuff 2012-02-18 20:07:25 +01:00
Miek Gieben 8ff38fb8c1 Allow parsing of TLSA 2012-02-18 19:08:39 +01:00
Miek Gieben 70122e69d5 Add SPF record 2012-02-18 18:59:19 +01:00
Miek Gieben 30d6def515 Add support for IPSECKEY; no wirefmt conversion as of yet 2012-02-16 23:59:44 +01:00
Miek Gieben 5dbfc48a5e start fixing for unknown rrs parsing/printing 2012-02-13 21:12:14 +01:00
Miek Gieben d235bf4c2e Remove debugging stuff 2012-02-13 16:18:42 +01:00
Miek Gieben c30821fece Fix TXT packing and unpacking 2012-02-13 16:12:26 +01:00
Miek Gieben 2c44133163 Fixes for the new presentation of txt records 2012-02-13 15:59:40 +01:00
Miek Gieben 6ddb9ab88b Txt record parsing works -- need to look at the on-the-wire stuff 2012-02-12 21:50:02 +01:00
Miek Gieben 53dcc5a425 update the todo 2012-02-12 13:06:47 +01:00
Miek Gieben 4e397e31ec Add tlsa 2012-01-16 10:11:05 +01:00
Miek Gieben 9432a7deed Add TSLA type - no type code yet 2012-01-16 10:06:21 +01:00
Miek Gieben eb12c526f2 Add more tests 2012-01-11 21:03:47 +01:00
Miek Gieben 13f1f5b066 Question is compressible IMO 2012-01-11 16:22:58 +01:00
Miek Gieben 6d95911558 Dont allow the question section to be compressed 2012-01-11 16:16:09 +01:00
Miek Gieben f39d939f52 Fix compression
The compression was fixed. Also the packing of message is been speed
up, by a facter of 3. Now the packing happens once, instead of
3 times.

Two tests still fail. atm
2012-01-11 16:04:52 +01:00
Miek Gieben 3fae586071 update all the lengths 2012-01-11 14:36:48 +01:00
Miek Gieben b5d73f1eff Implement compressible domain names 2012-01-11 11:19:07 +01:00
Miek Gieben 15d82f0b34 Fix the size -- was counting the labels, not the bytes 2012-01-10 13:47:34 +01:00
Miek Gieben bacfa5a80c A Len() to RR interface
This isn't yet finished, but it helps in asserting the amount of
space to alloc when packing a message
2012-01-10 10:43:28 +01:00
Miek Gieben d6b1d886d1 Funkensturm updates 2011-12-20 12:53:47 +01:00
Miek Gieben 59a200131a Fix sig incep/expir rfc1982 calc. needs to be done 2011-12-17 13:05:44 +01:00
Miek Gieben ef7b6f525f gofmt 2011-12-16 14:48:30 +01:00
Miek Gieben 081166db5e Fix the tests (Again) + NewRR(str)
Parse tests start to get working again
NewRR reads a string and is the easiest way to get an RR
in your code.
2011-12-15 17:37:07 +01:00
Miek Gieben b73eaf020b Fix incep,expir date representation in rrsigs 2011-12-15 12:41:24 +01:00
Miek Gieben 32a879d970 New parsing works, but a lot of stuff needs to be fixed:
* Parsing the different records
* Parsing private key files (trivial, but needs to be done)
2011-12-14 11:30:29 +01:00
Miek Gieben 131f6962d1 gofmt 2011-12-09 21:45:57 +01:00
Miek Gieben 17d3f12d31 Fix NSEC presentation 2011-12-09 16:11:37 +01:00
Miek Gieben e115e5da6e Update to the latest weekly: weekly/weekly.2011-12-06
The new time API must still be used. But for now it compiles.
All DNSSEC/TSIG timing is probably broken
2011-12-09 11:16:49 +01:00
Miek Gieben 22a467e718 Fixes the latest weekly 2011-11-02 23:06:54 +01:00
Miek Gieben f252e2f3f0 Add documentation and fix the tests for TSIG
Everything is working, I get a complete TSIG verified AXFR from
miek.nl.
2011-09-11 01:37:06 +02:00
Miek Gieben 31b2aec24e Parse differently
Returned each parsed RR on a channel and let the caller decide what
to do with it.

Ragel is still broken, so this is non tested code.
2011-09-02 13:44:35 +02:00
Miek Gieben 8c5049bd06 Add actual type any as RR_ANY 2011-08-22 14:13:43 +02:00
Miek Gieben 18596dd3f8 Use typeANY, not typeALL 2011-08-22 14:11:41 +02:00
Miek Gieben 0d917b3c92 accept an uint16, not an int 2011-08-08 10:35:16 +02:00