Subject: Pre-release of liblookup, c-ares wrapper.

Pre-release of liblookup, c-ares wrapper.

From: William Ahern <>
Date: 2006-02-15

I got permission from my employer, so here's a pre-release of liblookup. It
requires libevent, and currently only works in an asynchronous callback
mode, though since it's being released as free software hopefully I'll have
reason to get around to adding a synchronous interface as a set of functions
which captures the callback in-line and returns the answer directly to the

It currently supports the following record types:


The interface is simple, but tries to 1) makes easy things easy and 2)
difficult things possible. For instance, for SRV queries you can do a
compound SRV+A+AAAA query, which will return all A and AAAA records after
each SRV record in a list which is pre-sorted according to the SRV RFC.

I'll have a project page up shortly. For anyone interested I've attached the
two source files.

lookup.c won't build as-is. It depends on a memory pool allocator, which
I'll release seperately, and a couple of accessory string functions. But the
intrepid should be able to replace all the _get() and _put() calls with
malloc() and free(), and the string functions are straight-forward.

Um, the timeout isn't currently obeyed, and won't until c-ares is taught to
do per-lookup timeouts rather than inheriting a lookup timeout from the

lookup.h.m4 creates two lookup.h files, one for lookup.c and and another
for client consumption (without private declarations/definitions).

        m4 -DMODE=internal lookup.h.m4 > ./lookup.h
        m4 -DMODE=external lookup.h.m4 > /path/to/client/include/lookup.h

[See attached MIME files]

- Bill

Received on Wed Feb 15 04:33:27 2006