From 1048fa73010ca9dfb0cfba83b166fcfa2ef994be Mon Sep 17 00:00:00 2001 From: phk Date: Sat, 19 Jun 1999 18:42:31 +0000 Subject: Add a new interface ioctl, to return "aux status". This is inteded for to allow ifconfig to print various unstructured information from an interface. The data is returned from the kernel in ASCII form, see the comment in if.h for some technicalities. Canonical cut&paste example to be found in if_tun.c Initial use: Now tun* interfaces tell the PID of the process which opened them. Future uses could be (volounteers welcome!): Have ppp/slip interfaces tell which tty they use. Make sync interfaces return their media state: red/yellow/blue alarm, timeslot assignment and so on. Make ethernets warn about missing heartbeats and/or cables --- sys/net/if.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sys/net/if.c') diff --git a/sys/net/if.c b/sys/net/if.c index d51afcd..c6f5c5e 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.71 1999/06/06 09:17:49 phk Exp $ + * $Id: if.c,v 1.72 1999/06/06 09:28:01 phk Exp $ */ #include "opt_compat.h" @@ -604,6 +604,7 @@ ifioctl(so, cmd, data, p) { register struct ifnet *ifp; register struct ifreq *ifr; + struct ifstat *ifs; int error; switch (cmd) { @@ -731,6 +732,10 @@ ifioctl(so, cmd, data, p) getmicrotime(&ifp->if_lastchange); return error; + case SIOCGIFSTATUS: + ifs = (struct ifstat *)data; + ifs->ascii[0] = '\0'; + case SIOCGIFMEDIA: case SIOCGIFGENERIC: if (ifp->if_ioctl == 0) -- cgit v1.1