mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-29 13:38:26 +00:00
add dns_dispatch_getlocaladdress().
This commit is contained in:
parent
79bc63f006
commit
a674e7ecec
@ -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 <config.h>
|
||||
|
||||
@ -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));
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user