Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ability to use custom resolver #91

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

ghost
Copy link

@ghost ghost commented May 17, 2018

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)));

Juan Altmayer Pizzorno added 2 commits May 17, 2018 14:08
resolver for a library.  Especially useful for tests, but also
needed to integrate into environments where other DNS resolution
infrastructure is used.
@mskucherawy
Copy link
Member

The "user" pointer, as I recall, was used in OpenDKIM to carry a handle to an initialized libunbound instance. It wasn't used for the bind case.

Copy link
Member

@mskucherawy mskucherawy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't include hooks for setting arcl_dns_init or arcl_dns_callback. Could you add those?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant