[rtems commit] network: Header file compatiblity

Sebastian Huber sebh at rtems.org
Wed Jun 7 13:29:21 UTC 2017


Module:    rtems
Branch:    master
Commit:    26ccd139dc42c0abaafd5532729cb7d32afac9cf
Changeset: http://git.rtems.org/rtems/commit/?id=26ccd139dc42c0abaafd5532729cb7d32afac9cf

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Jun  7 07:24:00 2017 +0200

network: Header file compatiblity

Move legacy network stack implementation specifics to
<rtems/rtems_bsdnet_internal.h>.  Include missing header files.  Add
interface flags compatibility.

Update #2833.

---

 cpukit/libnetworking/include/net/if.h              |  8 ++----
 cpukit/libnetworking/include/netinet/tcp.h         | 15 -----------
 cpukit/libnetworking/net/if_arp.h                  |  1 +
 cpukit/libnetworking/net/if_ethersubr.c            |  1 +
 cpukit/libnetworking/net/rtsock.c                  |  1 +
 cpukit/libnetworking/netinet/ip_fw.c               |  1 +
 cpukit/libnetworking/netinet/tcp_input.c           |  1 +
 cpukit/libnetworking/nfs/bootp_subr.c              |  1 +
 cpukit/libnetworking/rtems/rtems_bsdnet_internal.h | 29 ++++++++++++++++++++++
 cpukit/libnetworking/rtems/rtems_showifstat.c      |  1 +
 cpukit/libnetworking/rtems/rtems_showroute.c       |  1 +
 11 files changed, 39 insertions(+), 21 deletions(-)

