[rtems commit] network: Fix warnings
Sebastian Huber
sebh at rtems.org
Fri Apr 22 07:28:44 UTC 2016
Module: rtems
Branch: master
Commit: e800b0738b05e683ab64e509e4b48170c71dbd2b
Changeset: http://git.rtems.org/rtems/commit/?id=e800b0738b05e683ab64e509e4b48170c71dbd2b
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Fri Apr 22 09:15:11 2016 +0200
network: Fix warnings
---
cpukit/libnetworking/libc/res_comp.c | 2 ++
cpukit/libnetworking/net/if.c | 4 ++--
cpukit/libnetworking/netinet/ip_divert.c | 3 +++
cpukit/libnetworking/rtems/rtems_bsdnet_internal.h | 8 ++++++++
cpukit/libnetworking/rtems/rtems_dhcp.c | 1 +
cpukit/libnetworking/rtems/rtems_glue.c | 18 +++++-------------
cpukit/libnetworking/rtems/rtems_showicmpstat.c | 2 ++
cpukit/libnetworking/rtems/rtems_showifstat.c | 2 ++
cpukit/libnetworking/rtems/rtems_showipstat.c | 2 ++
cpukit/libnetworking/rtems/rtems_showmbuf.c | 2 ++
cpukit/libnetworking/rtems/rtems_showroute.c | 2 ++
cpukit/libnetworking/rtems/rtems_showtcpstat.c | 2 ++
cpukit/libnetworking/rtems/rtems_showudpstat.c | 2 ++
cpukit/libnetworking/rtems/rtems_socketpair.c | 2 ++
cpukit/libnetworking/rtems/sghostname.c | 1 +
15 files changed, 38 insertions(+), 15 deletions(-)
diff --git a/cpukit/libnetworking/libc/res_comp.c b/cpukit/libnetworking/libc/res_comp.c
index 377d283..a1381fb 100644
--- a/cpukit/libnetworking/libc/res_comp.c
+++ b/cpukit/libnetworking/libc/res_comp.c
@@ -78,6 +78,8 @@
#include <string.h>
#include <unistd.h>
+#include "res_config.h"
+
#define BIND_4_COMPAT
/*
diff --git a/cpukit/libnetworking/net/if.c b/cpukit/libnetworking/net/if.c
index 64f9aae..d0da62a 100644
--- a/cpukit/libnetworking/net/if.c
+++ b/cpukit/libnetworking/net/if.c
@@ -435,7 +435,7 @@ if_slowtimo(void *arg)
* Map interface name to
* interface structure pointer.
*/
-struct ifnet *
+static struct ifnet *
ifunit(char *name)
{
char *cp;
@@ -715,7 +715,7 @@ ifconf(u_long cmd, caddr_t data)
struct ifconf *ifc = (struct ifconf *)data;
struct ifnet *ifp = ifnet;
struct ifaddr *ifa;
- struct ifreq ifr, *ifrp;
+ struct ifreq ifr;
char *ifrpc;
int space = ifc->ifc_len, error = 0;
diff --git a/cpukit/libnetworking/netinet/ip_divert.c b/cpukit/libnetworking/netinet/ip_divert.c
index bfced1b..c731e64 100644
--- a/cpukit/libnetworking/netinet/ip_divert.c
+++ b/cpukit/libnetworking/netinet/ip_divert.c
@@ -54,6 +54,8 @@
#include <netinet/in_var.h>
#include <netinet/ip_var.h>
+#ifdef IPDIVERT
+
/*
* Divert sockets
*/
@@ -380,3 +382,4 @@ release:
m_freem(m);
return (error);
}
+#endif /* IPDIVERT */
diff --git a/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h b/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h
index d2f23d6..b08d674 100644
--- a/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h
+++ b/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h
@@ -223,6 +223,14 @@ int ioctl (int, ioctl_command_t, ...);
struct socket *rtems_bsdnet_fdToSocket(int fd);
+void sysctl_register_all(void *);
+
+void rtems_set_udp_buffer_sizes(u_long, u_long);
+
+void rtems_set_tcp_buffer_sizes(u_long, u_long);
+
+void rtems_set_sb_efficiency(u_long);
+
#ifdef __cplusplus
}
#endif
diff --git a/cpukit/libnetworking/rtems/rtems_dhcp.c b/cpukit/libnetworking/rtems/rtems_dhcp.c
index cb6966d..74ea870 100644
--- a/cpukit/libnetworking/rtems/rtems_dhcp.c
+++ b/cpukit/libnetworking/rtems/rtems_dhcp.c
@@ -80,6 +80,7 @@
#include <string.h>
#include <stdlib.h>
+#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/param.h> /* for MAXHOSTNAMELEN */
diff --git a/cpukit/libnetworking/rtems/rtems_glue.c b/cpukit/libnetworking/rtems/rtems_glue.c
index 38c7fd5..f079a67 100644
--- a/cpukit/libnetworking/rtems/rtems_glue.c
+++ b/cpukit/libnetworking/rtems/rtems_glue.c
@@ -25,6 +25,7 @@
#include <sys/callout.h>
#include <sys/proc.h>
#include <sys/ioctl.h>
+#include <sys/systm.h>
#include <net/if.h>
#include <net/route.h>
#include <netinet/in.h>
@@ -37,11 +38,6 @@
#include "loop.h"
/*
- * Sysctl init all.
- */
-void sysctl_register_all(void *arg);
-
-/*
* Memory allocation
*/
static uint32_t nmbuf = (64L * 1024L) / MSIZE;
@@ -265,13 +261,6 @@ bsd_init (void)
}
/*
- * RTEMS Specific Helper Routines
- */
-extern void rtems_set_udp_buffer_sizes( u_long, u_long );
-extern void rtems_set_tcp_buffer_sizes( u_long, u_long );
-extern void rtems_set_sb_efficiency( u_long );
-
-/*
* Initialize and start network operations
*/
static int
@@ -843,8 +832,11 @@ rtems_bsdnet_log (int priority, const char *fmt, ...)
/*
* IP header checksum routine for processors which don't have an inline version
*/
+
+u_int in_cksum_hdr(const struct ip *);
+
u_int
-in_cksum_hdr (const void *ip)
+in_cksum_hdr (const struct ip *ip)
{
uint32_t sum;
const uint16_t *sp;
diff --git a/cpukit/libnetworking/rtems/rtems_showicmpstat.c b/cpukit/libnetworking/rtems/rtems_showicmpstat.c
index 4ae2fe0..c5ba552 100644
--- a/cpukit/libnetworking/rtems/rtems_showicmpstat.c
+++ b/cpukit/libnetworking/rtems/rtems_showicmpstat.c
@@ -15,6 +15,8 @@
#include <netinet/ip_icmp.h>
#include <netinet/icmp_var.h>
+#include <rtems/rtems_bsdnet.h>
+
/*
* Display ICMP statistics
* Don't lock the rest of the network tasks out while printing.
diff --git a/cpukit/libnetworking/rtems/rtems_showifstat.c b/cpukit/libnetworking/rtems/rtems_showifstat.c
index 8eea7c4..50be6c8 100644
--- a/cpukit/libnetworking/rtems/rtems_showifstat.c
+++ b/cpukit/libnetworking/rtems/rtems_showifstat.c
@@ -17,6 +17,8 @@
#include <netinet/in.h>
#include <arpa/inet.h>
+#include <rtems/rtems_bsdnet.h>
+
/*
* Display an address
*/
diff --git a/cpukit/libnetworking/rtems/rtems_showipstat.c b/cpukit/libnetworking/rtems/rtems_showipstat.c
index e0f6124..1040c71 100644
--- a/cpukit/libnetworking/rtems/rtems_showipstat.c
+++ b/cpukit/libnetworking/rtems/rtems_showipstat.c
@@ -18,6 +18,8 @@
#include <netinet/ip.h>
#include <netinet/ip_var.h>
+#include <rtems/rtems_bsdnet.h>
+
/*
* Display IP statistics
* Don't lock the rest of the network tasks out while printing.
diff --git a/cpukit/libnetworking/rtems/rtems_showmbuf.c b/cpukit/libnetworking/rtems/rtems_showmbuf.c
index 724838d..14aa79e 100644
--- a/cpukit/libnetworking/rtems/rtems_showmbuf.c
+++ b/cpukit/libnetworking/rtems/rtems_showmbuf.c
@@ -10,6 +10,8 @@
#include <sys/proc.h>
#include <sys/mbuf.h>
+#include <rtems/rtems_bsdnet.h>
+
/*
* Display MBUF statistics
* Don't lock the rest of the network tasks out while printing.
diff --git a/cpukit/libnetworking/rtems/rtems_showroute.c b/cpukit/libnetworking/rtems/rtems_showroute.c
index 6080fa3..44b4c3b 100644
--- a/cpukit/libnetworking/rtems/rtems_showroute.c
+++ b/cpukit/libnetworking/rtems/rtems_showroute.c
@@ -29,6 +29,8 @@
#undef random
#include <stdlib.h>
+#include <rtems/rtems_bsdnet.h>
+
/*
* Information per route
*/
diff --git a/cpukit/libnetworking/rtems/rtems_showtcpstat.c b/cpukit/libnetworking/rtems/rtems_showtcpstat.c
index c534acd..403e3c9 100644
--- a/cpukit/libnetworking/rtems/rtems_showtcpstat.c
+++ b/cpukit/libnetworking/rtems/rtems_showtcpstat.c
@@ -20,6 +20,8 @@
#include <netinet/tcp_seq.h>
#include <netinet/tcp_var.h>
+#include <rtems/rtems_bsdnet.h>
+
/*
* Display TCP statistics
* Don't lock the rest of the network tasks out while printing.
diff --git a/cpukit/libnetworking/rtems/rtems_showudpstat.c b/cpukit/libnetworking/rtems/rtems_showudpstat.c
index 0c86e4c..285a5a6 100644
--- a/cpukit/libnetworking/rtems/rtems_showudpstat.c
+++ b/cpukit/libnetworking/rtems/rtems_showudpstat.c
@@ -18,6 +18,8 @@
#include <netinet/udp.h>
#include <netinet/udp_var.h>
+#include <rtems/rtems_bsdnet.h>
+
/*
* Display UDP statistics
* Don't lock the rest of the network tasks out while printing.
diff --git a/cpukit/libnetworking/rtems/rtems_socketpair.c b/cpukit/libnetworking/rtems/rtems_socketpair.c
index 72b8687..55734dd 100644
--- a/cpukit/libnetworking/rtems/rtems_socketpair.c
+++ b/cpukit/libnetworking/rtems/rtems_socketpair.c
@@ -30,6 +30,8 @@
#include <sys/socket.h>
#include <errno.h>
+#include "rtems_syscall.h"
+
int socketpair (int domain, int type, int protocol, int *rsv)
{
if ( !rsv ) {
diff --git a/cpukit/libnetworking/rtems/sghostname.c b/cpukit/libnetworking/rtems/sghostname.c
index 8ac5c58..af383d4 100644
--- a/cpukit/libnetworking/rtems/sghostname.c
+++ b/cpukit/libnetworking/rtems/sghostname.c
@@ -9,6 +9,7 @@
#include <string.h>
#include <errno.h>
+#include <unistd.h>
#include <rtems/rtems_bsdnet.h>
#include <sys/param.h>
#include <sys/malloc.h>
More information about the vc
mailing list