* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
#include <sys/param.h>
#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#include "inet_aton.h"
-/*
+/*
* Check whether "cp" is a valid ascii representation
* of an Internet address and convert to a binary address.
* Returns 1 if the address is valid, 0 if not.
const char *cp_arg;
struct in_addr *addr;
{
- register const guchar *cp = cp_arg;
- register gulong val;
+ register const u_char *cp = cp_arg;
+ register u_long val;
register int base, n;
- register guchar c;
- guint parts[4];
- register guint *pp = parts;
+ register u_char c;
+ u_int parts[4];
+ register u_int *pp = parts;
for (;;) {
/*
continue;
}
if (base == 16 && isascii(c) && isxdigit(c)) {
- val = (val << 4) +
+ val = (val << 4) +
(c + 10 - (islower(c) ? 'a' : 'A'));
cp++;
continue;
break;
}
if (addr)
- addr->s_addr = g_htonl(val);
+ addr->s_addr = htonl(val);
return (1);
}