summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--c/src/exec/libnetworking/kern/uipc_domain.c4
-rw-r--r--c/src/exec/libnetworking/kern/uipc_socket.c2
-rw-r--r--c/src/exec/libnetworking/lib/getprotoby.c4
-rw-r--r--c/src/exec/libnetworking/lib/syslog.c2
-rw-r--r--c/src/exec/libnetworking/libc/base64.c2
-rw-r--r--c/src/exec/libnetworking/libc/gethostbydns.c8
-rw-r--r--c/src/exec/libnetworking/libc/gethostnamadr.c2
-rw-r--r--c/src/exec/libnetworking/libc/inet_addr.c10
-rw-r--r--c/src/exec/libnetworking/libc/ns_name.c8
-rw-r--r--c/src/exec/libnetworking/libc/ns_netint.c6
-rw-r--r--c/src/exec/libnetworking/libc/ns_parse.c6
-rw-r--r--c/src/exec/libnetworking/libc/ns_print.c6
-rw-r--r--c/src/exec/libnetworking/libc/ns_ttl.c8
-rw-r--r--c/src/exec/libnetworking/libc/res_config.h8
-rw-r--r--c/src/exec/libnetworking/libc/res_debug.c54
-rw-r--r--c/src/exec/libnetworking/libc/res_init.c4
-rw-r--r--c/src/exec/libnetworking/libc/res_mkupdate.c9
-rw-r--r--c/src/exec/libnetworking/libc/res_query.c6
-rw-r--r--c/src/exec/libnetworking/libc/res_send.c8
-rw-r--r--c/src/exec/libnetworking/libc/res_update.c2
-rw-r--r--c/src/exec/libnetworking/libc/strsep.c2
-rw-r--r--c/src/exec/libnetworking/net/if_ethersubr.c15
-rw-r--r--c/src/exec/libnetworking/net/route.c2
-rw-r--r--c/src/exec/libnetworking/net/rtsock.c4
-rw-r--r--c/src/exec/libnetworking/netinet/in_pcb.c4
-rw-r--r--c/src/exec/libnetworking/netinet/tcp_debug.c2
-rw-r--r--c/src/exec/libnetworking/netinet/tcp_subr.c6
-rw-r--r--c/src/exec/libnetworking/netinet/udp_usrreq.c2
-rw-r--r--c/src/exec/libnetworking/nfs/bootp_subr.c16
-rw-r--r--c/src/exec/libnetworking/rtems/rtems_bsdnet_internal.h2
-rw-r--r--c/src/exec/libnetworking/rtems/rtems_syscall.c1
-rw-r--r--c/src/exec/libnetworking/sys/libkern.h2
-rw-r--r--c/src/exec/libnetworking/sys/param.h4
-rw-r--r--c/src/exec/libnetworking/sys/syslimits.h21
-rw-r--r--c/src/lib/libnetworking/kern/uipc_domain.c4
-rw-r--r--c/src/lib/libnetworking/kern/uipc_socket.c2
-rw-r--r--c/src/lib/libnetworking/lib/getprotoby.c4
-rw-r--r--c/src/lib/libnetworking/lib/syslog.c2
-rw-r--r--c/src/lib/libnetworking/libc/Makefile.in6
-rw-r--r--c/src/lib/libnetworking/libc/base64.c2
-rw-r--r--c/src/lib/libnetworking/libc/gethostbydns.c8
-rw-r--r--c/src/lib/libnetworking/libc/gethostnamadr.c2
-rw-r--r--c/src/lib/libnetworking/libc/inet_addr.c10
-rw-r--r--c/src/lib/libnetworking/libc/ns_name.c8
-rw-r--r--c/src/lib/libnetworking/libc/ns_netint.c6
-rw-r--r--c/src/lib/libnetworking/libc/ns_parse.c6
-rw-r--r--c/src/lib/libnetworking/libc/ns_print.c6
-rw-r--r--c/src/lib/libnetworking/libc/ns_ttl.c8
-rw-r--r--c/src/lib/libnetworking/libc/res_config.h8
-rw-r--r--c/src/lib/libnetworking/libc/res_debug.c54
-rw-r--r--c/src/lib/libnetworking/libc/res_init.c4
-rw-r--r--c/src/lib/libnetworking/libc/res_mkupdate.c9
-rw-r--r--c/src/lib/libnetworking/libc/res_query.c6
-rw-r--r--c/src/lib/libnetworking/libc/res_send.c8
-rw-r--r--c/src/lib/libnetworking/libc/res_update.c2
-rw-r--r--c/src/lib/libnetworking/libc/strsep.c2
-rw-r--r--c/src/lib/libnetworking/net/if_ethersubr.c15
-rw-r--r--c/src/lib/libnetworking/net/route.c2
-rw-r--r--c/src/lib/libnetworking/net/rtsock.c4
-rw-r--r--c/src/lib/libnetworking/netinet/in_pcb.c4
-rw-r--r--c/src/lib/libnetworking/netinet/tcp_debug.c2
-rw-r--r--c/src/lib/libnetworking/netinet/tcp_subr.c6
-rw-r--r--c/src/lib/libnetworking/netinet/udp_usrreq.c2
-rw-r--r--c/src/lib/libnetworking/nfs/bootp_subr.c16
-rw-r--r--c/src/lib/libnetworking/rtems/rtems_bsdnet_internal.h2
-rw-r--r--c/src/lib/libnetworking/rtems/rtems_syscall.c1
-rw-r--r--c/src/lib/libnetworking/sys/libkern.h2
-rw-r--r--c/src/lib/libnetworking/sys/param.h4
-rw-r--r--c/src/lib/libnetworking/sys/syslimits.h21
-rw-r--r--c/src/libnetworking/kern/uipc_domain.c4
-rw-r--r--c/src/libnetworking/kern/uipc_socket.c2
-rw-r--r--c/src/libnetworking/lib/getprotoby.c4
-rw-r--r--c/src/libnetworking/lib/syslog.c2
-rw-r--r--c/src/libnetworking/libc/Makefile.in6
-rw-r--r--c/src/libnetworking/libc/base64.c2
-rw-r--r--c/src/libnetworking/libc/gethostbydns.c8
-rw-r--r--c/src/libnetworking/libc/gethostnamadr.c2
-rw-r--r--c/src/libnetworking/libc/inet_addr.c10
-rw-r--r--c/src/libnetworking/libc/ns_name.c8
-rw-r--r--c/src/libnetworking/libc/ns_netint.c6
-rw-r--r--c/src/libnetworking/libc/ns_parse.c6
-rw-r--r--c/src/libnetworking/libc/ns_print.c6
-rw-r--r--c/src/libnetworking/libc/ns_ttl.c8
-rw-r--r--c/src/libnetworking/libc/res_config.h8
-rw-r--r--c/src/libnetworking/libc/res_debug.c54
-rw-r--r--c/src/libnetworking/libc/res_init.c4
-rw-r--r--c/src/libnetworking/libc/res_mkupdate.c9
-rw-r--r--c/src/libnetworking/libc/res_query.c6
-rw-r--r--c/src/libnetworking/libc/res_send.c8
-rw-r--r--c/src/libnetworking/libc/res_update.c2
-rw-r--r--c/src/libnetworking/libc/strsep.c2
-rw-r--r--c/src/libnetworking/net/if_ethersubr.c15
-rw-r--r--c/src/libnetworking/net/route.c2
-rw-r--r--c/src/libnetworking/net/rtsock.c4
-rw-r--r--c/src/libnetworking/netinet/in_pcb.c4
-rw-r--r--c/src/libnetworking/netinet/tcp_debug.c2
-rw-r--r--c/src/libnetworking/netinet/tcp_subr.c6
-rw-r--r--c/src/libnetworking/netinet/udp_usrreq.c2
-rw-r--r--c/src/libnetworking/nfs/bootp_subr.c16
-rw-r--r--c/src/libnetworking/rtems/rtems_bsdnet_internal.h2
-rw-r--r--c/src/libnetworking/rtems/rtems_syscall.c1
-rw-r--r--c/src/libnetworking/sys/libkern.h2
-rw-r--r--c/src/libnetworking/sys/param.h4
-rw-r--r--c/src/libnetworking/sys/syslimits.h21
-rw-r--r--cpukit/libnetworking/kern/uipc_domain.c4
-rw-r--r--cpukit/libnetworking/kern/uipc_socket.c2
-rw-r--r--cpukit/libnetworking/lib/getprotoby.c4
-rw-r--r--cpukit/libnetworking/lib/syslog.c2
-rw-r--r--cpukit/libnetworking/libc/base64.c2
-rw-r--r--cpukit/libnetworking/libc/gethostbydns.c8
-rw-r--r--cpukit/libnetworking/libc/gethostnamadr.c2
-rw-r--r--cpukit/libnetworking/libc/inet_addr.c10
-rw-r--r--cpukit/libnetworking/libc/ns_name.c8
-rw-r--r--cpukit/libnetworking/libc/ns_netint.c6
-rw-r--r--cpukit/libnetworking/libc/ns_parse.c6
-rw-r--r--cpukit/libnetworking/libc/ns_print.c6
-rw-r--r--cpukit/libnetworking/libc/ns_ttl.c8
-rw-r--r--cpukit/libnetworking/libc/res_config.h8
-rw-r--r--cpukit/libnetworking/libc/res_debug.c54
-rw-r--r--cpukit/libnetworking/libc/res_init.c4
-rw-r--r--cpukit/libnetworking/libc/res_mkupdate.c9
-rw-r--r--cpukit/libnetworking/libc/res_query.c6
-rw-r--r--cpukit/libnetworking/libc/res_send.c8
-rw-r--r--cpukit/libnetworking/libc/res_update.c2
-rw-r--r--cpukit/libnetworking/libc/strsep.c2
-rw-r--r--cpukit/libnetworking/net/if_ethersubr.c15
-rw-r--r--cpukit/libnetworking/net/route.c2
-rw-r--r--cpukit/libnetworking/net/rtsock.c4
-rw-r--r--cpukit/libnetworking/netinet/in_pcb.c4
-rw-r--r--cpukit/libnetworking/netinet/tcp_debug.c2
-rw-r--r--cpukit/libnetworking/netinet/tcp_subr.c6
-rw-r--r--cpukit/libnetworking/netinet/udp_usrreq.c2
-rw-r--r--cpukit/libnetworking/nfs/bootp_subr.c16
-rw-r--r--cpukit/libnetworking/rtems/rtems_bsdnet_internal.h2
-rw-r--r--cpukit/libnetworking/rtems/rtems_syscall.c1
-rw-r--r--cpukit/libnetworking/sys/libkern.h2
-rw-r--r--cpukit/libnetworking/sys/param.h4
-rw-r--r--cpukit/libnetworking/sys/syslimits.h21
138 files changed, 644 insertions, 336 deletions
diff --git a/c/src/exec/libnetworking/kern/uipc_domain.c b/c/src/exec/libnetworking/kern/uipc_domain.c
index b35c7e6e67..910007395c 100644
--- a/c/src/exec/libnetworking/kern/uipc_domain.c
+++ b/c/src/exec/libnetworking/kern/uipc_domain.c
@@ -56,6 +56,7 @@
* passed to the doamin_add() function.
*/
+#if !defined(__rtems__)
static int x_save_spl; /* used by kludge*/
static void kludge_splimp __P((void *));
static void kludge_splx __P((void *));
@@ -63,6 +64,7 @@ static void kludge_splx __P((void *));
SYSINIT(splimp, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, kludge_splimp, &x_save_spl)
SYSINIT(domain, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, domaininit, NULL)
SYSINIT(splx, SI_SUB_PROTO_END, SI_ORDER_FIRST, kludge_splx, &x_save_spl)
+#endif
static void pffasttimo __P((void *));
static void pfslowtimo __P((void *));
@@ -81,7 +83,7 @@ void
domaininit(dummy)
void *dummy;
{
- register struct domain *dp, **dpp;
+ register struct domain *dp;
register struct protosw *pr;
/* - not in our sources
diff --git a/c/src/exec/libnetworking/kern/uipc_socket.c b/c/src/exec/libnetworking/kern/uipc_socket.c
index 0933fea50a..895d1c7d45 100644
--- a/c/src/exec/libnetworking/kern/uipc_socket.c
+++ b/c/src/exec/libnetworking/kern/uipc_socket.c
@@ -350,7 +350,7 @@ sosend(so, addr, uio, top, control, flags)
* Also check to make sure that MSG_EOR isn't used on SOCK_STREAM
* type sockets since that's an error.
*/
- if (resid < 0 || so->so_type == SOCK_STREAM && (flags & MSG_EOR)) {
+ if ((resid < 0) || (so->so_type == SOCK_STREAM && (flags & MSG_EOR))) {
error = EINVAL;
goto out;
}
diff --git a/c/src/exec/libnetworking/lib/getprotoby.c b/c/src/exec/libnetworking/lib/getprotoby.c
index b90c247a54..e0aa3bfbdb 100644
--- a/c/src/exec/libnetworking/lib/getprotoby.c
+++ b/c/src/exec/libnetworking/lib/getprotoby.c
@@ -21,7 +21,7 @@ getprotobyname (const char *name)
for (i = 0 ; i < (sizeof prototab / sizeof prototab[0]) ; i++) {
if (strcmp (name, prototab[i].p_name) == 0)
- return &prototab[i];
+ return (struct protoent *) &prototab[i];
}
return NULL;
}
@@ -36,7 +36,7 @@ getprotobynumber (int proto)
for (i = 0 ; i < (sizeof prototab / sizeof prototab[0]) ; i++) {
if (proto == prototab[i].p_proto)
- return &prototab[i];
+ return (struct protoent *) &prototab[i];
}
return NULL;
}
diff --git a/c/src/exec/libnetworking/lib/syslog.c b/c/src/exec/libnetworking/lib/syslog.c
index 7f468c81e6..0bb15bc78e 100644
--- a/c/src/exec/libnetworking/lib/syslog.c
+++ b/c/src/exec/libnetworking/lib/syslog.c
@@ -13,6 +13,8 @@
#include <sys/socket.h>
#include <netinet/in.h>
+#include <unistd.h>
+
static int LogStatus = LOG_CONS;
static const char *LogTag = "syslog";
static int LogFacility = LOG_USER;
diff --git a/c/src/exec/libnetworking/libc/base64.c b/c/src/exec/libnetworking/libc/base64.c
index c9518ca730..3017ccc01c 100644
--- a/c/src/exec/libnetworking/libc/base64.c
+++ b/c/src/exec/libnetworking/libc/base64.c
@@ -40,9 +40,11 @@
* IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
+#if !defined(__rtems__)
#if !defined(LINT) && !defined(CODECENTER)
static char rcsid[] = "$Id$";
#endif /* not lint */
+#endif /* not rtems */
#include <sys/types.h>
#include <sys/param.h>
diff --git a/c/src/exec/libnetworking/libc/gethostbydns.c b/c/src/exec/libnetworking/libc/gethostbydns.c
index ceb7088160..3d80ffde7a 100644
--- a/c/src/exec/libnetworking/libc/gethostbydns.c
+++ b/c/src/exec/libnetworking/libc/gethostbydns.c
@@ -518,7 +518,7 @@ _gethostbydnsname(name, af)
* disallow names consisting only of digits/dots, unless
* they end in a dot.
*/
- if (isdigit(name[0]))
+ if (isdigit((int)name[0]))
for (cp = name;; ++cp) {
if (!*cp) {
if (*--cp == '.')
@@ -547,10 +547,10 @@ _gethostbydnsname(name, af)
h_errno = NETDB_SUCCESS;
return (&host);
}
- if (!isdigit(*cp) && *cp != '.')
+ if (!isdigit((int)*cp) && *cp != '.')
break;
}
- if ((isxdigit(name[0]) && strchr(name, ':') != NULL) ||
+ if ((isxdigit((int)name[0]) && strchr(name, ':') != NULL) ||
name[0] == ':')
for (cp = name;; ++cp) {
if (!*cp) {
@@ -578,7 +578,7 @@ _gethostbydnsname(name, af)
h_errno = NETDB_SUCCESS;
return (&host);
}
- if (!isxdigit(*cp) && *cp != ':' && *cp != '.')
+ if (!isxdigit((int)*cp) && *cp != ':' && *cp != '.')
break;
}
diff --git a/c/src/exec/libnetworking/libc/gethostnamadr.c b/c/src/exec/libnetworking/libc/gethostnamadr.c
index 2ad832f4b1..92f7a21014 100644
--- a/c/src/exec/libnetworking/libc/gethostnamadr.c
+++ b/c/src/exec/libnetworking/libc/gethostnamadr.c
@@ -103,7 +103,7 @@ init_services()
if (cp == NULL)
continue;
do {
- if (isalpha(cp[0])) {
+ if (isalpha((int)cp[0])) {
service_order[cc] = get_service_name(cp);
if(service_order[cc] != SERVICE_NONE)
cc++;
diff --git a/c/src/exec/libnetworking/libc/inet_addr.c b/c/src/exec/libnetworking/libc/inet_addr.c
index a1ac899519..225ccc1269 100644
--- a/c/src/exec/libnetworking/libc/inet_addr.c
+++ b/c/src/exec/libnetworking/libc/inet_addr.c
@@ -103,7 +103,7 @@ inet_aton(cp, addr)
* Values are specified as for C:
* 0x=hex, 0=octal, isdigit=decimal.
*/
- if (!isdigit(c))
+ if (!isdigit((int)c))
return (0);
val = 0; base = 10;
if (c == '0') {
@@ -114,12 +114,12 @@ inet_aton(cp, addr)
base = 8;
}
for (;;) {
- if (isascii(c) && isdigit(c)) {
+ if (isascii((int)c) && isdigit((int)c)) {
val = (val * base) + (c - '0');
c = *++cp;
- } else if (base == 16 && isascii(c) && isxdigit(c)) {
+ } else if (base == 16 && isascii((int)c) && isxdigit((int)c)) {
val = (val << 4) |
- (c + 10 - (islower(c) ? 'a' : 'A'));
+ (c + 10 - (islower((int)c) ? 'a' : 'A'));
c = *++cp;
} else
break;
@@ -141,7 +141,7 @@ inet_aton(cp, addr)
/*
* Check for trailing characters.
*/
- if (c != '\0' && (!isascii(c) || !isspace(c)))
+ if (c != '\0' && (!isascii((int)c) || !isspace((int)c)))
return (0);
/*
* Concoct the address according to
diff --git a/c/src/exec/libnetworking/libc/ns_name.c b/c/src/exec/libnetworking/libc/ns_name.c
index 3e6b2b87fa..af10d2f062 100644
--- a/c/src/exec/libnetworking/libc/ns_name.c
+++ b/c/src/exec/libnetworking/libc/ns_name.c
@@ -15,9 +15,11 @@
* SOFTWARE.
*/
-#ifndef lint
+#if !defined(__rtems__)
+#if !defined(LINT) && !defined(CODECENTER)
static char rcsid[] = "$Id$";
-#endif
+#endif /* not lint */
+#endif /* not rtems */
#include <sys/types.h>
@@ -244,7 +246,7 @@ ns_name_unpack(const u_char *msg, const u_char *eom, const u_char *src,
{
const u_char *srcp, *dstlim;
u_char *dstp;
- int n, c, len, checked;
+ int n, len, checked;
len = -1;
checked = 0;
diff --git a/c/src/exec/libnetworking/libc/ns_netint.c b/c/src/exec/libnetworking/libc/ns_netint.c
index bf0f793c2c..3c09da8f8c 100644
--- a/c/src/exec/libnetworking/libc/ns_netint.c
+++ b/c/src/exec/libnetworking/libc/ns_netint.c
@@ -15,9 +15,11 @@
* SOFTWARE.
*/
-#ifndef lint
+#if !defined(__rtems__)
+#if !defined(LINT) && !defined(CODECENTER)
static char rcsid[] = "$Id$";
-#endif
+#endif /* not lint */
+#endif /* not rtems */
/* Import. */
diff --git a/c/src/exec/libnetworking/libc/ns_parse.c b/c/src/exec/libnetworking/libc/ns_parse.c
index 13b9956d93..cc1f070156 100644
--- a/c/src/exec/libnetworking/libc/ns_parse.c
+++ b/c/src/exec/libnetworking/libc/ns_parse.c
@@ -15,9 +15,11 @@
* SOFTWARE.
*/
-#ifndef lint
+#if !defined(__rtems__)
+#if !defined(LINT) && !defined(CODECENTER)
static char rcsid[] = "$Id$";
-#endif
+#endif /* not lint */
+#endif /* not rtems */
#include <sys/types.h>
diff --git a/c/src/exec/libnetworking/libc/ns_print.c b/c/src/exec/libnetworking/libc/ns_print.c
index 8e27c1290c..f7d7d16c64 100644
--- a/c/src/exec/libnetworking/libc/ns_print.c
+++ b/c/src/exec/libnetworking/libc/ns_print.c
@@ -15,9 +15,11 @@
* SOFTWARE.
*/
-#ifndef lint
+#if !defined(__rtems__)
+#if !defined(LINT) && !defined(CODECENTER)
static char rcsid[] = "$Id$";
-#endif
+#endif /* not lint */
+#endif /* not rtems */
/* Import. */
diff --git a/c/src/exec/libnetworking/libc/ns_ttl.c b/c/src/exec/libnetworking/libc/ns_ttl.c
index cca162b270..75093c1dbc 100644
--- a/c/src/exec/libnetworking/libc/ns_ttl.c
+++ b/c/src/exec/libnetworking/libc/ns_ttl.c
@@ -15,9 +15,11 @@
* SOFTWARE.
*/
-#ifndef lint
+#if !defined(__rtems__)
+#if !defined(LINT) && !defined(CODECENTER)
static char rcsid[] = "$Id$";
-#endif
+#endif /* not lint */
+#endif /* not rtems */
/* Import. */
@@ -44,7 +46,7 @@ int
ns_format_ttl(u_long src, char *dst, size_t dstlen) {
char *odst = dst;
int secs, mins, hours, days, weeks, x;
- char tmp[50], *p;
+ char *p;
secs = src % 60; src /= 60;
mins = src % 60; src /= 60;
diff --git a/c/src/exec/libnetworking/libc/res_config.h b/c/src/exec/libnetworking/libc/res_config.h
index 644e7d796a..9e5715cf28 100644
--- a/c/src/exec/libnetworking/libc/res_config.h
+++ b/c/src/exec/libnetworking/libc/res_config.h
@@ -6,3 +6,11 @@
#define MULTI_PTRS_ARE_ALIASES 1 /* fold multiple PTR records into aliases */
#define CHECK_SRVR_ADDR 1 /* confirm that the server requested sent the reply */
#define BIND_UPDATE 1 /* update support */
+
+#if defined(__rtems__)
+u_int16_t _getshort(const u_char *src);
+u_int32_t _getlong(const u_char *src);
+int gethostname (char *name, int namelen);
+int sethostname (char *name, int namelen);
+int issetugid (void);
+#endif
diff --git a/c/src/exec/libnetworking/libc/res_debug.c b/c/src/exec/libnetworking/libc/res_debug.c
index e58867acb3..b747b6e6d2 100644
--- a/c/src/exec/libnetworking/libc/res_debug.c
+++ b/c/src/exec/libnetworking/libc/res_debug.c
@@ -204,7 +204,7 @@ fp_query(const u_char *msg, FILE *file) {
void
fp_nquery(const u_char *msg, int len, FILE *file) {
ns_msg handle;
- int n, qdcount, ancount, nscount, arcount;
+ int qdcount, ancount, nscount, arcount;
u_int opcode, rcode, id;
if ((_res.options & RES_INIT) == 0 && res_init() == -1)
@@ -577,14 +577,14 @@ precsize_aton(strptr)
cp = *strptr;
- while (isdigit(*cp))
+ while (isdigit((int)*cp))
mval = mval * 10 + (*cp++ - '0');
if (*cp == '.') { /* centimeters */
cp++;
- if (isdigit(*cp)) {
+ if (isdigit((int)*cp)) {
cmval = (*cp++ - '0') * 10;
- if (isdigit(*cp)) {
+ if (isdigit((int)*cp)) {
cmval += (*cp++ - '0');
}
}
@@ -618,44 +618,44 @@ latlon2ul(latlonstrptr,which)
cp = *latlonstrptr;
- while (isdigit(*cp))
+ while (isdigit((int)*cp))
deg = deg * 10 + (*cp++ - '0');
- while (isspace(*cp))
+ while (isspace((int)*cp))
cp++;
- if (!(isdigit(*cp)))
+ if (!(isdigit((int)*cp)))
goto fndhemi;
- while (isdigit(*cp))
+ while (isdigit((int)*cp))
min = min * 10 + (*cp++ - '0');
- while (isspace(*cp))
+ while (isspace((int)*cp))
cp++;
- if (!(isdigit(*cp)))
+ if (!(isdigit((int)*cp)))
goto fndhemi;
- while (isdigit(*cp))
+ while (isdigit((int)*cp))
secs = secs * 10 + (*cp++ - '0');
if (*cp == '.') { /* decimal seconds */
cp++;
- if (isdigit(*cp)) {
+ if (isdigit((int)*cp)) {
secsfrac = (*cp++ - '0') * 100;
- if (isdigit(*cp)) {
+ if (isdigit((int)*cp)) {
secsfrac += (*cp++ - '0') * 10;
- if (isdigit(*cp)) {
+ if (isdigit((int)*cp)) {
secsfrac += (*cp++ - '0');
}
}
}
}
- while (!isspace(*cp)) /* if any trailing garbage */
+ while (!isspace((int)*cp)) /* if any trailing garbage */
cp++;
- while (isspace(*cp))
+ while (isspace((int)*cp))
cp++;
fndhemi:
@@ -693,10 +693,10 @@ latlon2ul(latlonstrptr,which)
cp++; /* skip the hemisphere */
- while (!isspace(*cp)) /* if any trailing garbage */
+ while (!isspace((int)*cp)) /* if any trailing garbage */
cp++;
- while (isspace(*cp)) /* move to next field */
+ while (isspace((int)*cp)) /* move to next field */
cp++;
*latlonstrptr = cp;
@@ -754,14 +754,14 @@ loc_aton(ascii, binary)
if (*cp == '+')
cp++;
- while (isdigit(*cp))
+ while (isdigit((int)*cp))
altmeters = altmeters * 10 + (*cp++ - '0');
if (*cp == '.') { /* decimal meters */
cp++;
- if (isdigit(*cp)) {
+ if (isdigit((int)*cp)) {
altfrac = (*cp++ - '0') * 10;
- if (isdigit(*cp)) {
+ if (isdigit((int)*cp)) {
altfrac += (*cp++ - '0');
}
}
@@ -769,10 +769,10 @@ loc_aton(ascii, binary)
alt = (10000000 + (altsign * (altmeters * 100 + altfrac)));
- while (!isspace(*cp) && (cp < maxcp)) /* if trailing garbage or m */
+ while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */
cp++;
- while (isspace(*cp) && (cp < maxcp))
+ while (isspace((int)*cp) && (cp < maxcp))
cp++;
if (cp >= maxcp)
@@ -780,10 +780,10 @@ loc_aton(ascii, binary)
siz = precsize_aton(&cp);
- while (!isspace(*cp) && (cp < maxcp)) /* if trailing garbage or m */
+ while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */
cp++;
- while (isspace(*cp) && (cp < maxcp))
+ while (isspace((int)*cp) && (cp < maxcp))
cp++;
if (cp >= maxcp)
@@ -791,10 +791,10 @@ loc_aton(ascii, binary)
hp = precsize_aton(&cp);
- while (!isspace(*cp) && (cp < maxcp)) /* if trailing garbage or m */
+ while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */
cp++;
- while (isspace(*cp) && (cp < maxcp))
+ while (isspace((int)*cp) && (cp < maxcp))
cp++;
if (cp >= maxcp)
diff --git a/c/src/exec/libnetworking/libc/res_init.c b/c/src/exec/libnetworking/libc/res_init.c
index 8b60889c6f..9371e9fa82 100644
--- a/c/src/exec/libnetworking/libc/res_init.c
+++ b/c/src/exec/libnetworking/libc/res_init.c
@@ -337,7 +337,7 @@ res_init()
break;
net = cp;
while (*cp && !ISSORTMASK(*cp) && *cp != ';' &&
- isascii(*cp) && !isspace(*cp))
+ isascii((int)*cp) && !isspace((int)*cp))
cp++;
n = *cp;
*cp = 0;
@@ -347,7 +347,7 @@ res_init()
*cp++ = n;
net = cp;
while (*cp && *cp != ';' &&
- isascii(*cp) && !isspace(*cp))
+ isascii((int)*cp) && !isspace((int)*cp))
cp++;
n = *cp;
*cp = 0;
diff --git a/c/src/exec/libnetworking/libc/res_mkupdate.c b/c/src/exec/libnetworking/libc/res_mkupdate.c
index b74f16ba78..56362f650b 100644
--- a/c/src/exec/libnetworking/libc/res_mkupdate.c
+++ b/c/src/exec/libnetworking/libc/res_mkupdate.c
@@ -20,9 +20,11 @@
* <viraj_bais@ccm.fm.intel.com>
*/
+#if !defined(__rtems__)
#if !defined(lint) && !defined(SABER)
static char rcsid[] = "$Id$";
#endif /* not lint */
+#endif /* not rtems */
#include <sys/types.h>
#include <sys/param.h>
@@ -64,9 +66,9 @@ int
res_mkupdate(ns_updrec *rrecp_in, u_char *buf, int buflen) {
ns_updrec *rrecp_start = rrecp_in;
HEADER *hp;
- u_char c, *cp, *cp1, *sp1, *sp2, *startp, *endp;
- int n, i, j, found, soanum, multiline;
- ns_updrec *rrecp, *tmprrecp, *recptr = NULL;
+ u_char *cp, *sp1, *sp2, *startp, *endp;
+ int n, i, soanum, multiline;
+ ns_updrec *rrecp;
struct in_addr ina;
char buf2[MAXDNAME];
int section, numrrs = 0, counts[ns_s_max];
@@ -350,7 +352,6 @@ static int
getnum_str(u_char **startpp, u_char *endp) {
int c, n;
int seendigit = 0;
- int seendecimal = 0;
int m = 0;
for (n = 0; *startpp <= endp; ) {
diff --git a/c/src/exec/libnetworking/libc/res_query.c b/c/src/exec/libnetworking/libc/res_query.c
index 42b7f1ecc2..784fa433bc 100644
--- a/c/src/exec/libnetworking/libc/res_query.c
+++ b/c/src/exec/libnetworking/libc/res_query.c
@@ -387,17 +387,17 @@ hostalias(name)
setbuf(fp, NULL);
buf[sizeof(buf) - 1] = '\0';
while (fgets(buf, sizeof(buf), fp)) {
- for (cp1 = buf; *cp1 && !isspace(*cp1); ++cp1)
+ for (cp1 = buf; *cp1 && !isspace((int)*cp1); ++cp1)
;
if (!*cp1)
break;
*cp1 = '\0';
if (!strcasecmp(buf, name)) {
- while (isspace(*++cp1))
+ while (isspace((int)*++cp1))
;
if (!*cp1)
break;
- for (cp2 = cp1 + 1; *cp2 && !isspace(*cp2); ++cp2)
+ for (cp2 = cp1 + 1; *cp2 && !isspace((int)*cp2); ++cp2)
;
abuf[sizeof(abuf) - 1] = *cp2 = '\0';
strncpy(abuf, cp1, sizeof(abuf) - 1);
diff --git a/c/src/exec/libnetworking/libc/res_send.c b/c/src/exec/libnetworking/libc/res_send.c
index cfb1e2eb9d..1b03bb5b1b 100644
--- a/c/src/exec/libnetworking/libc/res_send.c
+++ b/c/src/exec/libnetworking/libc/res_send.c
@@ -99,12 +99,14 @@ static char rcsid[] = "$Id$";
#include "res_config.h"
+#if !defined(__rtems__)
#ifdef NOPOLL /* libc_r doesn't wrap poll yet() */
static int use_poll = 0;
#else
static int use_poll = 1; /* adapt to poll() syscall availability */
/* 0 = not present, 1 = try it, 2 = exists */
#endif
+#endif
static int s = -1; /* socket used for communications */
static int connected = 0; /* is the socket connected */
@@ -375,7 +377,9 @@ res_send(buf, buflen, ans, anssiz)
if (v_circuit) {
int truncated;
+#if !defined(__rtems__)
struct iovec iov[2];
+#endif
u_short len;
u_char *cp;
@@ -411,7 +415,7 @@ res_send(buf, buflen, ans, anssiz)
* Send length & message
*/
putshort((u_short)buflen, (u_char*)&len);
-#if 0
+#if !defined(__rtems__)
iov[0].iov_base = (caddr_t)&len;
iov[0].iov_len = INT16SZ;
iov[1].iov_base = (caddr_t)buf;
@@ -536,8 +540,10 @@ read_len:
int msec;
#endif
struct timeval timeout;
+#ifndef NOSELECT
fd_set dsmask, *dsmaskp;
int dsmasklen;
+#endif
struct sockaddr_in from;
int fromlen;
diff --git a/c/src/exec/libnetworking/libc/res_update.c b/c/src/exec/libnetworking/libc/res_update.c
index 1c5f20abd7..ef591e0674 100644
--- a/c/src/exec/libnetworking/libc/res_update.c
+++ b/c/src/exec/libnetworking/libc/res_update.c
@@ -1,6 +1,8 @@
+#if !defined(__rtems__)
#if !defined(lint) && !defined(SABER)
static char rcsid[] = "$Id$";
#endif /* not lint */
+#endif /* not rtems */
/*
* Copyright (c) 1996 by Internet Software Consortium.
diff --git a/c/src/exec/libnetworking/libc/strsep.c b/c/src/exec/libnetworking/libc/strsep.c
index 33115f0e41..1d6e9ff79f 100644
--- a/c/src/exec/libnetworking/libc/strsep.c
+++ b/c/src/exec/libnetworking/libc/strsep.c
@@ -31,8 +31,6 @@
* SUCH DAMAGE.
*/
-#include "config.h"
-
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)strsep.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
diff --git a/c/src/exec/libnetworking/net/if_ethersubr.c b/c/src/exec/libnetworking/net/if_ethersubr.c
index 9ff1a5932a..4d1675ca3c 100644
--- a/c/src/exec/libnetworking/net/if_ethersubr.c
+++ b/c/src/exec/libnetworking/net/if_ethersubr.c
@@ -120,14 +120,18 @@ ether_output(ifp, m0, dst, rt0)
{
short type;
int s, error = 0;
- u_char *cp, edst[6];
- register struct mbuf *m2, *m = m0;
+#ifdef NS
+ u_char *cp
+ register struct ifqueue *inq;
+ register struct mbuf *m2;
+#endif
+ u_char edst[6];
+ register struct mbuf *m = m0;
register struct rtentry *rt;
struct mbuf *mcopy = (struct mbuf *)0;
register struct ether_header *eh;
int off, len = m->m_pkthdr.len;
struct arpcom *ac = (struct arpcom *)ifp;
- register struct ifqueue *inq;
#ifdef NETATALK
struct at_ifaddr *aa;
#endif NETATALK
@@ -457,7 +461,10 @@ ether_input(ifp, eh, m)
struct mbuf *m;
{
register struct ifqueue *inq;
- u_short ether_type, *checksum;
+ u_short ether_type;
+#ifdef NS
+ u_short *checksum;
+#endif
int s;
#if defined (ISO) || defined (LLC) || defined(NETATALK)
register struct llc *l;
diff --git a/c/src/exec/libnetworking/net/route.c b/c/src/exec/libnetworking/net/route.c
index 0bea64f747..683ddafee9 100644
--- a/c/src/exec/libnetworking/net/route.c
+++ b/c/src/exec/libnetworking/net/route.c
@@ -517,7 +517,7 @@ rtrequest(req, dst, gateway, netmask, flags, ret_nrt)
senderr(ENOBUFS);
Bzero(rt, sizeof(*rt));
rt->rt_flags = RTF_UP | flags;
- if (error = rt_setgate(rt, dst, gateway)) {
+ if ((error = rt_setgate(rt, dst, gateway))) {
Free(rt);
senderr(error);
}
diff --git a/c/src/exec/libnetworking/net/rtsock.c b/c/src/exec/libnetworking/net/rtsock.c
index 2a08181000..57e777906a 100644
--- a/c/src/exec/libnetworking/net/rtsock.c
+++ b/c/src/exec/libnetworking/net/rtsock.c
@@ -225,8 +225,8 @@ route_output(m, so)
case RTM_LOCK:
if ((rnh = rt_tables[dst->sa_family]) == 0) {
senderr(EAFNOSUPPORT);
- } else if (rt = (struct rtentry *)
- rnh->rnh_lookup(dst, netmask, rnh))
+ } else if ((rt = (struct rtentry *)
+ rnh->rnh_lookup(dst, netmask, rnh)))
rt->rt_refcnt++;
else
senderr(ESRCH);
diff --git a/c/src/exec/libnetworking/netinet/in_pcb.c b/c/src/exec/libnetworking/netinet/in_pcb.c
index 5241ddb6f8..116f70eebf 100644
--- a/c/src/exec/libnetworking/netinet/in_pcb.c
+++ b/c/src/exec/libnetworking/netinet/in_pcb.c
@@ -216,7 +216,7 @@ in_pcbbind(inp, nam)
last = ipport_hilastauto;
lastport = &inp->inp_pcbinfo->lasthi;
} else if (inp->inp_flags & INP_LOWPORT) {
- if (error = suser(p->p_ucred, &p->p_acflag))
+ if ((error = suser(p->p_ucred, &p->p_acflag)))
return (EACCES);
first = ipport_lowfirstauto; /* 1023 */
last = ipport_lowlastauto; /* 600 */
@@ -410,7 +410,7 @@ in_pcbconnect(inp, nam)
/*
* Call inner routine, to assign local interface address.
*/
- if (error = in_pcbladdr(inp, nam, &ifaddr))
+ if ((error = in_pcbladdr(inp, nam, &ifaddr)))
return(error);
if (in_pcblookuphash(inp->inp_pcbinfo, sin->sin_addr, sin->sin_port,
diff --git a/c/src/exec/libnetworking/netinet/tcp_debug.c b/c/src/exec/libnetworking/netinet/tcp_debug.c
index b90ff79ac8..864a01cb1a 100644
--- a/c/src/exec/libnetworking/netinet/tcp_debug.c
+++ b/c/src/exec/libnetworking/netinet/tcp_debug.c
@@ -86,8 +86,10 @@ tcp_trace(act, ostate, tp, ti, req)
struct tcpiphdr *ti;
int req;
{
+#ifdef TCPDEBUG
tcp_seq seq, ack;
int len, flags;
+#endif
struct tcp_debug *td = &tcp_debug[tcp_debx++];
if (tcp_debx == TCP_NDEBUG)
diff --git a/c/src/exec/libnetworking/netinet/tcp_subr.c b/c/src/exec/libnetworking/netinet/tcp_subr.c
index e268e32f19..a9cde3fdf0 100644
--- a/c/src/exec/libnetworking/netinet/tcp_subr.c
+++ b/c/src/exec/libnetworking/netinet/tcp_subr.c
@@ -74,17 +74,19 @@ int tcp_mssdflt = TCP_MSS;
SYSCTL_INT(_net_inet_tcp, TCPCTL_MSSDFLT, mssdflt,
CTLFLAG_RW, &tcp_mssdflt , 0, "");
+static int tcp_do_rfc1323 = 1;
+static int tcp_do_rfc1644 = 1;
+#if !defined(__rtems__)
static int tcp_rttdflt = TCPTV_SRTTDFLT / PR_SLOWHZ;
SYSCTL_INT(_net_inet_tcp, TCPCTL_RTTDFLT, rttdflt,
CTLFLAG_RW, &tcp_rttdflt , 0, "");
-static int tcp_do_rfc1323 = 1;
SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC1323, rfc1323,
CTLFLAG_RW, &tcp_do_rfc1323 , 0, "");
-static int tcp_do_rfc1644 = 1;
SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC1644, rfc1644,
CTLFLAG_RW, &tcp_do_rfc1644 , 0, "");
+#endif
static void tcp_cleartaocache(void);
static void tcp_notify __P((struct inpcb *, int));
diff --git a/c/src/exec/libnetworking/netinet/udp_usrreq.c b/c/src/exec/libnetworking/netinet/udp_usrreq.c
index 5198575c0c..16c5fce2df 100644
--- a/c/src/exec/libnetworking/netinet/udp_usrreq.c
+++ b/c/src/exec/libnetworking/netinet/udp_usrreq.c
@@ -250,7 +250,7 @@ udp_input(m, iphlen)
* port. It * assumes that an application will never
* clear these options after setting them.
*/
- if ((last->inp_socket->so_options&(SO_REUSEPORT|SO_REUSEADDR) == 0))
+ if (((last->inp_socket->so_options&(SO_REUSEPORT|SO_REUSEADDR)) == 0))
break;
}
diff --git a/c/src/exec/libnetworking/nfs/bootp_subr.c b/c/src/exec/libnetworking/nfs/bootp_subr.c
index f07ce6bd48..cb7d3d3407 100644
--- a/c/src/exec/libnetworking/nfs/bootp_subr.c
+++ b/c/src/exec/libnetworking/nfs/bootp_subr.c
@@ -69,7 +69,6 @@
#include <nfs/krpc.h>
#include <nfs/xdr_subs.h>
-
#define BOOTP_MIN_LEN 300 /* Minimum size of bootp udp packet */
/*
@@ -106,6 +105,7 @@ extern int nfs_diskless_valid;
extern struct nfsv3_diskless nfsv3_diskless;
/* mountd RPC */
+#if !defined(__rtems__)
static int md_mount __P((struct sockaddr_in *mdsin, char *path,
u_char *fhp, int *fhsizep, struct nfs_args *args,struct proc *procp));
static int md_lookup_swap __P((struct sockaddr_in *mdsin,char *path,
@@ -113,12 +113,15 @@ static int md_lookup_swap __P((struct sockaddr_in *mdsin,char *path,
struct nfs_args *args,
struct proc *procp));
static int setfs __P((struct sockaddr_in *addr, char *path, char *p));
+#endif
static int getdec __P((char **ptr));
static char *substr __P((char *a,char *b));
+#if !defined(__rtems__)
static void mountopts __P((struct nfs_args *args, char *p));
static int xdr_opaque_decode __P((struct mbuf **ptr,u_char *buf,
int len));
static int xdr_int_decode __P((struct mbuf **ptr,int *iptr));
+#endif
static void printip __P((char *prefix,struct in_addr addr));
#ifdef BOOTP_DEBUG
@@ -260,12 +263,11 @@ bootpc_call(call,reply,procp)
struct proc *procp;
{
struct socket *so;
- struct sockaddr_in *sin,sa;
+ struct sockaddr_in *sin;
struct mbuf *m, *nam;
struct uio auio;
struct iovec aio;
int error, rcvflg, timo, secs, len;
- u_int tport;
/* Free at end if not null. */
nam = NULL;
@@ -602,6 +604,7 @@ bootpc_adjust_interface(struct ifreq *ireq,struct socket *so,
return 0;
}
+#if !defined(__rtems__)
static int setfs(addr, path, p)
struct sockaddr_in *addr;
char *path;
@@ -634,6 +637,7 @@ static int setfs(addr, path, p)
strncpy(path,p,MNAMELEN-1);
return(1);
}
+#endif
static int getdec(ptr)
char **ptr;
@@ -690,7 +694,7 @@ bootpc_init(void)
struct socket *so;
int error;
int code,ncode,len;
- int i,j;
+ int j;
char *p;
unsigned int ip;
@@ -699,12 +703,16 @@ bootpc_init(void)
struct sockaddr_in gw;
int gotgw=0;
int gotnetmask=0;
+#if !defined(__rtems__)
int gotrootpath=0;
int gotswappath=0;
+#endif
char lookup_path[24];
#define EALEN 6
+#if !defined(__rtems__)
unsigned char ea[EALEN];
+#endif
struct ifaddr *ifa;
struct sockaddr_dl *sdl = NULL;
char *delim;
diff --git a/c/src/exec/libnetworking/rtems/rtems_bsdnet_internal.h b/c/src/exec/libnetworking/rtems/rtems_bsdnet_internal.h
index f27eb74491..cbd96d8e96 100644
--- a/c/src/exec/libnetworking/rtems/rtems_bsdnet_internal.h
+++ b/c/src/exec/libnetworking/rtems/rtems_bsdnet_internal.h
@@ -35,7 +35,7 @@ extern void soconnsleep (struct socket *so);
extern void soconnwakeup (struct socket *so);
#define splnet() 0
#define splimp() 0
-#define splx(s)
+#define splx(_s) do { (_s) = 0; } while(0)
#define ovbcopy(f,t,n) bcopy(f,t,n)
#define copyout(f,t,n) (memcpy(t,f,n),0)
diff --git a/c/src/exec/libnetworking/rtems/rtems_syscall.c b/c/src/exec/libnetworking/rtems/rtems_syscall.c
index 42361d22cd..368734e6e1 100644
--- a/c/src/exec/libnetworking/rtems/rtems_syscall.c
+++ b/c/src/exec/libnetworking/rtems/rtems_syscall.c
@@ -1,5 +1,6 @@
#include <string.h>
#include <stdarg.h>
+#include <stdlib.h>
#include <stdio.h>
#include <rtems.h>
diff --git a/c/src/exec/libnetworking/sys/libkern.h b/c/src/exec/libnetworking/sys/libkern.h
index bdc060346a..c01e35b273 100644
--- a/c/src/exec/libnetworking/sys/libkern.h
+++ b/c/src/exec/libnetworking/sys/libkern.h
@@ -79,9 +79,11 @@ int skpc __P((int, int, char *));
void srandom __P((u_long));
char *strcat __P((char *, const char *));
int strcmp __P((const char *, const char *));
+char *strdup __P((const char *s));
char *strcpy __P((char *, const char *));
size_t strlen __P((const char *));
int strncmp __P((const char *, const char *, size_t));
char *strncpy __P((char *, const char *, size_t));
+char *strerror __P((int errnum));
#endif /* !_SYS_LIBKERN_H_ */
diff --git a/c/src/exec/libnetworking/sys/param.h b/c/src/exec/libnetworking/sys/param.h
index 31551c7e06..21a9758520 100644
--- a/c/src/exec/libnetworking/sys/param.h
+++ b/c/src/exec/libnetworking/sys/param.h
@@ -42,6 +42,8 @@
#ifndef _SYS_PARAM_H_
#define _SYS_PARAM_H_
+#include <unistd.h>
+
#define BSD 199506 /* System version (year & month). */
#define BSD4_3 1
#define BSD4_4 1
@@ -168,7 +170,9 @@
* It should be set high enough to allow all legitimate uses, but halt
* infinite loops reasonably quickly.
*/
+#if !defined(__rtems__)
#define MAXPATHLEN PATH_MAX
+#endif
#define MAXSYMLINKS 32
/* Bit map related macros. */
diff --git a/c/src/exec/libnetworking/sys/syslimits.h b/c/src/exec/libnetworking/sys/syslimits.h
index 3546e6b1d3..283a0241e3 100644
--- a/c/src/exec/libnetworking/sys/syslimits.h
+++ b/c/src/exec/libnetworking/sys/syslimits.h
@@ -37,19 +37,40 @@
#ifndef _SYS_SYSLIMITS_H_
#define _SYS_SYSLIMITS_H_
+#if !defined(__rtems__)
#define ARG_MAX 65536 /* max bytes for an exec function */
+#endif
+
+#if !defined(__rtems__)
#ifndef CHILD_MAX
#define CHILD_MAX 40 /* max simultaneous processes */
#endif
+#endif
+
+#if !defined(__rtems__)
#define LINK_MAX 32767 /* max file link count */
+#endif
+
#define MAX_CANON 255 /* max bytes in term canon input line */
+
#define MAX_INPUT 255 /* max bytes in terminal input */
+
+#if !defined(__rtems__)
#define NAME_MAX 255 /* max bytes in a file name */
+#endif
+
#define NGROUPS_MAX 16 /* max supplemental group id's */
+
+#if !defined(__rtems__)
#ifndef OPEN_MAX
#define OPEN_MAX 64 /* max open files per process */
#endif
+#endif
+
+#if !defined(__rtems__)
#define PATH_MAX 1024 /* max bytes in pathname */
+#endif
+
#define PIPE_BUF 512 /* max bytes for atomic pipe writes */
#define BC_BASE_MAX 99 /* max ibase/obase values in bc(1) */
diff --git a/c/src/lib/libnetworking/kern/uipc_domain.c b/c/src/lib/libnetworking/kern/uipc_domain.c
index b35c7e6e67..910007395c 100644
--- a/c/src/lib/libnetworking/kern/uipc_domain.c
+++ b/c/src/lib/libnetworking/kern/uipc_domain.c
@@ -56,6 +56,7 @@
* passed to the doamin_add() function.
*/
+#if !defined(__rtems__)
static int x_save_spl; /* used by kludge*/
static void kludge_splimp __P((void *));
static void kludge_splx __P((void *));
@@ -63,6 +64,7 @@ static void kludge_splx __P((void *));
SYSINIT(splimp, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, kludge_splimp, &x_save_spl)
SYSINIT(domain, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, domaininit, NULL)
SYSINIT(splx, SI_SUB_PROTO_END, SI_ORDER_FIRST, kludge_splx, &x_save_spl)
+#endif
static void pffasttimo __P((void *));
static void pfslowtimo __P((void *));
@@ -81,7 +83,7 @@ void
domaininit(dummy)
void *dummy;
{
- register struct domain *dp, **dpp;
+ register struct domain *dp;
register struct protosw *pr;
/* - not in our sources
diff --git a/c/src/lib/libnetworking/kern/uipc_socket.c b/c/src/lib/libnetworking/kern/uipc_socket.c
index 0933fea50a..895d1c7d45 100644
--- a/c/src/lib/libnetworking/kern/uipc_socket.c
+++ b/c/src/lib/libnetworking/kern/uipc_socket.c
@@ -350,7 +350,7 @@ sosend(so, addr, uio, top, control, flags)
* Also check to make sure that MSG_EOR isn't used on SOCK_STREAM
* type sockets since that's an error.
*/
- if (resid < 0 || so->so_type == SOCK_STREAM && (flags & MSG_EOR)) {
+ if ((resid < 0) || (so->so_type == SOCK_STREAM && (flags & MSG_EOR))) {
error = EINVAL;
goto out;
}
diff --git a/c/src/lib/libnetworking/lib/getprotoby.c b/c/src/lib/libnetworking/lib/getprotoby.c
index b90c247a54..e0aa3bfbdb 100644
--- a/c/src/lib/libnetworking/lib/getprotoby.c
+++ b/c/src/lib/libnetworking/lib/getprotoby.c
@@ -21,7 +21,7 @@ getprotobyname (const char *name)
for (i = 0 ; i < (sizeof prototab / sizeof prototab[0]) ; i++) {
if (strcmp (name, prototab[i].p_name) == 0)
- return &prototab[i];
+ return (struct protoent *) &prototab[i];
}
return NULL;
}
@@ -36,7 +36,7 @@ getprotobynumber (int proto)
for (i = 0 ; i < (sizeof prototab / sizeof prototab[0]) ; i++) {
if (proto == prototab[i].p_proto)
- return &prototab[i];
+ return (struct protoent *) &prototab[i];
}
return NULL;
}
diff --git a/c/src/lib/libnetworking/lib/syslog.c b/c/src/lib/libnetworking/lib/syslog.c
index 7f468c81e6..0bb15bc78e 100644
--- a/c/src/lib/libnetworking/lib/syslog.c
+++ b/c/src/lib/libnetworking/lib/syslog.c
@@ -13,6 +13,8 @@
#include <sys/socket.h>
#include <netinet/in.h>
+#include <unistd.h>
+
static int LogStatus = LOG_CONS;
static const char *LogTag = "syslog";
static int LogFacility = LOG_USER;
diff --git a/c/src/lib/libnetworking/libc/Makefile.in b/c/src/lib/libnetworking/libc/Makefile.in
index 441e05ebbd..132c059cab 100644
--- a/c/src/lib/libnetworking/libc/Makefile.in
+++ b/c/src/lib/libnetworking/libc/Makefile.in
@@ -19,10 +19,8 @@ C_PIECES= base64 \
map_v4v6 \
nsap_addr ns_name ns_netint ns_parse ns_print ns_ttl \
res_comp res_data res_debug res_init res_mkquery res_mkupdate \
- res_query res_send res_stubs res_update
-
-# XXX this one is including a non-existent header file.
-# strsep
+ res_query res_send res_stubs res_update \
+ strsep
C_FILES=$(C_PIECES:%=%.c)
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
diff --git a/c/src/lib/libnetworking/libc/base64.c b/c/src/lib/libnetworking/libc/base64.c
index c9518ca730..3017ccc01c 100644
--- a/c/src/lib/libnetworking/libc/base64.c
+++ b/c/src/lib/libnetworking/libc/base64.c
@@ -40,9 +40,11 @@
* IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
+#if !defined(__rtems__)
#if !defined(LINT) && !defined(CODECENTER)
static char rcsid[] = "$Id$";
#endif /* not lint */
+#endif /* not rtems */
#include <sys/types.h>
#include <sys/param.h>
diff --git a/c/src/lib/libnetworking/libc/gethostbydns.c b/c/src/lib/libnetworking/libc/gethostbydns.c
index ceb7088160..3d80ffde7a 100644
--- a/c/src/lib/libnetworking/libc/gethostbydns.c
+++ b/c/src/lib/libnetworking/libc/gethostbydns.c
@@ -518,7 +518,7 @@ _gethostbydnsname(name, af)
* disallow names consisting only of digits/dots, unless
* they end in a dot.
*/
- if (isdigit(name[0]))
+ if (isdigit((int)name[0]))
for (cp = name;; ++cp) {
if (!*cp) {
if (*--cp == '.')
@@ -547,10 +547,10 @@ _gethostbydnsname(name, af)
h_errno = NETDB_SUCCESS;
return (&host);
}
- if (!isdigit(*cp) && *cp != '.')
+ if (!isdigit((int)*cp) && *cp != '.')
break;
}
- if ((isxdigit(name[0]) && strchr(name, ':') != NULL) ||
+ if ((isxdigit((int)name[0]) && strchr(name, ':') != NULL) ||
name[0] == ':')
for (cp = name;; ++cp) {
if (!*cp) {
@@ -578,7 +578,7 @@ _gethostbydnsname(name, af)
h_errno = NETDB_SUCCESS;
return (&host);
}
- if (!isxdigit(*cp) && *cp != ':' && *cp != '.')
+ if (!isxdigit((int)*cp) && *cp != ':' && *cp != '.')
break;
}
diff --git a/c/src/lib/libnetworking/libc/gethostnamadr.c b/c/src/lib/libnetworking/libc/gethostnamadr.c
index 2ad832f4b1..92f7a21014 100644
--- a/c/src/lib/libnetworking/libc/gethostnamadr.c
+++ b/c/src/lib/libnetworking/libc/gethostnamadr.c
@@ -103,7 +103,7 @@ init_services()
if (cp == NULL)
continue;
do {
- if (isalpha(cp[0])) {
+ if (isalpha((int)cp[0])) {
service_order[cc] = get_service_name(cp);
if(service_order[cc] != SERVICE_NONE)
cc++;
diff --git a/c/src/lib/libnetworking/libc/inet_addr.c b/c/src/lib/libnetworking/libc/inet_addr.c
index a1ac899519..225ccc1269 100644
--- a/c/src/lib/libnetworking/libc/inet_addr.c
+++ b/c/src/lib/libnetworking/libc/inet_addr.c
@@ -103,7 +103,7 @@ inet_aton(cp, addr)
* Values are specified as for C:
* 0x=hex, 0=octal, isdigit=decimal.
*/
- if (!isdigit(c))
+ if (!isdigit((int)c))
return (0);
val = 0; base = 10;
if (c == '0') {
@@ -114,12 +114,12 @@ inet_aton(cp, addr)
base = 8;
}
for (;;) {
- if (isascii(c) && isdigit(c)) {
+ if (isascii((int)c) && isdigit((int)c)) {
val = (val * base) + (c - '0');
c = *++cp;
- } else if (base == 16 && isascii(c) && isxdigit(c)) {
+ } else if (base == 16 && isascii((int)c) && isxdigit((int)c)) {
val = (val << 4) |
- (c + 10 - (islower(c) ? 'a' : 'A'));
+ (c + 10 - (islower((int)c) ? 'a' : 'A'));
c = *++cp;
} else
break;
@@ -141,7 +141,7 @@ inet_aton(cp, addr)
/*
* Check for trailing characters.
*/
- if (c != '\0' && (!isascii(c) || !isspace(c)))
+ if (c != '\0' && (!isascii((int)c) || !isspace((int)c)))
return (0);
/*
* Concoct the address according to
diff --git a/c/src/lib/libnetworking/libc/ns_name.c b/c/src/lib/libnetworking/libc/ns_name.c
index 3e6b2b87fa..af10d2f062 100644
--- a/c/src/lib/libnetworking/libc/ns_name.c
+++ b/c/src/lib/libnetworking/libc/ns_name.c
@@ -15,9 +15,11 @@
* SOFTWARE.
*/
-#ifndef lint
+#if !defined(__rtems__)
+#if !defined(LINT) && !defined(CODECENTER)
static char rcsid[] = "$Id$";
-#endif
+#endif /* not lint */
+#endif /* not rtems */
#include <sys/types.h>
@@ -244,7 +246,7 @@ ns_name_unpack(const u_char *msg, const u_char *eom, const u_char *src,
{
const u_char *srcp, *dstlim;
u_char *dstp;
- int n, c, len, checked;
+ int n, len, checked;
len = -1;
checked = 0;
diff --git a/c/src/lib/libnetworking/libc/ns_netint.c b/c/src/lib/libnetworking/libc/ns_netint.c
index bf0f793c2c..3c09da8f8c 100644
--- a/c/src/lib/libnetworking/libc/ns_netint.c
+++ b/c/src/lib/libnetworking/libc/ns_netint.c
@@ -15,9 +15,11 @@
* SOFTWARE.
*/
-#ifndef lint
+#if !defined(__rtems__)
+#if !defined(LINT) && !defined(CODECENTER)
static char rcsid[] = "$Id$";
-#endif
+#endif /* not lint */
+#endif /* not rtems */
/* Import. */
diff --git a/c/src/lib/libnetworking/libc/ns_parse.c b/c/src/lib/libnetworking/libc/ns_parse.c
index 13b9956d93..cc1f070156 100644
--- a/c/src/lib/libnetworking/libc/ns_parse.c
+++ b/c/src/lib/libnetworking/libc/ns_parse.c
@@ -15,9 +15,11 @@
* SOFTWARE.
*/
-#ifndef lint
+#if !defined(__rtems__)
+#if !defined(LINT) && !defined(CODECENTER)
static char rcsid[] = "$Id$";
-#endif
+#endif /* not lint */
+#endif /* not rtems */
#include <sys/types.h>
diff --git a/c/src/lib/libnetworking/libc/ns_print.c b/c/src/lib/libnetworking/libc/ns_print.c
index 8e27c1290c..f7d7d16c64 100644
--- a/c/src/lib/libnetworking/libc/ns_print.c
+++ b/c/src/lib/libnetworking/libc/ns_print.c
@@ -15,9 +15,11 @@
* SOFTWARE.
*/
-#ifndef lint
+#if !defined(__rtems__)
+#if !defined(LINT) && !defined(CODECENTER)
static char rcsid[] = "$Id$";
-#endif
+#endif /* not lint */
+#endif /* not rtems */
/* Import. */
diff --git a/c/src/lib/libnetworking/libc/ns_ttl.c b/c/src/lib/libnetworking/libc/ns_ttl.c
index cca162b270..75093c1dbc 100644
--- a/c/src/lib/libnetworking/libc/ns_ttl.c
+++ b/c/src/lib/libnetworking/libc/ns_ttl.c
@@ -15,9 +15,11 @@
* SOFTWARE.
*/
-#ifndef lint
+#if !defined(__rtems__)
+#if !defined(LINT) && !defined(CODECENTER)
static char rcsid[] = "$Id$";
-#endif
+#endif /* not lint */
+#endif /* not rtems */
/* Import. */
@@ -44,7 +46,7 @@ int
ns_format_ttl(u_long src, char *dst, size_t dstlen) {
char *odst = dst;
int secs, mins, hours, days, weeks, x;
- char tmp[50], *p;
+ char *p;
secs = src % 60; src /= 60;
mins = src % 60; src /= 60;
diff --git a/c/src/lib/libnetworking/libc/res_config.h b/c/src/lib/libnetworking/libc/res_config.h
index 644e7d796a..9e5715cf28 100644
--- a/c/src/lib/libnetworking/libc/res_config.h
+++ b/c/src/lib/libnetworking/libc/res_config.h
@@ -6,3 +6,11 @@
#define MULTI_PTRS_ARE_ALIASES 1 /* fold multiple PTR records into aliases */
#define CHECK_SRVR_ADDR 1 /* confirm that the server requested sent the reply */
#define BIND_UPDATE 1 /* update support */
+
+#if defined(__rtems__)
+u_int16_t _getshort(const u_char *src);
+u_int32_t _getlong(const u_char *src);
+int gethostname (char *name, int namelen);
+int sethostname (char *name, int namelen);
+int issetugid (void);
+#endif
diff --git a/c/src/lib/libnetworking/libc/res_debug.c b/c/src/lib/libnetworking/libc/res_debug.c
index e58867acb3..b747b6e6d2 100644
--- a/c/src/lib/libnetworking/libc/res_debug.c
+++ b/c/src/lib/libnetworking/libc/res_debug.c
@@ -204,7 +204,7 @@ fp_query(const u_char *msg, FILE *file) {
void
fp_nquery(const u_char *msg, int len, FILE *file) {
ns_msg handle;
- int n, qdcount, ancount, nscount, arcount;
+ int qdcount, ancount, nscount, arcount;
u_int opcode, rcode, id;
if ((_res.options & RES_INIT) == 0 && res_init() == -1)
@@ -577,14 +577,14 @@ precsize_aton(strptr)
cp = *strptr;
- while (isdigit(*cp))
+ while (isdigit((int)*cp))
mval = mval * 10 + (*cp++ - '0');
if (*cp == '.') { /* centimeters */
cp++;
- if (isdigit(*cp)) {
+ if (isdigit((int)*cp)) {
cmval = (*cp++ - '0') * 10;
- if (isdigit(*cp)) {
+ if (isdigit((int)*cp)) {
cmval += (*cp++ - '0');
}
}
@@ -618,44 +618,44 @@ latlon2ul(latlonstrptr,which)
cp = *latlonstrptr;
- while (isdigit(*cp))
+ while (isdigit((int)*cp))
deg = deg * 10 + (*cp++ - '0');
- while (isspace(*cp))
+ while (isspace((int)*cp))
cp++;
- if (!(isdigit(*cp)))
+ if (!(isdigit((int)*cp)))
goto fndhemi;
- while (isdigit(*cp))
+ while (isdigit((int)*cp))
min = min * 10 + (*cp++ - '0');
- while (isspace(*cp))
+ while (isspace((int)*cp))
cp++;
- if (!(isdigit(*cp)))
+ if (!(isdigit((int)*cp)))
goto fndhemi;
- while (isdigit(*cp))
+ while (isdigit((int)*cp))
secs = secs * 10 + (*cp++ - '0');
if (*cp == '.') { /* decimal seconds */
cp++;
- if (isdigit(*cp)) {
+ if (isdigit((int)*cp)) {
secsfrac = (*cp++ - '0') * 100;
- if (isdigit(*cp)) {
+ if (isdigit((int)*cp)) {
secsfrac += (*cp++ - '0') * 10;
- if (isdigit(*cp)) {
+ if (isdigit((int)*cp)) {
secsfrac += (*cp++ - '0');
}
}
}
}
- while (!isspace(*cp)) /* if any trailing garbage */
+ while (!isspace((int)*cp)) /* if any trailing garbage */
cp++;
- while (isspace(*cp))
+ while (isspace((int)*cp))
cp++;
fndhemi:
@@ -693,10 +693,10 @@ latlon2ul(latlonstrptr,which)
cp++; /* skip the hemisphere */
- while (!isspace(*cp)) /* if any trailing garbage */
+ while (!isspace((int)*cp)) /* if any trailing garbage */
cp++;
- while (isspace(*cp)) /* move to next field */
+ while (isspace((int)*cp)) /* move to next field */
cp++;
*latlonstrptr = cp;
@@ -754,14 +754,14 @@ loc_aton(ascii, binary)
if (*cp == '+')
cp++;
- while (isdigit(*cp))
+ while (isdigit((int)*cp))
altmeters = altmeters * 10 + (*cp++ - '0');
if (*cp == '.') { /* decimal meters */
cp++;
- if (isdigit(*cp)) {
+ if (isdigit((int)*cp)) {
altfrac = (*cp++ - '0') * 10;
- if (isdigit(*cp)) {
+ if (isdigit((int)*cp)) {
altfrac += (*cp++ - '0');
}
}
@@ -769,10 +769,10 @@ loc_aton(ascii, binary)
alt = (10000000 + (altsign * (altmeters * 100 + altfrac)));
- while (!isspace(*cp) && (cp < maxcp)) /* if trailing garbage or m */
+ while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */
cp++;
- while (isspace(*cp) && (cp < maxcp))
+ while (isspace((int)*cp) && (cp < maxcp))
cp++;
if (cp >= maxcp)
@@ -780,10 +780,10 @@ loc_aton(ascii, binary)
siz = precsize_aton(&cp);
- while (!isspace(*cp) && (cp < maxcp)) /* if trailing garbage or m */
+ while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */
cp++;
- while (isspace(*cp) && (cp < maxcp))
+ while (isspace((int)*cp) && (cp < maxcp))
cp++;
if (cp >= maxcp)
@@ -791,10 +791,10 @@ loc_aton(ascii, binary)
hp = precsize_aton(&cp);
- while (!isspace(*cp) && (cp < maxcp)) /* if trailing garbage or m */
+ while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */
cp++;
- while (isspace(*cp) && (cp < maxcp))
+ while (isspace((int)*cp) && (cp < maxcp))
cp++;
if (cp >= maxcp)
diff --git a/c/src/lib/libnetworking/libc/res_init.c b/c/src/lib/libnetworking/libc/res_init.c
index 8b60889c6f..9371e9fa82 100644
--- a/c/src/lib/libnetworking/libc/res_init.c
+++ b/c/src/lib/libnetworking/libc/res_init.c
@@ -337,7 +337,7 @@ res_init()
break;
net = cp;
while (*cp && !ISSORTMASK(*cp) && *cp != ';' &&
- isascii(*cp) && !isspace(*cp))
+ isascii((int)*cp) && !isspace((int)*cp))
cp++;
n = *cp;
*cp = 0;
@@ -347,7 +347,7 @@ res_init()
*cp++ = n;
net = cp;
while (*cp && *cp != ';' &&
- isascii(*cp) && !isspace(*cp))
+ isascii((int)*cp) && !isspace((int)*cp))
cp++;
n = *cp;
*cp = 0;
diff --git a/c/src/lib/libnetworking/libc/res_mkupdate.c b/c/src/lib/libnetworking/libc/res_mkupdate.c
index b74f16ba78..56362f650b 100644
--- a/c/src/lib/libnetworking/libc/res_mkupdate.c
+++ b/c/src/lib/libnetworking/libc/res_mkupdate.c
@@ -20,9 +20,11 @@
* <viraj_bais@ccm.fm.intel.com>
*/
+#if !defined(__rtems__)
#if !defined(lint) && !defined(SABER)
static char rcsid[] = "$Id$";
#endif /* not lint */
+#endif /* not rtems */
#include <sys/types.h>
#include <sys/param.h>
@@ -64,9 +66,9 @@ int
res_mkupdate(ns_updrec *rrecp_in, u_char *buf, int buflen) {
ns_updrec *rrecp_start = rrecp_in;
HEADER *hp;
- u_char c, *cp, *cp1, *sp1, *sp2, *startp, *endp;
- int n, i, j, found, soanum, multiline;
- ns_updrec *rrecp, *tmprrecp, *recptr = NULL;
+ u_char *cp, *sp1, *sp2, *startp, *endp;
+ int n, i, soanum, multiline;
+ ns_updrec *rrecp;
struct in_addr ina;
char buf2[MAXDNAME];
int section, numrrs = 0, counts[ns_s_max];
@@ -350,7 +352,6 @@ static int
getnum_str(u_char **startpp, u_char *endp) {
int c, n;
int seendigit = 0;
- int seendecimal = 0;
int m = 0;
for (n = 0; *startpp <= endp; ) {
diff --git a/c/src/lib/libnetworking/libc/res_query.c b/c/src/lib/libnetworking/libc/res_query.c
index 42b7f1ecc2..784fa433bc 100644
--- a/c/src/lib/libnetworking/libc/res_query.c
+++ b/c/src/lib/libnetworking/libc/res_query.c
@@ -387,17 +387,17 @@ hostalias(name)
setbuf(fp, NULL);
buf[sizeof(buf) - 1] = '\0';
while (fgets(buf, sizeof(buf), fp)) {
- for (cp1 = buf; *cp1 && !isspace(*cp1); ++cp1)
+ for (cp1 = buf; *cp1 && !isspace((int)*cp1); ++cp1)
;
if (!*cp1)
break;
*cp1 = '\0';
if (!strcasecmp(buf, name)) {
- while (isspace(*++cp1))
+ while (isspace((int)*++cp1))
;
if (!*cp1)
break;
- for (cp2 = cp1 + 1; *cp2 && !isspace(*cp2); ++cp2)
+ for (cp2 = cp1 + 1; *cp2 && !isspace((int)*cp2); ++cp2)
;
abuf[sizeof(abuf) - 1] = *cp2 = '\0';
strncpy(abuf, cp1, sizeof(abuf) - 1);
diff --git a/c/src/lib/libnetworking/libc/res_send.c b/c/src/lib/libnetworking/libc/res_send.c
index cfb1e2eb9d..1b03bb5b1b 100644
--- a/c/src/lib/libnetworking/libc/res_send.c
+++ b/c/src/lib/libnetworking/libc/res_send.c
@@ -99,12 +99,14 @@ static char rcsid[] = "$Id$";
#include "res_config.h"
+#if !defined(__rtems__)
#ifdef NOPOLL /* libc_r doesn't wrap poll yet() */
static int use_poll = 0;
#else
static int use_poll = 1; /* adapt to poll() syscall availability */
/* 0 = not present, 1 = try it, 2 = exists */
#endif
+#endif
static int s = -1; /* socket used for communications */
static int connected = 0; /* is the socket connected */
@@ -375,7 +377,9 @@ res_send(buf, buflen, ans, anssiz)
if (v_circuit) {
int truncated;
+#if !defined(__rtems__)
struct iovec iov[2];
+#endif
u_short len;
u_char *cp;
@@ -411,7 +415,7 @@ res_send(buf, buflen, ans, anssiz)
* Send length & message
*/
putshort((u_short)buflen, (u_char*)&len);
-#if 0
+#if !defined(__rtems__)
iov[0].iov_base = (caddr_t)&len;
iov[0].iov_len = INT16SZ;
iov[1].iov_base = (caddr_t)buf;
@@ -536,8 +540,10 @@ read_len:
int msec;
#endif
struct timeval timeout;
+#ifndef NOSELECT
fd_set dsmask, *dsmaskp;
int dsmasklen;
+#endif
struct sockaddr_in from;
int fromlen;
diff --git a/c/src/lib/libnetworking/libc/res_update.c b/c/src/lib/libnetworking/libc/res_update.c
index 1c5f20abd7..ef591e0674 100644
--- a/c/src/lib/libnetworking/libc/res_update.c
+++ b/c/src/lib/libnetworking/libc/res_update.c
@@ -1,6 +1,8 @@
+#if !defined(__rtems__)
#if !defined(lint) && !defined(SABER)
static char rcsid[] = "$Id$";
#endif /* not lint */
+#endif /* not rtems */
/*
* Copyright (c) 1996 by Internet Software Consortium.
diff --git a/c/src/lib/libnetworking/libc/strsep.c b/c/src/lib/libnetworking/libc/strsep.c
index 33115f0e41..1d6e9ff79f 100644
--- a/c/src/lib/libnetworking/libc/strsep.c
+++ b/c/src/lib/libnetworking/libc/strsep.c
@@ -31,8 +31,6 @@
* SUCH DAMAGE.
*/
-#include "config.h"
-
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)strsep.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
diff --git a/c/src/lib/libnetworking/net/if_ethersubr.c b/c/src/lib/libnetworking/net/if_ethersubr.c
index 9ff1a5932a..4d1675ca3c 100644
--- a/c/src/lib/libnetworking/net/if_ethersubr.c
+++ b/c/src/lib/libnetworking/net/if_ethersubr.c
@@ -120,14 +120,18 @@ ether_output(ifp, m0, dst, rt0)
{
short type;
int s, error = 0;
- u_char *cp, edst[6];
- register struct mbuf *m2, *m = m0;
+#ifdef NS
+ u_char *cp
+ register struct ifqueue *inq;
+ register struct mbuf *m2;
+#endif
+ u_char edst[6];
+ register struct mbuf *m = m0;
register struct rtentry *rt;
struct mbuf *mcopy = (struct mbuf *)0;
register struct ether_header *eh;
int off, len = m->m_pkthdr.len;
struct arpcom *ac = (struct arpcom *)ifp;
- register struct ifqueue *inq;
#ifdef NETATALK
struct at_ifaddr *aa;
#endif NETATALK
@@ -457,7 +461,10 @@ ether_input(ifp, eh, m)
struct mbuf *m;
{
register struct ifqueue *inq;
- u_short ether_type, *checksum;
+ u_short ether_type;
+#ifdef NS
+ u_short *checksum;
+#endif
int s;
#if defined (ISO) || defined (LLC) || defined(NETATALK)
register struct llc *l;
diff --git a/c/src/lib/libnetworking/net/route.c b/c/src/lib/libnetworking/net/route.c
index 0bea64f747..683ddafee9 100644
--- a/c/src/lib/libnetworking/net/route.c
+++ b/c/src/lib/libnetworking/net/route.c
@@ -517,7 +517,7 @@ rtrequest(req, dst, gateway, netmask, flags, ret_nrt)
senderr(ENOBUFS);
Bzero(rt, sizeof(*rt));
rt->rt_flags = RTF_UP | flags;
- if (error = rt_setgate(rt, dst, gateway)) {
+ if ((error = rt_setgate(rt, dst, gateway))) {
Free(rt);
senderr(error);
}
diff --git a/c/src/lib/libnetworking/net/rtsock.c b/c/src/lib/libnetworking/net/rtsock.c
index 2a08181000..57e777906a 100644
--- a/c/src/lib/libnetworking/net/rtsock.c
+++ b/c/src/lib/libnetworking/net/rtsock.c
@@ -225,8 +225,8 @@ route_output(m, so)
case RTM_LOCK:
if ((rnh = rt_tables[dst->sa_family]) == 0) {
senderr(EAFNOSUPPORT);
- } else if (rt = (struct rtentry *)
- rnh->rnh_lookup(dst, netmask, rnh))
+ } else if ((rt = (struct rtentry *)
+ rnh->rnh_lookup(dst, netmask, rnh)))
rt->rt_refcnt++;
else
senderr(ESRCH);
diff --git a/c/src/lib/libnetworking/netinet/in_pcb.c b/c/src/lib/libnetworking/netinet/in_pcb.c
index 5241ddb6f8..116f70eebf 100644
--- a/c/src/lib/libnetworking/netinet/in_pcb.c
+++ b/c/src/lib/libnetworking/netinet/in_pcb.c
@@ -216,7 +216,7 @@ in_pcbbind(inp, nam)
last = ipport_hilastauto;
lastport = &inp->inp_pcbinfo->lasthi;
} else if (inp->inp_flags & INP_LOWPORT) {
- if (error = suser(p->p_ucred, &p->p_acflag))
+ if ((error = suser(p->p_ucred, &p->p_acflag)))
return (EACCES);
first = ipport_lowfirstauto; /* 1023 */
last = ipport_lowlastauto; /* 600 */
@@ -410,7 +410,7 @@ in_pcbconnect(inp, nam)
/*
* Call inner routine, to assign local interface address.
*/
- if (error = in_pcbladdr(inp, nam, &ifaddr))
+ if ((error = in_pcbladdr(inp, nam, &ifaddr)))
return(error);
if (in_pcblookuphash(inp->inp_pcbinfo, sin->sin_addr, sin->sin_port,
diff --git a/c/src/lib/libnetworking/netinet/tcp_debug.c b/c/src/lib/libnetworking/netinet/tcp_debug.c
index b90ff79ac8..864a01cb1a 100644
--- a/c/src/lib/libnetworking/netinet/tcp_debug.c
+++ b/c/src/lib/libnetworking/netinet/tcp_debug.c
@@ -86,8 +86,10 @@ tcp_trace(act, ostate, tp, ti, req)
struct tcpiphdr *ti;
int req;
{
+#ifdef TCPDEBUG
tcp_seq seq, ack;
int len, flags;
+#endif
struct tcp_debug *td = &tcp_debug[tcp_debx++];
if (tcp_debx == TCP_NDEBUG)
diff --git a/c/src/lib/libnetworking/netinet/tcp_subr.c b/c/src/lib/libnetworking/netinet/tcp_subr.c
index e268e32f19..a9cde3fdf0 100644
--- a/c/src/lib/libnetworking/netinet/tcp_subr.c
+++ b/c/src/lib/libnetworking/netinet/tcp_subr.c
@@ -74,17 +74,19 @@ int tcp_mssdflt = TCP_MSS;
SYSCTL_INT(_net_inet_tcp, TCPCTL_MSSDFLT, mssdflt,
CTLFLAG_RW, &tcp_mssdflt , 0, "");
+static int tcp_do_rfc1323 = 1;
+static int tcp_do_rfc1644 = 1;
+#if !defined(__rtems__)
static int tcp_rttdflt = TCPTV_SRTTDFLT / PR_SLOWHZ;
SYSCTL_INT(_net_inet_tcp, TCPCTL_RTTDFLT, rttdflt,
CTLFLAG_RW, &tcp_rttdflt , 0, "");
-static int tcp_do_rfc1323 = 1;
SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC1323, rfc1323,
CTLFLAG_RW, &tcp_do_rfc1323 , 0, "");
-static int tcp_do_rfc1644 = 1;
SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC1644, rfc1644,
CTLFLAG_RW, &tcp_do_rfc1644 , 0, "");
+#endif
static void tcp_cleartaocache(void);
static void tcp_notify __P((struct inpcb *, int));
diff --git a/c/src/lib/libnetworking/netinet/udp_usrreq.c b/c/src/lib/libnetworking/netinet/udp_usrreq.c
index 5198575c0c..16c5fce2df 100644
--- a/c/src/lib/libnetworking/netinet/udp_usrreq.c
+++ b/c/src/lib/libnetworking/netinet/udp_usrreq.c
@@ -250,7 +250,7 @@ udp_input(m, iphlen)
* port. It * assumes that an application will never
* clear these options after setting them.
*/
- if ((last->inp_socket->so_options&(SO_REUSEPORT|SO_REUSEADDR) == 0))
+ if (((last->inp_socket->so_options&(SO_REUSEPORT|SO_REUSEADDR)) == 0))
break;
}
diff --git a/c/src/lib/libnetworking/nfs/bootp_subr.c b/c/src/lib/libnetworking/nfs/bootp_subr.c
index f07ce6bd48..cb7d3d3407 100644
--- a/c/src/lib/libnetworking/nfs/bootp_subr.c
+++ b/c/src/lib/libnetworking/nfs/bootp_subr.c
@@ -69,7 +69,6 @@
#include <nfs/krpc.h>
#include <nfs/xdr_subs.h>
-
#define BOOTP_MIN_LEN 300 /* Minimum size of bootp udp packet */
/*
@@ -106,6 +105,7 @@ extern int nfs_diskless_valid;
extern struct nfsv3_diskless nfsv3_diskless;
/* mountd RPC */
+#if !defined(__rtems__)
static int md_mount __P((struct sockaddr_in *mdsin, char *path,
u_char *fhp, int *fhsizep, struct nfs_args *args,struct proc *procp));
static int md_lookup_swap __P((struct sockaddr_in *mdsin,char *path,
@@ -113,12 +113,15 @@ static int md_lookup_swap __P((struct sockaddr_in *mdsin,char *path,
struct nfs_args *args,
struct proc *procp));
static int setfs __P((struct sockaddr_in *addr, char *path, char *p));
+#endif
static int getdec __P((char **ptr));
static char *substr __P((char *a,char *b));
+#if !defined(__rtems__)
static void mountopts __P((struct nfs_args *args, char *p));
static int xdr_opaque_decode __P((struct mbuf **ptr,u_char *buf,
int len));
static int xdr_int_decode __P((struct mbuf **ptr,int *iptr));
+#endif
static void printip __P((char *prefix,struct in_addr addr));
#ifdef BOOTP_DEBUG
@@ -260,12 +263,11 @@ bootpc_call(call,reply,procp)
struct proc *procp;
{
struct socket *so;
- struct sockaddr_in *sin,sa;
+ struct sockaddr_in *sin;
struct mbuf *m, *nam;
struct uio auio;
struct iovec aio;
int error, rcvflg, timo, secs, len;
- u_int tport;
/* Free at end if not null. */
nam = NULL;
@@ -602,6 +604,7 @@ bootpc_adjust_interface(struct ifreq *ireq,struct socket *so,
return 0;
}
+#if !defined(__rtems__)
static int setfs(addr, path, p)
struct sockaddr_in *addr;
char *path;
@@ -634,6 +637,7 @@ static int setfs(addr, path, p)
strncpy(path,p,MNAMELEN-1);
return(1);
}
+#endif
static int getdec(ptr)
char **ptr;
@@ -690,7 +694,7 @@ bootpc_init(void)
struct socket *so;
int error;
int code,ncode,len;
- int i,j;
+ int j;
char *p;
unsigned int ip;
@@ -699,12 +703,16 @@ bootpc_init(void)
struct sockaddr_in gw;
int gotgw=0;
int gotnetmask=0;
+#if !defined(__rtems__)
int gotrootpath=0;
int gotswappath=0;
+#endif
char lookup_path[24];
#define EALEN 6
+#if !defined(__rtems__)
unsigned char ea[EALEN];
+#endif
struct ifaddr *ifa;
struct sockaddr_dl *sdl = NULL;
char *delim;
diff --git a/c/src/lib/libnetworking/rtems/rtems_bsdnet_internal.h b/c/src/lib/libnetworking/rtems/rtems_bsdnet_internal.h
index f27eb74491..cbd96d8e96 100644
--- a/c/src/lib/libnetworking/rtems/rtems_bsdnet_internal.h
+++ b/c/src/lib/libnetworking/rtems/rtems_bsdnet_internal.h
@@ -35,7 +35,7 @@ extern void soconnsleep (struct socket *so);
extern void soconnwakeup (struct socket *so);
#define splnet() 0
#define splimp() 0
-#define splx(s)
+#define splx(_s) do { (_s) = 0; } while(0)
#define ovbcopy(f,t,n) bcopy(f,t,n)
#define copyout(f,t,n) (memcpy(t,f,n),0)
diff --git a/c/src/lib/libnetworking/rtems/rtems_syscall.c b/c/src/lib/libnetworking/rtems/rtems_syscall.c
index 42361d22cd..368734e6e1 100644
--- a/c/src/lib/libnetworking/rtems/rtems_syscall.c
+++ b/c/src/lib/libnetworking/rtems/rtems_syscall.c
@@ -1,5 +1,6 @@
#include <string.h>
#include <stdarg.h>
+#include <stdlib.h>
#include <stdio.h>
#include <rtems.h>
diff --git a/c/src/lib/libnetworking/sys/libkern.h b/c/src/lib/libnetworking/sys/libkern.h
index bdc060346a..c01e35b273 100644
--- a/c/src/lib/libnetworking/sys/libkern.h
+++ b/c/src/lib/libnetworking/sys/libkern.h
@@ -79,9 +79,11 @@ int skpc __P((int, int, char *));
void srandom __P((u_long));
char *strcat __P((char *, const char *));
int strcmp __P((const char *, const char *));
+char *strdup __P((const char *s));
char *strcpy __P((char *, const char *));
size_t strlen __P((const char *));
int strncmp __P((const char *, const char *, size_t));
char *strncpy __P((char *, const char *, size_t));
+char *strerror __P((int errnum));
#endif /* !_SYS_LIBKERN_H_ */
diff --git a/c/src/lib/libnetworking/sys/param.h b/c/src/lib/libnetworking/sys/param.h
index 31551c7e06..21a9758520 100644
--- a/c/src/lib/libnetworking/sys/param.h
+++ b/c/src/lib/libnetworking/sys/param.h
@@ -42,6 +42,8 @@
#ifndef _SYS_PARAM_H_
#define _SYS_PARAM_H_
+#include <unistd.h>
+
#define BSD 199506 /* System version (year & month). */
#define BSD4_3 1
#define BSD4_4 1
@@ -168,7 +170,9 @@
* It should be set high enough to allow all legitimate uses, but halt
* infinite loops reasonably quickly.
*/
+#if !defined(__rtems__)
#define MAXPATHLEN PATH_MAX
+#endif
#define MAXSYMLINKS 32
/* Bit map related macros. */
diff --git a/c/src/lib/libnetworking/sys/syslimits.h b/c/src/lib/libnetworking/sys/syslimits.h
index 3546e6b1d3..283a0241e3 100644
--- a/c/src/lib/libnetworking/sys/syslimits.h
+++ b/c/src/lib/libnetworking/sys/syslimits.h
@@ -37,19 +37,40 @@
#ifndef _SYS_SYSLIMITS_H_
#define _SYS_SYSLIMITS_H_
+#if !defined(__rtems__)
#define ARG_MAX 65536 /* max bytes for an exec function */
+#endif
+
+#if !defined(__rtems__)
#ifndef CHILD_MAX
#define CHILD_MAX 40 /* max simultaneous processes */
#endif
+#endif
+
+#if !defined(__rtems__)
#define LINK_MAX 32767 /* max file link count */
+#endif
+
#define MAX_CANON 255 /* max bytes in term canon input line */
+
#define MAX_INPUT 255 /* max bytes in terminal input */
+
+#if !defined(__rtems__)
#define NAME_MAX 255 /* max bytes in a file name */
+#endif
+
#define NGROUPS_MAX 16 /* max supplemental group id's */
+
+#if !defined(__rtems__)
#ifndef OPEN_MAX
#define OPEN_MAX 64 /* max open files per process */
#endif
+#endif
+
+#if !defined(__rtems__)
#define PATH_MAX 1024 /* max bytes in pathname */
+#endif
+
#define PIPE_BUF 512 /* max bytes for atomic pipe writes */
#define BC_BASE_MAX 99 /* max ibase/obase values in bc(1) */
diff --git a/c/src/libnetworking/kern/uipc_domain.c b/c/src/libnetworking/kern/uipc_domain.c
index b35c7e6e67..910007395c 100644
--- a/c/src/libnetworking/kern/uipc_domain.c
+++ b/c/src/libnetworking/kern/uipc_domain.c
@@ -56,6 +56,7 @@
* passed to the doamin_add() function.
*/
+#if !defined(__rtems__)
static int x_save_spl; /* used by kludge*/
static void kludge_splimp __P((void *));
static void kludge_splx __P((void *));
@@ -63,6 +64,7 @@ static void kludge_splx __P((void *));
SYSINIT(splimp, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, kludge_splimp, &x_save_spl)
SYSINIT(domain, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, domaininit, NULL)
SYSINIT(splx, SI_SUB_PROTO_END, SI_ORDER_FIRST, kludge_splx, &x_save_spl)
+#endif
static void pffasttimo __P((void *));
static void pfslowtimo __P((void *));
@@ -81,7 +83,7 @@ void
domaininit(dummy)
void *dummy;
{
- register struct domain *dp, **dpp;
+ register struct domain *dp;
register struct protosw *pr;
/* - not in our sources
diff --git a/c/src/libnetworking/kern/uipc_socket.c b/c/src/libnetworking/kern/uipc_socket.c
index 0933fea50a..895d1c7d45 100644
--- a/c/src/libnetworking/kern/uipc_socket.c
+++ b/c/src/libnetworking/kern/uipc_socket.c
@@ -350,7 +350,7 @@ sosend(so, addr, uio, top, control, flags)
* Also check to make sure that MSG_EOR isn't used on SOCK_STREAM
* type sockets since that's an error.
*/
- if (resid < 0 || so->so_type == SOCK_STREAM && (flags & MSG_EOR)) {
+ if ((resid < 0) || (so->so_type == SOCK_STREAM && (flags & MSG_EOR))) {
error = EINVAL;
goto out;
}
diff --git a/c/src/libnetworking/lib/getprotoby.c b/c/src/libnetworking/lib/getprotoby.c
index b90c247a54..e0aa3bfbdb 100644
--- a/c/src/libnetworking/lib/getprotoby.c
+++ b/c/src/libnetworking/lib/getprotoby.c
@@ -21,7 +21,7 @@ getprotobyname (const char *name)
for (i = 0 ; i < (sizeof prototab / sizeof prototab[0]) ; i++) {
if (strcmp (name, prototab[i].p_name) == 0)
- return &prototab[i];
+ return (struct protoent *) &prototab[i];
}
return NULL;
}
@@ -36,7 +36,7 @@ getprotobynumber (int proto)
for (i = 0 ; i < (sizeof prototab / sizeof prototab[0]) ; i++) {
if (proto == prototab[i].p_proto)
- return &prototab[i];
+ return (struct protoent *) &prototab[i];
}
return NULL;
}
diff --git a/c/src/libnetworking/lib/syslog.c b/c/src/libnetworking/lib/syslog.c
index 7f468c81e6..0bb15bc78e 100644
--- a/c/src/libnetworking/lib/syslog.c
+++ b/c/src/libnetworking/lib/syslog.c
@@ -13,6 +13,8 @@
#include <sys/socket.h>
#include <netinet/in.h>
+#include <unistd.h>
+
static int LogStatus = LOG_CONS;
static const char *LogTag = "syslog";
static int LogFacility = LOG_USER;
diff --git a/c/src/libnetworking/libc/Makefile.in b/c/src/libnetworking/libc/Makefile.in
index 441e05ebbd..132c059cab 100644
--- a/c/src/libnetworking/libc/Makefile.in
+++ b/c/src/libnetworking/libc/Makefile.in
@@ -19,10 +19,8 @@ C_PIECES= base64 \
map_v4v6 \
nsap_addr ns_name ns_netint ns_parse ns_print ns_ttl \
res_comp res_data res_debug res_init res_mkquery res_mkupdate \
- res_query res_send res_stubs res_update
-
-# XXX this one is including a non-existent header file.
-# strsep
+ res_query res_send res_stubs res_update \
+ strsep
C_FILES=$(C_PIECES:%=%.c)
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
diff --git a/c/src/libnetworking/libc/base64.c b/c/src/libnetworking/libc/base64.c
index c9518ca730..3017ccc01c 100644
--- a/c/src/libnetworking/libc/base64.c
+++ b/c/src/libnetworking/libc/base64.c
@@ -40,9 +40,11 @@
* IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
+#if !defined(__rtems__)
#if !defined(LINT) && !defined(CODECENTER)
static char rcsid[] = "$Id$";
#endif /* not lint */
+#endif /* not rtems */
#include <sys/types.h>
#include <sys/param.h>
diff --git a/c/src/libnetworking/libc/gethostbydns.c b/c/src/libnetworking/libc/gethostbydns.c
index ceb7088160..3d80ffde7a 100644
--- a/c/src/libnetworking/libc/gethostbydns.c
+++ b/c/src/libnetworking/libc/gethostbydns.c
@@ -518,7 +518,7 @@ _gethostbydnsname(name, af)
* disallow names consisting only of digits/dots, unless
* they end in a dot.
*/
- if (isdigit(name[0]))
+ if (isdigit((int)name[0]))
for (cp = name;; ++cp) {
if (!*cp) {
if (*--cp == '.')
@@ -547,10 +547,10 @@ _gethostbydnsname(name, af)
h_errno = NETDB_SUCCESS;
return (&host);
}
- if (!isdigit(*cp) && *cp != '.')
+ if (!isdigit((int)*cp) && *cp != '.')
break;
}
- if ((isxdigit(name[0]) && strchr(name, ':') != NULL) ||
+ if ((isxdigit((int)name[0]) && strchr(name, ':') != NULL) ||
name[0] == ':')
for (cp = name;; ++cp) {
if (!*cp) {
@@ -578,7 +578,7 @@ _gethostbydnsname(name, af)
h_errno = NETDB_SUCCESS;
return (&host);
}
- if (!isxdigit(*cp) && *cp != ':' && *cp != '.')
+ if (!isxdigit((int)*cp) && *cp != ':' && *cp != '.')
break;
}
diff --git a/c/src/libnetworking/libc/gethostnamadr.c b/c/src/libnetworking/libc/gethostnamadr.c
index 2ad832f4b1..92f7a21014 100644
--- a/c/src/libnetworking/libc/gethostnamadr.c
+++ b/c/src/libnetworking/libc/gethostnamadr.c
@@ -103,7 +103,7 @@ init_services()
if (cp == NULL)
continue;
do {
- if (isalpha(cp[0])) {
+ if (isalpha((int)cp[0])) {
service_order[cc] = get_service_name(cp);
if(service_order[cc] != SERVICE_NONE)
cc++;
diff --git a/c/src/libnetworking/libc/inet_addr.c b/c/src/libnetworking/libc/inet_addr.c
index a1ac899519..225ccc1269 100644
--- a/c/src/libnetworking/libc/inet_addr.c
+++ b/c/src/libnetworking/libc/inet_addr.c
@@ -103,7 +103,7 @@ inet_aton(cp, addr)
* Values are specified as for C:
* 0x=hex, 0=octal, isdigit=decimal.
*/
- if (!isdigit(c))
+ if (!isdigit((int)c))
return (0);
val = 0; base = 10;
if (c == '0') {
@@ -114,12 +114,12 @@ inet_aton(cp, addr)
base = 8;
}
for (;;) {
- if (isascii(c) && isdigit(c)) {
+ if (isascii((int)c) && isdigit((int)c)) {
val = (val * base) + (c - '0');
c = *++cp;
- } else if (base == 16 && isascii(c) && isxdigit(c)) {
+ } else if (base == 16 && isascii((int)c) && isxdigit((int)c)) {
val = (val << 4) |
- (c + 10 - (islower(c) ? 'a' : 'A'));
+ (c + 10 - (islower((int)c) ? 'a' : 'A'));
c = *++cp;
} else
break;
@@ -141,7 +141,7 @@ inet_aton(cp, addr)
/*
* Check for trailing characters.
*/
- if (c != '\0' && (!isascii(c) || !isspace(c)))
+ if (c != '\0' && (!isascii((int)c) || !isspace((int)c)))
return (0);
/*
* Concoct the address according to
diff --git a/c/src/libnetworking/libc/ns_name.c b/c/src/libnetworking/libc/ns_name.c
index 3e6b2b87fa..af10d2f062 100644
--- a/c/src/libnetworking/libc/ns_name.c
+++ b/c/src/libnetworking/libc/ns_name.c
@@ -15,9 +15,11 @@
* SOFTWARE.
*/
-#ifndef lint
+#if !defined(__rtems__)
+#if !defined(LINT) && !defined(CODECENTER)
static char rcsid[] = "$Id$";
-#endif
+#endif /* not lint */
+#endif /* not rtems */
#include <sys/types.h>
@@ -244,7 +246,7 @@ ns_name_unpack(const u_char *msg, const u_char *eom, const u_char *src,
{
const u_char *srcp, *dstlim;
u_char *dstp;
- int n, c, len, checked;
+ int n, len, checked;
len = -1;
checked = 0;
diff --git a/c/src/libnetworking/libc/ns_netint.c b/c/src/libnetworking/libc/ns_netint.c
index bf0f793c2c..3c09da8f8c 100644
--- a/c/src/libnetworking/libc/ns_netint.c
+++ b/c/src/libnetworking/libc/ns_netint.c
@@ -15,9 +15,11 @@
* SOFTWARE.
*/
-#ifndef lint
+#if !defined(__rtems__)
+#if !defined(LINT) && !defined(CODECENTER)
static char rcsid[] = "$Id$";
-#endif
+#endif /* not lint */
+#endif /* not rtems */
/* Import. */
diff --git a/c/src/libnetworking/libc/ns_parse.c b/c/src/libnetworking/libc/ns_parse.c
index 13b9956d93..cc1f070156 100644
--- a/c/src/libnetworking/libc/ns_parse.c
+++ b/c/src/libnetworking/libc/ns_parse.c
@@ -15,9 +15,11 @@
* SOFTWARE.
*/
-#ifndef lint
+#if !defined(__rtems__)
+#if !defined(LINT) && !defined(CODECENTER)
static char rcsid[] = "$Id$";
-#endif
+#endif /* not lint */
+#endif /* not rtems */
#include <sys/types.h>
diff --git a/c/src/libnetworking/libc/ns_print.c b/c/src/libnetworking/libc/ns_print.c
index 8e27c1290c..f7d7d16c64 100644
--- a/c/src/libnetworking/libc/ns_print.c
+++ b/c/src/libnetworking/libc/ns_print.c
@@ -15,9 +15,11 @@
* SOFTWARE.
*/
-#ifndef lint
+#if !defined(__rtems__)
+#if !defined(LINT) && !defined(CODECENTER)
static char rcsid[] = "$Id$";
-#endif
+#endif /* not lint */
+#endif /* not rtems */
/* Import. */
diff --git a/c/src/libnetworking/libc/ns_ttl.c b/c/src/libnetworking/libc/ns_ttl.c
index cca162b270..75093c1dbc 100644
--- a/c/src/libnetworking/libc/ns_ttl.c
+++ b/c/src/libnetworking/libc/ns_ttl.c
@@ -15,9 +15,11 @@
* SOFTWARE.
*/
-#ifndef lint
+#if !defined(__rtems__)
+#if !defined(LINT) && !defined(CODECENTER)
static char rcsid[] = "$Id$";
-#endif
+#endif /* not lint */
+#endif /* not rtems */
/* Import. */
@@ -44,7 +46,7 @@ int
ns_format_ttl(u_long src, char *dst, size_t dstlen) {
char *odst = dst;
int secs, mins, hours, days, weeks, x;
- char tmp[50], *p;
+ char *p;
secs = src % 60; src /= 60;
mins = src % 60; src /= 60;
diff --git a/c/src/libnetworking/libc/res_config.h b/c/src/libnetworking/libc/res_config.h
index 644e7d796a..9e5715cf28 100644
--- a/c/src/libnetworking/libc/res_config.h
+++ b/c/src/libnetworking/libc/res_config.h
@@ -6,3 +6,11 @@
#define MULTI_PTRS_ARE_ALIASES 1 /* fold multiple PTR records into aliases */
#define CHECK_SRVR_ADDR 1 /* confirm that the server requested sent the reply */
#define BIND_UPDATE 1 /* update support */
+
+#if defined(__rtems__)
+u_int16_t _getshort(const u_char *src);
+u_int32_t _getlong(const u_char *src);
+int gethostname (char *name, int namelen);
+int sethostname (char *name, int namelen);
+int issetugid (void);
+#endif
diff --git a/c/src/libnetworking/libc/res_debug.c b/c/src/libnetworking/libc/res_debug.c
index e58867acb3..b747b6e6d2 100644
--- a/c/src/libnetworking/libc/res_debug.c
+++ b/c/src/libnetworking/libc/res_debug.c
@@ -204,7 +204,7 @@ fp_query(const u_char *msg, FILE *file) {
void
fp_nquery(const u_char *msg, int len, FILE *file) {
ns_msg handle;
- int n, qdcount, ancount, nscount, arcount;
+ int qdcount, ancount, nscount, arcount;
u_int opcode, rcode, id;
if ((_res.options & RES_INIT) == 0 && res_init() == -1)
@@ -577,14 +577,14 @@ precsize_aton(strptr)
cp = *strptr;
- while (isdigit(*cp))
+ while (isdigit((int)*cp))
mval = mval * 10 + (*cp++ - '0');
if (*cp == '.') { /* centimeters */
cp++;
- if (isdigit(*cp)) {
+ if (isdigit((int)*cp)) {
cmval = (*cp++ - '0') * 10;
- if (isdigit(*cp)) {
+ if (isdigit((int)*cp)) {
cmval += (*cp++ - '0');
}
}
@@ -618,44 +618,44 @@ latlon2ul(latlonstrptr,which)
cp = *latlonstrptr;
- while (isdigit(*cp))
+ while (isdigit((int)*cp))
deg = deg * 10 + (*cp++ - '0');
- while (isspace(*cp))
+ while (isspace((int)*cp))
cp++;
- if (!(isdigit(*cp)))
+ if (!(isdigit((int)*cp)))
goto fndhemi;
- while (isdigit(*cp))
+ while (isdigit((int)*cp))
min = min * 10 + (*cp++ - '0');
- while (isspace(*cp))
+ while (isspace((int)*cp))
cp++;
- if (!(isdigit(*cp)))
+ if (!(isdigit((int)*cp)))
goto fndhemi;
- while (isdigit(*cp))
+ while (isdigit((int)*cp))
secs = secs * 10 + (*cp++ - '0');
if (*cp == '.') { /* decimal seconds */
cp++;
- if (isdigit(*cp)) {
+ if (isdigit((int)*cp)) {
secsfrac = (*cp++ - '0') * 100;
- if (isdigit(*cp)) {
+ if (isdigit((int)*cp)) {
secsfrac += (*cp++ - '0') * 10;
- if (isdigit(*cp)) {
+ if (isdigit((int)*cp)) {
secsfrac += (*cp++ - '0');
}
}
}
}
- while (!isspace(*cp)) /* if any trailing garbage */
+ while (!isspace((int)*cp)) /* if any trailing garbage */
cp++;
- while (isspace(*cp))
+ while (isspace((int)*cp))
cp++;
fndhemi:
@@ -693,10 +693,10 @@ latlon2ul(latlonstrptr,which)
cp++; /* skip the hemisphere */
- while (!isspace(*cp)) /* if any trailing garbage */
+ while (!isspace((int)*cp)) /* if any trailing garbage */
cp++;
- while (isspace(*cp)) /* move to next field */
+ while (isspace((int)*cp)) /* move to next field */
cp++;
*latlonstrptr = cp;
@@ -754,14 +754,14 @@ loc_aton(ascii, binary)
if (*cp == '+')
cp++;
- while (isdigit(*cp))
+ while (isdigit((int)*cp))
altmeters = altmeters * 10 + (*cp++ - '0');
if (*cp == '.') { /* decimal meters */
cp++;
- if (isdigit(*cp)) {
+ if (isdigit((int)*cp)) {
altfrac = (*cp++ - '0') * 10;
- if (isdigit(*cp)) {
+ if (isdigit((int)*cp)) {
altfrac += (*cp++ - '0');
}
}
@@ -769,10 +769,10 @@ loc_aton(ascii, binary)
alt = (10000000 + (altsign * (altmeters * 100 + altfrac)));
- while (!isspace(*cp) && (cp < maxcp)) /* if trailing garbage or m */
+ while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */
cp++;
- while (isspace(*cp) && (cp < maxcp))
+ while (isspace((int)*cp) && (cp < maxcp))
cp++;
if (cp >= maxcp)
@@ -780,10 +780,10 @@ loc_aton(ascii, binary)
siz = precsize_aton(&cp);
- while (!isspace(*cp) && (cp < maxcp)) /* if trailing garbage or m */
+ while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */
cp++;
- while (isspace(*cp) && (cp < maxcp))
+ while (isspace((int)*cp) && (cp < maxcp))
cp++;
if (cp >= maxcp)
@@ -791,10 +791,10 @@ loc_aton(ascii, binary)
hp = precsize_aton(&cp);
- while (!isspace(*cp) && (cp < maxcp)) /* if trailing garbage or m */
+ while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */
cp++;
- while (isspace(*cp) && (cp < maxcp))
+ while (isspace((int)*cp) && (cp < maxcp))
cp++;
if (cp >= maxcp)
diff --git a/c/src/libnetworking/libc/res_init.c b/c/src/libnetworking/libc/res_init.c
index 8b60889c6f..9371e9fa82 100644
--- a/c/src/libnetworking/libc/res_init.c
+++ b/c/src/libnetworking/libc/res_init.c
@@ -337,7 +337,7 @@ res_init()
break;
net = cp;
while (*cp && !ISSORTMASK(*cp) && *cp != ';' &&
- isascii(*cp) && !isspace(*cp))
+ isascii((int)*cp) && !isspace((int)*cp))
cp++;
n = *cp;
*cp = 0;
@@ -347,7 +347,7 @@ res_init()
*cp++ = n;
net = cp;
while (*cp && *cp != ';' &&
- isascii(*cp) && !isspace(*cp))
+ isascii((int)*cp) && !isspace((int)*cp))
cp++;
n = *cp;
*cp = 0;
diff --git a/c/src/libnetworking/libc/res_mkupdate.c b/c/src/libnetworking/libc/res_mkupdate.c
index b74f16ba78..56362f650b 100644
--- a/c/src/libnetworking/libc/res_mkupdate.c
+++ b/c/src/libnetworking/libc/res_mkupdate.c
@@ -20,9 +20,11 @@
* <viraj_bais@ccm.fm.intel.com>
*/
+#if !defined(__rtems__)
#if !defined(lint) && !defined(SABER)
static char rcsid[] = "$Id$";
#endif /* not lint */
+#endif /* not rtems */
#include <sys/types.h>
#include <sys/param.h>
@@ -64,9 +66,9 @@ int
res_mkupdate(ns_updrec *rrecp_in, u_char *buf, int buflen) {
ns_updrec *rrecp_start = rrecp_in;
HEADER *hp;
- u_char c, *cp, *cp1, *sp1, *sp2, *startp, *endp;
- int n, i, j, found, soanum, multiline;
- ns_updrec *rrecp, *tmprrecp, *recptr = NULL;
+ u_char *cp, *sp1, *sp2, *startp, *endp;
+ int n, i, soanum, multiline;
+ ns_updrec *rrecp;
struct in_addr ina;
char buf2[MAXDNAME];
int section, numrrs = 0, counts[ns_s_max];
@@ -350,7 +352,6 @@ static int
getnum_str(u_char **startpp, u_char *endp) {
int c, n;
int seendigit = 0;
- int seendecimal = 0;
int m = 0;
for (n = 0; *startpp <= endp; ) {
diff --git a/c/src/libnetworking/libc/res_query.c b/c/src/libnetworking/libc/res_query.c
index 42b7f1ecc2..784fa433bc 100644
--- a/c/src/libnetworking/libc/res_query.c
+++ b/c/src/libnetworking/libc/res_query.c
@@ -387,17 +387,17 @@ hostalias(name)
setbuf(fp, NULL);
buf[sizeof(buf) - 1] = '\0';
while (fgets(buf, sizeof(buf), fp)) {
- for (cp1 = buf; *cp1 && !isspace(*cp1); ++cp1)
+ for (cp1 = buf; *cp1 && !isspace((int)*cp1); ++cp1)
;
if (!*cp1)
break;
*cp1 = '\0';
if (!strcasecmp(buf, name)) {
- while (isspace(*++cp1))
+ while (isspace((int)*++cp1))
;
if (!*cp1)
break;
- for (cp2 = cp1 + 1; *cp2 && !isspace(*cp2); ++cp2)
+ for (cp2 = cp1 + 1; *cp2 && !isspace((int)*cp2); ++cp2)
;
abuf[sizeof(abuf) - 1] = *cp2 = '\0';
strncpy(abuf, cp1, sizeof(abuf) - 1);
diff --git a/c/src/libnetworking/libc/res_send.c b/c/src/libnetworking/libc/res_send.c
index cfb1e2eb9d..1b03bb5b1b 100644
--- a/c/src/libnetworking/libc/res_send.c
+++ b/c/src/libnetworking/libc/res_send.c
@@ -99,12 +99,14 @@ static char rcsid[] = "$Id$";
#include "res_config.h"
+#if !defined(__rtems__)
#ifdef NOPOLL /* libc_r doesn't wrap poll yet() */
static int use_poll = 0;
#else
static int use_poll = 1; /* adapt to poll() syscall availability */
/* 0 = not present, 1 = try it, 2 = exists */
#endif
+#endif
static int s = -1; /* socket used for communications */
static int connected = 0; /* is the socket connected */
@@ -375,7 +377,9 @@ res_send(buf, buflen, ans, anssiz)
if (v_circuit) {
int truncated;
+#if !defined(__rtems__)
struct iovec iov[2];
+#endif
u_short len;
u_char *cp;
@@ -411,7 +415,7 @@ res_send(buf, buflen, ans, anssiz)
* Send length & message
*/
putshort((u_short)buflen, (u_char*)&len);
-#if 0
+#if !defined(__rtems__)
iov[0].iov_base = (caddr_t)&len;
iov[0].iov_len = INT16SZ;
iov[1].iov_base = (caddr_t)buf;
@@ -536,8 +540,10 @@ read_len:
int msec;
#endif
struct timeval timeout;
+#ifndef NOSELECT
fd_set dsmask, *dsmaskp;
int dsmasklen;
+#endif
struct sockaddr_in from;
int fromlen;
diff --git a/c/src/libnetworking/libc/res_update.c b/c/src/libnetworking/libc/res_update.c
index 1c5f20abd7..ef591e0674 100644
--- a/c/src/libnetworking/libc/res_update.c
+++ b/c/src/libnetworking/libc/res_update.c
@@ -1,6 +1,8 @@
+#if !defined(__rtems__)
#if !defined(lint) && !defined(SABER)
static char rcsid[] = "$Id$";
#endif /* not lint */
+#endif /* not rtems */
/*
* Copyright (c) 1996 by Internet Software Consortium.
diff --git a/c/src/libnetworking/libc/strsep.c b/c/src/libnetworking/libc/strsep.c
index 33115f0e41..1d6e9ff79f 100644
--- a/c/src/libnetworking/libc/strsep.c
+++ b/c/src/libnetworking/libc/strsep.c
@@ -31,8 +31,6 @@
* SUCH DAMAGE.
*/
-#include "config.h"
-
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)strsep.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
diff --git a/c/src/libnetworking/net/if_ethersubr.c b/c/src/libnetworking/net/if_ethersubr.c
index 9ff1a5932a..4d1675ca3c 100644
--- a/c/src/libnetworking/net/if_ethersubr.c
+++ b/c/src/libnetworking/net/if_ethersubr.c
@@ -120,14 +120,18 @@ ether_output(ifp, m0, dst, rt0)
{
short type;
int s, error = 0;
- u_char *cp, edst[6];
- register struct mbuf *m2, *m = m0;
+#ifdef NS
+ u_char *cp
+ register struct ifqueue *inq;
+ register struct mbuf *m2;
+#endif
+ u_char edst[6];
+ register struct mbuf *m = m0;
register struct rtentry *rt;
struct mbuf *mcopy = (struct mbuf *)0;
register struct ether_header *eh;
int off, len = m->m_pkthdr.len;
struct arpcom *ac = (struct arpcom *)ifp;
- register struct ifqueue *inq;
#ifdef NETATALK
struct at_ifaddr *aa;
#endif NETATALK
@@ -457,7 +461,10 @@ ether_input(ifp, eh, m)
struct mbuf *m;
{
register struct ifqueue *inq;
- u_short ether_type, *checksum;
+ u_short ether_type;
+#ifdef NS
+ u_short *checksum;
+#endif
int s;
#if defined (ISO) || defined (LLC) || defined(NETATALK)
register struct llc *l;
diff --git a/c/src/libnetworking/net/route.c b/c/src/libnetworking/net/route.c
index 0bea64f747..683ddafee9 100644
--- a/c/src/libnetworking/net/route.c
+++ b/c/src/libnetworking/net/route.c
@@ -517,7 +517,7 @@ rtrequest(req, dst, gateway, netmask, flags, ret_nrt)
senderr(ENOBUFS);
Bzero(rt, sizeof(*rt));
rt->rt_flags = RTF_UP | flags;
- if (error = rt_setgate(rt, dst, gateway)) {
+ if ((error = rt_setgate(rt, dst, gateway))) {
Free(rt);
senderr(error);
}
diff --git a/c/src/libnetworking/net/rtsock.c b/c/src/libnetworking/net/rtsock.c
index 2a08181000..57e777906a 100644
--- a/c/src/libnetworking/net/rtsock.c
+++ b/c/src/libnetworking/net/rtsock.c
@@ -225,8 +225,8 @@ route_output(m, so)
case RTM_LOCK:
if ((rnh = rt_tables[dst->sa_family]) == 0) {
senderr(EAFNOSUPPORT);
- } else if (rt = (struct rtentry *)
- rnh->rnh_lookup(dst, netmask, rnh))
+ } else if ((rt = (struct rtentry *)
+ rnh->rnh_lookup(dst, netmask, rnh)))
rt->rt_refcnt++;
else
senderr(ESRCH);
diff --git a/c/src/libnetworking/netinet/in_pcb.c b/c/src/libnetworking/netinet/in_pcb.c
index 5241ddb6f8..116f70eebf 100644
--- a/c/src/libnetworking/netinet/in_pcb.c
+++ b/c/src/libnetworking/netinet/in_pcb.c
@@ -216,7 +216,7 @@ in_pcbbind(inp, nam)
last = ipport_hilastauto;
lastport = &inp->inp_pcbinfo->lasthi;
} else if (inp->inp_flags & INP_LOWPORT) {
- if (error = suser(p->p_ucred, &p->p_acflag))
+ if ((error = suser(p->p_ucred, &p->p_acflag)))
return (EACCES);
first = ipport_lowfirstauto; /* 1023 */
last = ipport_lowlastauto; /* 600 */
@@ -410,7 +410,7 @@ in_pcbconnect(inp, nam)
/*
* Call inner routine, to assign local interface address.
*/
- if (error = in_pcbladdr(inp, nam, &ifaddr))
+ if ((error = in_pcbladdr(inp, nam, &ifaddr)))
return(error);
if (in_pcblookuphash(inp->inp_pcbinfo, sin->sin_addr, sin->sin_port,
diff --git a/c/src/libnetworking/netinet/tcp_debug.c b/c/src/libnetworking/netinet/tcp_debug.c
index b90ff79ac8..864a01cb1a 100644
--- a/c/src/libnetworking/netinet/tcp_debug.c
+++ b/c/src/libnetworking/netinet/tcp_debug.c
@@ -86,8 +86,10 @@ tcp_trace(act, ostate, tp, ti, req)
struct tcpiphdr *ti;
int req;
{
+#ifdef TCPDEBUG
tcp_seq seq, ack;
int len, flags;
+#endif
struct tcp_debug *td = &tcp_debug[tcp_debx++];
if (tcp_debx == TCP_NDEBUG)
diff --git a/c/src/libnetworking/netinet/tcp_subr.c b/c/src/libnetworking/netinet/tcp_subr.c
index e268e32f19..a9cde3fdf0 100644
--- a/c/src/libnetworking/netinet/tcp_subr.c
+++ b/c/src/libnetworking/netinet/tcp_subr.c
@@ -74,17 +74,19 @@ int tcp_mssdflt = TCP_MSS;
SYSCTL_INT(_net_inet_tcp, TCPCTL_MSSDFLT, mssdflt,
CTLFLAG_RW, &tcp_mssdflt , 0, "");
+static int tcp_do_rfc1323 = 1;
+static int tcp_do_rfc1644 = 1;
+#if !defined(__rtems__)
static int tcp_rttdflt = TCPTV_SRTTDFLT / PR_SLOWHZ;
SYSCTL_INT(_net_inet_tcp, TCPCTL_RTTDFLT, rttdflt,
CTLFLAG_RW, &tcp_rttdflt , 0, "");
-static int tcp_do_rfc1323 = 1;
SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC1323, rfc1323,
CTLFLAG_RW, &tcp_do_rfc1323 , 0, "");
-static int tcp_do_rfc1644 = 1;
SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC1644, rfc1644,
CTLFLAG_RW, &tcp_do_rfc1644 , 0, "");
+#endif
static void tcp_cleartaocache(void);
static void tcp_notify __P((struct inpcb *, int));
diff --git a/c/src/libnetworking/netinet/udp_usrreq.c b/c/src/libnetworking/netinet/udp_usrreq.c
index 5198575c0c..16c5fce2df 100644
--- a/c/src/libnetworking/netinet/udp_usrreq.c
+++ b/c/src/libnetworking/netinet/udp_usrreq.c
@@ -250,7 +250,7 @@ udp_input(m, iphlen)
* port. It * assumes that an application will never
* clear these options after setting them.
*/
- if ((last->inp_socket->so_options&(SO_REUSEPORT|SO_REUSEADDR) == 0))
+ if (((last->inp_socket->so_options&(SO_REUSEPORT|SO_REUSEADDR)) == 0))
break;
}
diff --git a/c/src/libnetworking/nfs/bootp_subr.c b/c/src/libnetworking/nfs/bootp_subr.c
index f07ce6bd48..cb7d3d3407 100644
--- a/c/src/libnetworking/nfs/bootp_subr.c
+++ b/c/src/libnetworking/nfs/bootp_subr.c
@@ -69,7 +69,6 @@
#include <nfs/krpc.h>
#include <nfs/xdr_subs.h>
-
#define BOOTP_MIN_LEN 300 /* Minimum size of bootp udp packet */
/*
@@ -106,6 +105,7 @@ extern int nfs_diskless_valid;
extern struct nfsv3_diskless nfsv3_diskless;
/* mountd RPC */
+#if !defined(__rtems__)
static int md_mount __P((struct sockaddr_in *mdsin, char *path,
u_char *fhp, int *fhsizep, struct nfs_args *args,struct proc *procp));
static int md_lookup_swap __P((struct sockaddr_in *mdsin,char *path,
@@ -113,12 +113,15 @@ static int md_lookup_swap __P((struct sockaddr_in *mdsin,char *path,
struct nfs_args *args,
struct proc *procp));
static int setfs __P((struct sockaddr_in *addr, char *path, char *p));
+#endif
static int getdec __P((char **ptr));
static char *substr __P((char *a,char *b));
+#if !defined(__rtems__)
static void mountopts __P((struct nfs_args *args, char *p));
static int xdr_opaque_decode __P((struct mbuf **ptr,u_char *buf,
int len));
static int xdr_int_decode __P((struct mbuf **ptr,int *iptr));
+#endif
static void printip __P((char *prefix,struct in_addr addr));
#ifdef BOOTP_DEBUG
@@ -260,12 +263,11 @@ bootpc_call(call,reply,procp)
struct proc *procp;
{
struct socket *so;
- struct sockaddr_in *sin,sa;
+ struct sockaddr_in *sin;
struct mbuf *m, *nam;
struct uio auio;
struct iovec aio;
int error, rcvflg, timo, secs, len;
- u_int tport;
/* Free at end if not null. */
nam = NULL;
@@ -602,6 +604,7 @@ bootpc_adjust_interface(struct ifreq *ireq,struct socket *so,
return 0;
}
+#if !defined(__rtems__)
static int setfs(addr, path, p)
struct sockaddr_in *addr;
char *path;
@@ -634,6 +637,7 @@ static int setfs(addr, path, p)
strncpy(path,p,MNAMELEN-1);
return(1);
}
+#endif
static int getdec(ptr)
char **ptr;
@@ -690,7 +694,7 @@ bootpc_init(void)
struct socket *so;
int error;
int code,ncode,len;
- int i,j;
+ int j;
char *p;
unsigned int ip;
@@ -699,12 +703,16 @@ bootpc_init(void)
struct sockaddr_in gw;
int gotgw=0;
int gotnetmask=0;
+#if !defined(__rtems__)
int gotrootpath=0;
int gotswappath=0;
+#endif
char lookup_path[24];
#define EALEN 6
+#if !defined(__rtems__)
unsigned char ea[EALEN];
+#endif
struct ifaddr *ifa;
struct sockaddr_dl *sdl = NULL;
char *delim;
diff --git a/c/src/libnetworking/rtems/rtems_bsdnet_internal.h b/c/src/libnetworking/rtems/rtems_bsdnet_internal.h
index f27eb74491..cbd96d8e96 100644
--- a/c/src/libnetworking/rtems/rtems_bsdnet_internal.h
+++ b/c/src/libnetworking/rtems/rtems_bsdnet_internal.h
@@ -35,7 +35,7 @@ extern void soconnsleep (struct socket *so);
extern void soconnwakeup (struct socket *so);
#define splnet() 0
#define splimp() 0
-#define splx(s)
+#define splx(_s) do { (_s) = 0; } while(0)
#define ovbcopy(f,t,n) bcopy(f,t,n)
#define copyout(f,t,n) (memcpy(t,f,n),0)
diff --git a/c/src/libnetworking/rtems/rtems_syscall.c b/c/src/libnetworking/rtems/rtems_syscall.c
index 42361d22cd..368734e6e1 100644
--- a/c/src/libnetworking/rtems/rtems_syscall.c
+++ b/c/src/libnetworking/rtems/rtems_syscall.c
@@ -1,5 +1,6 @@
#include <string.h>
#include <stdarg.h>
+#include <stdlib.h>
#include <stdio.h>
#include <rtems.h>
diff --git a/c/src/libnetworking/sys/libkern.h b/c/src/libnetworking/sys/libkern.h
index bdc060346a..c01e35b273 100644
--- a/c/src/libnetworking/sys/libkern.h
+++ b/c/src/libnetworking/sys/libkern.h
@@ -79,9 +79,11 @@ int skpc __P((int, int, char *));
void srandom __P((u_long));
char *strcat __P((char *, const char *));
int strcmp __P((const char *, const char *));
+char *strdup __P((const char *s));
char *strcpy __P((char *, const char *));
size_t strlen __P((const char *));
int strncmp __P((const char *, const char *, size_t));
char *strncpy __P((char *, const char *, size_t));
+char *strerror __P((int errnum));
#endif /* !_SYS_LIBKERN_H_ */
diff --git a/c/src/libnetworking/sys/param.h b/c/src/libnetworking/sys/param.h
index 31551c7e06..21a9758520 100644
--- a/c/src/libnetworking/sys/param.h
+++ b/c/src/libnetworking/sys/param.h
@@ -42,6 +42,8 @@
#ifndef _SYS_PARAM_H_
#define _SYS_PARAM_H_
+#include <unistd.h>
+
#define BSD 199506 /* System version (year & month). */
#define BSD4_3 1
#define BSD4_4 1
@@ -168,7 +170,9 @@
* It should be set high enough to allow all legitimate uses, but halt
* infinite loops reasonably quickly.
*/
+#if !defined(__rtems__)
#define MAXPATHLEN PATH_MAX
+#endif
#define MAXSYMLINKS 32
/* Bit map related macros. */
diff --git a/c/src/libnetworking/sys/syslimits.h b/c/src/libnetworking/sys/syslimits.h
index 3546e6b1d3..283a0241e3 100644
--- a/c/src/libnetworking/sys/syslimits.h
+++ b/c/src/libnetworking/sys/syslimits.h
@@ -37,19 +37,40 @@
#ifndef _SYS_SYSLIMITS_H_
#define _SYS_SYSLIMITS_H_
+#if !defined(__rtems__)
#define ARG_MAX 65536 /* max bytes for an exec function */
+#endif
+
+#if !defined(__rtems__)
#ifndef CHILD_MAX
#define CHILD_MAX 40 /* max simultaneous processes */
#endif
+#endif
+
+#if !defined(__rtems__)
#define LINK_MAX 32767 /* max file link count */
+#endif
+
#define MAX_CANON 255 /* max bytes in term canon input line */
+
#define MAX_INPUT 255 /* max bytes in terminal input */
+
+#if !defined(__rtems__)
#define NAME_MAX 255 /* max bytes in a file name */
+#endif
+
#define NGROUPS_MAX 16 /* max supplemental group id's */
+
+#if !defined(__rtems__)
#ifndef OPEN_MAX
#define OPEN_MAX 64 /* max open files per process */
#endif
+#endif
+
+#if !defined(__rtems__)
#define PATH_MAX 1024 /* max bytes in pathname */
+#endif
+
#define PIPE_BUF 512 /* max bytes for atomic pipe writes */
#define BC_BASE_MAX 99 /* max ibase/obase values in bc(1) */
diff --git a/cpukit/libnetworking/kern/uipc_domain.c b/cpukit/libnetworking/kern/uipc_domain.c
index b35c7e6e67..910007395c 100644
--- a/cpukit/libnetworking/kern/uipc_domain.c
+++ b/cpukit/libnetworking/kern/uipc_domain.c
@@ -56,6 +56,7 @@
* passed to the doamin_add() function.
*/
+#if !defined(__rtems__)
static int x_save_spl; /* used by kludge*/
static void kludge_splimp __P((void *));
static void kludge_splx __P((void *));
@@ -63,6 +64,7 @@ static void kludge_splx __P((void *));
SYSINIT(splimp, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, kludge_splimp, &x_save_spl)
SYSINIT(domain, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, domaininit, NULL)
SYSINIT(splx, SI_SUB_PROTO_END, SI_ORDER_FIRST, kludge_splx, &x_save_spl)
+#endif
static void pffasttimo __P((void *));
static void pfslowtimo __P((void *));
@@ -81,7 +83,7 @@ void
domaininit(dummy)
void *dummy;
{
- register struct domain *dp, **dpp;
+ register struct domain *dp;
register struct protosw *pr;
/* - not in our sources
diff --git a/cpukit/libnetworking/kern/uipc_socket.c b/cpukit/libnetworking/kern/uipc_socket.c
index 0933fea50a..895d1c7d45 100644
--- a/cpukit/libnetworking/kern/uipc_socket.c
+++ b/cpukit/libnetworking/kern/uipc_socket.c
@@ -350,7 +350,7 @@ sosend(so, addr, uio, top, control, flags)
* Also check to make sure that MSG_EOR isn't used on SOCK_STREAM
* type sockets since that's an error.
*/
- if (resid < 0 || so->so_type == SOCK_STREAM && (flags & MSG_EOR)) {
+ if ((resid < 0) || (so->so_type == SOCK_STREAM && (flags & MSG_EOR))) {
error = EINVAL;
goto out;
}
diff --git a/cpukit/libnetworking/lib/getprotoby.c b/cpukit/libnetworking/lib/getprotoby.c
index b90c247a54..e0aa3bfbdb 100644
--- a/cpukit/libnetworking/lib/getprotoby.c
+++ b/cpukit/libnetworking/lib/getprotoby.c
@@ -21,7 +21,7 @@ getprotobyname (const char *name)
for (i = 0 ; i < (sizeof prototab / sizeof prototab[0]) ; i++) {
if (strcmp (name, prototab[i].p_name) == 0)
- return &prototab[i];
+ return (struct protoent *) &prototab[i];
}
return NULL;
}
@@ -36,7 +36,7 @@ getprotobynumber (int proto)
for (i = 0 ; i < (sizeof prototab / sizeof prototab[0]) ; i++) {
if (proto == prototab[i].p_proto)
- return &prototab[i];
+ return (struct protoent *) &prototab[i];
}
return NULL;
}
diff --git a/cpukit/libnetworking/lib/syslog.c b/cpukit/libnetworking/lib/syslog.c
index 7f468c81e6..0bb15bc78e 100644
--- a/cpukit/libnetworking/lib/syslog.c
+++ b/cpukit/libnetworking/lib/syslog.c
@@ -13,6 +13,8 @@
#include <sys/socket.h>
#include <netinet/in.h>
+#include <unistd.h>
+
static int LogStatus = LOG_CONS;
static const char *LogTag = "syslog";
static int LogFacility = LOG_USER;
diff --git a/cpukit/libnetworking/libc/base64.c b/cpukit/libnetworking/libc/base64.c
index c9518ca730..3017ccc01c 100644
--- a/cpukit/libnetworking/libc/base64.c
+++ b/cpukit/libnetworking/libc/base64.c
@@ -40,9 +40,11 @@
* IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
+#if !defined(__rtems__)
#if !defined(LINT) && !defined(CODECENTER)
static char rcsid[] = "$Id$";
#endif /* not lint */
+#endif /* not rtems */
#include <sys/types.h>
#include <sys/param.h>
diff --git a/cpukit/libnetworking/libc/gethostbydns.c b/cpukit/libnetworking/libc/gethostbydns.c
index ceb7088160..3d80ffde7a 100644
--- a/cpukit/libnetworking/libc/gethostbydns.c
+++ b/cpukit/libnetworking/libc/gethostbydns.c
@@ -518,7 +518,7 @@ _gethostbydnsname(name, af)
* disallow names consisting only of digits/dots, unless
* they end in a dot.
*/
- if (isdigit(name[0]))
+ if (isdigit((int)name[0]))
for (cp = name;; ++cp) {
if (!*cp) {
if (*--cp == '.')
@@ -547,10 +547,10 @@ _gethostbydnsname(name, af)
h_errno = NETDB_SUCCESS;
return (&host);
}
- if (!isdigit(*cp) && *cp != '.')
+ if (!isdigit((int)*cp) && *cp != '.')
break;
}
- if ((isxdigit(name[0]) && strchr(name, ':') != NULL) ||
+ if ((isxdigit((int)name[0]) && strchr(name, ':') != NULL) ||
name[0] == ':')
for (cp = name;; ++cp) {
if (!*cp) {
@@ -578,7 +578,7 @@ _gethostbydnsname(name, af)
h_errno = NETDB_SUCCESS;
return (&host);
}
- if (!isxdigit(*cp) && *cp != ':' && *cp != '.')
+ if (!isxdigit((int)*cp) && *cp != ':' && *cp != '.')
break;
}
diff --git a/cpukit/libnetworking/libc/gethostnamadr.c b/cpukit/libnetworking/libc/gethostnamadr.c
index 2ad832f4b1..92f7a21014 100644
--- a/cpukit/libnetworking/libc/gethostnamadr.c
+++ b/cpukit/libnetworking/libc/gethostnamadr.c
@@ -103,7 +103,7 @@ init_services()
if (cp == NULL)
continue;
do {
- if (isalpha(cp[0])) {
+ if (isalpha((int)cp[0])) {
service_order[cc] = get_service_name(cp);
if(service_order[cc] != SERVICE_NONE)
cc++;
diff --git a/cpukit/libnetworking/libc/inet_addr.c b/cpukit/libnetworking/libc/inet_addr.c
index a1ac899519..225ccc1269 100644
--- a/cpukit/libnetworking/libc/inet_addr.c
+++ b/cpukit/libnetworking/libc/inet_addr.c
@@ -103,7 +103,7 @@ inet_aton(cp, addr)
* Values are specified as for C:
* 0x=hex, 0=octal, isdigit=decimal.
*/
- if (!isdigit(c))
+ if (!isdigit((int)c))
return (0);
val = 0; base = 10;
if (c == '0') {
@@ -114,12 +114,12 @@ inet_aton(cp, addr)
base = 8;
}
for (;;) {
- if (isascii(c) && isdigit(c)) {
+ if (isascii((int)c) && isdigit((int)c)) {
val = (val * base) + (c - '0');
c = *++cp;
- } else if (base == 16 && isascii(c) && isxdigit(c)) {
+ } else if (base == 16 && isascii((int)c) && isxdigit((int)c)) {
val = (val << 4) |
- (c + 10 - (islower(c) ? 'a' : 'A'));
+ (c + 10 - (islower((int)c) ? 'a' : 'A'));
c = *++cp;
} else
break;
@@ -141,7 +141,7 @@ inet_aton(cp, addr)
/*
* Check for trailing characters.
*/
- if (c != '\0' && (!isascii(c) || !isspace(c)))
+ if (c != '\0' && (!isascii((int)c) || !isspace((int)c)))
return (0);
/*
* Concoct the address according to
diff --git a/cpukit/libnetworking/libc/ns_name.c b/cpukit/libnetworking/libc/ns_name.c
index 3e6b2b87fa..af10d2f062 100644
--- a/cpukit/libnetworking/libc/ns_name.c
+++ b/cpukit/libnetworking/libc/ns_name.c
@@ -15,9 +15,11 @@
* SOFTWARE.
*/
-#ifndef lint
+#if !defined(__rtems__)
+#if !defined(LINT) && !defined(CODECENTER)
static char rcsid[] = "$Id$";
-#endif
+#endif /* not lint */
+#endif /* not rtems */
#include <sys/types.h>
@@ -244,7 +246,7 @@ ns_name_unpack(const u_char *msg, const u_char *eom, const u_char *src,
{
const u_char *srcp, *dstlim;
u_char *dstp;
- int n, c, len, checked;
+ int n, len, checked;
len = -1;
checked = 0;
diff --git a/cpukit/libnetworking/libc/ns_netint.c b/cpukit/libnetworking/libc/ns_netint.c
index bf0f793c2c..3c09da8f8c 100644
--- a/cpukit/libnetworking/libc/ns_netint.c
+++ b/cpukit/libnetworking/libc/ns_netint.c
@@ -15,9 +15,11 @@
* SOFTWARE.
*/
-#ifndef lint
+#if !defined(__rtems__)
+#if !defined(LINT) && !defined(CODECENTER)
static char rcsid[] = "$Id$";
-#endif
+#endif /* not lint */
+#endif /* not rtems */
/* Import. */
diff --git a/cpukit/libnetworking/libc/ns_parse.c b/cpukit/libnetworking/libc/ns_parse.c
index 13b9956d93..cc1f070156 100644
--- a/cpukit/libnetworking/libc/ns_parse.c
+++ b/cpukit/libnetworking/libc/ns_parse.c
@@ -15,9 +15,11 @@
* SOFTWARE.
*/
-#ifndef lint
+#if !defined(__rtems__)
+#if !defined(LINT) && !defined(CODECENTER)
static char rcsid[] = "$Id$";
-#endif
+#endif /* not lint */
+#endif /* not rtems */
#include <sys/types.h>
diff --git a/cpukit/libnetworking/libc/ns_print.c b/cpukit/libnetworking/libc/ns_print.c
index 8e27c1290c..f7d7d16c64 100644
--- a/cpukit/libnetworking/libc/ns_print.c
+++ b/cpukit/libnetworking/libc/ns_print.c
@@ -15,9 +15,11 @@
* SOFTWARE.
*/
-#ifndef lint
+#if !defined(__rtems__)
+#if !defined(LINT) && !defined(CODECENTER)
static char rcsid[] = "$Id$";
-#endif
+#endif /* not lint */
+#endif /* not rtems */
/* Import. */
diff --git a/cpukit/libnetworking/libc/ns_ttl.c b/cpukit/libnetworking/libc/ns_ttl.c
index cca162b270..75093c1dbc 100644
--- a/cpukit/libnetworking/libc/ns_ttl.c
+++ b/cpukit/libnetworking/libc/ns_ttl.c
@@ -15,9 +15,11 @@
* SOFTWARE.
*/
-#ifndef lint
+#if !defined(__rtems__)
+#if !defined(LINT) && !defined(CODECENTER)
static char rcsid[] = "$Id$";
-#endif
+#endif /* not lint */
+#endif /* not rtems */
/* Import. */
@@ -44,7 +46,7 @@ int
ns_format_ttl(u_long src, char *dst, size_t dstlen) {
char *odst = dst;
int secs, mins, hours, days, weeks, x;
- char tmp[50], *p;
+ char *p;
secs = src % 60; src /= 60;
mins = src % 60; src /= 60;
diff --git a/cpukit/libnetworking/libc/res_config.h b/cpukit/libnetworking/libc/res_config.h
index 644e7d796a..9e5715cf28 100644
--- a/cpukit/libnetworking/libc/res_config.h
+++ b/cpukit/libnetworking/libc/res_config.h
@@ -6,3 +6,11 @@
#define MULTI_PTRS_ARE_ALIASES 1 /* fold multiple PTR records into aliases */
#define CHECK_SRVR_ADDR 1 /* confirm that the server requested sent the reply */
#define BIND_UPDATE 1 /* update support */
+
+#if defined(__rtems__)
+u_int16_t _getshort(const u_char *src);
+u_int32_t _getlong(const u_char *src);
+int gethostname (char *name, int namelen);
+int sethostname (char *name, int namelen);
+int issetugid (void);
+#endif
diff --git a/cpukit/libnetworking/libc/res_debug.c b/cpukit/libnetworking/libc/res_debug.c
index e58867acb3..b747b6e6d2 100644
--- a/cpukit/libnetworking/libc/res_debug.c
+++ b/cpukit/libnetworking/libc/res_debug.c
@@ -204,7 +204,7 @@ fp_query(const u_char *msg, FILE *file) {
void
fp_nquery(const u_char *msg, int len, FILE *file) {
ns_msg handle;
- int n, qdcount, ancount, nscount, arcount;
+ int qdcount, ancount, nscount, arcount;
u_int opcode, rcode, id;
if ((_res.options & RES_INIT) == 0 && res_init() == -1)
@@ -577,14 +577,14 @@ precsize_aton(strptr)
cp = *strptr;
- while (isdigit(*cp))
+ while (isdigit((int)*cp))
mval = mval * 10 + (*cp++ - '0');
if (*cp == '.') { /* centimeters */
cp++;
- if (isdigit(*cp)) {
+ if (isdigit((int)*cp)) {
cmval = (*cp++ - '0') * 10;
- if (isdigit(*cp)) {
+ if (isdigit((int)*cp)) {
cmval += (*cp++ - '0');
}
}
@@ -618,44 +618,44 @@ latlon2ul(latlonstrptr,which)
cp = *latlonstrptr;
- while (isdigit(*cp))
+ while (isdigit((int)*cp))
deg = deg * 10 + (*cp++ - '0');
- while (isspace(*cp))
+ while (isspace((int)*cp))
cp++;
- if (!(isdigit(*cp)))
+ if (!(isdigit((int)*cp)))
goto fndhemi;
- while (isdigit(*cp))
+ while (isdigit((int)*cp))
min = min * 10 + (*cp++ - '0');
- while (isspace(*cp))
+ while (isspace((int)*cp))
cp++;
- if (!(isdigit(*cp)))
+ if (!(isdigit((int)*cp)))
goto fndhemi;
- while (isdigit(*cp))
+ while (isdigit((int)*cp))
secs = secs * 10 + (*cp++ - '0');
if (*cp == '.') { /* decimal seconds */
cp++;
- if (isdigit(*cp)) {
+ if (isdigit((int)*cp)) {
secsfrac = (*cp++ - '0') * 100;
- if (isdigit(*cp)) {
+ if (isdigit((int)*cp)) {
secsfrac += (*cp++ - '0') * 10;
- if (isdigit(*cp)) {
+ if (isdigit((int)*cp)) {
secsfrac += (*cp++ - '0');
}
}
}
}
- while (!isspace(*cp)) /* if any trailing garbage */
+ while (!isspace((int)*cp)) /* if any trailing garbage */
cp++;
- while (isspace(*cp))
+ while (isspace((int)*cp))
cp++;
fndhemi:
@@ -693,10 +693,10 @@ latlon2ul(latlonstrptr,which)
cp++; /* skip the hemisphere */
- while (!isspace(*cp)) /* if any trailing garbage */
+ while (!isspace((int)*cp)) /* if any trailing garbage */
cp++;
- while (isspace(*cp)) /* move to next field */
+ while (isspace((int)*cp)) /* move to next field */
cp++;
*latlonstrptr = cp;
@@ -754,14 +754,14 @@ loc_aton(ascii, binary)
if (*cp == '+')
cp++;
- while (isdigit(*cp))
+ while (isdigit((int)*cp))
altmeters = altmeters * 10 + (*cp++ - '0');
if (*cp == '.') { /* decimal meters */
cp++;
- if (isdigit(*cp)) {
+ if (isdigit((int)*cp)) {
altfrac = (*cp++ - '0') * 10;
- if (isdigit(*cp)) {
+ if (isdigit((int)*cp)) {
altfrac += (*cp++ - '0');
}
}
@@ -769,10 +769,10 @@ loc_aton(ascii, binary)
alt = (10000000 + (altsign * (altmeters * 100 + altfrac)));
- while (!isspace(*cp) && (cp < maxcp)) /* if trailing garbage or m */
+ while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */
cp++;
- while (isspace(*cp) && (cp < maxcp))
+ while (isspace((int)*cp) && (cp < maxcp))
cp++;
if (cp >= maxcp)
@@ -780,10 +780,10 @@ loc_aton(ascii, binary)
siz = precsize_aton(&cp);
- while (!isspace(*cp) && (cp < maxcp)) /* if trailing garbage or m */
+ while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */
cp++;
- while (isspace(*cp) && (cp < maxcp))
+ while (isspace((int)*cp) && (cp < maxcp))
cp++;
if (cp >= maxcp)
@@ -791,10 +791,10 @@ loc_aton(ascii, binary)
hp = precsize_aton(&cp);
- while (!isspace(*cp) && (cp < maxcp)) /* if trailing garbage or m */
+ while (!isspace((int)*cp) && (cp < maxcp)) /* if trailing garbage or m */
cp++;
- while (isspace(*cp) && (cp < maxcp))
+ while (isspace((int)*cp) && (cp < maxcp))
cp++;
if (cp >= maxcp)
diff --git a/cpukit/libnetworking/libc/res_init.c b/cpukit/libnetworking/libc/res_init.c
index 8b60889c6f..9371e9fa82 100644
--- a/cpukit/libnetworking/libc/res_init.c
+++ b/cpukit/libnetworking/libc/res_init.c
@@ -337,7 +337,7 @@ res_init()
break;
net = cp;
while (*cp && !ISSORTMASK(*cp) && *cp != ';' &&
- isascii(*cp) && !isspace(*cp))
+ isascii((int)*cp) && !isspace((int)*cp))
cp++;
n = *cp;
*cp = 0;
@@ -347,7 +347,7 @@ res_init()
*cp++ = n;
net = cp;
while (*cp && *cp != ';' &&
- isascii(*cp) && !isspace(*cp))
+ isascii((int)*cp) && !isspace((int)*cp))
cp++;
n = *cp;
*cp = 0;
diff --git a/cpukit/libnetworking/libc/res_mkupdate.c b/cpukit/libnetworking/libc/res_mkupdate.c
index b74f16ba78..56362f650b 100644
--- a/cpukit/libnetworking/libc/res_mkupdate.c
+++ b/cpukit/libnetworking/libc/res_mkupdate.c
@@ -20,9 +20,11 @@
* <viraj_bais@ccm.fm.intel.com>
*/
+#if !defined(__rtems__)
#if !defined(lint) && !defined(SABER)
static char rcsid[] = "$Id$";
#endif /* not lint */
+#endif /* not rtems */
#include <sys/types.h>
#include <sys/param.h>
@@ -64,9 +66,9 @@ int
res_mkupdate(ns_updrec *rrecp_in, u_char *buf, int buflen) {
ns_updrec *rrecp_start = rrecp_in;
HEADER *hp;
- u_char c, *cp, *cp1, *sp1, *sp2, *startp, *endp;
- int n, i, j, found, soanum, multiline;
- ns_updrec *rrecp, *tmprrecp, *recptr = NULL;
+ u_char *cp, *sp1, *sp2, *startp, *endp;
+ int n, i, soanum, multiline;
+ ns_updrec *rrecp;
struct in_addr ina;
char buf2[MAXDNAME];
int section, numrrs = 0, counts[ns_s_max];
@@ -350,7 +352,6 @@ static int
getnum_str(u_char **startpp, u_char *endp) {
int c, n;
int seendigit = 0;
- int seendecimal = 0;
int m = 0;
for (n = 0; *startpp <= endp; ) {
diff --git a/cpukit/libnetworking/libc/res_query.c b/cpukit/libnetworking/libc/res_query.c
index 42b7f1ecc2..784fa433bc 100644
--- a/cpukit/libnetworking/libc/res_query.c
+++ b/cpukit/libnetworking/libc/res_query.c
@@ -387,17 +387,17 @@ hostalias(name)
setbuf(fp, NULL);
buf[sizeof(buf) - 1] = '\0';
while (fgets(buf, sizeof(buf), fp)) {
- for (cp1 = buf; *cp1 && !isspace(*cp1); ++cp1)
+ for (cp1 = buf; *cp1 && !isspace((int)*cp1); ++cp1)
;
if (!*cp1)
break;
*cp1 = '\0';
if (!strcasecmp(buf, name)) {
- while (isspace(*++cp1))
+ while (isspace((int)*++cp1))
;
if (!*cp1)
break;
- for (cp2 = cp1 + 1; *cp2 && !isspace(*cp2); ++cp2)
+ for (cp2 = cp1 + 1; *cp2 && !isspace((int)*cp2); ++cp2)
;
abuf[sizeof(abuf) - 1] = *cp2 = '\0';
strncpy(abuf, cp1, sizeof(abuf) - 1);
diff --git a/cpukit/libnetworking/libc/res_send.c b/cpukit/libnetworking/libc/res_send.c
index cfb1e2eb9d..1b03bb5b1b 100644
--- a/cpukit/libnetworking/libc/res_send.c
+++ b/cpukit/libnetworking/libc/res_send.c
@@ -99,12 +99,14 @@ static char rcsid[] = "$Id$";
#include "res_config.h"
+#if !defined(__rtems__)
#ifdef NOPOLL /* libc_r doesn't wrap poll yet() */
static int use_poll = 0;
#else
static int use_poll = 1; /* adapt to poll() syscall availability */
/* 0 = not present, 1 = try it, 2 = exists */
#endif
+#endif
static int s = -1; /* socket used for communications */
static int connected = 0; /* is the socket connected */
@@ -375,7 +377,9 @@ res_send(buf, buflen, ans, anssiz)
if (v_circuit) {
int truncated;
+#if !defined(__rtems__)
struct iovec iov[2];
+#endif
u_short len;
u_char *cp;
@@ -411,7 +415,7 @@ res_send(buf, buflen, ans, anssiz)
* Send length & message
*/
putshort((u_short)buflen, (u_char*)&len);
-#if 0
+#if !defined(__rtems__)
iov[0].iov_base = (caddr_t)&len;
iov[0].iov_len = INT16SZ;
iov[1].iov_base = (caddr_t)buf;
@@ -536,8 +540,10 @@ read_len:
int msec;
#endif
struct timeval timeout;
+#ifndef NOSELECT
fd_set dsmask, *dsmaskp;
int dsmasklen;
+#endif
struct sockaddr_in from;
int fromlen;
diff --git a/cpukit/libnetworking/libc/res_update.c b/cpukit/libnetworking/libc/res_update.c
index 1c5f20abd7..ef591e0674 100644
--- a/cpukit/libnetworking/libc/res_update.c
+++ b/cpukit/libnetworking/libc/res_update.c
@@ -1,6 +1,8 @@
+#if !defined(__rtems__)
#if !defined(lint) && !defined(SABER)
static char rcsid[] = "$Id$";
#endif /* not lint */
+#endif /* not rtems */
/*
* Copyright (c) 1996 by Internet Software Consortium.
diff --git a/cpukit/libnetworking/libc/strsep.c b/cpukit/libnetworking/libc/strsep.c
index 33115f0e41..1d6e9ff79f 100644
--- a/cpukit/libnetworking/libc/strsep.c
+++ b/cpukit/libnetworking/libc/strsep.c
@@ -31,8 +31,6 @@
* SUCH DAMAGE.
*/
-#include "config.h"
-
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)strsep.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
diff --git a/cpukit/libnetworking/net/if_ethersubr.c b/cpukit/libnetworking/net/if_ethersubr.c
index 9ff1a5932a..4d1675ca3c 100644
--- a/cpukit/libnetworking/net/if_ethersubr.c
+++ b/cpukit/libnetworking/net/if_ethersubr.c
@@ -120,14 +120,18 @@ ether_output(ifp, m0, dst, rt0)
{
short type;
int s, error = 0;
- u_char *cp, edst[6];
- register struct mbuf *m2, *m = m0;
+#ifdef NS
+ u_char *cp
+ register struct ifqueue *inq;
+ register struct mbuf *m2;
+#endif
+ u_char edst[6];
+ register struct mbuf *m = m0;
register struct rtentry *rt;
struct mbuf *mcopy = (struct mbuf *)0;
register struct ether_header *eh;
int off, len = m->m_pkthdr.len;
struct arpcom *ac = (struct arpcom *)ifp;
- register struct ifqueue *inq;
#ifdef NETATALK
struct at_ifaddr *aa;
#endif NETATALK
@@ -457,7 +461,10 @@ ether_input(ifp, eh, m)
struct mbuf *m;
{
register struct ifqueue *inq;
- u_short ether_type, *checksum;
+ u_short ether_type;
+#ifdef NS
+ u_short *checksum;
+#endif
int s;
#if defined (ISO) || defined (LLC) || defined(NETATALK)
register struct llc *l;
diff --git a/cpukit/libnetworking/net/route.c b/cpukit/libnetworking/net/route.c
index 0bea64f747..683ddafee9 100644
--- a/cpukit/libnetworking/net/route.c
+++ b/cpukit/libnetworking/net/route.c
@@ -517,7 +517,7 @@ rtrequest(req, dst, gateway, netmask, flags, ret_nrt)
senderr(ENOBUFS);
Bzero(rt, sizeof(*rt));
rt->rt_flags = RTF_UP | flags;
- if (error = rt_setgate(rt, dst, gateway)) {
+ if ((error = rt_setgate(rt, dst, gateway))) {
Free(rt);
senderr(error);
}
diff --git a/cpukit/libnetworking/net/rtsock.c b/cpukit/libnetworking/net/rtsock.c
index 2a08181000..57e777906a 100644
--- a/cpukit/libnetworking/net/rtsock.c
+++ b/cpukit/libnetworking/net/rtsock.c
@@ -225,8 +225,8 @@ route_output(m, so)
case RTM_LOCK:
if ((rnh = rt_tables[dst->sa_family]) == 0) {
senderr(EAFNOSUPPORT);
- } else if (rt = (struct rtentry *)
- rnh->rnh_lookup(dst, netmask, rnh))
+ } else if ((rt = (struct rtentry *)
+ rnh->rnh_lookup(dst, netmask, rnh)))
rt->rt_refcnt++;
else
senderr(ESRCH);
diff --git a/cpukit/libnetworking/netinet/in_pcb.c b/cpukit/libnetworking/netinet/in_pcb.c
index 5241ddb6f8..116f70eebf 100644
--- a/cpukit/libnetworking/netinet/in_pcb.c
+++ b/cpukit/libnetworking/netinet/in_pcb.c
@@ -216,7 +216,7 @@ in_pcbbind(inp, nam)
last = ipport_hilastauto;
lastport = &inp->inp_pcbinfo->lasthi;
} else if (inp->inp_flags & INP_LOWPORT) {
- if (error = suser(p->p_ucred, &p->p_acflag))
+ if ((error = suser(p->p_ucred, &p->p_acflag)))
return (EACCES);
first = ipport_lowfirstauto; /* 1023 */
last = ipport_lowlastauto; /* 600 */
@@ -410,7 +410,7 @@ in_pcbconnect(inp, nam)
/*
* Call inner routine, to assign local interface address.
*/
- if (error = in_pcbladdr(inp, nam, &ifaddr))
+ if ((error = in_pcbladdr(inp, nam, &ifaddr)))
return(error);
if (in_pcblookuphash(inp->inp_pcbinfo, sin->sin_addr, sin->sin_port,
diff --git a/cpukit/libnetworking/netinet/tcp_debug.c b/cpukit/libnetworking/netinet/tcp_debug.c
index b90ff79ac8..864a01cb1a 100644
--- a/cpukit/libnetworking/netinet/tcp_debug.c
+++ b/cpukit/libnetworking/netinet/tcp_debug.c
@@ -86,8 +86,10 @@ tcp_trace(act, ostate, tp, ti, req)
struct tcpiphdr *ti;
int req;
{
+#ifdef TCPDEBUG
tcp_seq seq, ack;
int len, flags;
+#endif
struct tcp_debug *td = &tcp_debug[tcp_debx++];
if (tcp_debx == TCP_NDEBUG)
diff --git a/cpukit/libnetworking/netinet/tcp_subr.c b/cpukit/libnetworking/netinet/tcp_subr.c
index e268e32f19..a9cde3fdf0 100644
--- a/cpukit/libnetworking/netinet/tcp_subr.c
+++ b/cpukit/libnetworking/netinet/tcp_subr.c
@@ -74,17 +74,19 @@ int tcp_mssdflt = TCP_MSS;
SYSCTL_INT(_net_inet_tcp, TCPCTL_MSSDFLT, mssdflt,
CTLFLAG_RW, &tcp_mssdflt , 0, "");
+static int tcp_do_rfc1323 = 1;
+static int tcp_do_rfc1644 = 1;
+#if !defined(__rtems__)
static int tcp_rttdflt = TCPTV_SRTTDFLT / PR_SLOWHZ;
SYSCTL_INT(_net_inet_tcp, TCPCTL_RTTDFLT, rttdflt,
CTLFLAG_RW, &tcp_rttdflt , 0, "");
-static int tcp_do_rfc1323 = 1;
SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC1323, rfc1323,
CTLFLAG_RW, &tcp_do_rfc1323 , 0, "");
-static int tcp_do_rfc1644 = 1;
SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC1644, rfc1644,
CTLFLAG_RW, &tcp_do_rfc1644 , 0, "");
+#endif
static void tcp_cleartaocache(void);
static void tcp_notify __P((struct inpcb *, int));
diff --git a/cpukit/libnetworking/netinet/udp_usrreq.c b/cpukit/libnetworking/netinet/udp_usrreq.c
index 5198575c0c..16c5fce2df 100644
--- a/cpukit/libnetworking/netinet/udp_usrreq.c
+++ b/cpukit/libnetworking/netinet/udp_usrreq.c
@@ -250,7 +250,7 @@ udp_input(m, iphlen)
* port. It * assumes that an application will never
* clear these options after setting them.
*/
- if ((last->inp_socket->so_options&(SO_REUSEPORT|SO_REUSEADDR) == 0))
+ if (((last->inp_socket->so_options&(SO_REUSEPORT|SO_REUSEADDR)) == 0))
break;
}
diff --git a/cpukit/libnetworking/nfs/bootp_subr.c b/cpukit/libnetworking/nfs/bootp_subr.c
index f07ce6bd48..cb7d3d3407 100644
--- a/cpukit/libnetworking/nfs/bootp_subr.c
+++ b/cpukit/libnetworking/nfs/bootp_subr.c
@@ -69,7 +69,6 @@
#include <nfs/krpc.h>
#include <nfs/xdr_subs.h>
-
#define BOOTP_MIN_LEN 300 /* Minimum size of bootp udp packet */
/*
@@ -106,6 +105,7 @@ extern int nfs_diskless_valid;
extern struct nfsv3_diskless nfsv3_diskless;
/* mountd RPC */
+#if !defined(__rtems__)
static int md_mount __P((struct sockaddr_in *mdsin, char *path,
u_char *fhp, int *fhsizep, struct nfs_args *args,struct proc *procp));
static int md_lookup_swap __P((struct sockaddr_in *mdsin,char *path,
@@ -113,12 +113,15 @@ static int md_lookup_swap __P((struct sockaddr_in *mdsin,char *path,
struct nfs_args *args,
struct proc *procp));
static int setfs __P((struct sockaddr_in *addr, char *path, char *p));
+#endif
static int getdec __P((char **ptr));
static char *substr __P((char *a,char *b));
+#if !defined(__rtems__)
static void mountopts __P((struct nfs_args *args, char *p));
static int xdr_opaque_decode __P((struct mbuf **ptr,u_char *buf,
int len));
static int xdr_int_decode __P((struct mbuf **ptr,int *iptr));
+#endif
static void printip __P((char *prefix,struct in_addr addr));
#ifdef BOOTP_DEBUG
@@ -260,12 +263,11 @@ bootpc_call(call,reply,procp)
struct proc *procp;
{
struct socket *so;
- struct sockaddr_in *sin,sa;
+ struct sockaddr_in *sin;
struct mbuf *m, *nam;
struct uio auio;
struct iovec aio;
int error, rcvflg, timo, secs, len;
- u_int tport;
/* Free at end if not null. */
nam = NULL;
@@ -602,6 +604,7 @@ bootpc_adjust_interface(struct ifreq *ireq,struct socket *so,
return 0;
}
+#if !defined(__rtems__)
static int setfs(addr, path, p)
struct sockaddr_in *addr;
char *path;
@@ -634,6 +637,7 @@ static int setfs(addr, path, p)
strncpy(path,p,MNAMELEN-1);
return(1);
}
+#endif
static int getdec(ptr)
char **ptr;
@@ -690,7 +694,7 @@ bootpc_init(void)
struct socket *so;
int error;
int code,ncode,len;
- int i,j;
+ int j;
char *p;
unsigned int ip;
@@ -699,12 +703,16 @@ bootpc_init(void)
struct sockaddr_in gw;
int gotgw=0;
int gotnetmask=0;
+#if !defined(__rtems__)
int gotrootpath=0;
int gotswappath=0;
+#endif
char lookup_path[24];
#define EALEN 6
+#if !defined(__rtems__)
unsigned char ea[EALEN];
+#endif
struct ifaddr *ifa;
struct sockaddr_dl *sdl = NULL;
char *delim;
diff --git a/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h b/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h
index f27eb74491..cbd96d8e96 100644
--- a/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h
+++ b/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h
@@ -35,7 +35,7 @@ extern void soconnsleep (struct socket *so);
extern void soconnwakeup (struct socket *so);
#define splnet() 0
#define splimp() 0
-#define splx(s)
+#define splx(_s) do { (_s) = 0; } while(0)
#define ovbcopy(f,t,n) bcopy(f,t,n)
#define copyout(f,t,n) (memcpy(t,f,n),0)
diff --git a/cpukit/libnetworking/rtems/rtems_syscall.c b/cpukit/libnetworking/rtems/rtems_syscall.c
index 42361d22cd..368734e6e1 100644
--- a/cpukit/libnetworking/rtems/rtems_syscall.c
+++ b/cpukit/libnetworking/rtems/rtems_syscall.c
@@ -1,5 +1,6 @@
#include <string.h>
#include <stdarg.h>
+#include <stdlib.h>
#include <stdio.h>
#include <rtems.h>
diff --git a/cpukit/libnetworking/sys/libkern.h b/cpukit/libnetworking/sys/libkern.h
index bdc060346a..c01e35b273 100644
--- a/cpukit/libnetworking/sys/libkern.h
+++ b/cpukit/libnetworking/sys/libkern.h
@@ -79,9 +79,11 @@ int skpc __P((int, int, char *));
void srandom __P((u_long));
char *strcat __P((char *, const char *));
int strcmp __P((const char *, const char *));
+char *strdup __P((const char *s));
char *strcpy __P((char *, const char *));
size_t strlen __P((const char *));
int strncmp __P((const char *, const char *, size_t));
char *strncpy __P((char *, const char *, size_t));
+char *strerror __P((int errnum));
#endif /* !_SYS_LIBKERN_H_ */
diff --git a/cpukit/libnetworking/sys/param.h b/cpukit/libnetworking/sys/param.h
index 31551c7e06..21a9758520 100644
--- a/cpukit/libnetworking/sys/param.h
+++ b/cpukit/libnetworking/sys/param.h
@@ -42,6 +42,8 @@
#ifndef _SYS_PARAM_H_
#define _SYS_PARAM_H_
+#include <unistd.h>
+
#define BSD 199506 /* System version (year & month). */
#define BSD4_3 1
#define BSD4_4 1
@@ -168,7 +170,9 @@
* It should be set high enough to allow all legitimate uses, but halt
* infinite loops reasonably quickly.
*/
+#if !defined(__rtems__)
#define MAXPATHLEN PATH_MAX
+#endif
#define MAXSYMLINKS 32
/* Bit map related macros. */
diff --git a/cpukit/libnetworking/sys/syslimits.h b/cpukit/libnetworking/sys/syslimits.h
index 3546e6b1d3..283a0241e3 100644
--- a/cpukit/libnetworking/sys/syslimits.h
+++ b/cpukit/libnetworking/sys/syslimits.h
@@ -37,19 +37,40 @@
#ifndef _SYS_SYSLIMITS_H_
#define _SYS_SYSLIMITS_H_
+#if !defined(__rtems__)
#define ARG_MAX 65536 /* max bytes for an exec function */
+#endif
+
+#if !defined(__rtems__)
#ifndef CHILD_MAX
#define CHILD_MAX 40 /* max simultaneous processes */
#endif
+#endif
+
+#if !defined(__rtems__)
#define LINK_MAX 32767 /* max file link count */
+#endif
+
#define MAX_CANON 255 /* max bytes in term canon input line */
+
#define MAX_INPUT 255 /* max bytes in terminal input */
+
+#if !defined(__rtems__)
#define NAME_MAX 255 /* max bytes in a file name */
+#endif
+
#define NGROUPS_MAX 16 /* max supplemental group id's */
+
+#if !defined(__rtems__)
#ifndef OPEN_MAX
#define OPEN_MAX 64 /* max open files per process */
#endif
+#endif
+
+#if !defined(__rtems__)
#define PATH_MAX 1024 /* max bytes in pathname */
+#endif
+
#define PIPE_BUF 512 /* max bytes for atomic pipe writes */
#define BC_BASE_MAX 99 /* max ibase/obase values in bc(1) */