2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

1246. [func] New functions isc_sockaddr_issitelocal(),

isc_sockaddr_islinklocal(), isc_netaddr_issitelocal()
                        and isc_netaddr_islinklocal().
This commit is contained in:
Mark Andrews
2002-04-03 06:38:38 +00:00
parent 5d26560e2b
commit 79a6a33184
7 changed files with 101 additions and 8 deletions

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: sockaddr.c,v 1.53 2002/02/20 03:35:29 marka Exp $ */
/* $Id: sockaddr.c,v 1.54 2002/04/03 06:38:32 marka Exp $ */
#include <config.h>
@@ -426,3 +426,25 @@ isc_sockaddr_ismulticast(isc_sockaddr_t *sockaddr) {
isc_netaddr_fromsockaddr(&netaddr, sockaddr);
return (isc_netaddr_ismulticast(&netaddr));
}
isc_boolean_t
isc_sockaddr_issitelocal(isc_sockaddr_t *sockaddr) {
isc_netaddr_t netaddr;
if (sockaddr->type.sa.sa_family == AF_INET6) {
isc_netaddr_fromsockaddr(&netaddr, sockaddr);
return (isc_netaddr_issitelocal(&netaddr));
}
return (ISC_FALSE);
}
isc_boolean_t
isc_sockaddr_islinklocal(isc_sockaddr_t *sockaddr) {
isc_netaddr_t netaddr;
if (sockaddr->type.sa.sa_family == AF_INET6) {
isc_netaddr_fromsockaddr(&netaddr, sockaddr);
return (isc_netaddr_islinklocal(&netaddr));
}
return (ISC_FALSE);
}