From 36aa3173151181564db05483d6982b686dc482b3 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Thu, 14 Apr 2011 22:22:24 +0200 Subject: [PATCH] Create SetQuestion function --- defaults.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/defaults.go b/defaults.go index 5787d8e5..8d538fb7 100644 --- a/defaults.go +++ b/defaults.go @@ -14,6 +14,12 @@ func (dns *Msg) SetReply(request *Msg) { dns.Question[0] = request.Question[0] } +func (dns *Msg) SetQuestion(z string, t uint16) { + dns.MsgHdr.Id = Id() + dns.Question = make([]Question, 1) + dns.Question[0] = Question{z, t, ClassINET} +} + // Create a notify packet. func (dns *Msg) SetNotify(z string) { dns.MsgHdr.Opcode = OpcodeNotify