Hi Murray, I used this to override the internal use of libresolv and such to
connect to PowerMTA's internal resolver, as well as to be able to provide
test DNS responses.
Since we're really only initializing the resolver library, whatever it may be,
once per ARC_LIB, I opted for a simple approach where I passed in the
library handle.
Alternatively, we could instead pass in an arc_dns_init function pointer,
but in this case I'd need to be able to pass in a "user data" pointer, as in
extern ARC_STAT arc_init_dns __P((ARC_LIB *, void* srv,
void *user,
void (*arc_dns_init) (void *user),
void (*arc_dns_close) (void *srv),
int (*arc_dns_start) (void *srv, int type,
unsigned char *query,
unsigned char *buf,
size_t buflen,
void **qh),
int (*arc_dns_cancel) (void *srv, void *qh),
int (*arc_dns_waitreply) (void *srv,
void *qh,
struct timeval *to,
size_t *bytes,
int *error,
int *dnssec)));
Hi Murray, I used this to override the internal use of libresolv and such to connect to PowerMTA's internal resolver, as well as to be able to provide test DNS responses.
Since we're really only initializing the resolver library, whatever it may be, once per ARC_LIB, I opted for a simple approach where I passed in the library handle.
Alternatively, we could instead pass in an
arc_dns_init
function pointer, but in this case I'd need to be able to pass in a "user data" pointer, as in