summaryrefslogtreecommitdiffstats
path: root/sys/net/if_media.h
diff options
context:
space:
mode:
authorandre <andre@FreeBSD.org>2006-04-04 20:02:51 +0000
committerandre <andre@FreeBSD.org>2006-04-04 20:02:51 +0000
commitda02059e81ca00b10e3d82d1fd2a32434865b67c (patch)
tree7677b921d0868503885708aa850249a55bbd6626 /sys/net/if_media.h
parentb2f560b56da603c47027a33fadcae456012269cd (diff)
downloadFreeBSD-src-da02059e81ca00b10e3d82d1fd2a32434865b67c.zip
FreeBSD-src-da02059e81ca00b10e3d82d1fd2a32434865b67c.tar.gz
MFC rev. 1.32: Add link status descriptions and related structures for userland
applications. Approved by: re
Diffstat (limited to 'sys/net/if_media.h')
-rw-r--r--sys/net/if_media.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/sys/net/if_media.h b/sys/net/if_media.h
index f387c9c..ccf406c 100644
--- a/sys/net/if_media.h
+++ b/sys/net/if_media.h
@@ -263,6 +263,15 @@ uint64_t ifmedia_baudrate(int);
#define IFM_MSHIFT 16 /* Mode shift */
#define IFM_GMASK 0x0ff00000 /* Global options */
+/* Mask of "status valid" bits, for ifconfig(8). */
+#define IFM_STATUS_VALID IFM_AVALID
+
+/* List of "status valid" bits, for ifconfig(8). */
+#define IFM_STATUS_VALID_LIST { \
+ IFM_AVALID, \
+ 0 \
+}
+
/*
* Status bits
*/
@@ -639,4 +648,33 @@ struct ifmedia_status_description {
{ 0, 0, 0, \
{ NULL, NULL } } \
}
+/*
+ * Status descriptions for the various media types.
+ */
+struct ifmedia_status_description {
+ int ifms_type;
+ int ifms_valid;
+ int ifms_bit;
+ const char *ifms_string[2];
+};
+
+#define IFM_STATUS_DESC(ifms, bit) \
+ (ifms)->ifms_string[((ifms)->ifms_bit & (bit)) ? 1 : 0]
+
+#define IFM_STATUS_DESCRIPTIONS { \
+ { IFM_ETHER, IFM_AVALID, IFM_ACTIVE, \
+ { "no carrier", "active" } }, \
+ { IFM_FDDI, IFM_AVALID, IFM_ACTIVE, \
+ { "no ring", "inserted" } }, \
+ { IFM_TOKEN, IFM_AVALID, IFM_ACTIVE, \
+ { "no ring", "inserted" } }, \
+ { IFM_IEEE80211, IFM_AVALID, IFM_ACTIVE, \
+ { "no network", "active" } }, \
+ { IFM_ATM, IFM_AVALID, IFM_ACTIVE, \
+ { "no network", "active" } }, \
+ { IFM_CARP, IFM_AVALID, IFM_ACTIVE, \
+ { "backup", "master" } }, \
+ { 0, 0, 0, \
+ { NULL, NULL } } \
+}
#endif /* _NET_IF_MEDIA_H_ */
OpenPOWER on IntegriCloud