diff options
author | rwatson <rwatson@FreeBSD.org> | 2002-10-23 03:40:47 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2002-10-23 03:40:47 +0000 |
commit | 2450bdb69b00fa80c6300b0490ce491af643f642 (patch) | |
tree | ba267ac92126b0e7888935d05b9dc9213152f167 /sbin/ifconfig/ifconfig.c | |
parent | ca968176795f13707779953f73781557cb143f7d (diff) | |
download | FreeBSD-src-2450bdb69b00fa80c6300b0490ce491af643f642.zip FreeBSD-src-2450bdb69b00fa80c6300b0490ce491af643f642.tar.gz |
Teach ifconfig(8) how to print and set the MAC labels on network
interfaces using the 'mac' argument. Without MAC support in the
kernel, this does not change the behavior of ifconfig.
Approved by: re
Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories
Diffstat (limited to 'sbin/ifconfig/ifconfig.c')
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 49ae26b..53e2563 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -279,6 +279,9 @@ struct cmd { { "nwkey", NEXTARG, set80211nwkey }, /* NetBSD */ { "-nwkey", 0, set80211wep }, /* NetBSD */ #endif +#ifdef USE_MAC + { "mac", NEXTARG, setifmac }, +#endif { "rxcsum", IFCAP_RXCSUM, setifcap }, { "-rxcsum", -IFCAP_RXCSUM, setifcap }, { "txcsum", IFCAP_TXCSUM, setifcap }, @@ -366,6 +369,9 @@ struct afswtch { #ifdef USE_IEEE80211 { "ieee80211", AF_UNSPEC, ieee80211_status, NULL, NULL, }, /* XXX not real!! */ #endif +#ifdef USE_MAC + { "mac", AF_UNSPEC, mac_status, NULL, NULL, }, +#endif #endif { 0, 0, 0, 0 } }; @@ -1145,6 +1151,10 @@ status(const struct afswtch *afp, int addrcount, struct sockaddr_dl *sdl, if (allfamilies || afp->af_status == ieee80211_status) ieee80211_status(s, NULL); #endif +#ifdef USE_MAC + if (allfamilies || afp->af_status == mac_status) + mac_status(s, NULL); +#endif strncpy(ifs.ifs_name, name, sizeof ifs.ifs_name); if (ioctl(s, SIOCGIFSTATUS, &ifs) == 0) printf("%s", ifs.ascii); |