diff --git a/lib/dns/dispatch.c b/lib/dns/dispatch.c index e81999e39e..563b5f00b3 100644 --- a/lib/dns/dispatch.c +++ b/lib/dns/dispatch.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dispatch.c,v 1.96 2001/02/17 00:23:49 gson Exp $ */ +/* $Id: dispatch.c,v 1.97 2001/03/13 05:48:40 marka Exp $ */ #include @@ -2010,6 +2010,19 @@ dns_dispatch_getsocket(dns_dispatch_t *disp) { return (disp->socket); } +isc_result_t +dns_dispatch_getlocaladdress(dns_dispatch_t *disp, isc_sockaddr_t *addrp) { + + REQUIRE(VALID_DISPATCH(disp)); + REQUIRE(addrp != NULL); + + if (disp->socktype == isc_sockettype_udp) { + *addrp = disp->local; + return (ISC_R_SUCCESS); + } + return (ISC_R_NOTIMPLEMENTED); +} + void dns_dispatch_cancel(dns_dispatch_t *disp) { REQUIRE(VALID_DISPATCH(disp)); diff --git a/lib/dns/include/dns/dispatch.h b/lib/dns/include/dns/dispatch.h index 8be480e39c..b6be4564d2 100644 --- a/lib/dns/include/dns/dispatch.h +++ b/lib/dns/include/dns/dispatch.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dispatch.h,v 1.43 2001/02/11 19:11:52 gson Exp $ */ +/* $Id: dispatch.h,v 1.44 2001/03/13 05:48:41 marka Exp $ */ #ifndef DNS_DISPATCH_H #define DNS_DISPATCH_H 1 @@ -383,6 +383,20 @@ dns_dispatch_getsocket(dns_dispatch_t *disp); * The socket the dispatcher is using. */ +isc_result_t +dns_dispatch_getlocaladdress(dns_dispatch_t *disp, isc_sockaddr_t *addrp); +/* + * Return the local address for this dispatch. + * This currently only works for dispatches using UDP sockets. + * + * Requires: + * disp is valid. + * addrp to be non null. + * + * Returns: + * ISC_R_SUCCESS + * ISC_R_NOTIMPLEMENTED + */ void dns_dispatch_cancel(dns_dispatch_t *disp);