[Pdns-dev] dnsparser.cc:simpleCompress()

Johan Ekenberg johan at ekenberg.se
Wed Jun 13 08:03:51 CEST 2012


On Tuesday 12 June 2012, Peter van Dijk wrote:
> On Jun 12, 2012, at 22:51 , Johan Ekenberg wrote:
> > If I'm not mistaken, the basic usage case of simpleCompress() should just
> > return a record with dots removed, so that "foo.bar.com" becomes
> > "foobarcom". (?)
> 
> No - the basic usage case (when actual compression is not possible or
> feasible) is to return a record with the dots turned into label length
> indicators.

Oh. Silly me.

> $ ./test_simple_compress foo.12345678.com | hexdump -C
> 00000000  03 66 6f 6f 08 31 32 33  34 35 36 37 38 03 63 6f 
> |.foo.12345678.co| 00000010  6d 00 0a                                     
>     |m..|
> 
> i.e. <03>foo<08>12345678<03>com
> 
> note that ascii 8 is interpreted as backspace by many terminals - which is
> why you seem to be losing an o.

Yeah, I get it. My bad.

> I do wonder - what were you testing, or what were you trying to find out?
> We're here to help!

I was looking to duplicate pdnssec.cc:hashQNameWithSalt() as a MySQL 
function/stored procedure. I want to put the hashed qname in records.ordername 
directly from MySQL without running an external program (ie pdnssec rectify-
zone or hash-zone-record).

/Johan


More information about the Pdns-dev mailing list