SCCS-vsn: lib/libc/net/inet_addr.c 5.4
SCCS-vsn: lib/libc/net/inet_network.c 5.3
SCCS-vsn: lib/libc/net/inet.3 6.5
.\" All rights reserved. The Berkeley software License Agreement
.\" specifies the terms and conditions for redistribution.
.\"
.\" All rights reserved. The Berkeley software License Agreement
.\" specifies the terms and conditions for redistribution.
.\"
-.\" @(#)inet.3 6.4 (Berkeley) %G%
+.\" @(#)inet.3 6.5 (Berkeley) %G%
.SH "SEE ALSO"
gethostbyname(3N), getnetent(3N), hosts(5), networks(5),
.SH DIAGNOSTICS
.SH "SEE ALSO"
gethostbyname(3N), getnetent(3N), hosts(5), networks(5),
.SH DIAGNOSTICS
-The value \-1 is returned by
+The constant \fBINADDR_NONE\fP is returned by
.I inet_addr
and
.I inet_network
.I inet_addr
and
.I inet_network
*/
#if defined(LIBC_SCCS) && !defined(lint)
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_addr.c 5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)inet_addr.c 5.4 (Berkeley) %G%";
#endif LIBC_SCCS and not lint
#include <sys/types.h>
#endif LIBC_SCCS and not lint
#include <sys/types.h>
* a.b (with b treated as 24 bits)
*/
if (pp >= parts + 4)
* a.b (with b treated as 24 bits)
*/
if (pp >= parts + 4)
*pp++ = val, cp++;
goto again;
}
*pp++ = val, cp++;
goto again;
}
* Check for trailing characters.
*/
if (*cp && !isspace(*cp))
* Check for trailing characters.
*/
if (*cp && !isspace(*cp))
*pp++ = val;
/*
* Concoct the address according to
*pp++ = val;
/*
* Concoct the address according to
}
val = htonl(val);
return (val);
}
val = htonl(val);
return (val);
*/
#if defined(LIBC_SCCS) && !defined(lint)
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)inet_network.c 5.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)inet_network.c 5.3 (Berkeley) %G%";
#endif LIBC_SCCS and not lint
#include <sys/types.h>
#endif LIBC_SCCS and not lint
#include <sys/types.h>
}
if (*cp == '.') {
if (pp >= parts + 4)
}
if (*cp == '.') {
if (pp >= parts + 4)
*pp++ = val, cp++;
goto again;
}
if (*cp && !isspace(*cp))
*pp++ = val, cp++;
goto again;
}
if (*cp && !isspace(*cp))
*pp++ = val;
n = pp - parts;
if (n > 4)
*pp++ = val;
n = pp - parts;
if (n > 4)
for (val = 0, i = 0; i < n; i++) {
val <<= 8;
val |= parts[i] & 0xff;
for (val = 0, i = 0; i < n; i++) {
val <<= 8;
val |= parts[i] & 0xff;