interfaceiter.c revision 15a44745412679c30a6d022733925af70a38b715
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Copyright (C) 1999, 2000 Internet Software Consortium.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Permission to use, copy, modify, and distribute this software for any
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * purpose with or without fee is hereby granted, provided that the above
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * copyright notice and this permission notice appear in all copies.
53bd3f325f898b6892742ce928da3daa02ba0eddDavid Lawrence * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
d362465c77b375be2707bc83cebc731d0645d12dAutomatic Updater * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid Lawrence * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
53bd3f325f898b6892742ce928da3daa02ba0eddDavid Lawrence * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
53bd3f325f898b6892742ce928da3daa02ba0eddDavid Lawrence * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
53bd3f325f898b6892742ce928da3daa02ba0eddDavid Lawrence * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
53bd3f325f898b6892742ce928da3daa02ba0eddDavid Lawrence/* $Id: interfaceiter.c,v 1.18 2000/07/27 09:52:46 tale Exp $ */
4be63b1fd8c18dbeca1648d6cf22fa14f057a469David Lawrence#include <sys/sockio.h> /* Required for ifiter_ioctl.c. */
53bd3f325f898b6892742ce928da3daa02ba0eddDavid Lawrence#include <net/if.h> /* Must follow <isc/net.h>. */
53bd3f325f898b6892742ce928da3daa02ba0eddDavid Lawrence/* Common utility functions */
53bd3f325f898b6892742ce928da3daa02ba0eddDavid Lawrence * Extract the network address part from a "struct sockaddr".
b09983678f5d116d3c8387aaeab4f2dc4deb0454David Lawrence * The address family is given explicity
53bd3f325f898b6892742ce928da3daa02ba0eddDavid Lawrence * instead of using src->sa_family, because the latter does not work
53bd3f325f898b6892742ce928da3daa02ba0eddDavid Lawrence * for copying a network mask obtained by SIOCGIFNETMASK (it does
53bd3f325f898b6892742ce928da3daa02ba0eddDavid Lawrence * not have a valid address family).
53bd3f325f898b6892742ce928da3daa02ba0eddDavid Lawrenceget_addr(unsigned int family, isc_netaddr_t *dst, struct sockaddr *src) {
53bd3f325f898b6892742ce928da3daa02ba0eddDavid Lawrence sizeof(struct in_addr));
53bd3f325f898b6892742ce928da3daa02ba0eddDavid Lawrence sizeof(struct in6_addr));
53bd3f325f898b6892742ce928da3daa02ba0eddDavid Lawrence * Include system-dependent code.
53bd3f325f898b6892742ce928da3daa02ba0eddDavid Lawrence * The remaining code is common to the sysctl and ioctl case.
return (ISC_R_SUCCESS);
return (result);
return (result);