diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-03-25 07:37:30 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-03-25 07:37:30 +0000 |
commit | f46bfe93fe70beae8f5c44a1b619f0e4e4c96fbe (patch) | |
tree | 3a56714113f45a63bcbe077fccc3dab2367a777f /sys | |
parent | 6bf8a14cc6e854e9823512250f69523fba92974b (diff) |
add SIOCGIFDATA; fetches ifdata structure attached to each interface
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if.c | 7 | ||||
-rw-r--r-- | sys/sys/sockio.h | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index fe46db122a6..301b1007507 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.15 1997/12/31 04:09:32 mickey Exp $ */ +/* $OpenBSD: if.c,v 1.16 1998/03/25 07:37:29 deraadt Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -468,6 +468,11 @@ ifioctl(so, cmd, data, p) ifr->ifr_metric = ifp->if_metric; break; + case SIOCGIFDATA: + error = copyout((caddr_t)&ifp->if_data, ifr->ifr_data, + sizeof(ifp->if_data)); + break; + case SIOCSIFFLAGS: if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) return (error); diff --git a/sys/sys/sockio.h b/sys/sys/sockio.h index 2c3b20411e3..f59dc4c096c 100644 --- a/sys/sys/sockio.h +++ b/sys/sys/sockio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sockio.h,v 1.2 1996/03/03 12:12:21 niklas Exp $ */ +/* $OpenBSD: sockio.h,v 1.3 1998/03/25 07:37:26 deraadt Exp $ */ /* $NetBSD: sockio.h,v 1.5 1995/08/23 00:40:47 thorpej Exp $ */ /*- @@ -73,6 +73,7 @@ #define SIOCSIFMETRIC _IOW('i', 24, struct ifreq) /* set IF metric */ #define SIOCDIFADDR _IOW('i', 25, struct ifreq) /* delete IF addr */ #define SIOCAIFADDR _IOW('i', 26, struct ifaliasreq)/* add/chg IF alias */ +#define SIOCGIFDATA _IOWR('i', 27, struct ifreq) /* get if_data */ #define SIOCADDMULTI _IOW('i', 49, struct ifreq) /* add m'cast addr */ #define SIOCDELMULTI _IOW('i', 50, struct ifreq) /* del m'cast addr */ |