[netdrivers] Updated mii-diag.c v2.09 9/06/2003
Donald Becker
becker@scyld.com
Sat Sep 6 14:09:46 2003
[[ I suggst distributions install 'mii-diag' with the name 'netif-config' ]]
Added mii-diag.8, a manual page for 'mii-diag'.
mii-diag.c:v2.09 9/06/2003 Donald Becker (becker@scyld.com)
Added '--monitor' option to allow scripting link beat changes.
This option is similar to --watch, but with lower overhead and simplifed
output. It polls the interface only once a second and the output format
is a single line per link change with three fixed words
<unknown|down||negotiating|up> <STATUS> <PARTNER-CAP>
Example output: mii-diag --monitor eth0
down 0x7809 0x0000
negotiating 0x7829 0x45e1
up 0x782d 0x45e1
down 0x7809 0x0000
This may be used as
mii-diag --monitor eth0 | while read linkstatus bmsr linkpar; do
case $linkstatus in
up) ifup eth0 ;;
down) ifdown eth0 ;;
esac
done
Note that it may be useful to add the following to /etc/sysconfig/network
DHCPCDARGS="-t 3"
Other changes in this version are
Added to the usage message.
Corrected the exit(-1) calls to exit with a positive value.
Use 'weak' function declarations to work even if libmii is not linked.
--
Donald Becker becker@scyld.com
Scyld Computing Corporation http://www.scyld.com
914 Bay Ridge Road, Suite 220 Scyld Beowulf cluster system
Annapolis MD 21403 410-990-9993