724. [func] New libisc functions isc_netaddr_any(),

isc_netaddr_any6().
This commit is contained in:
Andreas Gustafsson 2001-02-02 02:48:47 +00:00
parent 547f79ea44
commit 7e361074bc
3 changed files with 32 additions and 2 deletions

View file

@ -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]

View file

@ -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);
/*

View file

@ -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 <config.h>
@ -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) {