forked from Imagelibrary/rtems
2005-04-18 Ralf Corsepius <ralf.corsepius@rtems.org>
* libnetworking/net/ethernet.h: Add RTEMS outdated either_input. * libnetworking/net/if.c: Partial update from FreeBSD. * libnetworking/net/if_ethersubr.c: Partial update from FreeBSD.
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
2005-04-18 Ralf Corsepius <ralf.corsepius@rtems.org>
|
2005-04-18 Ralf Corsepius <ralf.corsepius@rtems.org>
|
||||||
|
|
||||||
|
* libnetworking/net/ethernet.h: Add RTEMS outdated either_input.
|
||||||
|
* libnetworking/net/if.c: Partial update from FreeBSD.
|
||||||
|
* libnetworking/net/if_ethersubr.c: Partial update from FreeBSD.
|
||||||
* libnetworking/net/if_var.h: New (extracted from net/if.h).
|
* libnetworking/net/if_var.h: New (extracted from net/if.h).
|
||||||
* libnetworking/Makefile.am: Add net/if_var.h.
|
* libnetworking/Makefile.am: Add net/if_var.h.
|
||||||
|
|
||||||
|
|||||||
@@ -361,6 +361,7 @@ extern void ether_demux(struct ifnet *, struct mbuf *);
|
|||||||
extern void ether_ifattach(struct ifnet *);
|
extern void ether_ifattach(struct ifnet *);
|
||||||
extern void ether_ifdetach(struct ifnet *);
|
extern void ether_ifdetach(struct ifnet *);
|
||||||
extern int ether_ioctl(struct ifnet *, int, caddr_t);
|
extern int ether_ioctl(struct ifnet *, int, caddr_t);
|
||||||
|
extern void ether_input (struct ifnet *, struct ether_header *, struct mbuf *);
|
||||||
extern int ether_output(struct ifnet *,
|
extern int ether_output(struct ifnet *,
|
||||||
struct mbuf *, struct sockaddr *, struct rtentry *);
|
struct mbuf *, struct sockaddr *, struct rtentry *);
|
||||||
extern int ether_output_frame(struct ifnet *, struct mbuf *);
|
extern int ether_output_frame(struct ifnet *, struct mbuf *);
|
||||||
|
|||||||
@@ -51,6 +51,7 @@
|
|||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
#include <net/if_dl.h>
|
#include <net/if_dl.h>
|
||||||
#include <net/if_types.h>
|
#include <net/if_types.h>
|
||||||
|
#include <net/if_var.h>
|
||||||
#include <net/radix.h>
|
#include <net/radix.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -79,8 +80,7 @@ struct ifnet *ifnet;
|
|||||||
*/
|
*/
|
||||||
/* ARGSUSED*/
|
/* ARGSUSED*/
|
||||||
void
|
void
|
||||||
ifinit(dummy)
|
ifinit(void *dummy)
|
||||||
void *dummy;
|
|
||||||
{
|
{
|
||||||
struct ifnet *ifp;
|
struct ifnet *ifp;
|
||||||
|
|
||||||
@@ -475,7 +475,7 @@ ifunit(char *name)
|
|||||||
* Interface ioctls.
|
* Interface ioctls.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
ifioctl(struct socket *so, int cmd, caddr_t data, struct proc *p)
|
ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p)
|
||||||
{
|
{
|
||||||
struct ifnet *ifp;
|
struct ifnet *ifp;
|
||||||
struct ifreq *ifr;
|
struct ifreq *ifr;
|
||||||
@@ -582,7 +582,7 @@ ifioctl(struct socket *so, int cmd, caddr_t data, struct proc *p)
|
|||||||
error = suser(p->p_ucred, &p->p_acflag);
|
error = suser(p->p_ucred, &p->p_acflag);
|
||||||
if (error)
|
if (error)
|
||||||
return (error);
|
return (error);
|
||||||
if (ifp->if_ioctl == 0)
|
if (ifp->if_ioctl == NULL)
|
||||||
return (EOPNOTSUPP);
|
return (EOPNOTSUPP);
|
||||||
error = (*ifp->if_ioctl)(ifp, cmd, data);
|
error = (*ifp->if_ioctl)(ifp, cmd, data);
|
||||||
if (error == 0)
|
if (error == 0)
|
||||||
@@ -590,7 +590,7 @@ ifioctl(struct socket *so, int cmd, caddr_t data, struct proc *p)
|
|||||||
return error;
|
return error;
|
||||||
|
|
||||||
case SIOCGIFMEDIA:
|
case SIOCGIFMEDIA:
|
||||||
if (ifp->if_ioctl == 0)
|
if (ifp->if_ioctl == NULL)
|
||||||
return (EOPNOTSUPP);
|
return (EOPNOTSUPP);
|
||||||
return ((*ifp->if_ioctl)(ifp, cmd, data));
|
return ((*ifp->if_ioctl)(ifp, cmd, data));
|
||||||
|
|
||||||
|
|||||||
@@ -520,14 +520,14 @@ ether_input(ifp, eh, m)
|
|||||||
* is protected by the RTEMS network mutex.
|
* is protected by the RTEMS network mutex.
|
||||||
*/
|
*/
|
||||||
char *
|
char *
|
||||||
ether_sprintf(const u_int8_t *addr)
|
ether_sprintf(const u_char *ap)
|
||||||
{
|
{
|
||||||
static char buf[32];
|
static char buf[32];
|
||||||
char *b = buf;
|
char *b = buf;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < ETHER_ADDR_LEN; i++, b+=3)
|
for (i = 0; i < ETHER_ADDR_LEN; i++, b+=3)
|
||||||
sprintf(b, "%02x:", *addr++);
|
sprintf(b, "%02x:", *ap++);
|
||||||
*--b = '\0';
|
*--b = '\0';
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
@@ -848,7 +848,7 @@ ether_ioctl(struct ifnet *ifp, int command, caddr_t data)
|
|||||||
*/
|
*/
|
||||||
case AF_IPX:
|
case AF_IPX:
|
||||||
{
|
{
|
||||||
register struct ipx_addr *ina = &(IA_SIPX(ifa)->sipx_addr);
|
struct ipx_addr *ina = &(IA_SIPX(ifa)->sipx_addr);
|
||||||
struct arpcom *ac = (struct arpcom *) (ifp->if_softc);
|
struct arpcom *ac = (struct arpcom *) (ifp->if_softc);
|
||||||
|
|
||||||
if (ipx_nullhost(*ina))
|
if (ipx_nullhost(*ina))
|
||||||
|
|||||||
Reference in New Issue
Block a user