diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-06-06 11:14:21 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-06-07 13:02:20 +0200 |
commit | d4ab0aef967e8d9fc0891d4232284ccefbc05fc6 (patch) | |
tree | 77de719f183bf1bf32f6f489dc81eaee208b69c4 /cpukit/libnetworking/net | |
parent | network: Include <sys/uio.h> explicitly (diff) | |
download | rtems-d4ab0aef967e8d9fc0891d4232284ccefbc05fc6.tar.bz2 |
network: Move RTEMS specifics
Move RTEMS specifics to <rtems/rtems_bsdnet.h>.
Introduce rtems_tap_ifreq. The interface tap support is RTEMS-specific
and only available in the legacy network stack.
Update #2833.
Diffstat (limited to 'cpukit/libnetworking/net')
-rw-r--r-- | cpukit/libnetworking/net/if.c | 9 | ||||
-rw-r--r-- | cpukit/libnetworking/net/if.h | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/cpukit/libnetworking/net/if.c b/cpukit/libnetworking/net/if.c index 740bb90700..b6c73cd002 100644 --- a/cpukit/libnetworking/net/if.c +++ b/cpukit/libnetworking/net/if.c @@ -54,6 +54,9 @@ #include <net/if_types.h> #include <net/if_var.h> #include <net/radix.h> +#ifdef __rtems__ +#include <rtems/rtems_bsdnet.h> +#endif /* __rtems__ */ /* * System initialization @@ -478,6 +481,7 @@ ifunit(char *name) int ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p) { + struct rtems_tap_ifreq *tr; struct ifnet *ifp; struct ifreq *ifr; int error; @@ -488,6 +492,7 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p) case OSIOCGIFCONF: return (ifconf(cmd, data)); } + tr = (struct rtems_tap_ifreq *)data; ifr = (struct ifreq *)data; ifp = ifunit(ifr->ifr_name); if (ifp == 0) @@ -660,11 +665,11 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p) * RTEMS additions for setting/getting `tap' function */ case SIOCSIFTAP: - ifp->if_tap = ifr->ifr_tap; + ifp->if_tap = tr->ifr_tap; return 0; case SIOCGIFTAP: - ifr->ifr_tap = ifp->if_tap; + tr->ifr_tap = ifp->if_tap; return 0; } return (0); diff --git a/cpukit/libnetworking/net/if.h b/cpukit/libnetworking/net/if.h index cfa140bb1c..3bedab4f6f 100644 --- a/cpukit/libnetworking/net/if.h +++ b/cpukit/libnetworking/net/if.h @@ -214,7 +214,6 @@ struct ifreq { int ifru_phys; int ifru_media; caddr_t ifru_data; - int (*ifru_tap)(struct ifnet *, struct ether_header *, struct mbuf *); } ifr_ifru; #define ifr_addr ifr_ifru.ifru_addr /* address */ #define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */ @@ -226,7 +225,6 @@ struct ifreq { #define ifr_phys ifr_ifru.ifru_phys /* physical wire */ #define ifr_media ifr_ifru.ifru_media /* physical media */ #define ifr_data ifr_ifru.ifru_data /* for use by interface */ -#define ifr_tap ifr_ifru.ifru_tap /* tap function */ }; struct ifaliasreq { |