summaryrefslogtreecommitdiffstats
path: root/lib/libc/inet/inet_addr.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/inet/inet_addr.c')
-rw-r--r--lib/libc/inet/inet_addr.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/lib/libc/inet/inet_addr.c b/lib/libc/inet/inet_addr.c
index c95622d..4a8b80f 100644
--- a/lib/libc/inet/inet_addr.c
+++ b/lib/libc/inet/inet_addr.c
@@ -10,10 +10,6 @@
* 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
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
@@ -70,8 +66,10 @@
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93";
-static const char rcsid[] = "$Id: inet_addr.c,v 1.4.18.1 2005/04/27 05:00:52 sra Exp $";
+static const char rcsid[] = "$Id: inet_addr.c,v 1.2.206.2 2004/03/17 00:29:45 marka Exp $";
#endif /* LIBC_SCCS and not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
#include "port_before.h"
@@ -85,11 +83,11 @@ static const char rcsid[] = "$Id: inet_addr.c,v 1.4.18.1 2005/04/27 05:00:52 sra
#include "port_after.h"
-/*%
+/*
* Ascii internet address interpretation routine.
* The value returned is in network order.
*/
-u_long
+in_addr_t /* XXX should be struct in_addr :( */
inet_addr(const char *cp) {
struct in_addr val;
@@ -98,7 +96,7 @@ inet_addr(const char *cp) {
return (INADDR_NONE);
}
-/*%
+/*
* 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.
@@ -179,22 +177,22 @@ inet_aton(const char *cp, struct in_addr *addr) {
*/
n = pp - parts + 1;
switch (n) {
- case 1: /*%< a -- 32 bits */
+ case 1: /* a -- 32 bits */
break;
- case 2: /*%< a.b -- 8.24 bits */
+ case 2: /* a.b -- 8.24 bits */
if (val > 0xffffffU)
return (0);
val |= parts[0] << 24;
break;
- case 3: /*%< a.b.c -- 8.8.16 bits */
+ case 3: /* a.b.c -- 8.8.16 bits */
if (val > 0xffffU)
return (0);
val |= (parts[0] << 24) | (parts[1] << 16);
break;
- case 4: /*%< a.b.c.d -- 8.8.8.8 bits */
+ case 4: /* a.b.c.d -- 8.8.8.8 bits */
if (val > 0xffU)
return (0);
val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
@@ -205,4 +203,11 @@ inet_aton(const char *cp, struct in_addr *addr) {
return (1);
}
-/*! \file */
+/*
+ * Weak aliases for applications that use certain private entry points,
+ * and fail to include <arpa/inet.h>.
+ */
+#undef inet_addr
+__weak_reference(__inet_addr, inet_addr);
+#undef inet_aton
+__weak_reference(__inet_aton, inet_aton);
OpenPOWER on IntegriCloud