genmask.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* Copyright (C) 1993-2001 by Darren Reed.
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* $Id: genmask.c,v 1.6 2002/01/28 06:50:46 darrenr Exp $
*/
#include "ipf.h"
char *msk;
{
char *endptr = 0L;
int bits;
/* possibly of the form xxx.xxx.xxx.xxx
* or 0xYYYYYYYY */
#ifdef USE_INET6
if (use_inet6) {
return -1;
} else
#endif
return -1;
} else {
/*
* set x most significant bits
*/
#ifdef USE_INET6
if ((*endptr != '\0') ||
#else
#endif
return -1;
#ifdef USE_INET6
if (use_inet6)
else
#endif
if (bits == 0)
*mskp = 0;
else
}
return 0;
}