From 7e361074bc8a2df7a0891a7040eea02ca3a5e286 Mon Sep 17 00:00:00 2001 From: Andreas Gustafsson Date: Fri, 2 Feb 2001 02:48:47 +0000 Subject: [PATCH] 724. [func] New libisc functions isc_netaddr_any(), isc_netaddr_any6(). --- CHANGES | 4 ++++ lib/isc/include/isc/netaddr.h | 14 +++++++++++++- lib/isc/netaddr.c | 16 +++++++++++++++- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index b4ddeeb72e..651af57024 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ + + 724. [func] New libisc functions isc_netaddr_any(), + isc_netaddr_any6(). + 723. [bug] Referrals whose NS RRs had a 0 TTL caused the resolver to return DNS_R_SERVFAIL. [RT #783] diff --git a/lib/isc/include/isc/netaddr.h b/lib/isc/include/isc/netaddr.h index b31fb1ee76..85c371416d 100644 --- a/lib/isc/include/isc/netaddr.h +++ b/lib/isc/include/isc/netaddr.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: netaddr.h,v 1.16 2001/01/09 21:57:17 bwelling Exp $ */ +/* $Id: netaddr.h,v 1.17 2001/02/02 02:48:47 gson Exp $ */ #ifndef ISC_NETADDR_H #define ISC_NETADDR_H 1 @@ -94,6 +94,18 @@ isc_netaddr_fromin(isc_netaddr_t *netaddr, const struct in_addr *ina); void isc_netaddr_fromin6(isc_netaddr_t *netaddr, const struct in6_addr *ina6); +void +isc_netaddr_any(isc_netaddr_t *netaddr); +/* + * Return the IPv4 wildcard address. + */ + +void +isc_netaddr_any6(isc_netaddr_t *netaddr); +/* + * Return the IPv6 wildcard address. + */ + isc_boolean_t isc_netaddr_ismulticast(isc_netaddr_t *na); /* diff --git a/lib/isc/netaddr.c b/lib/isc/netaddr.c index dd5a69f1ce..aac9baffe4 100644 --- a/lib/isc/netaddr.c +++ b/lib/isc/netaddr.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: netaddr.c,v 1.14 2001/01/09 21:56:18 bwelling Exp $ */ +/* $Id: netaddr.c,v 1.15 2001/02/02 02:48:46 gson Exp $ */ #include @@ -232,6 +232,20 @@ isc_netaddr_fromsockaddr(isc_netaddr_t *t, const isc_sockaddr_t *s) { } } +void +isc_netaddr_any(isc_netaddr_t *netaddr) { + memset(netaddr, 0, sizeof *netaddr); + netaddr->family = AF_INET; + netaddr->type.in.s_addr = INADDR_ANY; +} + +void +isc_netaddr_any6(isc_netaddr_t *netaddr) { + memset(netaddr, 0, sizeof *netaddr); + netaddr->family = AF_INET6; + netaddr->type.in6 = in6addr_any; +} + isc_boolean_t isc_netaddr_ismulticast(isc_netaddr_t *na) { switch (na->family) {