summaryrefslogtreecommitdiffstats
path: root/sys/net/if.h
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-06-19 18:42:31 +0000
committerphk <phk@FreeBSD.org>1999-06-19 18:42:31 +0000
commit1048fa73010ca9dfb0cfba83b166fcfa2ef994be (patch)
tree32836c1e0c0e6d5d181e3dd1260ec5097dfa0a32 /sys/net/if.h
parentd99f3d7a9346a2099e09e6afbacee7bffacdbdaa (diff)
downloadFreeBSD-src-1048fa73010ca9dfb0cfba83b166fcfa2ef994be.zip
FreeBSD-src-1048fa73010ca9dfb0cfba83b166fcfa2ef994be.tar.gz
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
Diffstat (limited to 'sys/net/if.h')
-rw-r--r--sys/net/if.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/net/if.h b/sys/net/if.h
index a639bc2..13048b0 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: if.h,v 1.52 1999/05/08 07:00:04 phk Exp $
+ * $Id: if.h,v 1.53 1999/06/06 09:17:51 phk Exp $
*/
#ifndef _NET_IF_H_
@@ -197,6 +197,20 @@ struct ifmediareq {
int ifm_count; /* # entries in ifm_ulist array */
int *ifm_ulist; /* media words */
};
+
+/*
+ * Structure used to retrieve aux status data from interfaces.
+ * kernel suppliers to this interface should respect the formatting
+ * needed by ifconfig(8): each line starts with a TAB and ends with
+ * a newline. The canonical example to copy&past is in if_tun.c
+ */
+
+#define IFSTATMAX 800 /* 10 lines of text */
+struct ifstat {
+ char ifs_name[IFNAMSIZ]; /* if name, e.g. "en0" */
+ char ascii[IFSTATMAX+1];
+};
+
/*
* Structure used in SIOCGIFCONF request.
* Used to retrieve interface configuration
OpenPOWER on IntegriCloud