diff --git a/Makefile b/Makefile index c034b904..e2a7c0b6 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,6 @@ GOFILES=\ tsig.go\ types.go\ xfr.go\ -# y.go\ include $(GOROOT)/src/Make.pkg diff --git a/dns.y b/dns.y deleted file mode 100644 index b4b8e5ce..00000000 --- a/dns.y +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright Miek Gieben 2011 -// Heavily influenced by the zone-parser from NSD - -%{ - -package dns - -import ( - "fmt" -) - -// A yacc parser for DNS Resource Records contained in strings - -%} - -%union { - val string - rrtype uint16 - class uint16 - ttl uint16 - -} - -/* - * Types known to package dns - */ -%token YA YNS - -/* - * Other elements of the Resource Records - */ -%token TTL -%token CLASS -%token VAL -%% -rr: name TTL CLASS rrtype - { - - }; - -name: label - | name '.' label - -label: VAL - -rrtype: - /* All supported RR types */ - YA - | YNS -%% - -type DnsLex int - -func (DnsLex) Lex(lval *yySymType) int { - - // yylval.rrtype = Str_rr($XX) //give back TypeA, TypeNS - // return Y_A this should be the token, another map? - -//func scan(s string) (string, int) { - if len(s) == 0 { - println("a bit short") - } - raw := []byte(s) - chunk := "" - off := 0 - brace := 0 -redo: - for off < len(raw) { - c := raw[off] -// println(c, string(c)) - switch c { - case '\n': - // normal case?? - if brace > 0 { - off++ - continue - } - case '.': -// println("off", off) - if off == 0 { - print("DOT") - return ".", off + 1 - } else { - return chunk, off - } - case ' ','\t': - if brace != 0 { - off++ - continue - } - // eat whitespace - // Look at next char - if raw[off+1] == ' ' { - off++ - continue - } else { - // if chunk is empty, we have skipped whitespace, and seen nothing - if len(chunk) == 0 { - off++ - goto redo - } - print("VAL ") - return chunk, off - } - case '(': - brace++ - off++ - continue - case ')': - brace-- - if brace < 0 { - println("syntax error") - } - off++ - continue - } - if c == ' ' { println("adding space") } - if c == '\t' { println("adding tab") } - chunk += string(c) - off++ - } - print("VAL ") - return chunk, off -} diff --git a/server.go b/server.go index 2ff1b31f..ef660272 100644 --- a/server.go +++ b/server.go @@ -62,6 +62,10 @@ func ServeTCP(l *net.TCPListener, f func(*Conn, *Msg)) os.Error { panic("not reached") } +// config functions Config +// ListenAndServeTCPTsig +// ListenAndServeUDPTsig + func ListenAndServeTCP(addr string, f func(*Conn, *Msg)) os.Error { a, err := net.ResolveTCPAddr(addr) if err != nil { diff --git a/xfr.go b/xfr.go index 1047e6ec..fe6a0c0a 100644 --- a/xfr.go +++ b/xfr.go @@ -112,7 +112,7 @@ func (d *Conn) axfrWrite(q *Msg, m chan Xfr) { } // TimersOnly foo } - // Everything is send, only the closing soa is left. + // Everything is sent, only the closing soa is left. out.Answer[i] = soa send, _ := out.Pack() _, err := d.Write(send)