interfaceiter.c revision 40f53fa8d9c6a4fc38c0014495e7a42b08f52481
/*
* Copyright (C) 1999, 2000 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: interfaceiter.c,v 1.19 2000/08/01 01:31:21 tale Exp $ */
#include <config.h>
#ifdef HAVE_SYS_SOCKIO_H
#endif
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <isc/interfaceiter.h>
/* Common utility functions */
/*
* Extract the network address part from a "struct sockaddr".
*
* The address family is given explicity
* instead of using src->sa_family, because the latter does not work
* for copying a network mask obtained by SIOCGIFNETMASK (it does
* not have a valid address family).
*/
static void
switch (family) {
case AF_INET:
sizeof(struct in_addr));
break;
case AF_INET6:
sizeof(struct in6_addr));
break;
default:
INSIST(0);
break;
}
}
/*
* Include system-dependent code.
*/
#include "ifiter_sysctl.c"
#else
#include "ifiter_ioctl.c"
#endif
/*
* The remaining code is common to the sysctl and ioctl case.
*/
{
return (ISC_R_SUCCESS);
}
for (;;) {
if (result != ISC_R_IGNORE)
break;
if (result != ISC_R_SUCCESS)
break;
}
return (result);
}
for (;;) {
if (result != ISC_R_SUCCESS)
break;
if (result != ISC_R_IGNORE)
break;
}
return (result);
}
void
{
}