From cae7244078849f83a863b9dea62c64e8fd828c2d Mon Sep 17 00:00:00 2001 From: JINMEI Tatuya Date: Fri, 30 Oct 2009 01:09:40 +0000 Subject: [PATCH] supported authors.bind. PLEASE add an RR for your name in the answer section! git-svn-id: svn://bind10.isc.org/svn/bind10/branches/f2f200910@216 e5f2f494-b856-4b98-b285-d166d9295462 --- src/bin/parkinglot/main.cc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/bin/parkinglot/main.cc b/src/bin/parkinglot/main.cc index 7c62601aa9..fb45f5dc18 100644 --- a/src/bin/parkinglot/main.cc +++ b/src/bin/parkinglot/main.cc @@ -87,6 +87,7 @@ process_message(int s) { struct sockaddr_storage ss; socklen_t sa_len = sizeof(ss); struct sockaddr* sa = static_cast((void*)&ss); + Name authors_name("authors.bind"); if (msg.getBuffer().recvFrom(s, sa, &sa_len) > 0) { try { @@ -107,7 +108,19 @@ process_message(int s) { RRsetPtr query = msg.getSection(SECTION_QUESTION)[0]; string name = query->getName().toText(true); - if (zones.contains(name)) { + if (query->getName() == authors_name && + query->getClass() == RRClass::CH, + query->getType() == RRType::TXT) { + msg.setRcode(Message::RCODE_NOERROR); + msg.addRR(SECTION_ANSWER, RR(authors_name, RRClass::CH, + RRType::TXT, TTL(0), + TXT("JINMEI Tatuya"))); + // add others name here!! + + msg.addRR(SECTION_AUTHORITY, RR(authors_name, RRClass::CH, + RRType::NS, TTL(0), + NS("authors.bind"))); + } if (zones.contains(name)) { msg.setRcode(Message::RCODE_NOERROR); RRset* nsset = new RRset(query->getName(), RRClass::IN, RRType::NS, TTL(3600));