From 26ccd139dc42c0abaafd5532729cb7d32afac9cf Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 7 Jun 2017 07:24:00 +0200 Subject: network: Header file compatiblity Move legacy network stack implementation specifics to . 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 3bedab4f6f..241d51c5e5 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 -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 2262803b5e..9df1b7e88f 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 76546784b6..7fbd36fcbb 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 /* * 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 0b87632318..5771d1dc35 100644 --- a/cpukit/libnetworking/net/if_ethersubr.c +++ b/cpukit/libnetworking/net/if_ethersubr.c @@ -56,6 +56,7 @@ #include #include +#include #include #include #include diff --git a/cpukit/libnetworking/net/rtsock.c b/cpukit/libnetworking/net/rtsock.c index 5a031221b1..d0d46b3a84 100644 --- a/cpukit/libnetworking/net/rtsock.c +++ b/cpukit/libnetworking/net/rtsock.c @@ -48,6 +48,7 @@ #include #include +#include #include #include diff --git a/cpukit/libnetworking/netinet/ip_fw.c b/cpukit/libnetworking/netinet/ip_fw.c index 5c6be50e96..4c19d4992e 100644 --- a/cpukit/libnetworking/netinet/ip_fw.c +++ b/cpukit/libnetworking/netinet/ip_fw.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include diff --git a/cpukit/libnetworking/netinet/tcp_input.c b/cpukit/libnetworking/netinet/tcp_input.c index caedc649fc..ee76d63156 100644 --- a/cpukit/libnetworking/netinet/tcp_input.c +++ b/cpukit/libnetworking/netinet/tcp_input.c @@ -52,6 +52,7 @@ #include /* before tcp_seq.h, for tcp_random18() */ #include +#include #include #include diff --git a/cpukit/libnetworking/nfs/bootp_subr.c b/cpukit/libnetworking/nfs/bootp_subr.c index 484a6b5d72..3e71e95e08 100644 --- a/cpukit/libnetworking/nfs/bootp_subr.c +++ b/cpukit/libnetworking/nfs/bootp_subr.c @@ -55,6 +55,7 @@ #include #include +#include #include #include diff --git a/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h b/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h index 9608996078..d103c56153 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 a936cf7458..d13efa6129 100644 --- a/cpukit/libnetworking/rtems/rtems_showifstat.c +++ b/cpukit/libnetworking/rtems/rtems_showifstat.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include diff --git a/cpukit/libnetworking/rtems/rtems_showroute.c b/cpukit/libnetworking/rtems/rtems_showroute.c index 30545d26d1..fb85ff2d3c 100644 --- a/cpukit/libnetworking/rtems/rtems_showroute.c +++ b/cpukit/libnetworking/rtems/rtems_showroute.c @@ -14,6 +14,7 @@ #include #include +#include #include #include -- cgit v1.2.3