diff options
author | peter <peter@FreeBSD.org> | 1997-05-03 21:07:13 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1997-05-03 21:07:13 +0000 |
commit | 97edcdf2f7e8f7cd5dc81bd510475b99b2df57ea (patch) | |
tree | 50b98afac73dc25b58e1fe305c05266a7f57d13f /sys | |
parent | feda6c95bd3113d5ced651679773a7116c70b5fb (diff) | |
download | FreeBSD-src-97edcdf2f7e8f7cd5dc81bd510475b99b2df57ea.zip FreeBSD-src-97edcdf2f7e8f7cd5dc81bd510475b99b2df57ea.tar.gz |
add SIOC{S,G}IFMEDIA ioctl support
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if.c | 18 | ||||
-rw-r--r-- | sys/net/if.h | 13 |
2 files changed, 29 insertions, 2 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 115cd64..017cf32 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if.c 8.3 (Berkeley) 1/4/94 - * $Id: if.c,v 1.46 1997/03/24 11:33:08 bde Exp $ + * $Id: if.c,v 1.47 1997/04/27 20:00:56 wollman Exp $ */ #include <sys/param.h> @@ -593,6 +593,22 @@ ifioctl(so, cmd, data, p) microtime(&ifp->if_lastchange); return error; + case SIOCSIFMEDIA: + error = suser(p->p_ucred, &p->p_acflag); + if (error) + return (error); + if (ifp->if_ioctl == 0) + return (EOPNOTSUPP); + error = (*ifp->if_ioctl)(ifp, cmd, data); + if (error == 0) + microtime(&ifp->if_lastchange); + return error; + + case SIOCGIFMEDIA: + if (ifp->if_ioctl == 0) + return (EOPNOTSUPP); + return ((*ifp->if_ioctl)(ifp, cmd, data)); + default: if (so->so_proto == 0) return (EOPNOTSUPP); diff --git a/sys/net/if.h b/sys/net/if.h index f3121aa..2646625 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if.h 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: if.h,v 1.45 1997/02/22 09:40:58 peter Exp $ */ #ifndef _NET_IF_H_ @@ -153,6 +153,7 @@ struct ifreq { int ifru_metric; int ifru_mtu; int ifru_phys; + int ifru_media; caddr_t ifru_data; } ifr_ifru; #define ifr_addr ifr_ifru.ifru_addr /* address */ @@ -162,6 +163,7 @@ struct ifreq { #define ifr_metric ifr_ifru.ifru_metric /* metric */ #define ifr_mtu ifr_ifru.ifru_mtu /* mtu */ #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 */ }; @@ -172,6 +174,15 @@ struct ifaliasreq { struct sockaddr ifra_mask; }; +struct ifmediareq { + char ifm_name[IFNAMSIZ]; /* if name, e.g. "en0" */ + int ifm_current; /* current media options */ + int ifm_mask; /* don't care mask */ + int ifm_status; /* media status */ + int ifm_active; /* active options */ + int ifm_count; /* # entries in ifm_ulist array */ + int *ifm_ulist; /* media words */ +}; /* * Structure used in SIOCGIFCONF request. * Used to retrieve interface configuration |