summaryrefslogtreecommitdiff
path: root/lib/libc/inet
diff options
context:
space:
mode:
authorHajimu UMEMOTO <ume@FreeBSD.org>2007-06-03 17:02:29 +0000
committerHajimu UMEMOTO <ume@FreeBSD.org>2007-06-03 17:02:29 +0000
commit861249f5830e8658b61130e0ee7eaad2e93d0449 (patch)
treefcab9dae0a6dfbc5403b46311a5588c3f7f49dd4 /lib/libc/inet
parent3f25740ec6845340de7abaae80607dea9c3a4bb8 (diff)
downloadsrc-test-861249f5830e8658b61130e0ee7eaad2e93d0449.tar.gz
src-test-861249f5830e8658b61130e0ee7eaad2e93d0449.zip
Notes
Diffstat (limited to 'lib/libc/inet')
-rw-r--r--lib/libc/inet/inet_addr.c16
-rw-r--r--lib/libc/inet/inet_cidr_ntop.c8
-rw-r--r--lib/libc/inet/inet_cidr_pton.c16
-rw-r--r--lib/libc/inet/inet_lnaof.c4
-rw-r--r--lib/libc/inet/inet_makeaddr.c4
-rw-r--r--lib/libc/inet/inet_net_ntop.c10
-rw-r--r--lib/libc/inet/inet_net_pton.c38
-rw-r--r--lib/libc/inet/inet_neta.c6
-rw-r--r--lib/libc/inet/inet_netof.c4
-rw-r--r--lib/libc/inet/inet_network.c4
-rw-r--r--lib/libc/inet/inet_ntoa.c6
-rw-r--r--lib/libc/inet/inet_ntop.c6
-rw-r--r--lib/libc/inet/inet_pton.c8
-rw-r--r--lib/libc/inet/nsap_addr.c4
14 files changed, 81 insertions, 53 deletions
diff --git a/lib/libc/inet/inet_addr.c b/lib/libc/inet/inet_addr.c
index b967dc22039cd..c95622d34c8c0 100644
--- a/lib/libc/inet/inet_addr.c
+++ b/lib/libc/inet/inet_addr.c
@@ -70,7 +70,7 @@
#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.2.206.2 2004/03/17 00:29:45 marka Exp $";
+static const char rcsid[] = "$Id: inet_addr.c,v 1.4.18.1 2005/04/27 05:00:52 sra Exp $";
#endif /* LIBC_SCCS and not lint */
#include "port_before.h"
@@ -85,7 +85,7 @@ static const char rcsid[] = "$Id: inet_addr.c,v 1.2.206.2 2004/03/17 00:29:45 ma
#include "port_after.h"
-/*
+/*%
* Ascii internet address interpretation routine.
* The value returned is in network order.
*/
@@ -98,7 +98,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 +179,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);
@@ -204,3 +204,5 @@ inet_aton(const char *cp, struct in_addr *addr) {
addr->s_addr = htonl(val);
return (1);
}
+
+/*! \file */
diff --git a/lib/libc/inet/inet_cidr_ntop.c b/lib/libc/inet/inet_cidr_ntop.c
index b25dc8256f61e..645b3cd500edb 100644
--- a/lib/libc/inet/inet_cidr_ntop.c
+++ b/lib/libc/inet/inet_cidr_ntop.c
@@ -16,7 +16,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: inet_cidr_ntop.c,v 1.1.2.1.8.4 2006/10/11 02:32:50 marka Exp $";
+static const char rcsid[] = "$Id: inet_cidr_ntop.c,v 1.4.18.3 2006/10/11 02:32:47 marka Exp $";
#endif
#include "port_before.h"
@@ -45,7 +45,7 @@ inet_cidr_ntop_ipv4(const u_char *src, int bits, char *dst, size_t size);
static char *
inet_cidr_ntop_ipv6(const u_char *src, int bits, char *dst, size_t size);
-/*
+/*%
* char *
* inet_cidr_ntop(af, src, bits, dst, size)
* convert network address from network to presentation format.
@@ -92,7 +92,7 @@ decoct(const u_char *src, int bytes, char *dst, size_t size) {
return (dst - odst);
}
-/*
+/*%
* static char *
* inet_cidr_ntop_ipv4(src, bits, dst, size)
* convert IPv4 network address from network to presentation format.
@@ -259,3 +259,5 @@ inet_cidr_ntop_ipv6(const u_char *src, int bits, char *dst, size_t size) {
strcpy(dst, tmp);
return (dst);
}
+
+/*! \file */
diff --git a/lib/libc/inet/inet_cidr_pton.c b/lib/libc/inet/inet_cidr_pton.c
index 5bfef71ba721a..b55e3ea95679c 100644
--- a/lib/libc/inet/inet_cidr_pton.c
+++ b/lib/libc/inet/inet_cidr_pton.c
@@ -16,7 +16,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: inet_cidr_pton.c,v 1.2.2.1.8.2 2004/03/17 00:29:46 marka Exp $";
+static const char rcsid[] = "$Id: inet_cidr_pton.c,v 1.5.18.1 2005/04/27 05:00:53 sra Exp $";
#endif
#include "port_before.h"
@@ -49,7 +49,7 @@ static int inet_cidr_pton_ipv6 __P((const char *src, u_char *dst,
static int getbits(const char *, int ipv6);
-/*
+/*%
* int
* inet_cidr_pton(af, src, dst, *bits)
* convert network address from presentation to network format.
@@ -204,7 +204,7 @@ inet_cidr_pton_ipv6(const char *src, u_char *dst, int *pbits) {
inet_cidr_pton_ipv4(curtok, tp, &bits, 1) == 0) {
tp += NS_INADDRSZ;
saw_xdigit = 0;
- break; /* '\0' was seen by inet_pton4(). */
+ break; /*%< '\\0' was seen by inet_pton4(). */
}
if (ch == '/') {
bits = getbits(src, 1);
@@ -256,20 +256,22 @@ getbits(const char *src, int ipv6) {
int bits = 0;
char *cp, ch;
- if (*src == '\0') /* syntax */
+ if (*src == '\0') /*%< syntax */
return (-2);
do {
ch = *src++;
cp = strchr(digits, ch);
- if (cp == NULL) /* syntax */
+ if (cp == NULL) /*%< syntax */
return (-2);
bits *= 10;
bits += cp - digits;
- if (bits == 0 && *src != '\0') /* no leading zeros */
+ if (bits == 0 && *src != '\0') /*%< no leading zeros */
return (-2);
- if (bits > (ipv6 ? 128 : 32)) /* range error */
+ if (bits > (ipv6 ? 128 : 32)) /*%< range error */
return (-2);
} while (*src != '\0');
return (bits);
}
+
+/*! \file */
diff --git a/lib/libc/inet/inet_lnaof.c b/lib/libc/inet/inet_lnaof.c
index 97b80cffdb5b3..70ac409512f8a 100644
--- a/lib/libc/inet/inet_lnaof.c
+++ b/lib/libc/inet/inet_lnaof.c
@@ -43,7 +43,7 @@ static const char sccsid[] = "@(#)inet_lnaof.c 8.1 (Berkeley) 6/4/93";
#include "port_after.h"
-/*
+/*%
* Return the local network address portion of an
* internet address; handles class a/b/c network
* number formats.
@@ -61,3 +61,5 @@ inet_lnaof(in)
else
return ((i)&IN_CLASSC_HOST);
}
+
+/*! \file */
diff --git a/lib/libc/inet/inet_makeaddr.c b/lib/libc/inet/inet_makeaddr.c
index 6e4ecc37ccabd..c56cb3eaeb579 100644
--- a/lib/libc/inet/inet_makeaddr.c
+++ b/lib/libc/inet/inet_makeaddr.c
@@ -43,7 +43,7 @@ static const char sccsid[] = "@(#)inet_makeaddr.c 8.1 (Berkeley) 6/4/93";
#include "port_after.h"
-/*
+/*%
* Formulate an Internet address from network + host. Used in
* building addresses stored in the ifnet structure.
*/
@@ -64,3 +64,5 @@ inet_makeaddr(net, host)
a.s_addr = htonl(a.s_addr);
return (a);
}
+
+/*! \file */
diff --git a/lib/libc/inet/inet_net_ntop.c b/lib/libc/inet/inet_net_ntop.c
index 47af6284ede3e..a1ac243da1120 100644
--- a/lib/libc/inet/inet_net_ntop.c
+++ b/lib/libc/inet/inet_net_ntop.c
@@ -16,7 +16,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: inet_net_ntop.c,v 1.1.2.1.8.2 2006/06/20 02:53:07 marka Exp $";
+static const char rcsid[] = "$Id: inet_net_ntop.c,v 1.3.18.2 2006/06/20 02:51:32 marka Exp $";
#endif
#include "port_before.h"
@@ -44,7 +44,7 @@ static char * inet_net_ntop_ipv4 __P((const u_char *src, int bits,
static char * inet_net_ntop_ipv6 __P((const u_char *src, int bits,
char *dst, size_t size));
-/*
+/*%
* char *
* inet_net_ntop(af, src, bits, dst, size)
* convert network number from network to presentation format.
@@ -73,7 +73,7 @@ inet_net_ntop(af, src, bits, dst, size)
}
}
-/*
+/*%
* static char *
* inet_net_ntop_ipv4(src, bits, dst, size)
* convert IPv4 network number from network to presentation format.
@@ -148,7 +148,7 @@ inet_net_ntop_ipv4(src, bits, dst, size)
return (NULL);
}
-/*
+/*%
* static char *
* inet_net_ntop_ipv6(src, bits, fakebits, dst, size)
* convert IPv6 network number from network to presentation format.
@@ -275,3 +275,5 @@ emsgsize:
errno = EMSGSIZE;
return (NULL);
}
+
+/*! \file */
diff --git a/lib/libc/inet/inet_net_pton.c b/lib/libc/inet/inet_net_pton.c
index abecfc79cd2c8..d3de33bf10a4c 100644
--- a/lib/libc/inet/inet_net_pton.c
+++ b/lib/libc/inet/inet_net_pton.c
@@ -16,7 +16,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: inet_net_pton.c,v 1.4.2.1.8.2 2004/03/17 00:29:47 marka Exp $";
+static const char rcsid[] = "$Id: inet_net_pton.c,v 1.7.18.1 2005/04/27 05:00:53 sra Exp $";
#endif
#include "port_before.h"
@@ -42,7 +42,7 @@ static const char rcsid[] = "$Id: inet_net_pton.c,v 1.4.2.1.8.2 2004/03/17 00:29
# define SPRINTF(x) ((size_t)sprintf x)
#endif
-/*
+/*%
* static int
* inet_net_pton_ipv4(src, dst, size)
* convert IPv4 network number from presentation to network format.
@@ -73,7 +73,7 @@ inet_net_pton_ipv4(const char *src, u_char *dst, size_t size) {
if (size <= 0U)
goto emsgsize;
dirty = 0;
- src++; /* skip x or X. */
+ src++; /*%< skip x or X. */
while ((ch = *src++) != '\0' && isascii(ch) && isxdigit(ch)) {
if (isupper(ch))
ch = tolower(ch);
@@ -90,7 +90,7 @@ inet_net_pton_ipv4(const char *src, u_char *dst, size_t size) {
dirty = 0;
}
}
- if (dirty) { /* Odd trailing nybble? */
+ if (dirty) { /*%< Odd trailing nybble? */
if (size-- <= 0U)
goto emsgsize;
*dst++ = (u_char) (tmp << 4);
@@ -126,7 +126,7 @@ inet_net_pton_ipv4(const char *src, u_char *dst, size_t size) {
if (ch == '/' && isascii((unsigned char)(src[0])) &&
isdigit((unsigned char)(src[0])) && dst > odst) {
/* CIDR width specifier. Nothing can follow it. */
- ch = *src++; /* Skip over the /. */
+ ch = *src++; /*%< Skip over the /. */
bits = 0;
do {
n = strchr(digits, ch) - digits;
@@ -149,15 +149,15 @@ inet_net_pton_ipv4(const char *src, u_char *dst, size_t size) {
goto enoent;
/* If no CIDR spec was given, infer width from net class. */
if (bits == -1) {
- if (*odst >= 240) /* Class E */
+ if (*odst >= 240) /*%< Class E */
bits = 32;
- else if (*odst >= 224) /* Class D */
+ else if (*odst >= 224) /*%< Class D */
bits = 8;
- else if (*odst >= 192) /* Class C */
+ else if (*odst >= 192) /*%< Class C */
bits = 24;
- else if (*odst >= 128) /* Class B */
+ else if (*odst >= 128) /*%< Class B */
bits = 16;
- else /* Class A */
+ else /*%< Class A */
bits = 8;
/* If imputed mask is narrower than specified octets, widen. */
if (bits < ((dst - odst) * 8))
@@ -200,11 +200,11 @@ getbits(const char *src, int *bitsp) {
pch = strchr(digits, ch);
if (pch != NULL) {
- if (n++ != 0 && val == 0) /* no leading zeros */
+ if (n++ != 0 && val == 0) /*%< no leading zeros */
return (0);
val *= 10;
val += (pch - digits);
- if (val > 128) /* range */
+ if (val > 128) /*%< range */
return (0);
continue;
}
@@ -231,16 +231,16 @@ getv4(const char *src, u_char *dst, int *bitsp) {
pch = strchr(digits, ch);
if (pch != NULL) {
- if (n++ != 0 && val == 0) /* no leading zeros */
+ if (n++ != 0 && val == 0) /*%< no leading zeros */
return (0);
val *= 10;
val += (pch - digits);
- if (val > 255) /* range */
+ if (val > 255) /*%< range */
return (0);
continue;
}
if (ch == '.' || ch == '/') {
- if (dst - odst > 3) /* too many octets? */
+ if (dst - odst > 3) /*%< too many octets? */
return (0);
*dst++ = val;
if (ch == '/')
@@ -253,7 +253,7 @@ getv4(const char *src, u_char *dst, int *bitsp) {
}
if (n == 0)
return (0);
- if (dst - odst > 3) /* too many octets? */
+ if (dst - odst > 3) /*%< too many octets? */
return (0);
*dst++ = val;
return (1);
@@ -322,7 +322,7 @@ inet_net_pton_ipv6(const char *src, u_char *dst, size_t size) {
tp += NS_INADDRSZ;
saw_xdigit = 0;
ipv4 = 1;
- break; /* '\0' was seen by inet_pton4(). */
+ break; /*%< '\\0' was seen by inet_pton4(). */
}
if (ch == '/' && getbits(src, &bits) > 0)
break;
@@ -378,7 +378,7 @@ inet_net_pton_ipv6(const char *src, u_char *dst, size_t size) {
return (-1);
}
-/*
+/*%
* int
* inet_net_pton(af, src, dst, size)
* convert network number from presentation to network format.
@@ -403,3 +403,5 @@ inet_net_pton(int af, const char *src, void *dst, size_t size) {
return (-1);
}
}
+
+/*! \file */
diff --git a/lib/libc/inet/inet_neta.c b/lib/libc/inet/inet_neta.c
index 325b7ce814e39..bc3b601e9b4e9 100644
--- a/lib/libc/inet/inet_neta.c
+++ b/lib/libc/inet/inet_neta.c
@@ -16,7 +16,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: inet_neta.c,v 1.1.206.1 2004/03/09 08:33:33 marka Exp $";
+static const char rcsid[] = "$Id: inet_neta.c,v 1.2.18.1 2005/04/27 05:00:53 sra Exp $";
#endif
#include "port_before.h"
@@ -38,7 +38,7 @@ static const char rcsid[] = "$Id: inet_neta.c,v 1.1.206.1 2004/03/09 08:33:33 ma
# define SPRINTF(x) ((size_t)sprintf x)
#endif
-/*
+/*%
* char *
* inet_neta(src, dst, size)
* format a u_long network number into presentation format.
@@ -85,3 +85,5 @@ inet_neta(src, dst, size)
errno = EMSGSIZE;
return (NULL);
}
+
+/*! \file */
diff --git a/lib/libc/inet/inet_netof.c b/lib/libc/inet/inet_netof.c
index e887530088a1b..c228e3d818f95 100644
--- a/lib/libc/inet/inet_netof.c
+++ b/lib/libc/inet/inet_netof.c
@@ -43,7 +43,7 @@ static const char sccsid[] = "@(#)inet_netof.c 8.1 (Berkeley) 6/4/93";
#include "port_after.h"
-/*
+/*%
* Return the network number from an internet
* address; handles class a/b/c network #'s.
*/
@@ -60,3 +60,5 @@ inet_netof(in)
else
return (((i)&IN_CLASSC_NET) >> IN_CLASSC_NSHIFT);
}
+
+/*! \file */
diff --git a/lib/libc/inet/inet_network.c b/lib/libc/inet/inet_network.c
index aaa50c8315781..4758a00f2651f 100644
--- a/lib/libc/inet/inet_network.c
+++ b/lib/libc/inet/inet_network.c
@@ -44,7 +44,7 @@ static const char sccsid[] = "@(#)inet_network.c 8.1 (Berkeley) 6/4/93";
#include "port_after.h"
-/*
+/*%
* Internet network address interpretation routine.
* The library routines call this routine to interpret
* network numbers.
@@ -102,3 +102,5 @@ again:
}
return (val);
}
+
+/*! \file */
diff --git a/lib/libc/inet/inet_ntoa.c b/lib/libc/inet/inet_ntoa.c
index 7fad4b8902a44..1d566be9972f8 100644
--- a/lib/libc/inet/inet_ntoa.c
+++ b/lib/libc/inet/inet_ntoa.c
@@ -33,7 +33,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)inet_ntoa.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: inet_ntoa.c,v 1.1 2001/03/29 06:31:38 marka Exp $";
+static const char rcsid[] = "$Id: inet_ntoa.c,v 1.1.352.1 2005/04/27 05:00:54 sra Exp $";
#endif /* LIBC_SCCS and not lint */
#include "port_before.h"
@@ -48,7 +48,7 @@ static const char rcsid[] = "$Id: inet_ntoa.c,v 1.1 2001/03/29 06:31:38 marka Ex
#include "port_after.h"
-/*
+/*%
* Convert network-format internet address
* to base 256 d.d.d.d representation.
*/
@@ -60,3 +60,5 @@ inet_ntoa(struct in_addr in) {
(void) inet_ntop(AF_INET, &in, ret, sizeof ret);
return (ret);
}
+
+/*! \file */
diff --git a/lib/libc/inet/inet_ntop.c b/lib/libc/inet/inet_ntop.c
index cd502ab75862f..9ab38bc0dcdad 100644
--- a/lib/libc/inet/inet_ntop.c
+++ b/lib/libc/inet/inet_ntop.c
@@ -16,7 +16,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: inet_ntop.c,v 1.1.2.1.8.2 2005/11/03 23:08:40 marka Exp $";
+static const char rcsid[] = "$Id: inet_ntop.c,v 1.3.18.2 2005/11/03 23:02:22 marka Exp $";
#endif /* LIBC_SCCS and not lint */
#include "port_before.h"
@@ -41,7 +41,7 @@ static const char rcsid[] = "$Id: inet_ntop.c,v 1.1.2.1.8.2 2005/11/03 23:08:40
# define SPRINTF(x) ((size_t)sprintf x)
#endif
-/*
+/*%
* WARNING: Don't even consider trying to compile this on a system where
* sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
*/
@@ -203,3 +203,5 @@ inet_ntop6(src, dst, size)
strcpy(dst, tmp);
return (dst);
}
+
+/*! \file */
diff --git a/lib/libc/inet/inet_pton.c b/lib/libc/inet/inet_pton.c
index f18a7b64fde26..66b4c6a669b17 100644
--- a/lib/libc/inet/inet_pton.c
+++ b/lib/libc/inet/inet_pton.c
@@ -16,7 +16,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: inet_pton.c,v 1.2.206.2 2005/07/28 07:43:18 marka Exp $";
+static const char rcsid[] = "$Id: inet_pton.c,v 1.3.18.2 2005/07/28 07:38:07 marka Exp $";
#endif /* LIBC_SCCS and not lint */
#include "port_before.h"
@@ -30,7 +30,7 @@ static const char rcsid[] = "$Id: inet_pton.c,v 1.2.206.2 2005/07/28 07:43:18 ma
#include <errno.h>
#include "port_after.h"
-/*
+/*%
* WARNING: Don't even consider trying to compile this on a system where
* sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
*/
@@ -188,7 +188,7 @@ inet_pton6(src, dst)
inet_pton4(curtok, tp) > 0) {
tp += NS_INADDRSZ;
seen_xdigits = 0;
- break; /* '\0' was seen by inet_pton4(). */
+ break; /*%< '\\0' was seen by inet_pton4(). */
}
return (0);
}
@@ -219,3 +219,5 @@ inet_pton6(src, dst)
memcpy(dst, tmp, NS_IN6ADDRSZ);
return (1);
}
+
+/*! \file */
diff --git a/lib/libc/inet/nsap_addr.c b/lib/libc/inet/nsap_addr.c
index a4b98e7c4a097..d8fe87c52c691 100644
--- a/lib/libc/inet/nsap_addr.c
+++ b/lib/libc/inet/nsap_addr.c
@@ -16,7 +16,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: nsap_addr.c,v 1.2.206.2 2005/07/28 07:43:18 marka Exp $";
+static const char rcsid[] = "$Id: nsap_addr.c,v 1.3.18.2 2005/07/28 07:38:08 marka Exp $";
#endif /* LIBC_SCCS and not lint */
#include "port_before.h"
@@ -107,3 +107,5 @@ inet_nsap_ntoa(int binlen, const u_char *binary, char *ascii) {
*ascii = '\0';
return (start);
}
+
+/*! \file */