From 0940f549bff12e0bcbdf3b56802729b2ecc56092 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Mon, 30 Apr 2012 16:01:07 +0200 Subject: [PATCH] Skeleton function for parsing LOC records --- zscan.go | 2 +- zscan_rr.go | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/zscan.go b/zscan.go index 44b46160..84226155 100644 --- a/zscan.go +++ b/zscan.go @@ -399,7 +399,7 @@ func parseZone(r io.Reader, origin, f string, t chan Token, include int) { } } -func (l lex) String() string { +func (l lex) _string() string { switch l.value { case _STRING: return "S:" + l.token + "$" diff --git a/zscan_rr.go b/zscan_rr.go index af7a49cd..89da90a2 100644 --- a/zscan_rr.go +++ b/zscan_rr.go @@ -53,8 +53,7 @@ func setRR(h RR_Header, c chan lex, o, f string) (RR, *ParseError) { r, e = setTALINK(h, c, o, f) goto Slurp case TypeLOC: - //r, e = setLOC(h, c, f) - // TODO + r, e = setLOC(h, c, f) goto Slurp // These types have a variable ending: either chunks of txt or chunks/base64 or hex. // They need to search for the end of the RR themselves, hence they look for the ending @@ -423,6 +422,12 @@ func setTALINK(h RR_Header, c chan lex, o, f string) (RR, *ParseError) { return rr, nil } +func setLOC(h RR_Header, c chan lex, f string) (RR, *ParseError) { + rr := new(RR_LOC) + rr.Hdr = h + return rr, nil +} + func setHIP(h RR_Header, c chan lex, o, f string) (RR, *ParseError) { rr := new(RR_HIP) rr.Hdr = h