#! /bin/csh -f
#
# shell script to print out the Ethernet address table (the bridge MIB)
# 
# Usage:
#	switchportether <device>
#
#
#We pull out the repeater table, which has the following columns:
#  Column number      Description
#          1          Ethernet Address
#          2          Port #
#          3          how we found out about this address

if ($1 == "") then 
   echo "usage:"
   echo "  switchportether <hub-name>"
   exit
else
   echo "Port   Ethernet Addr    Status"
   snmptable -v1 -c public -Ov -m BRIDGE-MIB -CHf + $1 .1.3.6.1.2.1.17.4.3 | \
      sed -e 's/\"//g;s/ //g' | \
      sed -e 's/+/ /g' | \
      awk '{printf "%3s%16s%12s\n",$2,$1,$3}'
endif
