2010-12-25 01:53:17 +11:00
|
|
|
package dns
|
|
|
|
|
2010-12-25 23:09:27 +11:00
|
|
|
// use scanner or ebnf
|
|
|
|
|
2010-12-25 21:14:11 +11:00
|
|
|
// Convert a string to an resource record. The string must fir on one line.
|
2010-12-25 01:53:17 +11:00
|
|
|
// 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
|
2010-12-25 21:14:11 +11:00
|
|
|
// IN A 192.168.1.1 // not ok
|
2010-12-28 00:31:31 +11:00
|
|
|
func ParseString(s string) *RR {
|
2010-12-25 21:14:11 +11:00
|
|
|
// 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
|
2010-12-25 01:53:17 +11:00
|
|
|
}
|