Add generic part of generic multiple-physical-interface support (the

successor of IFF_ALTPHYS).
This commit is contained in:
Garrett Wollman 1994-12-21 22:57:05 +00:00
parent b67268cfbc
commit 074c4a4e2e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=5184
3 changed files with 18 additions and 3 deletions

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)if.c 8.3 (Berkeley) 1/4/94
* $Id: if.c,v 1.9 1994/10/08 01:40:20 phk Exp $
* $Id: if.c,v 1.10 1994/11/10 18:49:23 guido Exp $
*/
#include <sys/param.h>
@ -496,6 +496,10 @@ ifioctl(so, cmd, data, p)
ifr->ifr_mtu = ifp->if_mtu;
break;
case SIOCGIFPHYS:
ifr->ifr_phys = ifp->if_physical;
break;
case SIOCSIFFLAGS:
error = suser(p->p_ucred, &p->p_acflag);
if (error)
@ -523,6 +527,13 @@ ifioctl(so, cmd, data, p)
ifp->if_metric = ifr->ifr_metric;
break;
case SIOCSIFPHYS:
error = suser(p->p_ucred, &p->p_acflag);
if (error) return error;
if (!ifp->if_ioctl) return EOPNOTSUPP;
return ifp->if_ioctl(ifp, cmd, data);
case SIOCSIFMTU:
error = suser(p->p_ucred, &p->p_acflag);
if (error)

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)if.h 8.1 (Berkeley) 6/10/93
* $Id: if.h,v 1.11 1994/12/13 22:31:44 wollman Exp $
* $Id: if.h,v 1.12 1994/12/21 18:03:41 wollman Exp $
*/
#ifndef _NET_IF_H_
@ -304,6 +304,7 @@ struct ifreq {
short ifru_flags;
int ifru_metric;
int ifru_mtu;
int ifru_phys;
caddr_t ifru_data;
} ifr_ifru;
#define ifr_addr ifr_ifru.ifru_addr /* address */
@ -312,6 +313,7 @@ struct ifreq {
#define ifr_flags ifr_ifru.ifru_flags /* flags */
#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_data ifr_ifru.ifru_data /* for use by interface */
};

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)sockio.h 8.1 (Berkeley) 3/28/94
* $Id: sockio.h,v 1.3 1994/08/08 10:49:26 davidg Exp $
* $Id: sockio.h,v 1.4 1994/09/06 22:42:31 wollman Exp $
*/
#ifndef _SYS_SOCKIO_H_
@ -81,5 +81,7 @@
#define SIOCDELMULTI _IOW('i', 50, struct ifreq) /* del m'cast addr */
#define SIOCGIFMTU _IOWR('i', 51, struct ifreq) /* get IF mtu */
#define SIOCSIFMTU _IOW('i', 52, struct ifreq) /* set IF mtu */
#define SIOCGIFPHYS _IOWR('i', 53, struct ifreq) /* get IF wire */
#define SIOCSIFPHYS _IOW('i', 54, struct ifreq) /* set IF wire */
#endif /* !_SYS_SOCKIO_H_ */