diff --git a/cpukit/libnetworking/include/net/if.h b/cpukit/libnetworking/include/net/if.h
index 3bedab4..241d51c 100644
--- a/cpukit/libnetworking/include/net/if.h
+++ b/cpukit/libnetworking/include/net/if.h
@@ -124,11 +124,11 @@ struct if_data {
 #define	IFF_LOOPBACK	0x8		/* is a loopback net */
 #define	IFF_POINTOPOINT	0x10		/* interface is point-to-point link */
 #define	IFF_SMART	0x20		/* interface manages own routes */
-#define	IFF_RUNNING	0x40		/* resources allocated */
+#define	IFF_DRV_RUNNING	0x40		/* resources allocated */
 #define	IFF_NOARP	0x80		/* no address resolution protocol */
 #define	IFF_PROMISC	0x100		/* receive all packets */
 #define	IFF_ALLMULTI	0x200		/* receive all multicast packets */
-#define	IFF_OACTIVE	0x400		/* tx hardware queue is full */
+#define	IFF_DRV_OACTIVE	0x400		/* tx hardware queue is full */
 #define	IFF_SIMPLEX	0x800		/* can't hear own transmissions */
 #define	IFF_LINK0	0x1000		/* per link layer defined bit */
 #define	IFF_LINK1	0x2000		/* per link layer defined bit */
@@ -292,10 +292,6 @@ __END_DECLS
 /* XXX - this should go away soon. */
 #include <net/if_var.h>
 
-void	ifafree(struct ifaddr *);
-
-int	looutput(struct ifnet *,
-	   struct mbuf *, struct sockaddr *, struct rtentry *);
 #endif
 
 #endif /* !_NET_IF_H_ */
diff --git a/cpukit/libnetworking/include/netinet/tcp.h b/cpukit/libnetworking/include/netinet/tcp.h
index 2262803..9df1b7e 100644
--- a/cpukit/libnetworking/include/netinet/tcp.h
+++ b/cpukit/libnetworking/include/netinet/tcp.h
@@ -44,8 +44,6 @@ typedef	u_int32_t tcp_seq;
 #define tcp6_seq	tcp_seq	/* for KAME src sync over BSD*'s */
 #define tcp6hdr		tcphdr	/* for KAME src sync over BSD*'s */
 
-typedef u_long	tcp_cc;			/* connection count per rfc1644 */
-
 /*
  * TCP header.
  * Per RFC 793, September, 1981.
@@ -91,19 +89,6 @@ struct tcphdr {
 #define TCPOPT_TIMESTAMP	8L
 #define    TCPOLEN_TIMESTAMP		10L
 #define    TCPOLEN_TSTAMP_APPA		(uint32_t)(TCPOLEN_TIMESTAMP+2) /* appendix A */
-#define    TCPOPT_TSTAMP_HDR		\
-    (uint32_t)(((uint32_t)TCPOPT_NOP<<24)| \
-               ((uint32_t)TCPOPT_NOP<<16)| \
-               ((uint32_t)TCPOPT_TIMESTAMP<<8)| \
-               ((uint32_t)TCPOLEN_TIMESTAMP))
-
-#define	TCPOPT_CC		11		/* CC options: RFC-1644 */
-#define TCPOPT_CCNEW		12
-#define TCPOPT_CCECHO		13
-#define	   TCPOLEN_CC			6
-#define	   TCPOLEN_CC_APPA		(TCPOLEN_CC+2)
-#define	   TCPOPT_CC_HDR(ccopt)		\
-    (TCPOPT_NOP<<24|TCPOPT_NOP<<16|(ccopt)<<8|TCPOLEN_CC)
 
 /*
  * Default maximum segment size for TCP.
diff --git a/cpukit/libnetworking/net/if_arp.h b/cpukit/libnetworking/net/if_arp.h
index 7654678..7fbd36f 100644
--- a/cpukit/libnetworking/net/if_arp.h
+++ b/cpukit/libnetworking/net/if_arp.h
@@ -100,6 +100,7 @@ struct arpreq {
 #define	ATF_USETRAILERS	0x10	/* has requested trailers */
 
 #ifdef _KERNEL
+#include <net/if_var.h>
 /*
  * Structure shared between the ethernet driver modules and
  * the address resolution code.  For example, each ec_softc or il_softc
diff --git a/cpukit/libnetworking/net/if_ethersubr.c b/cpukit/libnetworking/net/if_ethersubr.c
index 0b87632..5771d1d 100644
--- a/cpukit/libnetworking/net/if_ethersubr.c
+++ b/cpukit/libnetworking/net/if_ethersubr.c
@@ -56,6 +56,7 @@
 #include <sys/sysctl.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_arp.h>
 #include <net/netisr.h>
 #include <net/route.h>
diff --git a/cpukit/libnetworking/net/rtsock.c b/cpukit/libnetworking/net/rtsock.c
index 5a03122..d0d46b3 100644
--- a/cpukit/libnetworking/net/rtsock.c
+++ b/cpukit/libnetworking/net/rtsock.c
@@ -48,6 +48,7 @@
 #include <sys/protosw.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/route.h>
 #include <net/raw_cb.h>
 
diff --git a/cpukit/libnetworking/netinet/ip_fw.c b/cpukit/libnetworking/netinet/ip_fw.c
index 5c6be50..4c19d49 100644
--- a/cpukit/libnetworking/netinet/ip_fw.c
+++ b/cpukit/libnetworking/netinet/ip_fw.c
@@ -35,6 +35,7 @@
 #include <sys/time.h>
 #include <sys/sysctl.h>
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/route.h>
 #include <netinet/in.h>
 #include <rtems/rtems_netinet_in.h>
diff --git a/cpukit/libnetworking/netinet/tcp_input.c b/cpukit/libnetworking/netinet/tcp_input.c
index caedc64..ee76d63 100644
--- a/cpukit/libnetworking/netinet/tcp_input.c
+++ b/cpukit/libnetworking/netinet/tcp_input.c
@@ -52,6 +52,7 @@
 #include <machine/cpu.h>	/* before tcp_seq.h, for tcp_random18() */
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/route.h>
 
 #include <netinet/in.h>
diff --git a/cpukit/libnetworking/nfs/bootp_subr.c b/cpukit/libnetworking/nfs/bootp_subr.c
index 484a6b5..3e71e95 100644
--- a/cpukit/libnetworking/nfs/bootp_subr.c
+++ b/cpukit/libnetworking/nfs/bootp_subr.c
@@ -55,6 +55,7 @@
 #include <sys/uio.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/route.h>
 
 #include <netinet/in.h>
diff --git a/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h b/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h
index 9608996..d103c56 100644
--- a/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h
+++ b/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h
@@ -249,6 +249,35 @@ void rtems_set_tcp_buffer_sizes(u_long, u_long);
 
 void rtems_set_sb_efficiency(u_long);
 
+#define IFF_OACTIVE IFF_DRV_OACTIVE
+#define IFF_RUNNING IFF_DRV_RUNNING
+
+struct ifaddr;
+void	ifafree(struct ifaddr *);
+
+struct ifnet;
+struct mbuf;
+struct sockaddr;
+struct rtentry;
+int	looutput(struct ifnet *,
+	   struct mbuf *, struct sockaddr *, struct rtentry *);
+
+typedef u_long	tcp_cc;			/* connection count per rfc1644 */
+
+#define    TCPOPT_TSTAMP_HDR		\
+    (uint32_t)(((uint32_t)TCPOPT_NOP<<24)| \
+               ((uint32_t)TCPOPT_NOP<<16)| \
+               ((uint32_t)TCPOPT_TIMESTAMP<<8)| \
+               ((uint32_t)TCPOLEN_TIMESTAMP))
+
+#define	TCPOPT_CC		11		/* CC options: RFC-1644 */
+#define TCPOPT_CCNEW		12
+#define TCPOPT_CCECHO		13
+#define	   TCPOLEN_CC			6
+#define	   TCPOLEN_CC_APPA		(TCPOLEN_CC+2)
+#define	   TCPOPT_CC_HDR(ccopt)		\
+    (TCPOPT_NOP<<24|TCPOPT_NOP<<16|(ccopt)<<8|TCPOLEN_CC)
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/cpukit/libnetworking/rtems/rtems_showifstat.c b/cpukit/libnetworking/rtems/rtems_showifstat.c
index a936cf7..d13efa6 100644
--- a/cpukit/libnetworking/rtems/rtems_showifstat.c
+++ b/cpukit/libnetworking/rtems/rtems_showifstat.c
@@ -12,6 +12,7 @@
 #include <sys/sockio.h>
 #include <sys/mbuf.h>
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_dl.h>
 #include <net/if_types.h>
 #include <netinet/in.h>
diff --git a/cpukit/libnetworking/rtems/rtems_showroute.c b/cpukit/libnetworking/rtems/rtems_showroute.c
index 30545d2..fb85ff2 100644
--- a/cpukit/libnetworking/rtems/rtems_showroute.c
+++ b/cpukit/libnetworking/rtems/rtems_showroute.c
@@ -14,6 +14,7 @@
 #include <sys/domain.h>
 
 #include <net/if.h>
+#include <net/if_var.h>
 #include <net/if_dl.h>
 #include <net/route.h>
 



More information about the vc mailing list