mirror of
https://github.com/miekg/dns.git
synced 2025-08-11 12:06:58 +02:00
remove these files, stay lean and mean
This commit is contained in:
parent
f9f20203ad
commit
73cc848e00
7
Makefile
7
Makefile
@ -11,8 +11,6 @@ GOFILES=\
|
|||||||
types.go\
|
types.go\
|
||||||
dnssec.go\
|
dnssec.go\
|
||||||
edns.go\
|
edns.go\
|
||||||
server.go\
|
|
||||||
strconv.go\
|
|
||||||
|
|
||||||
include $(GOROOT)/src/Make.pkg
|
include $(GOROOT)/src/Make.pkg
|
||||||
|
|
||||||
@ -21,7 +19,7 @@ include $(GOROOT)/src/Make.pkg
|
|||||||
examples:
|
examples:
|
||||||
(cd examples; make)
|
(cd examples; make)
|
||||||
|
|
||||||
progs: dnssectest keytest
|
progs: dnssectest keytest readtest
|
||||||
|
|
||||||
# too lazy to lookup how this works again in Makefiles
|
# too lazy to lookup how this works again in Makefiles
|
||||||
dnssectest: dnssectest.go $(GOFILES)
|
dnssectest: dnssectest.go $(GOFILES)
|
||||||
@ -29,3 +27,6 @@ dnssectest: dnssectest.go $(GOFILES)
|
|||||||
|
|
||||||
keytest: keytest.go $(GOFILES)
|
keytest: keytest.go $(GOFILES)
|
||||||
6g -I _obj keytest.go && 6l -L _obj -o keytest keytest.6
|
6g -I _obj keytest.go && 6l -L _obj -o keytest keytest.6
|
||||||
|
|
||||||
|
readtest: readtest.go $(GOFILES)
|
||||||
|
6g -I _obj readtest.go && 6l -L _obj -o readtest readtest.6
|
||||||
|
1
TODO
1
TODO
@ -1,6 +1,7 @@
|
|||||||
Todo:
|
Todo:
|
||||||
* parse RRs from strings AToRR()
|
* parse RRs from strings AToRR()
|
||||||
* DNSSEC validation
|
* DNSSEC validation
|
||||||
|
* NSEC(3) secure denial of existence
|
||||||
* Unknown RRs
|
* Unknown RRs
|
||||||
* fix os.Erros usage
|
* fix os.Erros usage
|
||||||
|
|
||||||
|
27
keytest.go
Normal file
27
keytest.go
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"dns"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
key := new(dns.RR_DNSKEY)
|
||||||
|
key.Hdr.Name = "miek.nl"
|
||||||
|
key.Hdr.Rrtype = dns.TypeDNSKEY
|
||||||
|
key.Hdr.Class = dns.ClassINET
|
||||||
|
key.Hdr.Ttl = 3600
|
||||||
|
key.Flags = 256
|
||||||
|
key.Protocol = 3
|
||||||
|
key.Algorithm = dns.AlgRSASHA256
|
||||||
|
key.PubKey = "AwEAAcNEU67LJI5GEgF9QLNqLO1SMq1EdoQ6E9f85ha0k0ewQGCblyW2836GiVsm6k8Kr5ECIoMJ6fZWf3CQSQ9ycWfTyOHfmI3eQ/1Covhb2y4bAmL/07PhrL7ozWBW3wBfM335Ft9xjtXHPy7ztCbV9qZ4TVDTW/Iyg0PiwgoXVesz"
|
||||||
|
|
||||||
|
tag := key.KeyTag()
|
||||||
|
fmt.Printf("%v\n", key)
|
||||||
|
fmt.Printf("Wrong key tag: %d\n", tag)
|
||||||
|
|
||||||
|
m := new(dns.Msg)
|
||||||
|
m.Ns = make([]dns.RR, 1)
|
||||||
|
m.Ns[0] = key
|
||||||
|
m.Pack()
|
||||||
|
}
|
23
readtest.go
Normal file
23
readtest.go
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"dns"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
key := new(dns.RR_DNSKEY)
|
||||||
|
key.Hdr.Name = "miek.nl."
|
||||||
|
key.Hdr.Rrtype = dns.TypeDNSKEY
|
||||||
|
key.Hdr.Class = dns.ClassINET
|
||||||
|
key.Hdr.Ttl = 3600
|
||||||
|
key.Flags = 256
|
||||||
|
key.Protocol = 3
|
||||||
|
key.Algorithm = dns.AlgRSASHA256
|
||||||
|
key.PubKey = "AwEAAcNEU67LJI5GEgF9QLNqLO1SMq1EdoQ6E9f85ha0k0ewQGCblyW2836GiVsm6k8Kr5ECIoMJ6fZWf3CQSQ9ycWfTyOHfmI3eQ/1Covhb2y4bAmL/07PhrL7ozWBW3wBfM335Ft9xjtXHPy7ztCbV9qZ4TVDTW/Iyg0PiwgoXVesz"
|
||||||
|
|
||||||
|
fmt.Printf("%v\n", key)
|
||||||
|
|
||||||
|
s := "miek.nl. 3600 IN DNSKEY 256 3 8 AwEAAcNEU67LJI5GEgF9QLNqLO1SMq1EdoQ6E9f85ha0k0ewQGCblyW2836GiVsm6k8Kr5ECIoMJ6fZWf3CQSQ9ycWfTyOHfmI3eQ/1Covhb2y4bAmL/07PhrL7ozWBW3wBfM335Ft9xjtXHPy7ztCbV9qZ4TVDTW/Iyg0PiwgoXVesz"
|
||||||
|
dns.ParseString(s)
|
||||||
|
}
|
@ -6,7 +6,8 @@
|
|||||||
// A dns resolver is to be run as a seperate goroutine.
|
// A dns resolver is to be run as a seperate goroutine.
|
||||||
// For every reply the resolver answers by sending the
|
// For every reply the resolver answers by sending the
|
||||||
// received packet (with a possible error) back on the channel.
|
// received packet (with a possible error) back on the channel.
|
||||||
// A simple resolver can be setup with the following code:
|
//
|
||||||
|
// Basic usage pattern:
|
||||||
//
|
//
|
||||||
// res := new(Resolver)
|
// res := new(Resolver)
|
||||||
// ch := NewQuerier(res) // start new resolver
|
// ch := NewQuerier(res) // start new resolver
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
// Server side. An receiver listen for incoming packets.
|
|
||||||
// If the packet is wellformed it is passed on to the channel.
|
|
||||||
// Otherwise a FORMERR is returned directly.
|
|
||||||
//
|
|
||||||
package dns
|
|
||||||
|
|
||||||
// TODO MG
|
|
20
strconv.go
20
strconv.go
@ -1,20 +0,0 @@
|
|||||||
package dns
|
|
||||||
|
|
||||||
// use scanner or ebnf
|
|
||||||
|
|
||||||
// Convert a string to an resource record. The string must fir on one line.
|
|
||||||
// miek.nl. 3600 IN A 192.168.1.1 // ok
|
|
||||||
// miek.nl. IN A 192.168.1.1 // ok, ttl may be omitted
|
|
||||||
// miek.nl. A 192.168.1.1 // ok, ttl and class omitted
|
|
||||||
// miek.nl. 3600 A 192.168.1.1 // ok, class omitted
|
|
||||||
// IN A 192.168.1.1 // not ok
|
|
||||||
func ParseString(s string) *RR {
|
|
||||||
// up to first whitespace is domainname
|
|
||||||
// next word is:
|
|
||||||
// <number> -> TTL
|
|
||||||
// IN|CH|HS -> Class
|
|
||||||
// <rest> -> Type
|
|
||||||
// When the type is seen, we can read the rest
|
|
||||||
// of the string in an rr-specific manner
|
|
||||||
return nil
|
|
||||||
}
|
|
2
types.go
2
types.go
@ -15,6 +15,8 @@
|
|||||||
// DNS RR types definitions. See RFC 1035/.../4034 and many more.
|
// DNS RR types definitions. See RFC 1035/.../4034 and many more.
|
||||||
// To create quad-A record: "a.miek.nl" IN AAAA 2001:7b8:206:1:200:39ff:fe59:b187
|
// To create quad-A record: "a.miek.nl" IN AAAA 2001:7b8:206:1:200:39ff:fe59:b187
|
||||||
//
|
//
|
||||||
|
// Basic usage pattern:
|
||||||
|
//
|
||||||
// import "net" // for IP functions
|
// import "net" // for IP functions
|
||||||
// r := new(RR_AAAA)
|
// r := new(RR_AAAA)
|
||||||
// r.AAAA = net.ParseIP("2001:7b8:206:1:200:39ff:fe59:b187").To16()
|
// r.AAAA = net.ParseIP("2001:7b8:206:1:200:39ff:fe59:b187").To16()
|
||||||
|
Loading…
Reference in New Issue
Block a user