Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 28608 invoked from network); 13 Jun 2007 09:33:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Jun 2007 09:33:08 -0000 Received: (qmail 54671 invoked by uid 500); 13 Jun 2007 09:33:11 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 54645 invoked by uid 500); 13 Jun 2007 09:33:11 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 54634 invoked by uid 99); 13 Jun 2007 09:33:11 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jun 2007 02:33:11 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [82.223.190.84] (HELO flsc030.serveursdns.net) (82.223.190.84) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jun 2007 02:33:06 -0700 Received: from [192.168.0.228] (82.23.98-84.rev.gaoland.net [84.98.23.82]) by smtp-01.serveursdns.net (Postfix) with ESMTP id 1543E6E462C for ; Wed, 13 Jun 2007 11:32:43 +0200 (CEST) Subject: Re: DNS : RecordStore From: Julien Vermillard Reply-To: jvermillard@archean.fr To: Apache Directory Developers List In-Reply-To: <1181726852.5935.31.camel@localhost> References: <1181658958.24438.34.camel@localhost> <568753d90706121415s77cf96e9g80c78acee11e2c76@mail.gmail.com> <1181725835.5935.26.camel@localhost> <1181726852.5935.31.camel@localhost> Content-Type: text/plain; charset=UTF-8 Organization: Archean Date: Wed, 13 Jun 2007 11:37:34 +0200 Message-Id: <1181727454.5935.38.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Please forget my last message, I pressed send too quicly :) After a little digging in ResourceRecordImpl you have : public String get( String id ) { return ( String ) attributes.get( id.toLowerCase() ); } Which return null for my address, due to the "toLowerCase()". Am I supposed to build my Attribute Set using .toLowerCase() for keys ? Like : attr.put(DnsAttribute.IP_ADDRESS.toLowerCase(),"192.168.66.66"); Julien Le mercredi 13 juin 2007 à 11:27 +0200, Julien Vermillard a écrit : > in > > /** > * Returns the raw IP address of this InetAddress > * object. The result is in network byte order: the highest order > * byte of the address is in getAddress()[0]. > * > * @return the raw IP address of this object. > */ > public byte[] getAddress() { > return null; > } > Le mercredi 13 juin 2007 à 11:10 +0200, Julien Vermillard a écrit : > > Le mardi 12 juin 2007 à 14:15 -0700, Enrique Rodriguez a écrit : > > > On 6/12/07, Julien Vermillard wrote: > > > > ... > > > > 1# > > > > In DNS protocol, the RecordStore interface > > > > http://tinyurl.com/2prg84 > > > > > > I added your suggestion, re: generics and some minor Javadocs. I > > > recently completed a Javadoc run on Kerberos and Change Password and > > > DNS was on my TODO list. I'll step it up. > > > > > > > 2# > > > > I made my minimal RecordStore for just resolving few hostname to IP > > > > address. Be carefull, my knowledge of DNS is very low :) > > > > > > > > public Set getRecords(QuestionRecord question) throws Exception > > > > System.err.println("My store ! : "+question); > > > > Set set=new HashSet(); > > > > HashMap attr= new HashMap(); > > > > attr.put(DnsAttribute.DOMAIN_NAME,"mydomaine.net"); > > > > attr.put(DnsAttribute.IP_ADDRESS,"192.168.66.66"); > > > > attr.put(DnsAttribute.TYPE,"IN"); > > > > attr.put(DnsAttribute.CLASS,"A"); > > > > ResourceRecord rr=new ResourceRecordImpl("totoz.net", > > > > RecordType.A,RecordClass.IN,10000,attr); > > > > set.add(rr); > > > > return set; > > > > } > > > > > > > > dig report me "corrupted reply". > > > > > > > > Any idea of what I'm doing wrong ? > > > > > > Just eyeballing it, the only thing in 'attr' should be IP address. > > > The rest is redundant (and domain name conflicts) with the info put > > > into the RR constructor. > > > > > > What is your dig statement? If you query for "mydomaine.net" but are > > > returning "totoz.net" that could give you a problem. With the above > > > code you should be dig'ing: > > > > > > $ dig totoz.net > > > > > > and getting "192.168.66.66". > > > > > > Your reply could also be corrupted if UDP/TCP isn't being handled > > > properly. Our DNS provider doesn't have TCP support, though it is > > > trivial to add with MINA. TCP uses a 2-byte pre-pended size, which > > > could be throwing off the client-side decode. > > > > > > Enrique > > > > I use a DatagramAcceptor > > > > I made that test : > > Set set=new HashSet(); > > HashMap attr= new HashMap(); > > > > attr.put(DnsAttribute.IP_ADDRESS,"192.168.66.66"); > > ResourceRecord rr=new > > ResourceRecordImpl("totoz.net",RecordType.A,RecordClass.IN,10000,attr); > > set.add(rr); > > return set; > > > > dig result : > > > > :~$ dig @192.168.0.228 -p 10053 www.totoz.net > > Warning: Message parser reports malformed message packet. > > > > ; <<>> DiG 9.3.4 <<>> @192.168.0.228 -p 10053 www.totoz.net > > ; (1 server found) > > ;; global options: printcmd > > ;; Got answer: > > ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23978 > > ;; flags: qr rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 > > > > ;; QUESTION SECTION: > > ;www.totoz.net. IN A > > > > ;; Query time: 11 msec > > ;; SERVER: 192.168.0.228#10053(192.168.0.228) > > ;; WHEN: Wed Jun 13 11:04:24 2007 > > ;; > > > > The binary dump of query and the reply : > > > > http://rafb.net/p/Qb1QSm95.html > > > > Julien > > > > I'm going to look in the codec, I prolly missed something. > >