diff options
author | harti <harti@FreeBSD.org> | 2003-04-29 17:23:23 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2003-04-29 17:23:23 +0000 |
commit | 7cb80f0d91bac91209aee934234d22b21cd84f6d (patch) | |
tree | 6d09fc1dfe94350d3a19d15b2d28906d297f782e /sbin | |
parent | 0ab2dac10866e26ec79c2a544b010a6e9a09b8b5 (diff) | |
download | FreeBSD-src-7cb80f0d91bac91209aee934234d22b21cd84f6d.zip FreeBSD-src-7cb80f0d91bac91209aee934234d22b21cd84f6d.tar.gz |
Add media types and options for ATM. While on most ATM cards media cannot
be changed, it is very convenient to be able to toggle SDH/Sonet,
idle/unassigned cells and scrambled mode and to see the carrier
state.
Reviewed by: -arch (if_media.h definitions)
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ifconfig/ifmedia.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/sbin/ifconfig/ifmedia.c b/sbin/ifconfig/ifmedia.c index fe85b14..e1b3d39 100644 --- a/sbin/ifconfig/ifmedia.c +++ b/sbin/ifconfig/ifmedia.c @@ -159,6 +159,14 @@ media_status(int s, struct rt_addrinfo *info __unused) else printf("no ring"); break; + + case IFM_ATM: + if (ifmr.ifm_status & IFM_ACTIVE) + printf("active"); + else + printf("no carrier"); + break; + case IFM_IEEE80211: /* XXX: Different value for adhoc? */ if (ifmr.ifm_status & IFM_ACTIVE) @@ -370,6 +378,15 @@ static struct ifmedia_description ifm_subtype_ieee80211_option_descriptions[] = struct ifmedia_description ifm_subtype_ieee80211_mode_descriptions[] = IFM_SUBTYPE_IEEE80211_MODE_DESCRIPTIONS; +static struct ifmedia_description ifm_subtype_atm_descriptions[] = + IFM_SUBTYPE_ATM_DESCRIPTIONS; + +static struct ifmedia_description ifm_subtype_atm_aliases[] = + IFM_SUBTYPE_ATM_ALIASES; + +static struct ifmedia_description ifm_subtype_atm_option_descriptions[] = + IFM_SUBTYPE_ATM_OPTION_DESCRIPTIONS; + static struct ifmedia_description ifm_subtype_shared_descriptions[] = IFM_SUBTYPE_SHARED_DESCRIPTIONS; @@ -465,6 +482,23 @@ static struct ifmedia_type_to_subtype ifmedia_types_to_subtypes[] = { { NULL, 0 }, }, }, + { + { + { &ifm_subtype_shared_descriptions[0], 0 }, + { &ifm_subtype_shared_aliases[0], 1 }, + { &ifm_subtype_atm_descriptions[0], 0 }, + { &ifm_subtype_atm_aliases[0], 1 }, + { NULL, 0 }, + }, + { + { &ifm_shared_option_descriptions[0], 0 }, + { &ifm_subtype_atm_option_descriptions[0], 0 }, + { NULL, 0 }, + }, + { + { NULL, 0 }, + }, + }, }; static int |